Skip to content

Commit

Permalink
Changes on cloudflare
Browse files Browse the repository at this point in the history
  • Loading branch information
VeNoMouS committed Apr 6, 2021
1 parent f0bab8c commit 498f722
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cloudscraper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def simpleException(self, exception, msg):
@staticmethod
def debugRequest(req):
try:
print(dump.dump_all(req).decode('utf-8'))
print(dump.dump_all(req).decode('utf-8', errors='backslashreplace'))
except ValueError as e:
print(f"Debug Error: {getattr(e, 'message', e)}")

Expand Down Expand Up @@ -355,7 +355,7 @@ 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
)
Expand All @@ -376,7 +376,7 @@ def is_New_Captcha_Challenge(resp):
return (
CloudScraper.is_Captcha_Challenge(resp)
and re.search(
r'cpo.src\s*=\s*"/cdn-cgi/challenge-platform/\S+orchestrate/captcha/v1"',
r'cpo.src\s*=\s*"/cdn-cgi/challenge-platform/\S+orchestrate/captcha/v1',
resp.text,
re.M | re.S
)
Expand Down

0 comments on commit 498f722

Please sign in to comment.