From 08fbd888d5fb095d200f4e8f09d17c56def3a7f3 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 6 Oct 2026 13:07:47 +0200 Subject: Fail fast on unreachable file nodes 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 --- coomer_dl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3