j
This commit is contained in:
@@ -1483,7 +1483,13 @@ class Download_File(Cmdlet):
|
|||||||
if mode == "video" and not actual_format:
|
if mode == "video" and not actual_format:
|
||||||
configured = (ytdlp_tool.default_format("video") or "").strip()
|
configured = (ytdlp_tool.default_format("video") or "").strip()
|
||||||
if configured and configured != "bestvideo+bestaudio/best":
|
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
|
forced_single_applied = False
|
||||||
if (
|
if (
|
||||||
@@ -2069,16 +2075,10 @@ class Download_File(Cmdlet):
|
|||||||
height_selector = None
|
height_selector = None
|
||||||
if query_format and not query_wants_audio:
|
if query_format and not query_wants_audio:
|
||||||
try:
|
try:
|
||||||
# Check if this looks like a YouTube format ID (used when selecting from format table)
|
# Always try to resolve numeric inputs like 720/1080p to height selectors.
|
||||||
# Format IDs are typically 3 digits and come from user selections
|
# If it is a real format ID, resolve_height_selector will return None
|
||||||
# Only treat as height if it looks like a resolution (ends with 'p' or is 1080+)
|
# and we will fall back to using the literal format ID below.
|
||||||
is_likely_format_id = (
|
height_selector = ytdlp_tool.resolve_height_selector(query_format)
|
||||||
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)
|
|
||||||
except Exception:
|
except Exception:
|
||||||
height_selector = None
|
height_selector = None
|
||||||
if query_wants_audio:
|
if query_wants_audio:
|
||||||
|
|||||||
Reference in New Issue
Block a user