-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.Cutcaptcha.php
More file actions
59 lines (47 loc) · 1.64 KB
/
Copy pathexample.Cutcaptcha.php
File metadata and controls
59 lines (47 loc) · 1.64 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Death by Captcha PHP API cutcaptcha usage example
*
* @package DBCAPI
* @subpackage PHP
*/
/**
* DBC API clients
*/
require_once '../deathbycaptcha.php';
$username = "username"; // DBC account username
$password = "password"; // DBC account password
$token_from_panel = "your-token-from-panel"; // DBC account authtoken
// Use DeathByCaptcha_SocketClient() class if you want to use SOCKET API.
$client = new DeathByCaptcha_HttpClient($username, $password);
$client->is_verbose = true;
// To use token the first parameter must be authtoken.
// $client = new DeathByCaptcha_HttpClient("authtoken", $token_from_panel);
echo "Your balance is {$client->balance} US cents\n";
// Set the proxy and cutcaptcha token data
$data = array(
'proxy' => 'http://user:password@127.0.0.1:1234',
'proxytype' => 'HTTP',
'apikey' => 'SAs61IAI',
'miserykey' => '56a9e9b989aa8cf99e0cea28d4b4678b84fa7a4e',
'pageurl' => 'https://filecrypt.cc/Contact.html'
);
//Create a json string
$json = json_encode($data);
//Put the type and the json payload
$extra = [
'type' => 19,
'cutcaptcha_params' => $json,
];
// Put null the first parameter and add the extra payload
if ($captcha = $client->decode(null, $extra)) {
echo "CAPTCHA {$captcha['captcha']} uploaded\n";
sleep(DeathByCaptcha_Client::DEFAULT_TIMEOUT);
// Poll for CAPTCHA indexes:
if ($text = $client->get_text($captcha['captcha'])) {
echo "CAPTCHA {$captcha['captcha']} solved: {$text}\n";
// Report an incorrectly solved CAPTCHA.
// Make sure the CAPTCHA was in fact incorrectly solved!
//$client->report($captcha['captcha']);
}
}