siftlode/backend/app/downloads
npeter83 4b15d55092 fix(downloads): force IPv4 (fixes container 'Errno -5' DNS failures) + retry resets errored asset
Root cause of the failing downloads: containers usually have no working IPv6 route, but
googlevideo CDN hosts advertise AAAA records, so the downloader tried IPv6 and failed with
'[Errno -5] No address associated with hostname'. Small clips happened to use IPv4; long videos
(more CDN requests / the ffmpeg path) hit IPv6 and died.
- yt-dlp source_address=0.0.0.0 forces IPv4 for every connection (== --force-ipv4). Verified: the
  full video+audio download completes cleanly.
- Also: retry (resume) now resets the shared asset from 'error' to 'pending', so it actually
  re-downloads — previously the requeued job instantly re-inherited the asset's stale error
  because the worker short-circuits a job whose asset already errored.
- Dropped the localdev DNS override (wrong hypothesis; the issue was IPv6, not the resolver).
- Kept yt-dlp retries/fragment_retries/socket_timeout for transient blips.

Verified end-to-end in the worker: two previously-failing long videos now download to done.
2026-07-03 03:47:13 +02:00
..
__init__.py fix(downloads): add the downloads package (was wrongly gitignored) + robust sanitizer 2026-07-03 00:19:22 +02:00
formats.py fix(downloads): force IPv4 (fixes container 'Errno -5' DNS failures) + retry resets errored asset 2026-07-03 03:47:13 +02:00
gc.py feat(downloads): M3 — per-user quota + retention GC 2026-07-03 00:26:40 +02:00
quota.py feat(downloads): M4 — REST API (enqueue, manage, file-serve, sharing, admin) 2026-07-03 00:34:08 +02:00
service.py fix(downloads): show real title + thumbnail while queued/downloading 2026-07-03 02:23:21 +02:00
storage.py fix(downloads): strip emoji from device filename + free disk when a download is deleted 2026-07-03 02:16:36 +02:00