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

@@ -657,6 +657,15 @@ def delete_bookmark(
db.commit()
@router.get("/by-yt/{youtube_video_id}/subs")
def get_available_subs(
youtube_video_id: str,
current_user: User = Depends(get_current_user),
):
"""Return subtitle languages available on YouTube for a video."""
return ytdlp.fetch_available_subs(youtube_video_id)
@router.get("/by-yt/{youtube_video_id}/comments")
def get_comments(
youtube_video_id: str,