mirror of
https://github.com/mpv-player/mpv
synced 2024-12-23 23:32:26 +00:00
ytdl_hook: handle optional format_note
some extractors don't return a format_note for their audio stream which resulted in commandv complaining "argument 4 is not a string" (got nil).
This commit is contained in:
parent
0e1e4005fb
commit
f7244ebe9b
@ -207,7 +207,7 @@ mp.add_hook("on_load", 10, function ()
|
||||
|
||||
-- audio url
|
||||
mp.commandv("audio-add", json["requested_formats"][2].url,
|
||||
"select", json["requested_formats"][2]["format_note"])
|
||||
"select", json["requested_formats"][2]["format_note"] or "")
|
||||
|
||||
elseif not (json.url == nil) then
|
||||
-- normal video
|
||||
|
Loading…
Reference in New Issue
Block a user