mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2026-04-24 08:55:35 +02:00
@@ -37,7 +37,13 @@ export default async function resolveChallenge(url: string, page: Page, response
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (await findAnySelector(page, BAN_SELECTORS)) {
|
if (await findAnySelector(page, BAN_SELECTORS)) {
|
||||||
throw new Error('Cloudflare has blocked this request. Probably your IP is banned for this site, check in your web browser.')
|
const errorCodeElem = await page.$(BAN_SELECTORS[0]);
|
||||||
|
if (errorCodeElem) {
|
||||||
|
let displayCSSProperty = await errorCodeElem.evaluate(el => (<HTMLElement>el).style.display);
|
||||||
|
if (displayCSSProperty !== 'none') {
|
||||||
|
throw new Error('Cloudflare has blocked this request. Probably your IP is banned for this site, check in your web browser.');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// find Cloudflare selectors
|
// find Cloudflare selectors
|
||||||
|
|||||||
Reference in New Issue
Block a user