fix(blocks): add yt-dlp format fallback for video download

Append `/best` to yt-dlp format string so it falls back to best
available format when the preferred quality isn't available.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Nicholas Tindle
2026-02-04 17:56:16 -06:00
parent 448e8b8876
commit 2b08ea9d4d

View File

@@ -63,7 +63,11 @@ class VideoDownloadBlock(Block):
("source_url", str),
],
test_mock={
"_download_video": lambda *args: ("video.mp4", 212.0, "Test Video"),
"_download_video": lambda *args: (
"video.mp4",
212.0,
"Test Video",
),
"_store_output_video": lambda *args, **kwargs: "video.mp4",
},
)
@@ -102,7 +106,7 @@ class VideoDownloadBlock(Block):
)
ydl_opts: "_Params" = {
"format": self._get_format_string(quality),
"format": f"{self._get_format_string(quality)}/best",
"outtmpl": output_template,
"merge_output_format": output_format,
"quiet": True,