abovesky/anticaptcha
Composer 安装命令:
composer require abovesky/anticaptcha
包简介
A Simple wrapper for anti-captcha.com
README 文档
README
A Simple wrapper for anti-captcha.com
Thanks
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 }
统计信息
- 总下载量: 37
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-10-19