-
Notifications
You must be signed in to change notification settings - Fork 3
/
ocr.php
35 lines (32 loc) · 1.06 KB
/
ocr.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
require_once "curl.php";
function ocr($key,$data){
$ua =["Host: api.anycaptcha.com","Content-Type: application/json"];
$url = "https://api.anycaptcha.com";
$data=json_encode([
"clientKey" => $key,
"task" => [
"type" => "ImageToTextTask",
"body" => base64_encode($data)
],
]);
$create =json_decode(curl($url."/createTask",$data,$ua)[1],1);
if(!$task = $create["taskId"]){
echo "\tanycaptcha ".$create["errorCode"]."\n";return false;
}
$data = json_encode([
"clientKey" => $key,
"taskId" => $create["taskId"]
]);
while(true):
echo "wait for result....!";
$solve=json_decode(curl($url."/getTaskResult",$data,$ua)[1],1);
echo "\r \r";
if($solve["status"] == "processing"){
echo "processing bypass recaptcha";
sleep(7);
echo "\r \r";
continue;}
return $solve["solution"]["text"];
endwhile;
}