mirror of https://github.com/mpv-player/mpv
ytdl_hook: fix URL extraction for manifests
This commit is contained in:
parent
ee6ad403a7
commit
57ecfb4da2
|
@ -489,8 +489,8 @@ local function add_single_video(json)
|
|||
-- prefer manifest_url if present
|
||||
format_info = "manifest"
|
||||
|
||||
local mpd_url = reqfmts and reqfmts[1]["manifest_url"] or
|
||||
json["manifest_url"]
|
||||
local mpd_url = requested_formats and
|
||||
requested_formats[1]["manifest_url"] or json["manifest_url"]
|
||||
if not mpd_url then
|
||||
msg.error("No manifest URL found in JSON data.")
|
||||
return
|
||||
|
@ -500,8 +500,8 @@ local function add_single_video(json)
|
|||
|
||||
streamurl = mpd_url
|
||||
|
||||
if reqfmts then
|
||||
for _, track in pairs(reqfmts) do
|
||||
if requested_formats then
|
||||
for _, track in pairs(requested_formats) do
|
||||
max_bitrate = track.tbr > max_bitrate and
|
||||
track.tbr or max_bitrate
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue