From 07c0d4124dafd6315f9f2f2b374e8cdee57c58e9 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Sat, 24 Aug 2013 05:45:57 +0200 Subject: [PATCH] media/guardian.lua: Also support "old" domain name The old "guardian.co.uk" domain name still works, so detect older URLs as working too, without the need to access the network, or check for redirects. Signed-off-by: Bastien Nocera --- share/media/guardian.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/media/guardian.lua b/share/media/guardian.lua index 52405ca..c42f72c 100644 --- a/share/media/guardian.lua +++ b/share/media/guardian.lua @@ -24,7 +24,7 @@ local Guardian = {} -- Utility functions unique to this script function ident(qargs) return { can_parse_url = Guardian.can_parse_url(qargs), - domains = table.concat({'theguardian.com'}, ',') + domains = table.concat({'theguardian.com', 'guardian.co.uk'}, ',') } end @@ -56,7 +56,8 @@ function Guardian.can_parse_url(qargs) local U = require 'socket.url' 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('theguardian%.com$') + and t.host and (t.host:lower():match('theguardian%.com$') + or t.host:lower():match('guardian%.co%.uk$')) and t.path and (t.path:lower():match('/video/') or t.path:lower():match('/audio/')) then -- 2.11.4.GIT