hectordev15/anticaptchasolver

基于Anti-Captcha.com的anticaptcha-php库的库

v2.1 2019-05-22 13:38 UTC

This package is auto-updated.

Last update: 2024-09-26 03:40:50 UTC


README

注意:使用此库需要注册并拥有正余额。

安装

composer require hectordev15/anticaptchasolver

图像转文本

$client = new \AntiCaptchaSolver\Client('Tu API Key');

将图像转换为base64

$image = $client->image_url_to_base64('http://url-to-captcha-image');

创建新的解决Captcha任务

$result = $client->solveCaptcha($image);

等待结果

echo $result

解决Recaptcha

$client = new \AntiCaptchaSolver\Client('Tu API Key');

声明包含所需数据的数组

$options = 
[
    'websiteURL' => 'URL del sitio con recaptcha',
    'websiteKey' => 'Key de Recaptcha',
];

创建新的任务

$result = $client->solveNoCaptcha($options);

等待结果

echo $result

发送Recaptcha

$client = new \AntiCaptchaSolver\Client('Tu API Key');

声明包含所需数据的数组

$options = 
[
    'websiteURL' => 'URL del sitio con recaptcha',
    'websiteKey' => 'Key de Recaptcha',
];

创建新的任务

$result = $client->sendNoCaptcha($options);

结果是服务请求的ID

echo $result

获取Recaptcha结果

$client = new \AntiCaptchaSolver\Client('Tu API Key');

发送带有您请求ID的ID

echo $client->takeNoCaptcha('Tu ID');

为了获取siteKey

在站点中找到以下HTML标签

<div class="g-recaptcha" data-sitekey="6Lc_aCMTAAAAABx7u2W0WPXnVbI_v6ZdbM6rYf16"></div>

更多信息 anti-captcha 文档: https://anticaptcha.atlassian.net/wiki/display/API/API+v.2+Documentation

此仓库基于 https://github.com/Majesko/anti-captcha