2017 © Pedro Peláez
 

extension anticaptcha

Wrapper for anti-captcha.com

image

maxlen/anticaptcha

Wrapper for anti-captcha.com

  • Thursday, January 5, 2017
  • by maxlen
  • Repository
  • 0 Watchers
  • 1 Stars
  • 152 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 5 % Grown

The README.md

anticaptcha-php

Wrapper for anti-captcha.com, (*1)

Installation:

composer require maxlen/anticaptcha

Use for captcha ImageToText:

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

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

05/01 2017

dev-master

9999999-dev

Wrapper for anti-captcha.com

  Sources   Download

BSD-4-Clause

The Requires

  • php >=5.4.0

 

by Maxim

recaptcha google recaptcha simple anticaptcha