From aa254eb83086ff0910024a968eac1d2e79d75e6e Mon Sep 17 00:00:00 2001 From: ngosang Date: Sun, 25 Sep 2022 00:35:39 +0200 Subject: [PATCH] Detect Cloudflare Access Denied --- src/providers/cloudflare.ts | 4 +++- src/tests/app.test.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/providers/cloudflare.ts b/src/providers/cloudflare.ts index d16d2cc..f5d8bd0 100644 --- a/src/providers/cloudflare.ts +++ b/src/providers/cloudflare.ts @@ -6,7 +6,9 @@ import log from "../services/log"; * This class contains the logic to solve protections provided by CloudFlare **/ -const BAN_SELECTORS: string[] = []; +const BAN_SELECTORS: string[] = [ + 'div.main-wrapper div.header.section h1 span.code-label span' // CloudFlare +]; const CHALLENGE_SELECTORS: string[] = [ // todo: deprecate '#trk_jschal_js', '#cf-please-wait' '#cf-challenge-running', '#trk_jschal_js', '#cf-please-wait', // CloudFlare diff --git a/src/tests/app.test.ts b/src/tests/app.test.ts index dcc1f1f..0911f36 100644 --- a/src/tests/app.test.ts +++ b/src/tests/app.test.ts @@ -14,7 +14,7 @@ const googleUrl = "https://www.google.com"; const postUrl = "https://ptsv2.com/t/qv4j3-1634496523"; const cfUrl = "https://nowsecure.nl"; const cfCaptchaUrl = "https://idope.se" -const cfBlockedUrl = "https://www.torrentmafya.org/table.php" +const cfBlockedUrl = "https://avistaz.to/api/v1/jackett/torrents?in=1&type=0&search=" const ddgUrl = "https://anidex.info/"; const ccfUrl = "https://www.muziekfabriek.org";