From bddf8a229a221e80e908ea18a6e221d22552d440 Mon Sep 17 00:00:00 2001 From: VeNoMouS Date: Sat, 27 Aug 2022 21:48:09 +1200 Subject: [PATCH] Release 1.2.61 --- cloudscraper/__init__.py | 2 +- cloudscraper/cloudflare.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cloudscraper/__init__.py b/cloudscraper/__init__.py index feb73b1..ce6c0c0 100644 --- a/cloudscraper/__init__.py +++ b/cloudscraper/__init__.py @@ -38,7 +38,7 @@ # ------------------------------------------------------------------------------- # -__version__ = '1.2.60' +__version__ = '1.2.61' # ------------------------------------------------------------------------------- # diff --git a/cloudscraper/cloudflare.py b/cloudscraper/cloudflare.py index 420ec70..8738a59 100644 --- a/cloudscraper/cloudflare.py +++ b/cloudscraper/cloudflare.py @@ -92,11 +92,10 @@ def is_New_IUAM_Challenge(resp): resp.headers.get('Server', '').startswith('cloudflare') and resp.status_code in [429, 503] and re.search( - r'cpo.src\s*=\s*"/cdn-cgi/challenge-platform/\S+orchestrate/jsch/v1', + r'''cpo.src\s*=\s*['"]/cdn-cgi/challenge-platform/\S+orchestrate/jsch/v1''', resp.text, re.M | re.S ) - and re.search(r'window._cf_chl_enter\s*[\(=]', resp.text, re.M | re.S) ) except AttributeError: pass @@ -112,11 +111,10 @@ def is_New_Captcha_Challenge(self, resp): return ( self.is_Captcha_Challenge(resp) and re.search( - r'cpo.src\s*=\s*"/cdn-cgi/challenge-platform/\S+orchestrate/(captcha|managed)/v1', + r'''cpo.src\s*=\s*['"]/cdn-cgi/challenge-platform/\S+orchestrate/(captcha|managed)/v1''', resp.text, re.M | re.S ) - and re.search(r'\s*id="trk_captcha_js"', resp.text, re.M | re.S) ) except AttributeError: pass