fix media proxying (clicking preview.redd.it image links was broken after 3612345fab
This commit is contained in:
parent
e640e794db
commit
8ccc694d2f
|
@ -38,6 +38,10 @@ homeRoute.get('/:sort?', async (req, res, next) => {
|
||||||
} else {
|
} else {
|
||||||
let params = new URLSearchParams(req.query).toString();
|
let params = new URLSearchParams(req.query).toString();
|
||||||
media_url = `https://preview.redd.it/${sortby}?${params}`;
|
media_url = `https://preview.redd.it/${sortby}?${params}`;
|
||||||
|
if (media_url.includes('teddit_proxy')) {
|
||||||
|
// if the URL includes teddit_proxy query param, remove everything after it
|
||||||
|
media_url = media_url.split('%3Fteddit_proxy')[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let proxied_media = await downloadAndSave(media_url);
|
let proxied_media = await downloadAndSave(media_url);
|
||||||
|
|
Loading…
Reference in New Issue