fix clip
This commit is contained in:
@@ -1531,6 +1531,25 @@ class Download_File(Cmdlet):
|
||||
):
|
||||
actual_format = "bestaudio"
|
||||
|
||||
if clip_sections_spec and mode != "audio":
|
||||
clip_format_basis = actual_format
|
||||
if not clip_format_basis or str(clip_format_basis).strip().lower() in {
|
||||
"bestvideo+bestaudio/best",
|
||||
"bestvideo+bestaudio",
|
||||
"best",
|
||||
"best/b",
|
||||
"best/best",
|
||||
"b",
|
||||
}:
|
||||
preferred_clip_format = str(getattr(ytdlp_tool.defaults, "format", "") or "").strip()
|
||||
if preferred_clip_format and preferred_clip_format.lower() != "audio":
|
||||
clip_format_basis = preferred_clip_format
|
||||
else:
|
||||
clip_format_basis = ytdlp_tool.default_format("video")
|
||||
clip_safe_format = ytdlp_tool.resolve_clip_safe_format(clip_format_basis)
|
||||
if clip_safe_format:
|
||||
actual_format = clip_safe_format
|
||||
|
||||
# DEBUG: Render config panel for tracking pipeline state
|
||||
if is_debug_enabled():
|
||||
try:
|
||||
@@ -1563,6 +1582,7 @@ class Download_File(Cmdlet):
|
||||
actual_format
|
||||
and isinstance(actual_format, str)
|
||||
and mode != "audio"
|
||||
and not clip_sections_spec
|
||||
and "+" not in actual_format
|
||||
and "/" not in actual_format
|
||||
and "[" not in actual_format
|
||||
@@ -1727,7 +1747,12 @@ class Download_File(Cmdlet):
|
||||
try:
|
||||
vcodec = str(only.get("vcodec", "none"))
|
||||
acodec = str(only.get("acodec", "none"))
|
||||
if vcodec != "none" and acodec == "none" and fallback_format:
|
||||
if (
|
||||
not clip_sections_spec
|
||||
and vcodec != "none"
|
||||
and acodec == "none"
|
||||
and fallback_format
|
||||
):
|
||||
selection_format_id = f"{fallback_format}+bestaudio"
|
||||
except Exception:
|
||||
selection_format_id = fallback_format
|
||||
|
||||
Reference in New Issue
Block a user