teddit.net to config.domain

This commit is contained in:
teddit 2020-12-10 19:21:07 +01:00
parent 5c3ff13585
commit 76546f0b6c
1 changed files with 3 additions and 3 deletions

View File

@ -39,16 +39,16 @@ module.exports = function(request, fs) {
try { try {
let u = new URL(url) let u = new URL(url)
if(u.host === 'www.reddit.com' || u.host === 'reddit.com') { if(u.host === 'www.reddit.com' || u.host === 'reddit.com') {
url = url.replace(u.host, 'teddit.net') url = url.replace(u.host, config.domain)
} }
if(u.host === 'i.redd.it' || u.host === 'v.redd.it') { if(u.host === 'i.redd.it' || u.host === 'v.redd.it') {
let image_exts = ['png', 'jpg', 'jpeg'] let image_exts = ['png', 'jpg', 'jpeg']
let video_exts = ['mp4', 'gif', 'gifv'] let video_exts = ['mp4', 'gif', 'gifv']
let file_ext = getFileExtension(url) let file_ext = getFileExtension(url)
if(image_exts.includes(file_ext)) if(image_exts.includes(file_ext))
url = url.replace(`${u.host}/`, 'teddit.net/pics/w:null_') url = url.replace(`${u.host}/`, `${config.domain}/pics/w:null_`)
if(video_exts.includes(file_ext) || !image_exts.includes(file_ext)) if(video_exts.includes(file_ext) || !image_exts.includes(file_ext))
url = url.replace(u.host, 'teddit.net/vids') + '.mp4' url = url.replace(u.host, `${config.domain}/vids`) + '.mp4'
} }
} catch(e) { } } catch(e) { }