97
97
elseif not (json["_type"] == nil) and (json["_type"] == "playlist") then
100
local playlist = "#EXTM3U\n"
101
for i, entry in pairs(json.entries) do
102
local site = entry.url
104
-- some extractors will still return the full info for
105
-- all clips in the playlist and the URL will point
106
-- directly to the file in that case, which we don't
107
-- want so get the webpage URL instead, which is what
109
if not (entry["webpage_url"] == nil) then
110
site = entry["webpage_url"]
113
playlist = playlist .. "ytdl://" .. site .. "\n"
100
-- some funky guessing to detect multi-arc videos
101
if not (json.entries[1]["webpage_url"] == nil)
102
and (json.entries[1]["webpage_url"] == json["webpage_url"]) then
103
msg.verbose("multi-arc video detected, building EDL")
106
local playlist = "edl://"
107
for i, entry in pairs(json.entries) do
109
playlist = playlist .. entry.url .. ";"
112
msg.debug("EDL: " .. playlist)
115
mp.set_property("stream-open-filename", playlist)
116
if not (json.title == nil) then
117
mp.set_property("file-local-options/media-title", json.title)
122
local playlist = "#EXTM3U\n"
123
for i, entry in pairs(json.entries) do
124
local site = entry.url
126
-- some extractors will still return the full info for
127
-- all clips in the playlist and the URL will point
128
-- directly to the file in that case, which we don't
129
-- want so get the webpage URL instead, which is what
131
if not (entry["webpage_url"] == nil) then
132
site = entry["webpage_url"]
135
playlist = playlist .. "ytdl://" .. site .. "\n"
138
mp.set_property("stream-open-filename", "memory://" .. playlist)
116
mp.set_property("stream-open-filename", "memory://" .. playlist)
118
141
else -- probably a video
119
142
local streamurl = ""
122
145
if not (json["requested_formats"] == nil) then
123
msg.info("NOTE: Using DASH, expect inaccurate duration.")
146
msg.info("Using DASH, expect inaccurate duration.")
147
if not (json.duration == nil) then
148
msg.info("actual duration: " .. mp.format_time(json.duration))
125
152
streamurl = json["requested_formats"][1].url