diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-06 13:07:47 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-06 13:07:53 +0200 |
| commit | 08fbd888d5fb095d200f4e8f09d17c56def3a7f3 (patch) | |
| tree | e00ea248ad1561e7c4a62464678629381352035d | |
| parent | 6f366eb8504cfaa84d08b2f24ed8e83179d0e0f6 (diff) | |
| download | coomer_dl-master.tar.gz coomer_dl-master.zip | |
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-x | coomer_dl | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |
