mirror of
https://github.com/mpv-player/mpv
synced 2025-01-12 18:02:36 +00:00
ytdl: Try to handle multi-arc videos
this currently uses a sketchy but apparently working workaround, which will be removed once the neccessary changes in youtube-dl are implemented Fixes #1277
This commit is contained in:
parent
07ddfd4f8a
commit
13845cf6fe
@ -97,6 +97,28 @@ mp.add_hook("on_load", 10, function ()
|
||||
elseif not (json["_type"] == nil) and (json["_type"] == "playlist") then
|
||||
-- a playlist
|
||||
|
||||
-- some funky guessing to detect multi-arc videos
|
||||
if not (json.entries[1]["webpage_url"] == nil)
|
||||
and (json.entries[1]["webpage_url"] == json["webpage_url"]) then
|
||||
msg.verbose("multi-arc video detected, building EDL")
|
||||
|
||||
|
||||
local playlist = "edl://"
|
||||
for i, entry in pairs(json.entries) do
|
||||
|
||||
playlist = playlist .. entry.url .. ";"
|
||||
end
|
||||
|
||||
msg.debug("EDL: " .. playlist)
|
||||
|
||||
|
||||
mp.set_property("stream-open-filename", playlist)
|
||||
if not (json.title == nil) then
|
||||
mp.set_property("file-local-options/media-title", json.title)
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
local playlist = "#EXTM3U\n"
|
||||
for i, entry in pairs(json.entries) do
|
||||
local site = entry.url
|
||||
@ -114,6 +136,7 @@ mp.add_hook("on_load", 10, function ()
|
||||
end
|
||||
|
||||
mp.set_property("stream-open-filename", "memory://" .. playlist)
|
||||
end
|
||||
|
||||
else -- probably a video
|
||||
local streamurl = ""
|
||||
|
Loading…
Reference in New Issue
Block a user