summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author▟ ▖▟ ▖ <dodo.the.last@gmail.com>2016-03-10 16:21:28 +0100
committerwm4 <wm4@nowhere>2016-03-10 22:46:03 +0100
commitf7244ebe9b08160934feeb41a3e74efc0936ef4f (patch)
treeaedb1de9114d0d1e53f877e787635695248384a6
parent0e1e4005fb231dee4a86322d308870cfd765b751 (diff)
downloadmpv-f7244ebe9b08160934feeb41a3e74efc0936ef4f.tar.bz2
mpv-f7244ebe9b08160934feeb41a3e74efc0936ef4f.tar.xz
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).
-rw-r--r--player/lua/ytdl_hook.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
index 5b90b95cdd..c0ce8b97c4 100644
--- a/player/lua/ytdl_hook.lua
+++ b/player/lua/ytdl_hook.lua
@@ -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