magisk/anti-captcha

该包最新版本(1.1.0)的许可证信息不可用。

anti-captcha服务的包装器

1.1.0 2017-05-29 20:16 UTC

This package is not auto-updated.

Last update: 2024-09-23 07:22:17 UTC


README

注意:要使用此库,您需要注册到anti-captcha服务并拥有正余额

# 安装和用法

#install library with composer
php composer.phar require majesko/anti-captcha

接下来,使用anti-captcha的API密钥初始化Anti-captcha客户端

$client = new \AntiCaptcha\Client('enter api key here');

使用URL中的辅助方法以base64格式准备验证码图片

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

创建新的验证码解决任务

$task = new \AntiCaptcha\Tasks\ImageToTextTask($image);

将任务发送给Anti-captcha

$taskResponse = $client->createTask($task);

检查验证码状态

$status = $client->getTaskResult($taskResponse->getTaskId());

如果验证码已解决(大约需要30秒 - 取决于设置和难度),获取解决方案

$solution = $status->getSolution();
$solution->getText(); // this is solved captcha string

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