GithubHelp home page GithubHelp logo

captchasio / php-captchas-io Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 464 KB

CAPTCHAs.IO PHP SDK https://captchas.io

Home Page: http://captchas.io

License: MIT License

PHP 100.00%
captcha captcha-breaking captcha-bypass captcha-recaptcha captcha-recognition captcha-services-for-recaptcha-v2 captcha-solver captcha-solving

php-captchas-io's Introduction

CAPTCHAs.IO PHP SDK


PHP client for captchas.io service. This client supports resolving captcha types:

To Do:

  • FunCaptcha
  • GeeTest captcha
  • Solving HCaptcha

Recognize captcha from image

use CaptchasIO\CaptchasIO;

// Get file content
$image = file_get_contents(realpath(dirname(__FILE__)) . '/images/image.jpg');

$imageText = $CaptchasIOClient->recognizeImage($image, null, ['phrase' => 0, 'numeric' => 0], 'en');

echo $imageText;

Recognize reCaptcha V2 (with Proxy or without, Invisible)

$task = new \CaptchasIO\Task\RecaptchaV2Task(
    "http://makeawebsitehub.com/recaptcha/test.php",     // <-- target website address
    "6LfI9IsUAAAAAKuvopU0hfY8pWADfR_mogXokIIZ"           // <-- recaptcha key from target website
);

// Value of 'data-s' parameter. Applies only to Recaptchas on Google web sites.
$task->setRecaptchaDataSValue("some data s-value")

// Specify whether or not reCaptcha is invisible. This will render an appropriate widget for our workers. 
$task->setIsInvisible(true);

// To use Proxy, use this function
$task->setProxy(
    "8.8.8.8",
    1234,
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116",
    "http",
    "login",
    "password",
    // also you can add cookie
    "cookiename1=cookievalue1; cookiename2=cookievalue2" 
);

$response = $CaptchasIOClient->recognizeTask($task);

echo $response['gRecaptchaResponse'];

Recognize reCaptcha V2 Enterprise (with Proxy or without)

$task = new \CaptchasIO\Task\RecaptchaV2EnterpriseTask(
    "http://makeawebsitehub.com/recaptcha/test.php",     // <-- target website address
    "6LfI9IsUAAAAAKuvopU0hfY8pWADfR_mogXokIIZ"           // <-- recaptcha key from target website
);

// Additional array parameters enterprisePayload
$task->setEnterprisePayload([
    "s" => "SOME_ADDITIONAL_TOKEN"
]);

// To use Proxy
$task->setProxy(
    "8.8.8.8",
    1234,
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116",
    "http",
    "login",
    "password",
    // also you can add cookie
    "cookiename1=cookievalue1; cookiename2=cookievalue2" 
);

$response = $CaptchasIOClient->recognizeTask($task);

echo $response['gRecaptchaResponse'];

Recognize reCaptcha V3 (or V3 Enterprise)

$task = new \CaptchasIO\Task\RecaptchaV3Task(
    "http://makeawebsitehub.com/recaptcha/test.php",  // target website address
    "6LfI9IsUAAAAAKuvopU0hfY8pWADfR_mogXokIIZ",      // recaptcha key from target website

    // Filters workers with a particular score. It can have one of the following values:
    // 0.3, 0.7, 0.9
    "0.3"
);

// Recaptcha's "action" value. Website owners use this parameter to define what users are doing on the page.
$task->setPageAction("myaction");

// As V3 Enterprise is virtually the same as V3 non-Enterprise, we decided to roll out it’s support within the usual V3 tasks.
// Set this flag to "true" if you need this V3 solved with Enterprise API. Default value is "false" and
// Recaptcha is solved with non-enterprise API.
$reCaptchaV3Task->setIsEnterprise(true);

$response = $CaptchasIOClient->recognizeTask($task);

echo $response['gRecaptchaResponse'];  // Return 3AHJ_VuvYIBNBW5yyv0zRYJ75VkOKvhKj9_xGBJKnQimF72rfoq3Iy-DyGHMwLAo6a3

Recognize Turnstile

$task = new \CaptchasIO\Task\TurnstileTask(
    // Address of a target web page. Can be located anywhere on the web site, even in a member area.
    // Our workers don't navigate there but simulate the visit instead.
    "http://makeawebsitehub.com/recaptcha/test.php",
    // Turnstile sitekey
    "6LfI9IsUAAAAAKuvopU0hfY8pWADfR_mogXokIIZ"
);

// Optional "action" parameter.
$task->setAction("myaction");

// If you need setup proxy
$task->setProxy(
    "8.8.8.8",
    1234,
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0",
    "http",
    "login",
    "password",
    null // also you can add cookie
);

$response = $CaptchasIOClient->recognizeTask($task);

// Token string required for interacting with the submit form on the target website.
echo $response['token'];  // 0.vtJqmZnvobaUzK2i2PyKaSqHELYtBZfRoPwMvLMdA81WL_9G0vCO3y2VQVIeVplG0mxYF7uX.......

// User-Agent of worker's browser. Use it when you submit the response token.
echo $response['userAgent'];  // Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0

Get balance

use CaptchasIO\CaptchasIO;

$apiKey = '*********** API_KEY **************';

$service = new \CaptchasIO\Service\CaptchasIO($apiKey);
$CaptchasIOClient = new \CaptchasIO\CaptchasIO($service);

echo "Your Balance is: " . $CaptchasIOClient->balance() . "\n";

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.