mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2025-06-08 12:35:30 +00:00
Improve Cloudflare IP ban detection
This commit is contained in:
parent
6dd8206a10
commit
fdb3eae051
@ -20,8 +20,8 @@ export default async function resolveChallenge(url: string, page: Page, response
|
|||||||
}
|
}
|
||||||
log.info('Cloudflare detected');
|
log.info('Cloudflare detected');
|
||||||
|
|
||||||
if (await page.$('.cf-error-code')) {
|
if (await page.$('span[data-translate="error"]') || (await page.content()).includes('error code: 1020')) {
|
||||||
throw new Error('Cloudflare has blocked this request (Code 1020 Detected).')
|
throw new Error('Cloudflare has blocked this request. Probably your IP is banned for this site, check in your web browser.')
|
||||||
}
|
}
|
||||||
|
|
||||||
let selectorFoundCount = 0;
|
let selectorFoundCount = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user