1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-19 14:26:57 +00:00

ytdl_hook: whitelist subtitle URLs as well

This was overlooked when doing the whitelisting for video and audio to
fix #5456.
This commit is contained in:
Ricardo Constantino 2018-02-11 13:18:10 +00:00 committed by Kevin Mitchell
parent 2ae812ec6d
commit 789e04e9a0
No known key found for this signature in database
GPG Key ID: 559A34B46A917232

View File

@ -270,7 +270,8 @@ local function add_single_video(json)
if not (sub_info.data == nil) then
sub = "memory://"..sub_info.data
elseif not (sub_info.url == nil) then
elseif not (sub_info.url == nil) and
url_is_safe(sub_info.url) then
sub = sub_info.url
end
@ -468,7 +469,8 @@ mp.add_hook("on_load", 10, function ()
local subfile = "edl://"
for i, entry in pairs(json.entries) do
if not (entry.requested_subtitles == nil) and
not (entry.requested_subtitles[j] == nil) then
not (entry.requested_subtitles[j] == nil) and
url_is_safe(entry.requested_subtitles[j].url) then
subfile = subfile..edl_escape(entry.requested_subtitles[j].url)
else
subfile = subfile..edl_escape("memory://WEBVTT")