From b33a7b88fe9b79f97b19a652781438d90ab1e5f6 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Thu, 4 Jan 2018 13:41:46 +0200 Subject: [PATCH] [Feature] Multimap: template URL filter --- src/plugins/lua/multimap.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 252c592ff..60324fac1 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -210,6 +210,14 @@ local function apply_url_filter(task, filter, url, r) return nil end end + elseif string.find(filter, '^template:') then + if not r['template'] then + r['template'] = string.match(filter, '^template:(.+)') + end + + if r['template'] then + return lua_util.template(r['template'], url:to_table()) + end end return url:get_host() -- 2.39.5