feat: add options for timeout

This commit is contained in:
HugoPoi 2020-03-31 18:32:12 +02:00
parent 33fa371716
commit 2846a50983
2 changed files with 4 additions and 2 deletions

View File

@ -31,8 +31,8 @@ module.exports = class Scraper {
this.proxy = config.proxy; this.proxy = config.proxy;
this.keywords = config.keywords; this.keywords = config.keywords;
this.STANDARD_TIMEOUT = 10000; this.STANDARD_TIMEOUT = config.standard_timeout;
this.SOLVE_CAPTCHA_TIME = 45000; this.SOLVE_CAPTCHA_TIME = config.solve_captcha_time;
this.results = {}; this.results = {};
this.result_rank = 1; this.result_rank = 1;

View File

@ -139,6 +139,8 @@ class ScrapeManager {
//custom_func: resolve('examples/pluggable.js'), //custom_func: resolve('examples/pluggable.js'),
custom_func: null, custom_func: null,
throw_on_detection: false, throw_on_detection: false,
standard_timeout: 10000,
solve_captcha_time: 45000,
// List of proxies to use ['socks5://78.94.172.42:1080', 'http://localhost:1080'] // List of proxies to use ['socks5://78.94.172.42:1080', 'http://localhost:1080']
proxies: null, proxies: null,
// a file with one proxy per line. Example: // a file with one proxy per line. Example: