PHP code example of danielbinsmaier / deathbycaptcha-php

1. Go to this page and download the library: Download danielbinsmaier/deathbycaptcha-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

danielbinsmaier / deathbycaptcha-php example snippets


use DanielBinsmaier\DeathByCaptcha\Client;

// Create a client instance.
$client = new Client();

// Authenticate and use HTTP client.
$client->http('username', 'password');

// Alternatively, you can authenticate using socket based client.
// $client->socket('username', 'password');

// To authenticate using the authtoken, pick either http or socket and don't use a password.
// $client->http('authtoken');

// Get user information from the service.
$user = $client->user();

// Check balance.
$balance = $client->balance();

// Solve a captcha and wait for it.
$result = $client->solve('captcha.png');

// Additionally, you can also upload the captcha first and check later.
$captcha = $client->upload('captcha.png');

// Check the captcha by polling its state ...
if ($captcha->poll()) {
    // captcha solved ...
}

// ... or poll until it's solved.
$result = $captcha->solve();

use DanielBinsmaier\DeathByCaptcha\Client;

$client = new Client();
$client->http('username', 'password');
$result = $client->solve('captcha.png');

use DanielBinsmaier\DeathByCaptcha\Client;

$client = new Client();
$client->socket('authtoken');
$result = $client->solve('captcha.png');

use DanielBinsmaier\DeathByCaptcha\Client;

$client = new Client();
$client->socket('authtoken');

$data = [
    'googlekey' => 'sitekey',
    'pageurl' => 'url'
];

$params = json_encode($data);

$extra = [
    'type' => 4,
    'token_params' => $params
];

$result = $client->solve(null, $extra);

composer