From 070ecf2eaabe8823153eba7190024f2830d633be Mon Sep 17 00:00:00 2001 From: Thephaseless Date: Sun, 27 Oct 2024 18:32:06 +0000 Subject: [PATCH] do not skip challenged --- src/utils/browser.py | 2 +- tests/main_test.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils/browser.py b/src/utils/browser.py index fbdb94b..b6e1c05 100644 --- a/src/utils/browser.py +++ b/src/utils/browser.py @@ -98,7 +98,7 @@ async def bypass_cloudflare(page: webdriver.Tab): raise InvalidElementError for attr in parent.attributes: - if attr == "display: none; visibility: hidden;": + if attr == "display: none; visibility: hidden;" and not loaded: loaded = True logger.info("Page loaded") diff --git a/tests/main_test.py b/tests/main_test.py index 748aa30..9471348 100644 --- a/tests/main_test.py +++ b/tests/main_test.py @@ -17,7 +17,7 @@ test_websites = [ "https://extratorrent.st/", # github is blocking these "https://idope.se/", # github is blocking these "https://www.ygg.re/", - "https://speed.cd/", + "https://speed.cd/login", ] @@ -27,7 +27,10 @@ def test_bypass(website: str): test_request = httpx.get( website, ) - if test_request.status_code != HTTPStatus.OK: + if ( + test_request.status_code != HTTPStatus.OK + and "Just a moment..." not in test_request.text + ): logger.info(f"Skipping {website} due to {test_request.status_code}") pytest.skip()