From 33d7461db6e70c2b88ef4df1941254f866c4cf64 Mon Sep 17 00:00:00 2001 From: Nose Date: Tue, 10 Feb 2026 23:34:13 -0800 Subject: [PATCH] j --- cmdlet/download_file.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cmdlet/download_file.py b/cmdlet/download_file.py index 3916a47..f3a9756 100644 --- a/cmdlet/download_file.py +++ b/cmdlet/download_file.py @@ -1483,7 +1483,13 @@ class Download_File(Cmdlet): if mode == "video" and not actual_format: configured = (ytdlp_tool.default_format("video") or "").strip() if configured and configured != "bestvideo+bestaudio/best": - actual_format = configured + # Check if the configured default is a short-hand resolution (e.g. "720") + # and resolve it to a proper selector. + resolved = ytdlp_tool.resolve_height_selector(configured) + if resolved: + actual_format = resolved + else: + actual_format = configured forced_single_applied = False if ( @@ -2069,16 +2075,10 @@ class Download_File(Cmdlet): height_selector = None if query_format and not query_wants_audio: try: - # Check if this looks like a YouTube format ID (used when selecting from format table) - # Format IDs are typically 3 digits and come from user selections - # Only treat as height if it looks like a resolution (ends with 'p' or is 1080+) - is_likely_format_id = ( - len(str(query_format).strip()) == 3 and - str(query_format).strip().isdigit() - ) - - if not is_likely_format_id: - height_selector = ytdlp_tool.resolve_height_selector(query_format) + # Always try to resolve numeric inputs like 720/1080p to height selectors. + # If it is a real format ID, resolve_height_selector will return None + # and we will fall back to using the literal format ID below. + height_selector = ytdlp_tool.resolve_height_selector(query_format) except Exception: height_selector = None if query_wants_audio: