1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 17:12:36 +00:00

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

View File

@ -9,7 +9,7 @@ local ytdl = {
local function exec(args) local function exec(args)
local ret = utils.subprocess({args = args}) local ret = utils.subprocess({args = args})
return ret.status, ret.stdout return ret.status, ret.stdout, ret
end end
-- return if it was explicitly set on the command line -- return if it was explicitly set on the command line
@ -123,10 +123,12 @@ mp.add_hook("on_load", 10, function ()
end end
table.insert(command, "--") table.insert(command, "--")
table.insert(command, url) table.insert(command, url)
local es, json = exec(command) local es, json, result = exec(command)
if (es < 0) or (json == nil) or (json == "") then 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 return
end end