Skip to content

Commit

Permalink
Don't double print debug if post hooking
Browse files Browse the repository at this point in the history
  • Loading branch information
VeNoMouS committed Apr 10, 2021
1 parent 35647d4 commit 2e9f520
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cloudscraper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,13 @@ def request(self, method, url, *args, **kwargs):
# ------------------------------------------------------------------------------- #

if self.requestPostHook:
response = self.requestPostHook(self, response)
newResponse = self.requestPostHook(self, response)

if self.debug:
self.debugRequest(response)
if response != newResponse: # Give me walrus in 3.7!!!
response = newResponse
if self.debug:
print('==== requestPostHook Debug ====')
self.debugRequest(response)

# Check if Cloudflare anti-bot is on
if self.is_Challenge_Request(response):
Expand Down

0 comments on commit 2e9f520

Please sign in to comment.