From 3526b95aafe11bb829c924a1f69877ec72406068 Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Sat, 22 Apr 2017 21:53:48 +0100 Subject: ytdl_hook: treat single-entry playlists as a single video --- player/lua/ytdl_hook.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'player/lua/ytdl_hook.lua') diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index f40759e0ff..9f0e4941c2 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -320,7 +320,8 @@ mp.add_hook("on_load", 10, function () -- some funky guessing to detect multi-arc videos if (not (json.entries[1]["_type"] == "url_transparent")) and (not (json.entries[1]["webpage_url"] == nil) - and (json.entries[1]["webpage_url"] == json["webpage_url"])) then + and (json.entries[1]["webpage_url"] == json["webpage_url"])) + and not (json.entries[1].url == nil) then msg.verbose("multi-arc video detected, building EDL") local playlist = edl_track_joined(json.entries) @@ -365,6 +366,13 @@ mp.add_hook("on_load", 10, function () end end + elseif (not (json.entries[1]["_type"] == "url_transparent")) and + (not (json.entries[1]["webpage_url"] == nil) + and (json.entries[1]["webpage_url"] == json["webpage_url"])) + and (#json.entries == 1) then + + msg.verbose("Playlist with single entry detected.") + add_single_video(json.entries[1]) else local playlist = "#EXTM3U\n" -- cgit v1.2.3