forked from chrisli30/anticaptcha-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_funcaptcha_proxyless.js
42 lines (35 loc) · 1.18 KB
/
example_funcaptcha_proxyless.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// http module should be installed:
// npm i http
// Params:
// your anti-captcha.com account key
var anticaptcha = require('./anticaptcha')('12345678901234567890123456789012');
//funcaptcha key from target website
anticaptcha.setWebsiteURL("http://mywebsite.com/funcaptcha/test.php");
anticaptcha.setWebsitePublicKey("fun-captcha-website-key");
// check balance first
anticaptcha.getBalance(function (err, balance) {
if (err) {
console.error(err);
return;
}
if (balance > 0) {
// ATTENTION!
// Customer needs to enable Funcaptcha Proxyless tasks first
// in API settings web-page: https://anti-captcha.com/clients/settings/apisetup
// to make this task type work
anticaptcha.createFunCaptchaTaskProxyless(function (err, taskId) {
if (err) {
console.error(err);
return;
}
console.log(taskId);
anticaptcha.getTaskSolution(taskId, function (err, taskSolution) {
if (err) {
console.error(err);
return;
}
console.log(taskSolution);
});
});
}
});