forked from chrisli30/anticaptcha-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_image.js
42 lines (35 loc) · 5.77 KB
/
example_image.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');
// check balance first
anticaptcha.getBalance(function (err, balance) {
if (err) {
console.error(err);
return;
}
// captcha params can be set here
anticaptcha.setMinLength(5);
if (balance > 0) {
anticaptcha.createImageToTextTask({
case: true, // or params can be set for every captcha specially
body: '/9j/4AAQSkZJRgABAQAAAQABAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2ODApLCBkZWZhdWx0IHF1YWxpdHkK/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMPFB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEcITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgAPACUAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBC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dRmSOZnhh3KxWNFlJZ+cdNvHXtmsSy0LeUIircsNqgE7Bz70U23nku7aOdT5e4cqRnBoo1At5FRTQQ3G0TRJIAcjeoODVR5ZRqAQStsyPlwMfyzVbxFdz2dhG8DlGaQKSPSrjBuSS6gaTW0DsWaGNmK7SSoJK+n0qM2YVQtvM9sg/ghVAPrypqCJHZ7hjcTfdGBkYHy9RxU1hvNqjSSvIzAMS2P6UWaW4D0s7dCx8mMu4w7lBl/rgc1H/Ztp5sbiBB5Y+RQo2rznOOmfes/Urm4tIb6aOd8x4CqcYGQPaqum393eWscsk7BljdsLjBKtgZzV8krc1wN02VpmQ/Zocyff8AkHzd+fWnC0th5eLeIeWcp8g+U+3pWfeyG0sdRmgARwwbIGOcLTLK4nu7S3meZ1YRI5C4wxJIOfyqeSTXNcLmottBGZGSGNWk++VUAt9fWnRosaIg6KMCub0fVru8j1LznB8qPcmB0Pzf4VuR2cJMExB3oowc+x/xNE4uDswVmWI41jL4J+Zixyc80eVGZRKUUyAYDY5A+tVFjDQPgsheVtzIcE8nv+FVXupxr8duJD5Xk7iPU4NRsWoN7GrLGsoUMThWDcHHQ5pWCupRuhGDVOSMLboGZnIlQguckHcKnW1i+1faMHzCCOv0/wABQTYmiiSGJIo1CogAA9BRsXLMVGWGDnuP8mnnpXOyXksepawqk5hgDKxZj2z0zj8hQI2vsdptjH2aHEZyg2D5T7elK9rbOZC8ETGQAPlAd2PX1rD068urnTIp5Lh94jaQ4xyd2MHjpVqSScQSEXEgPlyEHjgq/Hb04oAv/YbTAH2aHA6DYOP0orIvNQurJ44kl3jYGLOASeTRQB//2Q=='
},
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);
});
}
);
}
});