From 1921f40db58dfbbd55170d9bfde6e14559d74a7d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 27 Jun 2015 21:09:12 +0200 Subject: ytdl: don't print failure warning when youtube-dl was killed by us --- player/lua/ytdl_hook.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index 967a20a226..9cf76b3ea1 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -9,7 +9,7 @@ local ytdl = { local function exec(args) local ret = utils.subprocess({args = args}) - return ret.status, ret.stdout + return ret.status, ret.stdout, ret end -- return if it was explicitly set on the command line @@ -123,10 +123,12 @@ mp.add_hook("on_load", 10, function () end table.insert(command, "--") table.insert(command, url) - local es, json = exec(command) + local es, json, result = exec(command) if (es < 0) or (json == nil) or (json == "") then - msg.warn("youtube-dl failed, trying to play URL directly ...") + if not result.killed_by_us then + msg.warn("youtube-dl failed, trying to play URL directly ...") + end return end -- cgit v1.2.3