mirror of https://github.com/mpv-player/mpv
ytdl_hook: check for possible infinite loop in playlist generation
This commit is contained in:
parent
442ff93626
commit
cf8855cd2e
|
@ -464,13 +464,14 @@ mp.add_hook("on_load_fail", 10, function ()
|
||||||
table.insert(playlist, "#EXTINF:0," .. title)
|
table.insert(playlist, "#EXTINF:0," .. title)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- some extractors will still return the full info for
|
--[[ some extractors will still return the full info for
|
||||||
-- all clips in the playlist and the URL will point
|
all clips in the playlist and the URL will point
|
||||||
-- directly to the file in that case, which we don't
|
directly to the file in that case, which we don't
|
||||||
-- want so get the webpage URL instead, which is what
|
want so get the webpage URL instead, which is what
|
||||||
-- we want
|
we want, but only if we aren't going to trigger an
|
||||||
if not (json.entries[1]["_type"] == "url_transparent")
|
infinite loop
|
||||||
and not (entry["webpage_url"] == nil) then
|
--]]
|
||||||
|
if not self_redirecting_url then
|
||||||
site = entry["webpage_url"]
|
site = entry["webpage_url"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue