From 6c88176d1ea54ea2863a12d79bbc396d3460cca9 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Sun, 19 May 2013 20:13:06 +0300 Subject: [PATCH] playlist/youtube.lua: Improve patterns Use more strict pattern with URL paths. Add a pattern for URL query element. This script will no longer accept URLs that are clearly media URLs, not playlist URLs, e.g.: http://www.youtube.com/watch?v=...&list=...&index=1 Signed-off-by: Toni Gundogdu --- share/playlist/youtube.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/playlist/youtube.lua b/share/playlist/youtube.lua index adf649e..627292c 100644 --- a/share/playlist/youtube.lua +++ b/share/playlist/youtube.lua @@ -73,7 +73,8 @@ function YouTube.can_parse_url(qargs) local t = U.parse(qargs.input_url) if t and t.scheme and t.scheme:lower():match('^https?$') and t.host and t.host:lower():match('youtube%.com$') - and t.query and t.query:lower():match('list=[%w_-]+') + and t.path and t.path:lower():match('^/playlist$') + and t.query and t.query:lower():match('^list=[%w_-]+') then return true else -- 2.11.4.GIT