summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Constantino <wiiaboo@gmail.com>2018-02-11 13:18:10 +0000
committerKevin Mitchell <kevmitch@gmail.com>2018-02-11 23:25:56 -0800
commit3e71eb8676de53a05f51b987d294e7d2fa0a5bc1 (patch)
treeb1f5feb76385bf627266e71d21d2820fed58b5b9
parent268431c8580ef7d6f28690b1c4019be5d25142ed (diff)
downloadmpv-3e71eb8676de53a05f51b987d294e7d2fa0a5bc1.tar.bz2
mpv-3e71eb8676de53a05f51b987d294e7d2fa0a5bc1.tar.xz
ytdl_hook: whitelist subtitle URLs as well
This was overlooked when doing the whitelisting for video and audio to fix #5456.
-rw-r--r--player/lua/ytdl_hook.lua6
1 files changed, 4 insertions, 2 deletions
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")