2017 © Pedro Peláez
 

library anticaptcha

A Simple wrapper for anti-captcha.com

image

abovesky/anticaptcha

A Simple wrapper for anti-captcha.com

  • Thursday, October 19, 2017
  • by abovesky
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

anticaptcha

A Simple wrapper for anti-captcha.com, (*1)

Thanks

maxlen/anticaptcha, (*2)

Installation:

composer require abovesky/anticaptcha

Use for captcha ImageToText:

$resCaptcha = new CaptchaService(
    $apiKey, // your apiKey from anti-captcha.com
    CaptchaService::TYPE_IMAGE_TO_TEXT,
    [
        'imgPath' => '/path/example.png', // path to captcha image
        'isBase64' => false
    ]
);

echo $resCaptcha->check(); // text-result

// or

$resCaptcha->check();
echo $resCaptcha->hashResult; // text-result

Use for reCaptcha:

// $html - it's html-code from $url
// $html = file_get_contents($url) or something like that

if (Captcha::isCaptcha($html)) {
    $html = self::CaptchaProc($url, $html);
    die('CAPTCHA RESOLVED');
}

private function CaptchaProc($url, $html)
{
    $resCaptcha = new CaptchaService(
        $apiKey, // your apiKey from anti-captcha.com
        CaptchaService::TYPE_NO_CAPTCHA_PROXYLESS,
        [
            'webSiteUrl' => $url,
            'html' => $html,
        ]
    );

    // echo PHP_EOL . "getWebSiteKey: " . $resCaptcha->getWebSiteKey();
    // echo PHP_EOL . "getWebSiteSToken: " . $resCaptcha->getWebSiteSToken();
    // echo PHP_EOL;
    // var_dump($resCaptcha->getResolveGetParams());

    if (!$resCaptcha->check()) {
        return false;
    }

    $resolveUrl = $url . '&g-recaptcha-response=' . $resCaptcha->hashResult;
    return file_get_contents($resolveUrl); // curl or something like that
}

The Versions

19/10 2017

dev-master

9999999-dev

A Simple wrapper for anti-captcha.com

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar abovesky

19/10 2017

v1.0.0

1.0.0.0

A Simple wrapper for anti-captcha.com

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar abovesky