feat(downloads): categorize download failures + a readable error dialog (S2)

Failed downloads stored the raw yt-dlp/ffmpeg text and dumped it as a truncated red
one-liner in the queue. Classify the failure into a category (unavailable / login_required /
geo_blocked / format_unavailable / drm / postprocess / source_missing / network / unknown)
and surface it properly:

- backend: app/downloads/errors.classify maps the raw message to a category code; the worker
  stores it in the new download_jobs.error_code (migration 0061) at both failure sites; resume
  clears it; the serializer exposes it. Raw text kept as technical detail.
- frontend: the queue row shows a clean localized reason + a "details" link opening a modal
  with the explanation, the raw text behind a disclosure, and a Retry only for transient
  categories (network/postprocess/unknown).
- tests: classify() unit coverage over verbatim yt-dlp/ffmpeg message shapes.
This commit is contained in:
2026-07-28 01:40:22 +02:00
parent 3f15f35256
commit cdcffb8c91
10 changed files with 337 additions and 5 deletions
@@ -206,6 +206,49 @@
"empty_edit": "Choose a trim range or crop area first.",
"source_not_ready": "The source download isn't ready to edit.",
"generic": "That edit couldn't be created."
},
"fail": {
"title": "Download failed",
"detailsLink": "details",
"detailsToggle": "Technical details",
"cat": {
"unavailable": {
"short": "Video unavailable",
"body": "This video is private, deleted, or otherwise no longer available at the source, so it can't be downloaded."
},
"login_required": {
"short": "Sign-in required",
"body": "This video needs a signed-in, age-verified, or members-only account to view, so it can't be downloaded here."
},
"geo_blocked": {
"short": "Region-blocked",
"body": "The source blocks this video in the server's region, so it can't be downloaded."
},
"format_unavailable": {
"short": "No downloadable format",
"body": "No downloadable video format was offered for this link — it may be images-only or an unsupported page."
},
"drm": {
"short": "DRM-protected",
"body": "This video is DRM-protected and cannot be downloaded."
},
"postprocess": {
"short": "Processing failed",
"body": "The video downloaded but a processing step (merge or convert) failed. A retry often fixes this."
},
"source_missing": {
"short": "Source unavailable",
"body": "The original download this clip is based on is no longer available."
},
"network": {
"short": "Network error",
"body": "A network error interrupted the download. A retry usually fixes this."
},
"unknown": {
"short": "Download failed",
"body": "Something went wrong while downloading this item. The technical details below may help."
}
}
}
}
}
@@ -206,6 +206,49 @@
"empty_edit": "Előbb válassz vágási tartományt vagy körbevágási területet.",
"source_not_ready": "A forrásletöltés még nem szerkeszthető.",
"generic": "Ezt a vágást nem sikerült létrehozni."
},
"fail": {
"title": "A letöltés nem sikerült",
"detailsLink": "részletek",
"detailsToggle": "Technikai részletek",
"cat": {
"unavailable": {
"short": "A videó nem elérhető",
"body": "Ez a videó privát, törölt, vagy más okból már nem elérhető a forrásnál, ezért nem tölthető le."
},
"login_required": {
"short": "Bejelentkezés szükséges",
"body": "Ehhez a videóhoz bejelentkezett, kor-ellenőrzött vagy tagsági fiók kell, ezért itt nem tölthető le."
},
"geo_blocked": {
"short": "Régió szerint tiltva",
"body": "A forrás a szerver régiójában letiltja ezt a videót, ezért nem tölthető le."
},
"format_unavailable": {
"short": "Nincs letölthető formátum",
"body": "Ehhez a linkhez nem kínált fel letölthető videóformátumot — lehet csak képes, vagy nem támogatott oldal."
},
"drm": {
"short": "DRM-védett",
"body": "Ez a videó DRM-védett, ezért nem tölthető le."
},
"postprocess": {
"short": "A feldolgozás megszakadt",
"body": "A videó letöltődött, de egy feldolgozási lépés (összefűzés vagy konvertálás) meghiúsult. Újrapróbálásra gyakran megjavul."
},
"source_missing": {
"short": "A forrás nem elérhető",
"body": "Az eredeti letöltés, amelyből ez a vágás készült, már nem érhető el."
},
"network": {
"short": "Hálózati hiba",
"body": "Hálózati hiba szakította meg a letöltést. Újrapróbálásra általában megjavul."
},
"unknown": {
"short": "A letöltés nem sikerült",
"body": "Valami hiba történt az elem letöltése közben. Az alábbi technikai részletek segíthetnek."
}
}
}
}
}