mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-04 06:06:07 +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;
|
data = data[0]?.data?.children[0]?.data;
|
||||||
|
|
||||||
|
const id = `${String(obj.sub).toLowerCase()}_${obj.id}`;
|
||||||
|
|
||||||
if (data?.url?.endsWith('.gif')) return {
|
if (data?.url?.endsWith('.gif')) return {
|
||||||
typeId: "redirect",
|
typeId: "redirect",
|
||||||
urls: data.url
|
urls: data.url,
|
||||||
|
filename: `reddit_${id}.gif`,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.secure_media?.reddit_video)
|
if (!data.secure_media?.reddit_video)
|
||||||
|
@ -109,8 +112,6 @@ export default async function(obj) {
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
let id = `${String(obj.sub).toLowerCase()}_${obj.id}`;
|
|
||||||
|
|
||||||
if (!audio) return {
|
if (!audio) return {
|
||||||
typeId: "redirect",
|
typeId: "redirect",
|
||||||
urls: video
|
urls: video
|
||||||
|
|
Loading…
Reference in a new issue