From 35e31af37fa6a78265494c832393ac01ba0df81f Mon Sep 17 00:00:00 2001 From: arkiver Date: Wed, 5 Oct 2022 16:19:53 +0200 Subject: [PATCH] Queue redditstatic.com URLs as outlinks. --- reddit.lua | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/reddit.lua b/reddit.lua index bf20d92..13f4dd0 100644 --- a/reddit.lua +++ b/reddit.lua @@ -162,19 +162,18 @@ allowed = function(url, parenturl) string.match(url, "^https?://[^/]*redd%.it/") or string.match(url, "^https?://[^/]*reddit%.com/") or string.match(url, "^https?://[^/]*redditmedia%.com/") + or string.match(url, "^https?://[^/]*redditstatic%.com/") ) then - if not string.match(url, "^https?://[^/]*redditstatic%.com/") then - local temp = "" - for c in string.gmatch(url, "(.)") do - local b = string.byte(c) - if b < 32 or b > 126 then - c = string.format("%%%02X", b) - end - temp = temp .. c + local temp = "" + for c in string.gmatch(url, "(.)") do + local b = string.byte(c) + if b < 32 or b > 126 then + c = string.format("%%%02X", b) end - url = temp - outlinks[url] = true + temp = temp .. c end + url = temp + outlinks[url] = true return false end