This commit is contained in:
2026-02-09 17:22:40 -08:00
parent d2e571b6f1
commit c86aae1ff6
5 changed files with 35 additions and 22 deletions

View File

@@ -999,9 +999,18 @@ class YtDlpTool:
pass
if ytdl_format and opts.mode != "audio":
resolved = self.resolve_height_selector(ytdl_format)
if resolved:
ytdl_format = resolved
# Don't resolve 3-digit format IDs (like 251, 249, 140 from YouTube format tables) as heights
# YouTube format IDs are typically 2-3 digits representing specific codec/quality combinations
# Height selectors come from user input like "720" or "1080p"
is_likely_format_id = (
isinstance(ytdl_format, str) and
len(ytdl_format.strip()) == 3 and
ytdl_format.strip().isdigit()
)
if not is_likely_format_id:
resolved = self.resolve_height_selector(ytdl_format)
if resolved:
ytdl_format = resolved
fmt = ytdl_format or self.default_format(opts.mode)
base_options["format"] = fmt