如何绕过腾讯验证码
代码示例
方法: createTask
API端点:https://api.2captcha.com/createTask
TencentTaskProxyless
{ "clientKey": "YOUR_API_KEY", "task": { "type":"TencentTaskProxyless", "appId":"190014885", "websiteURL":"https://www.example.com/" } }
TencentTask
{ "clientKey": "YOUR_API_KEY", "task": { "type":"TencentTask", "appId":"190014885", "websiteURL":"https://www.example.com/", "proxyType": "http", "proxyAddress": "1.2.3.4", "proxyPort": "8080", "proxyLogin": "user23", "proxyPassword": "p4$w0rd" } }
回應範例
{ "errorId": 0, "status": "ready", "solution": { "appid": "190014885", "ret": 0, "ticket": "tr0344YjJASGmJGtohyWS_y6tJKiqVPIdFgl87vWlVaQoueR8D6DH28go-i-VjeassM31SXO7D0*", "randstr": "@KVN" }, "cost": "0.00299", "ip": "1.2.3.4", "createTime": 1692863536, "endTime": 1692863556, "solveCount": 1 }
使用令牌
在验证码初始化过程中,令牌会传递给 “TencentCaptcha ”构造函数调用的第二个参数中定义的回调函数。
new TencentCaptcha(CaptchaAppId, callback, options);
该函数通常用于向验证令牌的网站后台发出请求。您可以将令牌作为参数执行回调函数,也可以使用令牌向后台发出请求。例如,如果验证码是这样初始化的
const myCallbackFunction = (token) { // verify the token } var captcha = new TencentCaptcha('190014885', myCallbackFunction, {}); captcha.show();
你需要打电话:
let data = JSON.parse(res) myCallbackFunction(res.solution)
其中,“res ”是来自 API 的 JSON 响应。