2captcha-api 中文文档教程
2Captcha API wrapper for Node.js
将验证码发送到 2Captcha 服务,然后轮询直到验证码被解码。
Installation
npm install 2captcha
Usage
设置您的 api 密钥:
var solver = require('2captcha');
solver.setApiKey('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
从 url 解码,轮询间隔为 10 秒:(默认值 = 2000ms)
solver.decodeUrl(url, {pollingInterval: 10000}, function(err, result, invalid) {
console.log(result.text);
});
解码 reCaptcha,轮询间隔为 10 秒:(默认值 = 2000ms)
solver.decodeReCaptcha(captcha, pageUrl, {pollingInterval: 10000}, function(err, result, invalid) {
console.log(result.text);
});
如果调用无效,则从 url 重试 5 次(默认 = 3)
solver.decodeUrl(url, {retries: 5}, function(err, result, invalid) {
if(!checkIfCaptchaIsValid(result.text)){
return invalid();
}
});
2Captcha API wrapper for Node.js
Post a captcha to the 2Captcha service, then polls until the captcha is decoded.
Installation
npm install 2captcha
Usage
Set up your api key:
var solver = require('2captcha');
solver.setApiKey('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
Decode from a url, with a 10 seconds polling interval: (default = 2000ms)
solver.decodeUrl(url, {pollingInterval: 10000}, function(err, result, invalid) {
console.log(result.text);
});
Decode reCaptcha, with a 10 seconds polling interval: (default = 2000ms)
solver.decodeReCaptcha(captcha, pageUrl, {pollingInterval: 10000}, function(err, result, invalid) {
console.log(result.text);
});
Decode from a url retrying 5 times if invalid is called (default = 3)
solver.decodeUrl(url, {retries: 5}, function(err, result, invalid) {
if(!checkIfCaptchaIsValid(result.text)){
return invalid();
}
});
更多
你可能也喜欢
- 3rdweb-sdk 中文文档教程
- @010webdev/react-prerender 中文文档教程
- @128technology/mocha-junit-reporter 中文文档教程
- @128technology/yinz 中文文档教程
- @15gifts/redux-wiretap 中文文档教程
- @2bit/slacker 中文文档教程
- @2hats/react-native-vector-icons 中文文档教程
- @36node/koa-openapi 中文文档教程
- @4you-free/seamless-actions 中文文档教程
- @54696d654a6f6c74/html-injector 中文文档教程