Skip to content

Commit 7244c73

Browse files
added enterprise (v2 & v3) reCAPTCHA and cookie_input param
1 parent 6753162 commit 7244c73

File tree

8 files changed

+66
-41
lines changed

8 files changed

+66
-41
lines changed

example/capy.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// recaptcha parameters
2-
var captcha_params = {};
3-
captcha_params.page_url = 'https://your-site.com';
4-
captcha_params.sitekey = 'Fme6hZLjuCRMMC3uh15F52D3uNms5c';
5-
// captcha_params.proxy = '126.45.34.53:123'; // optional
6-
// captcha_params.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'; // optional
2+
var capy_params = {};
3+
capy_params.page_url = 'https://your-site.com';
4+
capy_params.sitekey = 'Fme6hZLjuCRMMC3uh15F52D3uNms5c';
5+
// capy_params.proxy = '126.45.34.53:123'; // optional
6+
// capy_params.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'; // optional
77

88
async function capy() {
99
try {
@@ -14,7 +14,7 @@ async function capy() {
1414
// get account balance
1515
const balance = await imagetyperzapi.account_balance()
1616
log('Balance: $' + balance); // print balance gathered
17-
const captchaID = await imagetyperzapi.submit_capy(captcha_params)
17+
const captchaID = await imagetyperzapi.submit_capy(capy_params)
1818
// solve captcha
1919
log('Waiting for captcha to be solved ...');
2020
const response = await imagetyperzapi.retrieve_response(captchaID)

example/geetest.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
var captcha_params = {};
2-
captcha_params.domain = 'https://your-site.com';
3-
captcha_params.challenge = 'eea8d7d1bd1a933d72a9eda8af6d15d3';
4-
captcha_params.gt = '1a761081b1114c388092c8e2fd7f58bc';
5-
//captcha_params.proxy = '126.45.34.53:123'; // optional
6-
//captcha_params.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'; // optional
1+
var geetest_params = {};
2+
geetest_params.domain = 'https://your-site.com';
3+
geetest_params.challenge = 'eea8d7d1bd1a933d72a9eda8af6d15d3';
4+
geetest_params.gt = '1a761081b1114c388092c8e2fd7f58bc';
5+
//geetest_params.proxy = '126.45.34.53:123'; // optional
6+
//geetest_params.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'; // optional
77

88
async function geetest() {
99
try {
@@ -14,7 +14,7 @@ async function geetest() {
1414
// get account balance
1515
const balance = await imagetyperzapi.account_balance()
1616
log('Balance: $' + balance); // print balance gathered
17-
const captchaID = await imagetyperzapi.submit_geetest(captcha_params)
17+
const captchaID = await imagetyperzapi.submit_geetest(geetest_params)
1818
// solve captcha
1919
log('Waiting for captcha to be solved ...');
2020
const response = await imagetyperzapi.retrieve_response(captchaID)

example/hcaptcha.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// recaptcha parameters
2-
var captcha_params = {};
3-
captcha_params.page_url = 'https://your-site.com';
4-
captcha_params.sitekey = '8c7062c7-cae6-4e12-96fb-303fbec7fe4f';
5-
// captcha_params.proxy = '126.45.34.53:123'; // optional
6-
// captcha_params.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'; // optional
2+
var hcaptcha_params = {};
3+
hcaptcha_params.page_url = 'https://your-site.com';
4+
hcaptcha_params.sitekey = '8c7062c7-cae6-4e12-96fb-303fbec7fe4f';
5+
// hcaptcha_params.proxy = '126.45.34.53:123'; // optional
6+
// hcaptcha_params.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'; // optional
77

88
async function hcaptcha() {
99
try {
@@ -14,7 +14,7 @@ async function hcaptcha() {
1414
// get account balance
1515
const balance = await imagetyperzapi.account_balance()
1616
log('Balance: $' + balance); // print balance gathered
17-
const captchaID = await imagetyperzapi.submit_hcaptcha(captcha_params)
17+
const captchaID = await imagetyperzapi.submit_hcaptcha(hcaptcha_params)
1818
// solve captcha
1919
log('Waiting for captcha to be solved ...');
2020
const response = await imagetyperzapi.retrieve_response(captchaID)

example/recaptcha.js

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
// recaptcha parameters
2-
var captcha_params = {};
3-
captcha_params.page_url = 'https://your-site.com';
4-
captcha_params.sitekey = '7LrGJmcUABBAALFtIb_FxC0LXm_GwOLyJAfbbUCL';
5-
// captcha_params.type = 3; // optional, defaults to 1
6-
// captcha_params.v3_min_score = 0.1; // min score to target when solving v3 - optional
7-
// captcha_params.v3_action = 'homepage'; // action to use when solving v3 - optional
8-
// captcha_params.proxy = '126.45.34.53:123'; // optional
9-
// captcha_params.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'; // optional
10-
// captcha_params.data_s = 'recaptcha data-s value' // optional
2+
var recaptcha_params = {};
3+
recaptcha_params.page_url = 'https://your-site.com';
4+
recaptcha_params.sitekey = '7LrGJmcUABBAALFtIb_FxC0LXm_GwOLyJAfbbUCL';
5+
//
6+
// reCAPTCHA type(s) - optional, defaults to 1
7+
// ---------------------------------------------
8+
// 1 - v2
9+
// 2 - invisible
10+
// 3 - v3
11+
// 4 - enterprise v2
12+
// 5 - enterprise v3
13+
//
14+
// recaptcha_params.type = 1; // optional, defaults to 1
15+
//
16+
// recaptcha_params.v3_min_score = 0.1; // min score to target when solving v3 - optional
17+
// recaptcha_params.v3_action = 'homepage'; // action to use when solving v3 - optional
18+
// recaptcha_params.proxy = '126.45.34.53:123'; // optional
19+
// recaptcha_params.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'; // optional
20+
// recaptcha_params.data_s = 'recaptcha data-s value' // optional
21+
// recaptcha_params.cookie_input = 'a=b;c=d'
1122

1223
async function recaptcha() {
1324
try {
@@ -18,7 +29,7 @@ async function recaptcha() {
1829
// get account balance
1930
const balance = await imagetyperzapi.account_balance()
2031
log('Balance: $' + balance); // print balance gathered
21-
const captchaID = await imagetyperzapi.submit_recaptcha(captcha_params)
32+
const captchaID = await imagetyperzapi.submit_recaptcha(recaptcha_params)
2233
// solve captcha
2334
log('Waiting for captcha to be solved ...');
2435
const response = await imagetyperzapi.retrieve_response(captchaID)

example/tiktok.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// recaptcha parameters
2-
var captcha_params = {};
3-
captcha_params.page_url = 'https://tiktok.com';
4-
captcha_params.sitekey = 's_v_web_id:verify_kd6243o_fd449FX_FDGG_1x8E_8NiQ_fgrg9FEIJ3f;tt_webid:612465623570154;tt_webid_v2:7679206562717014313;SLARDAR_WEB_ID:d0314f-ce16-5e16-a066-71f19df1545f;';
5-
// captcha_params.proxy = '126.45.34.53:123'; // optional
6-
// captcha_params.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'; // optional
2+
var tiktok_params = {};
3+
tiktok_params.page_url = 'https://tiktok.com';
4+
tiktok_params.sitekey = 's_v_web_id:verify_kd6243o_fd449FX_FDGG_1x8E_8NiQ_fgrg9FEIJ3f;tt_webid:612465623570154;tt_webid_v2:7679206562717014313;SLARDAR_WEB_ID:d0314f-ce16-5e16-a066-71f19df1545f;';
5+
// tiktok_params.proxy = '126.45.34.53:123'; // optional
6+
// tiktok_params.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'; // optional
77

88
async function tiktok() {
99
try {
@@ -14,7 +14,7 @@ async function tiktok() {
1414
// get account balance
1515
const balance = await imagetyperzapi.account_balance()
1616
log('Balance: $' + balance); // print balance gathered
17-
const captchaID = await imagetyperzapi.submit_tiktok(captcha_params)
17+
const captchaID = await imagetyperzapi.submit_tiktok(tiktok_params)
1818
// solve captcha
1919
log('Waiting for captcha to be solved ...');
2020
const response = await imagetyperzapi.retrieve_response(captchaID)

lib/imagetyperz-api-client.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ window.imagetyperz_config = {
33
'endpoints': {
44
CAPTCHA_ENDPOINT: 'http://captchatypers.com/Forms/UploadFileAndGetTextNEW.ashx',
55
RECAPTCHA_SUBMIT_ENDPOINT: 'http://captchatypers.com/captchaapi/UploadRecaptchaV1.ashx',
6+
RECAPTCHA_ENTERPRISE_SUBMIT_ENDPOINT: 'http://captchatypers.com/captchaapi/UploadRecaptchaEnt.ashx',
67
RECAPTCHA_RETRIEVE_ENDPOINT: 'http://captchatypers.com/captchaapi/GetRecaptchaText.ashx',
78
BALANCE_ENDPOINT: 'http://captchatypers.com/Forms/RequestBalance.ashx',
89
BAD_IMAGE_ENDPOINT: 'http://captchatypers.com/Forms/SetBadImage.ashx',
@@ -174,11 +175,17 @@ imagetyperzapi.submit_recaptcha = function (d) {
174175

175176
// user agent
176177
if(d.user_agent) data.useragent = d.user_agent;
177-
// v3
178-
if (d.type) data.recaptchatype = d['type'];
178+
// type / enterprise
179+
if (d.type) {
180+
data.recaptchatype = d['type'];
181+
const ts = d['type'].toString()
182+
if (ts === '4' || ts === '5') url = ic.endpoints.RECAPTCHA_ENTERPRISE_SUBMIT_ENDPOINT
183+
if (ts === '5') data.enterprise_type = 'v3'
184+
}
179185
if (d.v3_action) data.captchaaction = d['v3_action'];
180186
if (d.v3_min_score) data.score = d['v3_min_score'];
181187
if (d.data_s) data['data-s'] = d.data_s
188+
if (d.cookie_input) data['cookie_input'] = d.cookie_input;
182189

183190
// make post request
184191
$.post(url, data).done(function (resp) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "imagetyperz-api-client",
3-
"version": "1.2.2",
3+
"version": "1.2.3",
44
"description": "ImagetyperzAPI (client) is a super easy to use bypass captcha API wrapper for imagetyperz.com captcha service",
55
"main": "lib/imagetyperz-api-client.js",
66
"scripts": {

readme.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,30 @@ It works with URL instead b64 image too
7070
For recaptcha submission there are two things that are required.
7171
- page_url (**required**)
7272
- site_key (**required**)
73-
- type - can be one of this 3 values: `1` - normal, `2` - invisible, `3` - v3 (it's optional, defaults to `1`)
73+
- type (optional, defaults to 1 if not given)
74+
- `1` - v2
75+
- `2` - invisible
76+
- `3` - v3
77+
- `4` - enterprise v2
78+
- `5` - enterprise v3
7479
- v3_min_score - minimum score to target for v3 recaptcha `- optional`
7580
- v3_action - action parameter to use for v3 recaptcha `- optional`
7681
- proxy - proxy to use when solving recaptcha, eg. `12.34.56.78:1234` or `12.34.56.78:1234:user:password` `- optional`
7782
- user_agent - useragent to use when solve recaptcha `- optional`
7883
- data-s - extra parameter used in solving recaptcha `- optional`
84+
- cookie_input - cookies used in solving reCAPTCHA - `- optional`
7985

8086
```javascript
8187
var captcha_params = {}
8288
captcha_params.page_url = 'https://your-site.com'
8389
captcha_params.sitekey = '7LrGJmcUABBAALFtIb_FxC0LXm_GwOLyJAfbbUCL'
84-
// captcha_params.type = 3; // optional, defaults to 1
90+
// captcha_params.type = 1; // optional, defaults to 1
8591
// captcha_params.v3_min_score = 0.3; // min score to target when solving v3 - optional
8692
// captcha_params.v3_action = 'homepage'; // action to use when solving v3 - optional
8793
// captcha_params.proxy = '126.45.34.53:123'; // optional
8894
// captcha_params.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'; // optional
8995
// captcha_params.data_s = 'recaptcha data-s value' // optional
96+
// captcha_params.cookie_input = 'a=b;c=d' // optional
9097
const captchaID = await imagetyperzapi.submit_recaptcha(captcha_params)
9198
```
9299
ID will be used to retrieve the g-response, once workers have
@@ -173,7 +180,7 @@ const response = await imagetyperzapi.retrieve_response(captchaID) // wait for
173180
```
174181

175182
```javascript
176-
const captchaID = await imagetyperzapi.submit_recaptcha(captcha_params)
183+
const captchaID = await imagetyperzapi.submit_recaptcha(recaptcha_params)
177184
console.log('Waiting for captcha to be solved ...')
178185
const response = await imagetyperzapi.retrieve_response(captchaID) // wait for response to get solved
179186
console.log(`Response: ${JSON.stringify(response)}`)

0 commit comments

Comments
 (0)