summaryrefslogtreecommitdiffstats
path: root/player/lua
diff options
context:
space:
mode:
authorRicardo Constantino <wiiaboo@gmail.com>2018-01-12 01:38:30 +0000
committerRicardo Constantino <wiiaboo@gmail.com>2018-01-12 01:52:37 +0000
commit2d6fdccb9230f3486573bb6cec85e1fbfb000ca1 (patch)
treefb4a089c4fc1a8410e212f852a8f4a357a51335e /player/lua
parent48143b0cf52de37f93ae53a95261988d9b5ebff2 (diff)
downloadmpv-2d6fdccb9230f3486573bb6cec85e1fbfb000ca1.tar.bz2
mpv-2d6fdccb9230f3486573bb6cec85e1fbfb000ca1.tar.xz
ytdl_hook: be more informative when youtube-dl fails
Diffstat (limited to 'player/lua')
-rw-r--r--player/lua/ytdl_hook.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
index cc060cdcb8..5416a7ff07 100644
--- a/player/lua/ytdl_hook.lua
+++ b/player/lua/ytdl_hook.lua
@@ -366,9 +366,15 @@ mp.add_hook(o.try_ytdl_first and "on_load" or "on_load_fail", 10, function ()
local es, json, result = exec(command)
if (es < 0) or (json == nil) or (json == "") then
- if not result.killed_by_us then
- msg.error("youtube-dl failed")
+ local err = "youtube-dl failed: "
+ if result.error and result.error == "init" then
+ err = err .. "not found or not enough permissions"
+ elseif not result.killed_by_us then
+ err = err .. "unexpected error ocurred"
+ else
+ err = string.format("%s returned '%d'", err, es)
end
+ msg.error(err)
return
end