Add per-video subtitle language picker on Watch page

- fetch_available_subs() queries yt-dlp for manual + auto-generated
  subtitle langs available on YouTube for any given video
- GET /api/videos/by-yt/{ytId}/subs exposes this to the frontend
- DownloadRequest now accepts subtitle_langs to override the global
  setting on a per-download basis
- Watch page fetches available subtitle langs on load (in parallel),
  shows a CC dropdown with manual langs + auto-generated langs labeled
  "(auto)"; selected lang is passed through to the download

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-26 20:57:57 +02:00
parent ea99b74ba8
commit 399c5fcada
5 changed files with 87 additions and 8 deletions

View File

@@ -87,9 +87,10 @@ export const importChapters = (videoId) => api.post(`/videos/${videoId}/bookmark
export const clearChapters = (videoId) => api.delete(`/videos/${videoId}/bookmarks/clear-chapters`);
// Downloads
export const createDownload = (youtube_video_id, quality) =>
api.post("/downloads", { youtube_video_id, ...(quality ? { quality } : {}) });
export const createDownload = (youtube_video_id, quality, subtitle_langs) =>
api.post("/downloads", { youtube_video_id, ...(quality ? { quality } : {}), ...(subtitle_langs ? { subtitle_langs } : {}) });
export const getDownloads = () => api.get("/downloads");
export const getAvailableSubs = (ytId) => api.get(`/videos/by-yt/${ytId}/subs`);
export const getDownload = (id) => api.get(`/downloads/${id}`);
export const deleteDownload = (id) => api.delete(`/downloads/${id}`);
export const deleteAllDownloads = () => api.delete("/downloads/all");