removed TUI and others
This commit is contained in:
@@ -4608,6 +4608,25 @@ function M._raw_format_selection_id(fmt)
|
||||
return display_id
|
||||
end
|
||||
|
||||
function M._raw_info_has_audio_variant_selectors(raw)
|
||||
if type(raw) ~= 'table' or type(raw.formats) ~= 'table' then
|
||||
return false
|
||||
end
|
||||
|
||||
for _, fmt in ipairs(raw.formats) do
|
||||
if type(fmt) == 'table' then
|
||||
local format_id = trim(tostring(fmt.format_id or ''))
|
||||
local vcodec = tostring(fmt.vcodec or 'none')
|
||||
local acodec = tostring(fmt.acodec or 'none')
|
||||
if format_id:match('^%d+%-%w+$') and vcodec == 'none' and acodec ~= 'none' then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function M._raw_format_picker_score(fmt)
|
||||
local note = trim(tostring(fmt and (fmt.format_note or fmt.format) or '')):lower()
|
||||
local format_id = trim(tostring(fmt and fmt.format_id or '')):lower()
|
||||
@@ -4715,6 +4734,14 @@ local function _cache_formats_from_raw_info(url, raw, source_label)
|
||||
return nil, 'missing url'
|
||||
end
|
||||
|
||||
if raw == nil then
|
||||
raw = mp.get_property_native('ytdl-raw-info')
|
||||
end
|
||||
|
||||
if M._raw_info_has_audio_variant_selectors(raw) then
|
||||
return nil, 'raw info requires validated probe'
|
||||
end
|
||||
|
||||
local tbl, err = _build_formats_table_from_raw_info(url, raw)
|
||||
if type(tbl) ~= 'table' or type(tbl.rows) ~= 'table' then
|
||||
return nil, err or 'raw format conversion failed'
|
||||
|
||||
@@ -477,7 +477,7 @@ class MPV:
|
||||
pipeline += f" | file -add -plugin local -instance {_q(path or '')}"
|
||||
|
||||
try:
|
||||
from TUI.pipeline_runner import PipelineRunner # noqa: WPS433
|
||||
from SYS.pipeline_runner import PipelineRunner # noqa: WPS433
|
||||
|
||||
runner = PipelineRunner()
|
||||
result = runner.run_pipeline(pipeline)
|
||||
|
||||
@@ -305,7 +305,7 @@ def _run_pipeline(
|
||||
json_output: bool = False,
|
||||
) -> Dict[str, Any]:
|
||||
# Import after sys.path fix.
|
||||
from TUI.pipeline_runner import PipelineRunner # noqa: WPS433
|
||||
from SYS.pipeline_runner import PipelineRunner # noqa: WPS433
|
||||
|
||||
def _json_safe(value: Any) -> Any:
|
||||
if value is None or isinstance(value, (str, int, float, bool)):
|
||||
|
||||
Reference in New Issue
Block a user