teddit.net to config.domain
This commit is contained in:
parent
5c3ff13585
commit
76546f0b6c
|
@ -39,16 +39,16 @@ module.exports = function(request, fs) {
|
|||
try {
|
||||
let u = new URL(url)
|
||||
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') {
|
||||
let image_exts = ['png', 'jpg', 'jpeg']
|
||||
let video_exts = ['mp4', 'gif', 'gifv']
|
||||
let file_ext = getFileExtension(url)
|
||||
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))
|
||||
url = url.replace(u.host, 'teddit.net/vids') + '.mp4'
|
||||
url = url.replace(u.host, `${config.domain}/vids`) + '.mp4'
|
||||
}
|
||||
|
||||
} catch(e) { }
|
||||
|
|
Loading…
Reference in New Issue