From d3444d1f4a47492b3b40025a460344f73d690a77 Mon Sep 17 00:00:00 2001 From: teddit Date: Mon, 4 Jan 2021 17:42:22 +0100 Subject: [PATCH] fix gallery urls #95 --- inc/commons.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inc/commons.js b/inc/commons.js index 2cea66e..c532d2f 100644 --- a/inc/commons.js +++ b/inc/commons.js @@ -41,6 +41,8 @@ module.exports = function(request, fs) { let u = new URL(url) if(u.host === 'www.reddit.com' || u.host === 'reddit.com') { url = url.replace(u.host, config.domain) + if(u.pathname.startsWith('/gallery/')) + url = url.replace('/gallery/', '/comments/') } if(u.host === 'i.redd.it' || u.host === 'v.redd.it') { let image_exts = ['png', 'jpg', 'jpeg']