aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-06 13:07:47 +0200
committerDanilo M. <danix@danix.xyz>2026-10-06 13:07:53 +0200
commit08fbd888d5fb095d200f4e8f09d17c56def3a7f3 (patch)
treee00ea248ad1561e7c4a62464678629381352035d
parent6f366eb8504cfaa84d08b2f24ed8e83179d0e0f6 (diff)
downloadcoomer_dl-master.tar.gz
coomer_dl-master.zip
Fail fast on unreachable file nodesHEADmaster
Use a 15s connect timeout so a dead file node costs 75s over five retries instead of five minutes. Read timeout stays at 60s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
-rwxr-xr-xcoomer_dl2
1 files changed, 1 insertions, 1 deletions
diff --git a/coomer_dl b/coomer_dl
index 4a6acb4..ec1db9d 100755
--- a/coomer_dl
+++ b/coomer_dl
@@ -65,7 +65,7 @@ def download_file(file_url, file_name, save_dir, retries=5):
if os.path.exists(local_filename):
req_headers["Range"] = f"bytes={os.path.getsize(local_filename)}-"
try:
- with requests.get(file_url, headers=req_headers, stream=True, timeout=60) as response:
+ with requests.get(file_url, headers=req_headers, stream=True, timeout=(15, 60)) as response: # (connect, read)
if response.status_code == 416: # Range past end: already complete
print(f"Already downloaded: {local_filename}")
return local_filename