Friendly CAPTCHA绕过API服务
代码示例
方法: createTask
API端点:https://api.2captcha.com/createTask
FriendlyCaptchaTaskProxyless
{ "clientKey": "YOUR_API_KEY", "task": { "type": "FriendlyCaptchaTaskProxyless", "websiteURL": "https://example.com", "websiteKey": "2FZFEVS1FZCGQ9" } }
FriendlyCaptchaTask
{ "clientKey": "YOUR_API_KEY", "task": { "type": "FriendlyCaptchaTask", "websiteURL": "https://example.com", "websiteKey": "2FZFEVS1FZCGQ9", "proxyType": "http", "proxyAddress": "1.2.3.4", "proxyPort": "8080", "proxyLogin": "user23", "proxyPassword": "p4$w0rd" } }
回應範 例
{ "errorId": 0, "status": "ready", "solution": { "token": "f8b10f4ad796484bae963b1ebe3ce2bb.ZXL8Z...AAAAAA.AgAD" }, "cost": "0.00299", "ip": "1.2.3.4", "createTime": 1692863536, "endTime": 1692863556, "solveCount": 1 }
使用令牌
使用返回的标记作为`name = frc-captcha-solution` 的`input`的值,然后提交它的父表单,举例来说:
document.querySelector('input.frc-captcha-solution').value='f8b10f4ad796484bae963b1ebe3ce2bb.ZXL8Z...AAAAAA.AgAD' document.querySelector('form').submit()
请注意,表单名称可通过 `data-solution-field-name` 属性自定义,然后您需要使用设置的名称作为属性值。
如果定义了回调函数,可以将标记作为参数调用该函数。例如,如果`data-callback="doneCallback"`,则应按以下方式运行:
doneCallback('f8b10f4ad796484bae963b1ebe3ce2bb.ZXL8Z...AAAAAA.AgAD')