j
This commit is contained in:
@@ -1483,6 +1483,12 @@ 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":
|
||||
# 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
|
||||
@@ -2069,15 +2075,9 @@ 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:
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user