Skip to content

Commit 653451c

Browse files
Add img_type param for Grid method
1 parent 6c3631f commit 653451c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

examples/grid_options.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ const imageInstructionsBase64 = fs.readFileSync("./media/recaptchaGridImginstruc
88

99
solver.grid({
1010
body: imageBase64,
11-
textinstructions: "Select all squares with stairs",
11+
textinstructions: "select all squares with stairs if there are none, click skip",
1212
imginstructions: imageInstructionsBase64,
1313
cols: 4,
1414
rows: 4,
1515
minClicks: 2,
1616
maxClicks: 6,
1717
lang: "en",
1818
canSkip: 1,
19+
imgType: "recaptcha" /* More information about the `img_type` parameter can be found at: https://2captcha.com/2captcha-api#grid */
1920
// pingback: '123.123.123.123' /* More info about pingback https://2captcha.com/setting/pingback */
2021
// previousId: '123456789'
2122
})
@@ -24,4 +25,4 @@ solver.grid({
2425
})
2526
.catch((err) => {
2627
console.log(err);
27-
});
28+
});

src/structs/2captcha.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ export interface paramsGrid {
230230
minСlicks?: number,
231231
maxСlicks?: number,
232232
previousId?: string,
233+
imgType?: string,
233234
textinstructions?: string,
234235
imginstructions?: string,
235236
canSkip?: number,
@@ -1358,14 +1359,15 @@ public async boundingBox(params: paramsBoundingBox): Promise<CaptchaAnswer> {
13581359
*
13591360
* 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.
13601361
*
1361-
* @param {{ body, textinstructions, imginstructions, rows, cols, minСlicks, maxСlicks, previousId, canSkip, lang, pingback}} params Parameters Grid Method as an object.
1362+
* @param {{ body, textinstructions, imginstructions, rows, cols, minСlicks, maxСlicks, imgType, previousId, canSkip, lang, pingback}} params Parameters Grid Method as an object.
13621363
* @param {string} params.body `Base64`- encoded captcha image.
13631364
* @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`.
13641365
* @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`.
13651366
* @param {number} params.rows Number of rows in grid captcha.
13661367
* @param {number} params.cols Number of columns in grid captcdha.
13671368
* @param {number} params.minСlicks The minimum number of tiles that must be selected. Can't be more than `rows` * `cols`.
13681369
* @param {number} params.maxСlicks The maximum number of tiles that can be selected on the image.
1370+
* @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).
13691371
* @param {string} params.previousId Id of your previous request with the same captcha challenge.
13701372
* @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.
13711373
* @param {string} params.lang Language code. [See the list of supported languages](https://2captcha.com/2captcha-api#language).

src/utils/renameParams.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export default function renameParams(params: any) {
2020
"minClicks" : "min_clicks",
2121
"maxClicks" : "max_clicks",
2222
"canSkip" : "can_no_answer",
23-
"previousId" : "previousID"
23+
"previousId" : "previousID",
24+
"imgType" : "img_type"
2425
}
2526

2627
for(let key in params) {

0 commit comments

Comments
 (0)