This commit is contained in:
2026-01-03 21:23:55 -08:00
parent 73f3005393
commit 3acf21a673
10 changed files with 1244 additions and 43 deletions

View File

@@ -1109,18 +1109,27 @@ def _queue_items(
}
_send_ipc_command(ytdl_cmd, silent=True)
# For memory:// M3U payloads (used to carry titles), use loadlist so mpv parses
# the content as a playlist and does not expose #EXTINF lines as entries.
command_name = "loadfile"
try:
if isinstance(target_to_send, str) and target_to_send.startswith("memory://") and "#EXTM3U" in target_to_send:
command_name = "loadlist"
except Exception:
pass
cmd = {
"command": ["loadfile",
"command": [command_name,
target_to_send,
mode],
"request_id": 200
}
try:
debug(f"Sending MPV loadfile: {target_to_send} mode={mode}")
debug(f"Sending MPV {command_name}: {target_to_send} mode={mode}")
resp = _send_ipc_command(cmd, silent=True)
debug(f"MPV loadfile response: {resp}")
debug(f"MPV {command_name} response: {resp}")
except Exception as e:
debug(f"Exception sending loadfile to MPV: {e}", file=sys.stderr)
debug(f"Exception sending {command_name} to MPV: {e}", file=sys.stderr)
resp = None
if resp is None: