From f7244ebe9b08160934feeb41a3e74efc0936ef4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=96=9F=20=E2=96=96=E2=96=9F=20=E2=96=96?= Date: Thu, 10 Mar 2016 16:21:28 +0100 Subject: [PATCH] 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). --- player/lua/ytdl_hook.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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