From c647516278f5624174b3152b77e2565e502bbb73 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 15 Apr 2018 09:00:18 +0200 Subject: ytdl_hook: don't log error when loading is aborted --- player/lua/ytdl_hook.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index 8bf088fe5f..91e1a732bd 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -31,7 +31,7 @@ local safe_protos = Set { local function exec(args) local ret = utils.subprocess({args = args}) - return ret.status, ret.stdout, ret + return ret.status, ret.stdout, ret, ret.killed_by_us end -- return true if it was explicitly set on the command line @@ -502,7 +502,11 @@ mp.add_hook(o.try_ytdl_first and "on_load" or "on_load_fail", 10, function () table.insert(command, "--") table.insert(command, url) msg.debug("Running: " .. table.concat(command,' ')) - local es, json, result = exec(command) + local es, json, result, aborted = exec(command) + + if aborted then + return + end if (es < 0) or (json == nil) or (json == "") then local err = "youtube-dl failed: " -- cgit v1.2.3