ytdl: don't print failure warning when youtube-dl was killed by us

This commit is contained in:
wm4 2015-06-27 21:09:12 +02:00
parent 03c70a8d81
commit 1921f40db5
1 changed files with 5 additions and 3 deletions

View File

@ -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