Automated daily backup: 2026-10-13 03:08
This commit is contained in:
1 parent
2b31e92673
commit
f339c8a971
920 files changed
+612465
-1405
No files matched your search
+2
-2
@@ -252,7 +252,7 @@ def curl_fetch(url: str, cookies: dict = None, referer: str = None, retries: int
|
||||
clean_write(f" {TAG_CURL} {colorama.Fore.YELLOW}Interstitial bot-check page returned (attempt {attempt+1}/{retries}): {url}{colorama.Style.RESET_ALL}")
|
||||
else:
|
||||
return resp.text
|
||||
if resp.status_code == 403:
|
||||
elif resp.status_code == 403:
|
||||
# If cookies had cf_clearance, Cloudflare 403s because the TLS fingerprint of curl_cffi
|
||||
# doesn't match the browser that generated cf_clearance. Retry without cf_clearance.
|
||||
if req_cookies and "cf_clearance" in req_cookies:
|
||||
@@ -271,7 +271,7 @@ def curl_fetch(url: str, cookies: dict = None, referer: str = None, retries: int
|
||||
wait = (2 ** attempt) * 8 + random.uniform(2.0, 6.0)
|
||||
clean_write(f" {TAG_CURL} {colorama.Fore.YELLOW}429 Rate limited, waiting {wait:.1f}s (attempt {attempt+1}/{retries}): {url}{colorama.Style.RESET_ALL}")
|
||||
time.sleep(wait)
|
||||
else:
|
||||
elif resp.status_code != 200:
|
||||
clean_write(f" {TAG_CURL} HTTP {resp.status_code} (attempt {attempt+1}/{retries}): {url}")
|
||||
except Exception as e:
|
||||
clean_write(f" {TAG_CURL} {colorama.Fore.RED}Error (attempt {attempt+1}/{retries}): {e}{colorama.Style.RESET_ALL}")
|
||||
|
||||
Reference in new issue
Block a user