api/reddit: add a filename to returned gifs
This commit is contained in:
parent
10717c69f6
commit
892b875e3f
1 changed files with 4 additions and 3 deletions
|
@ -73,9 +73,12 @@ export default async function(obj) {
|
|||
|
||||
data = data[0]?.data?.children[0]?.data;
|
||||
|
||||
const id = `${String(obj.sub).toLowerCase()}_${obj.id}`;
|
||||
|
||||
if (data?.url?.endsWith('.gif')) return {
|
||||
typeId: "redirect",
|
||||
urls: data.url
|
||||
urls: data.url,
|
||||
filename: `reddit_${id}.gif`,
|
||||
}
|
||||
|
||||
if (!data.secure_media?.reddit_video)
|
||||
|
@ -109,8 +112,6 @@ export default async function(obj) {
|
|||
}).catch(() => {})
|
||||
}
|
||||
|
||||
let id = `${String(obj.sub).toLowerCase()}_${obj.id}`;
|
||||
|
||||
if (!audio) return {
|
||||
typeId: "redirect",
|
||||
urls: video
|
||||
|
|
Loading…
Reference in a new issue