Skip to content

Commit

Permalink
Increase captcha solver timeout (#63)
Browse files Browse the repository at this point in the history
* increase captcha solver timeout

* fix version and readme
  • Loading branch information
mxsnq authored Jan 21, 2025
1 parent db98efd commit 9f73b56
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ Example request body:
```json5
{
"waitOptions": { // selector, xpath or timeout, same as in the goto method
"timeout": 5000, //default timeout is 1000ms
"timeout": 5000, // timeout in milliseconds, default is 30000
},
"solve_recaptcha": true, // Whether to solve recaptcha on the page or not
"close_on_empty": false, // Whether to close the page if there was no recaptcha
Expand Down
4 changes: 2 additions & 2 deletions actions/recaptcha_solver.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const utils = require('../helpers/utils')
const exceptions = require("../helpers/exceptions");

const DEFAULT_TIMEOUT = 1000; // 1 second
const DEFAULT_TIMEOUT = 30000; // 30 seconds

/**
* The function solves recaptchas on the page.
Expand All @@ -26,7 +26,7 @@ exports.recaptchaSolver = async function recaptchaSolver(page, request) {
recaptchaData = await page.findRecaptchas();
}

const waitOptions = request.body.waitOptions || { timeout: DEFAULT_TIMEOUT };
const waitOptions = request.body.waitOptions || {timeout: DEFAULT_TIMEOUT};
const contents = await utils.getContents(page, waitOptions);

if (request.query.closePage ||
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scrapy-puppeteer-service",
"version": "0.3.9",
"version": "0.3.11",
"private": true,
"scripts": {
"start": "node ./bin/www"
Expand Down

0 comments on commit 9f73b56

Please sign in to comment.