From 3e71eb8676de53a05f51b987d294e7d2fa0a5bc1 Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Sun, 11 Feb 2018 13:18:10 +0000 Subject: ytdl_hook: whitelist subtitle URLs as well This was overlooked when doing the whitelisting for video and audio to fix #5456. --- player/lua/ytdl_hook.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'player/lua') diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua index 7c1867deb8..6399f14ed3 100644 --- a/player/lua/ytdl_hook.lua +++ b/player/lua/ytdl_hook.lua @@ -320,7 +320,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 @@ -543,7 +544,8 @@ mp.add_hook(o.try_ytdl_first and "on_load" or "on_load_fail", 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") -- cgit v1.2.3