Skip to content

Commit

Permalink
ytdl_hook: whitelist subtitle URLs as well
Browse files Browse the repository at this point in the history
This was overlooked when doing the whitelisting for video and audio to
fix mpv-player#5456.
  • Loading branch information
wiiaboo authored and kevmitch committed Feb 13, 2018
1 parent 0d893be commit 408a65c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions player/lua/ytdl_hook.lua
Expand Up @@ -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

Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 408a65c

Please sign in to comment.