@2captcha/captcha-solver 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +192 -8
- package/dist/structs/2captcha.d.ts +287 -45
- package/dist/structs/2captcha.d.ts.map +1 -1
- package/dist/structs/2captcha.js +436 -22
- package/dist/utils/checkCaptchaParams.d.ts +8 -0
- package/dist/utils/checkCaptchaParams.d.ts.map +1 -1
- package/dist/utils/checkCaptchaParams.js +49 -16
- package/dist/utils/renameParams.d.ts.map +1 -1
- package/dist/utils/renameParams.js +15 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2captcha.d.ts","sourceRoot":"","sources":["../../src/structs/2captcha.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB;AAGD,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAA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;IACW,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;IAgCzE;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2BE;IACW,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAgCnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6BE;IACW,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;IAiCzE;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACU,KAAK,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;IA+BlE;;;;;;;;OAQG;IACU,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBlD;;;;;;;;;OASG;IACU,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAuBpD"}
|
package/dist/structs/2captcha.js
CHANGED
|
@@ -111,7 +111,9 @@ class Solver {
|
|
|
111
111
|
try {
|
|
112
112
|
data = JSON.parse(result);
|
|
113
113
|
if (data.status == 1) {
|
|
114
|
-
|
|
114
|
+
let dataJSON = { ...data, data: data.request, id: id };
|
|
115
|
+
delete dataJSON.request;
|
|
116
|
+
return dataJSON;
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
119
|
catch {
|
|
@@ -119,7 +121,6 @@ class Solver {
|
|
|
119
121
|
}
|
|
120
122
|
switch (data.request) {
|
|
121
123
|
case "CAPCHA_NOT_READY":
|
|
122
|
-
// console.log('CAPCHA_NOT_READY')
|
|
123
124
|
return this.pollResponse(id);
|
|
124
125
|
default: {
|
|
125
126
|
throw new _2captchaError_1.APIError(data.request);
|
|
@@ -652,7 +653,7 @@ class Solver {
|
|
|
652
653
|
*
|
|
653
654
|
* [Read more about Cloudflare Turnstile captcha](https://2captcha.com/2captcha-api#turnstile).
|
|
654
655
|
*
|
|
655
|
-
* @param {{ pageurl, sitekey, action, data, pingback, proxy, proxytype}} params The
|
|
656
|
+
* @param {{ pageurl, sitekey, action, data, pingback, proxy, proxytype}} params The `cloudflareTurnstile` method takes arguments as an object. Thus, the `pageurl`, `sitekey` fields in the passed object are mandatory.
|
|
656
657
|
* @param {string} params.pageurl Full `URL` of the page where you see the captcha.
|
|
657
658
|
* @param {string} params.sitekey Is a value of `sitekey` parameter in the page source.
|
|
658
659
|
* @param {string} params.action Value of optional `action` parameter you found on page.
|
|
@@ -699,7 +700,7 @@ class Solver {
|
|
|
699
700
|
/**
|
|
700
701
|
* ### Solves a Coordinates captcha.
|
|
701
702
|
*
|
|
702
|
-
* @param {{ body, imginstructions, textinstructions, language, lang, pingback }} params parameters
|
|
703
|
+
* @param {{ body, imginstructions, textinstructions, language, lang, pingback }} params parameters Coordinates Captcha as an object.
|
|
703
704
|
* @param {string} params.body Base64-encoded captcha image.
|
|
704
705
|
* @param {string} params.imginstructions Base64-encoded image with instruction for solving captcha.
|
|
705
706
|
* @param {string} params.textinstructions Text will be shown to worker to help him to solve the captcha correctly. For example: click on all objects in red color.
|
|
@@ -941,35 +942,49 @@ class Solver {
|
|
|
941
942
|
}
|
|
942
943
|
}
|
|
943
944
|
/**
|
|
944
|
-
* ### Solves Cutcaptcha
|
|
945
|
+
* ### Solves a Cutcaptcha.
|
|
945
946
|
*
|
|
946
|
-
*
|
|
947
|
-
*
|
|
948
|
-
*
|
|
949
|
-
* @param {
|
|
950
|
-
* @param {string} params.
|
|
951
|
-
* @param {string} params.
|
|
947
|
+
* Use this method to solve Cutcaptcha. Returns the response in JSON.
|
|
948
|
+
* [Read more about Cutcaptcha Method](https://2captcha.com/2captcha-api#cutcaptcha).
|
|
949
|
+
*
|
|
950
|
+
* @param {{ pageurl, miseryKey, apiKey, pingback, proxy, proxytype }} params Parameters for solving Cutcaptcha as an object.
|
|
951
|
+
* @param {string} params.pageurl The URL where the captcha is located.
|
|
952
|
+
* @param {string} params.miseryKey The value of `CUTCAPTCHA_MISERY_KEY` variable defined on page.
|
|
953
|
+
* @param {string} params.apiKey The value of `data-apikey` attribute of iframe's body. Also the name of javascript file included on the page
|
|
954
|
+
* @param {string} [params.pingback] Optional param. URL for pingback (callback) response when captcha is solved.
|
|
955
|
+
* @param {string} [params.proxy] Optional param. Proxy to use while solving the captcha. Format: `login:password@123.123.123.123:3128`.
|
|
956
|
+
* @param {string} [params.proxytype] Optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
|
|
957
|
+
*
|
|
958
|
+
* @returns {Promise<CaptchaAnswer>} The result from the solve.
|
|
959
|
+
* @throws APIError
|
|
952
960
|
*
|
|
953
961
|
* @example
|
|
954
962
|
* solver.cutCaptcha({
|
|
955
|
-
* pageurl: "https://
|
|
956
|
-
*
|
|
963
|
+
* pageurl: "https://mysite.com/page/with/cutcaptcha",
|
|
964
|
+
* miseryKey: "098e6a849af406142e3150dbf4e6d0538db2b51f",
|
|
965
|
+
* apiKey: "SAs61IAI",
|
|
957
966
|
* })
|
|
958
967
|
* .then((res) => {
|
|
959
|
-
*
|
|
960
|
-
*
|
|
968
|
+
* console.log(res);
|
|
969
|
+
* })
|
|
961
970
|
* .catch((err) => {
|
|
962
|
-
*
|
|
971
|
+
* console.log(err);
|
|
963
972
|
* })
|
|
964
973
|
*/
|
|
965
974
|
async cutCaptcha(params) {
|
|
966
|
-
(0,
|
|
975
|
+
params = (0, renameParams_1.default)(params);
|
|
976
|
+
(0, checkCaptchaParams_1.default)(params, "cutcaptcha");
|
|
967
977
|
const payload = {
|
|
968
978
|
...params,
|
|
969
|
-
method: "
|
|
979
|
+
method: "cutcaptcha",
|
|
970
980
|
...this.defaultPayload,
|
|
971
981
|
};
|
|
972
|
-
const
|
|
982
|
+
const URL = this.in;
|
|
983
|
+
const response = await (0, fetch_1.default)(URL, {
|
|
984
|
+
body: JSON.stringify(payload),
|
|
985
|
+
method: "post",
|
|
986
|
+
headers: { 'Content-Type': 'application/json' }
|
|
987
|
+
});
|
|
973
988
|
const result = await response.text();
|
|
974
989
|
let data;
|
|
975
990
|
try {
|
|
@@ -1083,14 +1098,15 @@ class Solver {
|
|
|
1083
1098
|
*
|
|
1084
1099
|
* The method can be used to bypass tasks where a grid is applied to an image and you need to click on grid tiles, like reCAPTCHA or hCaptcha images.
|
|
1085
1100
|
*
|
|
1086
|
-
* @param {{ body, textinstructions, imginstructions, rows, cols,
|
|
1101
|
+
* @param {{ body, textinstructions, imginstructions, rows, cols, minClicks, maxClicks, imgType, previousId, canSkip, lang, pingback}} params Parameters Grid Method as an object.
|
|
1087
1102
|
* @param {string} params.body `Base64`- encoded captcha image.
|
|
1088
1103
|
* @param {string} params.textinstructions Text will be shown to worker to help him to select object on the image correctly. For example: "*Select cars in the image*". **Optional parameter**, if the instruction already exists in the form of the `imginstructions`.
|
|
1089
1104
|
* @param {string} params.imginstructions Image with instruction for worker to help him to select object on the image correctly. The image must be encoded in `Base64` format. **Optional parameter**, if the instruction already exists in the form of the `textinstructions`.
|
|
1090
1105
|
* @param {number} params.rows Number of rows in grid captcha.
|
|
1091
1106
|
* @param {number} params.cols Number of columns in grid captcdha.
|
|
1092
|
-
* @param {number} params.
|
|
1093
|
-
* @param {number} params.
|
|
1107
|
+
* @param {number} params.minClicks The minimum number of tiles that must be selected. Can't be more than `rows` * `cols`.
|
|
1108
|
+
* @param {number} params.maxClicks The maximum number of tiles that can be selected on the image.
|
|
1109
|
+
* @param {string} params.imgType The image will be recognized using Computer Vision. Supported value options: `recaptcha`, `hcaptcha`, `funcaptcha`, `funcaptcha_compare`. [More info here](https://2captcha.com/2captcha-api#grid).
|
|
1094
1110
|
* @param {string} params.previousId Id of your previous request with the same captcha challenge.
|
|
1095
1111
|
* @param {number} params.canSkip Set the value to `1` only if it's possible that there's no images matching to the instruction. We'll provide a button "No matching images" to worker and you will receive `No_matching_images` as answer.
|
|
1096
1112
|
* @param {string} params.lang Language code. [See the list of supported languages](https://2captcha.com/2captcha-api#language).
|
|
@@ -1139,6 +1155,404 @@ class Solver {
|
|
|
1139
1155
|
throw new _2captchaError_1.APIError(data.request);
|
|
1140
1156
|
}
|
|
1141
1157
|
}
|
|
1158
|
+
/**
|
|
1159
|
+
* ### Text Captcha method
|
|
1160
|
+
*
|
|
1161
|
+
* Text Captcha is a type of captcha that is represented as text and doesn't contain images. Usually you have to answer a question to pass the verification. For example: "If tomorrow is Saturday, what day is today?".
|
|
1162
|
+
* [Read more about Text Captcha Method](https://2captcha.com/2captcha-api#text-captcha).
|
|
1163
|
+
*
|
|
1164
|
+
* @param {{ textcaptcha, lang, pingback}} params Parameters Text Captcha Method as an object.
|
|
1165
|
+
* @param {string} params.textcaptcha Text Captcha is a type of captcha that is represented as text and doesn't contain images. Usually you have to answer a question to pass the verification.
|
|
1166
|
+
* @param {string} params.lang Language code. [See the list of supported languages](https://2captcha.com/2captcha-api#language).
|
|
1167
|
+
* @param {string} params.pingback params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
|
|
1168
|
+
*
|
|
1169
|
+
* @example
|
|
1170
|
+
* solver.text({
|
|
1171
|
+
* textcaptcha: "If tomorrow is Saturday, what day is today?",
|
|
1172
|
+
* lang: 'en'
|
|
1173
|
+
* })
|
|
1174
|
+
* .then((res) => {
|
|
1175
|
+
* console.log(res);
|
|
1176
|
+
* })
|
|
1177
|
+
* .catch((err) => {
|
|
1178
|
+
* console.log(err);
|
|
1179
|
+
* })
|
|
1180
|
+
*/
|
|
1181
|
+
async text(params) {
|
|
1182
|
+
(0, checkCaptchaParams_1.default)(params, "textcaptcha");
|
|
1183
|
+
params = await (0, renameParams_1.default)(params);
|
|
1184
|
+
const payload = {
|
|
1185
|
+
...params,
|
|
1186
|
+
...this.defaultPayload,
|
|
1187
|
+
};
|
|
1188
|
+
const URL = this.in;
|
|
1189
|
+
const response = await (0, fetch_1.default)(URL, {
|
|
1190
|
+
body: JSON.stringify(payload),
|
|
1191
|
+
method: "post",
|
|
1192
|
+
headers: { 'Content-Type': 'application/json' }
|
|
1193
|
+
});
|
|
1194
|
+
const result = await response.text();
|
|
1195
|
+
let data;
|
|
1196
|
+
try {
|
|
1197
|
+
data = JSON.parse(result);
|
|
1198
|
+
}
|
|
1199
|
+
catch {
|
|
1200
|
+
throw new _2captchaError_1.APIError(result);
|
|
1201
|
+
}
|
|
1202
|
+
if (data.status == 1) {
|
|
1203
|
+
return this.pollResponse(data.request);
|
|
1204
|
+
}
|
|
1205
|
+
else {
|
|
1206
|
+
throw new _2captchaError_1.APIError(data.request);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* ### Canvas method
|
|
1211
|
+
*
|
|
1212
|
+
* This method can be used to bypass tasks in which you need to circle an object or line in an image.
|
|
1213
|
+
* [Read more about Canvas Method](https://2captcha.com/2captcha-api#canvas).
|
|
1214
|
+
*
|
|
1215
|
+
* @param {{ body, textinstructions, imginstructions, canSkip, lang, pingback}} params Parameters Canvas as an object.
|
|
1216
|
+
* @param {string} params.body `Base64`- encoded captcha image.
|
|
1217
|
+
* @param {string} params.textinstructions Text will be shown to worker to help him to select object on the image correctly. For example: "*Select cars in the image*". **Optional parameter**, if the instruction already exists in the form of the `imginstructions`.
|
|
1218
|
+
* @param {string} params.imginstructions Image with instruction for worker to help him to select object on the image correctly. The image must be encoded in `Base64` format. **Optional parameter**, if the instruction already exists in the form of the `textinstructions`.
|
|
1219
|
+
* @param {number} params.canSkip Set the value to `1` only if it's possible that there's no images matching to the instruction. We'll provide a button "No matching images" to worker and you will receive `No_matching_images` as answer.
|
|
1220
|
+
* @param {string} params.lang Language code. [See the list of supported languages](https://2captcha.com/2captcha-api#language).
|
|
1221
|
+
* @param {string} params.pingback params.pingback URL for pingback (callback) response that will be sent when captcha is solved. URL should be registered on the server. [More info here](https://2captcha.com/2captcha-api#pingback).
|
|
1222
|
+
*
|
|
1223
|
+
* @example
|
|
1224
|
+
* solver.canvas({
|
|
1225
|
+
* body: 'iVBORw0KGgoAAAANSgAAAcIA...',
|
|
1226
|
+
* imginstructions: '/9j/4AAQSkZJRgABAQEA...',
|
|
1227
|
+
* textinstructions: 'Highlight the red CIRCLE'
|
|
1228
|
+
* })
|
|
1229
|
+
* .then((res) => {
|
|
1230
|
+
* console.log(res);
|
|
1231
|
+
* })
|
|
1232
|
+
* .catch((err) => {
|
|
1233
|
+
* console.log(err);
|
|
1234
|
+
* })
|
|
1235
|
+
*/
|
|
1236
|
+
async canvas(params) {
|
|
1237
|
+
(0, checkCaptchaParams_1.default)(params, "canvas");
|
|
1238
|
+
params = await (0, renameParams_1.default)(params);
|
|
1239
|
+
const payload = {
|
|
1240
|
+
...params,
|
|
1241
|
+
recaptcha: 1,
|
|
1242
|
+
canvas: 1,
|
|
1243
|
+
method: "base64",
|
|
1244
|
+
...this.defaultPayload,
|
|
1245
|
+
};
|
|
1246
|
+
const URL = this.in;
|
|
1247
|
+
const response = await (0, fetch_1.default)(URL, {
|
|
1248
|
+
body: JSON.stringify(payload),
|
|
1249
|
+
method: "post",
|
|
1250
|
+
headers: { 'Content-Type': 'application/json' }
|
|
1251
|
+
});
|
|
1252
|
+
const result = await response.text();
|
|
1253
|
+
let data;
|
|
1254
|
+
try {
|
|
1255
|
+
data = JSON.parse(result);
|
|
1256
|
+
}
|
|
1257
|
+
catch {
|
|
1258
|
+
throw new _2captchaError_1.APIError(result);
|
|
1259
|
+
}
|
|
1260
|
+
if (data.status == 1) {
|
|
1261
|
+
return this.pollResponse(data.request);
|
|
1262
|
+
}
|
|
1263
|
+
else {
|
|
1264
|
+
throw new _2captchaError_1.APIError(data.request);
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
/**
|
|
1268
|
+
* ### Rotate method
|
|
1269
|
+
*
|
|
1270
|
+
* This method can be used to solve a captcha that asks to rotate an object. It is mostly used to bypass FunCaptcha. Returns the rotation angle.
|
|
1271
|
+
* [Read more about Rotate Method](https://2captcha.com/2captcha-api#solving_rotatecaptcha).
|
|
1272
|
+
*
|
|
1273
|
+
* @param {{ body, angle, pingback, lang, textinstructions, imginstructions }} params Parameters for solving Rotate Captcha as an object.
|
|
1274
|
+
* @param {string} params.body Base64-encoded image of the captcha that needs to be rotated.
|
|
1275
|
+
* @param {number} params.angle Angle to which the captcha needs to be rotated to solve it correctly. Value between `0` to `360`.
|
|
1276
|
+
* @param {string} params.textinstructions Optional param. Text instruction that will be shown to worker to help solve the captcha correctly.
|
|
1277
|
+
* @param {string} params.imginstructions Optional param. Base64-encoded image instruction that will be shown to worker to help solve the captcha correctly.
|
|
1278
|
+
* @param {string} params.lang Optional param. Language code for worker to use while solving the captcha.
|
|
1279
|
+
* @param {string} params.pingback Optional param. URL for pingback (callback) response when captcha is solved.
|
|
1280
|
+
*
|
|
1281
|
+
* @returns {Promise<CaptchaAnswer>} The result from the solve.
|
|
1282
|
+
* @throws APIError
|
|
1283
|
+
*
|
|
1284
|
+
* @example
|
|
1285
|
+
* solver.rotate({
|
|
1286
|
+
* body: "iVBORw0KGgoAAAANSUhEUgAAAcIA...",
|
|
1287
|
+
* angle: 15,
|
|
1288
|
+
* textinstructions: "Rotate the object to the correct position"
|
|
1289
|
+
* })
|
|
1290
|
+
* .then((res) => {
|
|
1291
|
+
* console.log(res);
|
|
1292
|
+
* })
|
|
1293
|
+
* .catch((err) => {
|
|
1294
|
+
* console.log(err);
|
|
1295
|
+
* })
|
|
1296
|
+
*/
|
|
1297
|
+
async rotate(params) {
|
|
1298
|
+
(0, checkCaptchaParams_1.default)(params, "rotatecaptcha");
|
|
1299
|
+
const payload = {
|
|
1300
|
+
...params,
|
|
1301
|
+
method: "rotatecaptcha",
|
|
1302
|
+
...this.defaultPayload,
|
|
1303
|
+
};
|
|
1304
|
+
const URL = this.in;
|
|
1305
|
+
const response = await (0, fetch_1.default)(URL, {
|
|
1306
|
+
body: JSON.stringify(payload),
|
|
1307
|
+
method: "post",
|
|
1308
|
+
headers: { 'Content-Type': 'application/json' }
|
|
1309
|
+
});
|
|
1310
|
+
const result = await response.text();
|
|
1311
|
+
let data;
|
|
1312
|
+
try {
|
|
1313
|
+
data = JSON.parse(result);
|
|
1314
|
+
}
|
|
1315
|
+
catch {
|
|
1316
|
+
throw new _2captchaError_1.APIError(result);
|
|
1317
|
+
}
|
|
1318
|
+
if (data.status == 1) {
|
|
1319
|
+
return this.pollResponse(data.request);
|
|
1320
|
+
}
|
|
1321
|
+
else {
|
|
1322
|
+
throw new _2captchaError_1.APIError(data.request);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* ### Solves a KeyCaptcha.
|
|
1327
|
+
*
|
|
1328
|
+
* This method can be used to solve a KeyCaptcha. It is mostly used to bypass captchas that use KeyCaptcha technology.
|
|
1329
|
+
* [Read more about KeyCaptcha Method](https://2captcha.com/2captcha-api#solving_keycaptcha).
|
|
1330
|
+
*
|
|
1331
|
+
* @param {{ pageurl, userId, sessionId, webServerSign, webServerSign2, pingback, proxy, proxytype }} params Parameters for solving KeyCaptcha as an object.
|
|
1332
|
+
* @param {string} params.pageurl The URL where the captcha is located.
|
|
1333
|
+
* @param {string} params.userId Value of `s_s_c_user_id` parameter you found on page.
|
|
1334
|
+
* @param {string} params.sessionId Value of `s_s_c_session_id` parameter you found on page.
|
|
1335
|
+
* @param {string} params.webServerSign Value of `s_s_c_web_server_sign` parameter you found on page.
|
|
1336
|
+
* @param {string} params.webServerSign2 Value of `s_s_c_web_server_sign2` parameter you found on page.
|
|
1337
|
+
* @param {string} [params.pingback] Optional param. URL for pingback (callback) response when captcha is solved.
|
|
1338
|
+
* @param {string} [params.proxy] Optional param. Proxy to use while solving the captcha. Format: `login:password@123.123.123.123:3128`.
|
|
1339
|
+
* @param {string} [params.proxytype] Optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
|
|
1340
|
+
*
|
|
1341
|
+
* @returns {Promise<CaptchaAnswer>} The result from the solve.
|
|
1342
|
+
* @throws APIError
|
|
1343
|
+
*
|
|
1344
|
+
* @example
|
|
1345
|
+
* solver.keyCaptcha({
|
|
1346
|
+
* pageurl: "https://2captcha.com/demo/keycaptcha",
|
|
1347
|
+
* userId: "184015",
|
|
1348
|
+
* sessionId: "11975dc265ce9174a54edb1619af15b7",
|
|
1349
|
+
* webServerSign: "73ef77fd3cf0ce02947d9088bdc8412a",
|
|
1350
|
+
* webServerSign2: "93836d9e7007f38f072ce07d89bb7e2b"
|
|
1351
|
+
* })
|
|
1352
|
+
* .then((res) => {
|
|
1353
|
+
* console.log(res);
|
|
1354
|
+
* })
|
|
1355
|
+
* .catch((err) => {
|
|
1356
|
+
* console.log(err);
|
|
1357
|
+
* })
|
|
1358
|
+
*/
|
|
1359
|
+
async keyCaptcha(params) {
|
|
1360
|
+
params = await (0, renameParams_1.default)(params);
|
|
1361
|
+
(0, checkCaptchaParams_1.default)(params, "keycaptcha");
|
|
1362
|
+
const payload = {
|
|
1363
|
+
...params,
|
|
1364
|
+
method: "keycaptcha",
|
|
1365
|
+
...this.defaultPayload,
|
|
1366
|
+
};
|
|
1367
|
+
const URL = this.in;
|
|
1368
|
+
const response = await (0, fetch_1.default)(URL, {
|
|
1369
|
+
body: JSON.stringify(payload),
|
|
1370
|
+
method: "post",
|
|
1371
|
+
headers: { 'Content-Type': 'application/json' }
|
|
1372
|
+
});
|
|
1373
|
+
const result = await response.text();
|
|
1374
|
+
let data;
|
|
1375
|
+
try {
|
|
1376
|
+
data = JSON.parse(result);
|
|
1377
|
+
}
|
|
1378
|
+
catch {
|
|
1379
|
+
throw new _2captchaError_1.APIError(result);
|
|
1380
|
+
}
|
|
1381
|
+
if (data.status == 1) {
|
|
1382
|
+
return this.pollResponse(data.request);
|
|
1383
|
+
}
|
|
1384
|
+
else {
|
|
1385
|
+
throw new _2captchaError_1.APIError(data.request);
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
/**
|
|
1389
|
+
* ### Solves a Tencent.
|
|
1390
|
+
*
|
|
1391
|
+
* Use this method to solve Tencent captcha. Returns a token.
|
|
1392
|
+
* [Read more about Tencent Method](https://2captcha.com/2captcha-api#tencent).
|
|
1393
|
+
*
|
|
1394
|
+
* @param {{ pageurl, appId, pingback, proxy, proxytype }} params Parameters for solving Tencent as an object.
|
|
1395
|
+
* @param {string} params.pageurl The URL where the captcha is located.
|
|
1396
|
+
* @param {string} params.appId The value of `appId` parameter in the website source code.
|
|
1397
|
+
* @param {string} [params.pingback] Optional param. URL for pingback (callback) response when captcha is solved.
|
|
1398
|
+
* @param {string} [params.proxy] Optional param. Proxy to use while solving the captcha. Format: `login:password@123.123.123.123:3128`.
|
|
1399
|
+
* @param {string} [params.proxytype] Optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
|
|
1400
|
+
*
|
|
1401
|
+
* @returns {Promise<CaptchaAnswer>} The result from the solve.
|
|
1402
|
+
* @throws APIError
|
|
1403
|
+
*
|
|
1404
|
+
* @example
|
|
1405
|
+
* solver.tencent({
|
|
1406
|
+
* pageurl: "https://mysite.com/page/with/tencent",
|
|
1407
|
+
* appId: "189956587"
|
|
1408
|
+
* })
|
|
1409
|
+
* .then((res) => {
|
|
1410
|
+
* console.log(res);
|
|
1411
|
+
* })
|
|
1412
|
+
* .catch((err) => {
|
|
1413
|
+
* console.log(err);
|
|
1414
|
+
* })
|
|
1415
|
+
*/
|
|
1416
|
+
async tencent(params) {
|
|
1417
|
+
params = await (0, renameParams_1.default)(params);
|
|
1418
|
+
(0, checkCaptchaParams_1.default)(params, "tencent");
|
|
1419
|
+
const payload = {
|
|
1420
|
+
...params,
|
|
1421
|
+
method: "tencent",
|
|
1422
|
+
...this.defaultPayload,
|
|
1423
|
+
};
|
|
1424
|
+
const URL = this.in;
|
|
1425
|
+
const response = await (0, fetch_1.default)(URL, {
|
|
1426
|
+
body: JSON.stringify(payload),
|
|
1427
|
+
method: "post",
|
|
1428
|
+
headers: { 'Content-Type': 'application/json' }
|
|
1429
|
+
});
|
|
1430
|
+
const result = await response.text();
|
|
1431
|
+
let data;
|
|
1432
|
+
try {
|
|
1433
|
+
data = JSON.parse(result);
|
|
1434
|
+
}
|
|
1435
|
+
catch {
|
|
1436
|
+
throw new _2captchaError_1.APIError(result);
|
|
1437
|
+
}
|
|
1438
|
+
if (data.status == 1) {
|
|
1439
|
+
return this.pollResponse(data.request);
|
|
1440
|
+
}
|
|
1441
|
+
else {
|
|
1442
|
+
throw new _2captchaError_1.APIError(data.request);
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* ### Solves a atbCAPTCHA.
|
|
1447
|
+
*
|
|
1448
|
+
* Use this method to solve atbCAPTCHA captcha. Returns a token.
|
|
1449
|
+
* [Read more about atbCAPTCHA Method](https://2captcha.com/2captcha-api#atb-captcha).
|
|
1450
|
+
*
|
|
1451
|
+
* @param {{ pageurl, appId, apiServer, pingback, proxy, proxytype }} params Parameters for solving atbCAPTCHA as an object.
|
|
1452
|
+
* @param {string} params.pageurl The URL where the captcha is located.
|
|
1453
|
+
* @param {string} params.appId The value of `appId` parameter in the website source code.
|
|
1454
|
+
* @param {string} params.apiServer The value of `apiServer` parameter in the website source code.
|
|
1455
|
+
* @param {string} [params.pingback] Optional param. URL for pingback (callback) response when captcha is solved.
|
|
1456
|
+
* @param {string} [params.proxy] Optional param. Proxy to use while solving the captcha. Format: `login:password@123.123.123.123:3128`.
|
|
1457
|
+
* @param {string} [params.proxytype] Optional param. Type of your proxy: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`.
|
|
1458
|
+
*
|
|
1459
|
+
* @returns {Promise<CaptchaAnswer>} The result from the solve.
|
|
1460
|
+
* @throws APIError
|
|
1461
|
+
*
|
|
1462
|
+
* @example
|
|
1463
|
+
* solver.atbCaptcha({
|
|
1464
|
+
* pageurl: "https://mysite.com/page/with/tencent",
|
|
1465
|
+
* appId: "af25e409b33d722a95e56a230ff8771c",
|
|
1466
|
+
apiServer: "https://cap.aisecurius.com"
|
|
1467
|
+
* })
|
|
1468
|
+
* .then((res) => {
|
|
1469
|
+
* console.log(res);
|
|
1470
|
+
* })
|
|
1471
|
+
* .catch((err) => {
|
|
1472
|
+
* console.log(err);
|
|
1473
|
+
* })
|
|
1474
|
+
*/
|
|
1475
|
+
async atbCaptcha(params) {
|
|
1476
|
+
params = await (0, renameParams_1.default)(params);
|
|
1477
|
+
(0, checkCaptchaParams_1.default)(params, "atb_captcha");
|
|
1478
|
+
const payload = {
|
|
1479
|
+
...params,
|
|
1480
|
+
method: "atb_captcha",
|
|
1481
|
+
...this.defaultPayload,
|
|
1482
|
+
};
|
|
1483
|
+
const URL = this.in;
|
|
1484
|
+
const response = await (0, fetch_1.default)(URL, {
|
|
1485
|
+
body: JSON.stringify(payload),
|
|
1486
|
+
method: "post",
|
|
1487
|
+
headers: { 'Content-Type': 'application/json' }
|
|
1488
|
+
});
|
|
1489
|
+
const result = await response.text();
|
|
1490
|
+
let data;
|
|
1491
|
+
try {
|
|
1492
|
+
data = JSON.parse(result);
|
|
1493
|
+
}
|
|
1494
|
+
catch {
|
|
1495
|
+
throw new _2captchaError_1.APIError(result);
|
|
1496
|
+
}
|
|
1497
|
+
if (data.status == 1) {
|
|
1498
|
+
return this.pollResponse(data.request);
|
|
1499
|
+
}
|
|
1500
|
+
else {
|
|
1501
|
+
throw new _2captchaError_1.APIError(data.request);
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
/**
|
|
1505
|
+
* ### Method for solving Audio captcha.
|
|
1506
|
+
*
|
|
1507
|
+
* Use the following method to bypass an audio captcha (`mp3` formats only). You must provide the language as `lang = 'en'`. Supported languages are "en", "ru", "de", "el", "pt", "fr".
|
|
1508
|
+
* [Read more about Audio recognition Method](https://2captcha.com/2captcha-api#audio-recognition).
|
|
1509
|
+
*
|
|
1510
|
+
* @param {{ body, lang, pingback }} params Object containing parameters for the audio captcha.
|
|
1511
|
+
* @param {string} params.body Base64 encoded audio file in `mp3` format. Max file size: 1 MB.
|
|
1512
|
+
* @param {string} params.lang The language of audio record. Supported languages are: "en", "ru", "de", "el", "pt", "fr".
|
|
1513
|
+
* @param {string} [params.pingback] URL for pingback response once captcha is solved.
|
|
1514
|
+
*
|
|
1515
|
+
* @returns {Promise<CaptchaAnswer>} The result from solving the audio captcha.
|
|
1516
|
+
* @throws APIError
|
|
1517
|
+
* @example
|
|
1518
|
+
* solver.audio({
|
|
1519
|
+
* body: "SUQzBAAAAAAAHFRTU0UAAAA...",
|
|
1520
|
+
* lang: "en"
|
|
1521
|
+
* })
|
|
1522
|
+
* .then((res) => {
|
|
1523
|
+
* console.log(res);
|
|
1524
|
+
* })
|
|
1525
|
+
* .catch((err) => {
|
|
1526
|
+
* console.log(err);
|
|
1527
|
+
* })
|
|
1528
|
+
*/
|
|
1529
|
+
async audio(params) {
|
|
1530
|
+
(0, checkCaptchaParams_1.default)(params, "audio");
|
|
1531
|
+
const payload = {
|
|
1532
|
+
...params,
|
|
1533
|
+
method: "audio",
|
|
1534
|
+
...this.defaultPayload
|
|
1535
|
+
};
|
|
1536
|
+
const response = await (0, fetch_1.default)(this.in, {
|
|
1537
|
+
method: 'post',
|
|
1538
|
+
body: JSON.stringify(payload),
|
|
1539
|
+
headers: { 'Content-Type': 'application/json' }
|
|
1540
|
+
});
|
|
1541
|
+
const result = await response.text();
|
|
1542
|
+
let data;
|
|
1543
|
+
try {
|
|
1544
|
+
data = JSON.parse(result);
|
|
1545
|
+
}
|
|
1546
|
+
catch {
|
|
1547
|
+
throw new _2captchaError_1.APIError(result);
|
|
1548
|
+
}
|
|
1549
|
+
if (data.status == 1) {
|
|
1550
|
+
return this.pollResponse(data.request);
|
|
1551
|
+
}
|
|
1552
|
+
else {
|
|
1553
|
+
throw new _2captchaError_1.APIError(data.request);
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1142
1556
|
/**
|
|
1143
1557
|
* Reports a captcha as correctly solved.
|
|
1144
1558
|
*
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* ### Captcha Required Parameters Check.
|
|
3
|
+
*
|
|
4
|
+
* Checking required captcha parameters before sending.
|
|
5
|
+
* This function checks for required fields in the provided captcha parameters.
|
|
6
|
+
* Throws an error if the specified method is not supported or if required fields are missing.
|
|
7
|
+
*
|
|
8
|
+
* Note: The `checkCaptchaParams()` function should be called after `renameParams()`, if function `renameParams()` is used.
|
|
9
|
+
*
|
|
2
10
|
* @param { Object } params Captcha parameters that need to be checked.
|
|
3
11
|
* @returns true | false | Error
|
|
4
12
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkCaptchaParams.d.ts","sourceRoot":"","sources":["../../src/utils/checkCaptchaParams.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkCaptchaParams.d.ts","sourceRoot":"","sources":["../../src/utils/checkCaptchaParams.ts"],"names":[],"mappings":"AA0HA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAiCxE"}
|