Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

Commit

Permalink
Fixed bug with failing captcha download when --enforce-tor option is …
Browse files Browse the repository at this point in the history
…not set
  • Loading branch information
filo891 authored Aug 21, 2023
1 parent 97a8d9b commit ef8e7a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions uldlib/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ def captcha_download_links_generator(self, solver: Type[CaptchaSolver], stop_eve

if not self.cloudflareWAFActive:
r = s.get(self.captchaURL, headers=XML_HEADERS, proxies=self.tor.proxies)
if r.status_code == 403:
self.frontend.main_log(f"Cloudflare WAF detected, trying with automated Cloudflare Solver...", level=LogLevel.INFO)
self.cloudflareWAFActive = True
continue
else:
solver.log(f"Solving Cloudflare WAF challenge (timeout {self.cfsolver.get_timeout()}s)...")
r = self.cfsolver.get(self.captchaURL)
Expand Down

0 comments on commit ef8e7a5

Please sign in to comment.