diff options
author | Ricardo Constantino <wiiaboo@gmail.com> | 2017-04-22 21:53:48 +0100 |
---|---|---|
committer | Ricardo Constantino <wiiaboo@gmail.com> | 2017-04-23 01:53:59 +0100 |
commit | 3526b95aafe11bb829c924a1f69877ec72406068 (patch) | |
tree | df119e24f24de4cfcbd577a30c61c213978554d8 /player/lua/ytdl_hook.lua | |
parent | d5517f0d9fb124d30e28724f948fcecb729808e4 (diff) | |
download | mpv-3526b95aafe11bb829c924a1f69877ec72406068.tar.bz2 mpv-3526b95aafe11bb829c924a1f69877ec72406068.tar.xz |
ytdl_hook: treat single-entry playlists as a single video
Diffstat (limited to 'player/lua/ytdl_hook.lua')
-rw-r--r-- | player/lua/ytdl_hook.lua | 10 |
1 files changed, 9 insertions, 1 deletions
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" |