Skip to content

Commit 4c29474

Browse files
1st commit
0 parents  commit 4c29474

9 files changed

+10750
-0
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

Diff for: LICENSE.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2013 Ran Mizrahi <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

Diff for: README.md

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
bestcaptchasolver-client - Bestcaptchasolver JS client API library
2+
=========================================
3+
4+
Bypass image captcha and reCAPTCHA with bestcaptchasolver service, JS library
5+
6+
## Installation
7+
8+
npm install bestcaptchasolver-client
9+
10+
or
11+
12+
git clone https://github.com/bestcaptchasolver/bestcaptchasolver-javascript
13+
14+
## Usage
15+
16+
Promises are used inside the library, for better code management
17+
18+
Simply require the module, set the auth details and start using the captcha service:
19+
20+
``` javascript
21+
<!-- Load jQuery (dependency) -->
22+
<script src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
23+
<!-- Load the API library -->
24+
<script src="../lib/bestcaptchasolver.js"></script>
25+
```
26+
27+
Set access token, before using the library
28+
29+
``` javascript
30+
bestcaptchasolverapi.set_access_token('access token from /account');
31+
```
32+
33+
34+
**Get balance**
35+
36+
``` javascript
37+
bestcaptchasolverapi.account_balance().then(function (balance) {
38+
console.log('Balance: $', balance);
39+
})
40+
```
41+
42+
**Submit image captcha**
43+
44+
The submission of image captcha is done by sending us the image as a b64 encoded string.
45+
There's the `case_sensitive` parameter as well, which is optional, and by default `false`
46+
47+
``` javascript
48+
bestcaptchasolverapi.submit_captcha({
49+
b64image: captcha,
50+
//case_sensitive: true,
51+
});
52+
```
53+
54+
**Submit reCAPTCHA**
55+
56+
The `page_url` and `site_key` are the only requirements. There are other optional parameters though.
57+
58+
``` javascript
59+
bestcaptchasolverapi.submit_recaptcha({
60+
page_url: 'bestcaptchasolver.com',
61+
site_key: '6LfGJmcUAAAAALGtIb_FxC0LXm_GwOLyJAfbbUCN',
62+
//user_agent: 'Your user agent',
63+
//proxy: 'abc:[email protected]:4321 or 12.35.56.78:4321',
64+
//type: '1', // 1 - normal, 2 - invisible, 3 - v3
65+
//v3_action: '', // v3 action
66+
//v3_min_score: '0.3', // if v3, score to target
67+
});
68+
```
69+
70+
Just like the image submission method, this method also returns an ID, which is then used
71+
to get the text or gresponse.
72+
73+
**Retrieve**
74+
75+
Retrieval is done by passing the ID
76+
77+
``` javascript
78+
bestcaptchasolverapi.retrieve_captcha(id);
79+
```
80+
81+
This method returns an object, with the `text` attribute for image captcha or `gresponse` if submission was done for reCAPTCHA
82+
83+
**Affiliate ID**
84+
85+
```javascript
86+
bestcaptchasolverapi.set_affiliate_id('ID of affiliate from /account');
87+
```
88+
89+
**Set captcha bad**
90+
91+
```javascript
92+
bestcaptchasolverapi.set_captcha_bad(captcha_id);
93+
```
94+
95+
## Examples
96+
Check the example/example.html
97+
98+
## License
99+
API library is licensed under the MIT License
100+
101+
## More information
102+
More info about the API parameters can be found [here](https://bestcaptchasolver.com/captchabypass-api)
103+
104+
105+
<sup><sub>captcha, bypasscaptcha, decaptcher, decaptcha, 2captcha, deathbycaptcha, anticaptcha,
106+
bypassrecaptchav2, bypassnocaptcharecaptcha, bypassinvisiblerecaptcha, captchaservicesforrecaptchav2,
107+
recaptchav2captchasolver, googlerecaptchasolver, recaptchasolverpython, recaptchabypassscript</sup></sub>
108+

Diff for: example/example.html

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Bestcaptchasolver JS example</title>
6+
<style>
7+
textarea{
8+
width: 100%;
9+
font-family: 'Courier New', Courier, 'Lucida Sans Typewriter', 'Lucida Typewriter';
10+
}
11+
button{
12+
width: 100%;
13+
height: 80px;
14+
font-size: 25px;
15+
color: mediumvioletred;
16+
}
17+
</style>
18+
</head>
19+
<body>
20+
<!-- Element for logging data -->
21+
<textarea id='log' style="height: 200px" autofocus></textarea>
22+
<button onclick="example()">Run</button>
23+
<!-- Load jQuery (dependency) -->
24+
<script src="jquery.js"></script>
25+
<!-- Load the library -->
26+
<script src="../lib/bestcaptchasolver.js"></script>
27+
<!-- Load example -->
28+
<script src="example.js"></script>
29+
</body>
30+
</html>

Diff for: example/example.js

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// check dashboard for accesskey
2+
const ACCESS_KEY = '76A0CBD91760484E84C11F9FDF0184C6';
3+
var in_solving = false;
4+
5+
function example() {
6+
var captcha_id = undefined;
7+
if(!in_solving) in_solving = true;
8+
else return log('Doing another task currently');
9+
10+
document.getElementById('log').value = '';
11+
12+
bestcaptchasolverapi.set_access_token(ACCESS_KEY);
13+
// using affiliate ID
14+
//bestcaptchasolverapi.set_affiliate_id('ID of affiliate from /account');
15+
16+
// balance
17+
bestcaptchasolverapi.account_balance().then(function (balance) {
18+
log('Balance: $' + balance); // print balance gathered
19+
log('Solving image captcha');
20+
// captcha can be b64 encoded string or image URL
21+
var captcha = 'iVBORw0KGgoAAAANSUhEUgAAASkAAACqCAMAAADGFElyAAAAgVBMVEX///8AAAD8/Pze3t5cXFzz8/Pp6emZmZlKSkqysrKoqKhtbW0zMzOenp69vb3h4eHU1NTMzMyNjY11dXVmZmbY2NgrKyvf398TExOtra2Tk5MpKSnPz893d3eEhIT39/dPT09EREQ6OjrDw8MgICA/Pz8cHBxXV1c2NjZ+fn4NDQ3FRJmkAAAJoElEQVR4nO2c65qiuhKGiRwEFAQEW2wVFW0P93+BO+RkAgnS80xjr9n1/pjWECB8VCqVShzLAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtefTuFvxXQM67W/DrQVcrRAiRzxf8AcWGigkKxmvVr8G1K2tB8NDB22B9PA8X7674U+gtFp0TcFmMosWEfZ3YXlPkjdrotxCj1EIqOTlAP391TjjQA1yaCu2tHUKnEZv8JmK0Dx6qUn4ZYujnM/4s20sRXuiBaUiJkBNg8eZlGHkW/l60b1BF5AputO1pRR3hen0VfgE1ekktVQ976hWNHYbtG0xwYYo7Lcp6WnFHlttb4e1UB58/Z+DJT53a0mdR3bteepQ65PifS+5c5TssG4fn586ux5Wl1xVqVbD92lj9LbgtixB40rdnm200CPkOK1bm97SC2PVRKSp+3/Ca8sdLaCDliOfc0vKNUr0cJFX+PGElFSfaFrgdKYWdmxpNKpR/+MR/xiSJno/hNKJsRNxZ5KemfFkkwtVWSTj7JI81wzT9Km8+zJboa+lLkjiF6En3/FkcFIndbUNXKYfVX5uajSusZmUyMR3/AaTepxl5Mn6MN6nADps8OekajTlW9AC6WIFiVc8XPlHKj+17/KlSS2uKxgziJuWeNmoWaG67Dc6sF7gZcesujgVuQimvDEqmYRBbH2UQS+YjLiK9DFys8dOswmrKRo7t9DZAqUvkoGzUGSqLEgz3/OJK8SE8bJuMgk4pxaZ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oJsm7R2EpVy6h2rXrg78XqxFqkPtp2fpkmKrBdnrc7s1Lm0fOlLp4artRxf9+3flo3tlIuur+upHLoc2tiYGLrM72R53ClNIz+Y+nJt7P2L86IkC1tpZsY5330UvhiN61SMzlJ3CKkJ/7XCVYLa7V/fneO6NP3T55hRHddIuXppj45vgJR6nzo7NLW/NjyH2FC/bFh0GDZYY2jJOnYu5V1lfpX/z+Himw7nhoMod5MMRtNIiNtjsRWHYnNpsiJSOVf/nvl93H7543pbzH/tJMksddDE7P/v7AtxMi4bRcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOBv8T/b92zy9H0HcAAAAABJRU5ErkJggg==';
22+
return bestcaptchasolverapi.submit_captcha({
23+
b64image: captcha,
24+
//case_sensitive: true,
25+
});
26+
}).then(function (id) {
27+
log('Got ID ' + id + ', waiting for completion ...');
28+
return bestcaptchasolverapi.retrieve_captcha(id);
29+
}).then(function(data){
30+
log('Captcha text: ' + data.text); // print captcha text and submit recaptcha
31+
log('Solving recaptcha');
32+
return bestcaptchasolverapi.submit_recaptcha({
33+
page_url: 'bestcaptchasolver.com',
34+
site_key: '6LfGJmcUAAAAALGtIb_FxC0LXm_GwOLyJAfbbUCN',
35+
//user_agent: 'Your user agent',
36+
//proxy: 'abc:[email protected]:4321 or 12.35.56.78:4321',
37+
//type: '1', // 1 - normal, 2 - invisible, 3 - v3
38+
//v3_action: '', // v3 action
39+
//v3_min_score: '0.3', // if v3, score to target
40+
});
41+
}).then(function (id) {
42+
captcha_id = id;
43+
log('Got ID ' + id + ', waiting for completion ...');
44+
return bestcaptchasolverapi.retrieve_captcha(id);
45+
}).then(function (data) {
46+
console.log('recaptcha data', data);
47+
// --------------------------------------
48+
log('Recaptcha response: ' + data.gresponse);
49+
// Set captcha bad
50+
// ---------------
51+
// return bestcaptchasolverapi.set_captcha_bad(captcha_id);
52+
// }).then(function(resp){
53+
// log(resp);
54+
}).catch(function (err) {
55+
log(err.message || err);
56+
}).then(function () {
57+
in_solving = false;
58+
log('Example finished !');
59+
});
60+
}
61+
62+
// log what's happening to UI and console
63+
function log(txt) {
64+
document.getElementById('log').value += txt + '\n';
65+
console.log(txt);
66+
}

0 commit comments

Comments
 (0)