From f670c64e59119fc91675d8eccf1e350365ee2f55 Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Sat, 10 Feb 2018 13:12:47 +0000 Subject: ytdl_hook: add ytdl:// prefix again for non-youtube playlists Only youtube playlists return ID-only urls. Other extractors may return ":" so those still need the ytdl:// prefix. Reproduced with http://www.cbc.ca/burdenoftruth/videos/trailers-promos/burden-of-truth-returns --- player/lua/ytdl_hook.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'player') diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index 3c5068bfd7..8bf088fe5f 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -626,9 +626,13 @@ mp.add_hook(o.try_ytdl_first and "on_load" or "on_load_fail", 10, function () site = entry["webpage_url"] end - -- links with only youtube id as returned by --flat-playlist + -- links without protocol as returned by --flat-playlist if not site:find("://") then - table.insert(playlist, "https://youtu.be/" .. site) + -- youtube extractor provides only IDs, + -- others come prefixed with the extractor name and ":" + local prefix = site:find(":") and "ytdl://" or + "https://youtu.be/" + table.insert(playlist, prefix .. site) elseif url_is_safe(site) then table.insert(playlist, site) end -- cgit v1.2.3