Add video codec selector and codec/quality columns in done list

Allow users to prefer a specific video codec (H.264, H.265, AV1, VP9)
when adding downloads. The selector filters available formats via
yt-dlp format strings, falling back to best available if the preferred
codec is not found. The completed downloads table now shows Quality
and Codec columns.
This commit is contained in:
CyCl0ne
2026-03-09 08:59:01 +01:00
parent 3b0eaad67e
commit 56826d33fd
8 changed files with 111 additions and 8 deletions
+8
View File
@@ -288,6 +288,7 @@ async def add(request):
subtitle_format = post.get('subtitle_format')
subtitle_language = post.get('subtitle_language')
subtitle_mode = post.get('subtitle_mode')
video_codec = post.get('video_codec')
if custom_name_prefix is None:
custom_name_prefix = ''
@@ -319,6 +320,12 @@ async def add(request):
if subtitle_mode not in VALID_SUBTITLE_MODES:
raise web.HTTPBadRequest(reason=f'subtitle_mode must be one of {sorted(VALID_SUBTITLE_MODES)}')
if video_codec is None:
video_codec = 'auto'
video_codec = str(video_codec).strip().lower()
if video_codec not in ('auto', 'h264', 'h265', 'av1', 'vp9'):
raise web.HTTPBadRequest(reason="video_codec must be one of ['auto', 'h264', 'h265', 'av1', 'vp9']")
playlist_item_limit = int(playlist_item_limit)
status = await dqueue.add(
@@ -334,6 +341,7 @@ async def add(request):
subtitle_format,
subtitle_language,
subtitle_mode,
video_codec=video_codec,
)
return web.Response(text=serializer.encode(status))