fix: a failed subtitle no longer destroys the download

Two faults behind the 429 in the report.

The subtitle languages were a wildcard: 'en.*' also matches every
machine-translated variant YouTube offers — en-en-US and dozens more —
so each download fired a burst of subtitle requests and earned an HTTP
429. Languages are now named exactly, as '<lang>,<lang>-orig'. Turning
subtitles off now really does request none; it previously still asked
for English.

Worse, yt-dlp exits non-zero if anything at all failed, and a caption it
could not fetch was enough to mark a fully downloaded video as failed
and leave the file orphaned. yt-dlp now runs with --ignore-errors, and
success is judged by whether the media file actually landed rather than
by the exit code.

429 also gets its own message pointing at the sign-in setting, which
raises the limit.
This commit is contained in:
vincent
2026-08-29 14:29:14 +02:00
parent 22c7a3a5ec
commit 923fd3273f
3 changed files with 89 additions and 29 deletions
+4 -3
View File
@@ -168,9 +168,10 @@ export default function App() {
[channels],
);
// yt-dlp wants a pattern; "en.*" catches "en" and "en-orig" and the
// auto-generated "en" track alike. English is always fetched as a fallback.
const subLangArg = subLang === "off" ? "en.*" : `${subLang}.*,en.*`;
// Named exactly, never as a wildcard: "en.*" also matches every
// machine-translated variant YouTube offers, and asking for all of them
// earns an HTTP 429. Off means no subtitle requests at all.
const subLangArg = subLang === "off" ? "" : `${subLang},${subLang}-orig`;
const doRefresh = useCallback(async () => {
setRefreshing(true);