Set puppeteer timeout half of maxTimeout param. Resolves #180

This commit is contained in:
ngosang
2021-10-20 18:28:30 +02:00
parent a6628d0cda
commit 753e8e1be8
3 changed files with 14 additions and 4 deletions

View File

@@ -13,7 +13,8 @@ const CAPTCHA_SELECTORS = ['input[name="cf_captcha_kind"]'];
export default async function resolveChallenge(url: string, page: Page, response: Response): Promise<Response> {
// look for challenge and return fast if not detected
if (response.headers().server.startsWith('cloudflare') &&
if (response.headers().server &&
response.headers().server.startsWith('cloudflare') &&
(response.status() == 403 || response.status() == 503)) {
log.info('Cloudflare detected');
} else {