mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +00:00
api/reddit: add a filename to returned gifs
This commit is contained in:
parent
10717c69f6
commit
892b875e3f
|
@ -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