0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

ytdl_hook: fix URL extraction for manifests

This commit is contained in:
sfan5 2020-02-23 12:02:01 +01:00
parent ee6ad403a7
commit 57ecfb4da2

View File

@ -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