ImageToTextTask:破解图片人机验证谜题
公开提供图片主体,然后会收到其中的文本。文本仅可包含数字、字母、特殊字符和空格。GIF 动画受支持,最大 500kb。“在这些图片中找到猫,然后输入其编号”之类的自定义人机验证谜题不受支持。
相关教程。 学习如何使用Python提交带有图像验证码的表单
任务对象
属性 | 类型 | 必须使用 | 默认值 | 用途 |
---|---|---|---|---|
type | 字符串 | 是 | ImageToTextTask | 指定任务类型。 |
body | 字符串 | 是 | 文件主体以 base64 方式编码。一定要在没有换行符的情况下发送文件主体。不要包括“data:image/png”或类似的标记,仅使用纯净的 base64 格式! | |
phrase | 布尔值 | 否 | false | |
case | 布尔值 | 否 | true | |
numeric | 整数 | 否 | 0 | |
math | 布尔值 | 否 | false | |
minLength | 整数 | 否 | 0 | |
maxLength | 整数 | 否 | 0 | |
comment | 字符串 | 否 | 为工人提供 "输入红色文本 "等附加注释。结果无法保证,完全由工人自己决定。 | |
websiteURL | 字符串 | 否 | 自愿使用的参数,用于在支出统计数据中区分图片人机验证谜题来源。 |
请求示例
Python
Javascript
PHP
Java
C#
bash
#pip3 install anticaptchaofficial
from anticaptchaofficial.imagecaptcha import *
solver = imagecaptcha()
solver.set_verbose(1)
solver.set_key("YOUR_API_KEY_HERE")
# Specify softId to earn 10% commission with your app.
# Get your softId here: https://anti-captcha.com/clients/tools/devcenter
solver.set_soft_id(0)
captcha_text = solver.solve_and_return_solution("captcha.jpeg")
if captcha_text != 0:
print "captcha text "+captcha_text
else:
print "task finished with error "+solver.error_code
任务破解结果对象
属性 | 类型 | 用途 |
---|---|---|
text | 字符串 | 图片人机验证谜题中的文本 |
url | 字符串 | 人机验证谜题网址,我们将在未来的 24 小时内从中存储人机验证谜题。这段时间过后会将其删除。 |
回应示例
{
"errorId":0,
"status":"ready",
"solution":
{
"text":"deditur",
"url":"http://61.39.233.233/1/147220556452507.jpg"
},
"cost":"0.000700",
"ip":"46.98.54.221",
"createTime":1472205564,
"endTime":1472205570,
"solveCount":"0"
}