mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-23 11:16:20 +01:00
api/twitter: add proper file name for proxied thumb
This commit is contained in:
parent
facf7741ce
commit
76fa1b2b87
1 changed files with 4 additions and 4 deletions
|
@ -180,12 +180,12 @@ export default async function({ id, index, toGif, dispatcher }) {
|
||||||
isGif: media[0].type === "animated_gif"
|
isGif: media[0].type === "animated_gif"
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
const proxyThumb = (url) =>
|
const proxyThumb = (url, i) =>
|
||||||
createStream({
|
createStream({
|
||||||
service: "twitter",
|
service: "twitter",
|
||||||
type: "proxy",
|
type: "proxy",
|
||||||
u: url,
|
u: url,
|
||||||
filename: `image.${new URL(url).pathname.split(".", 2)[1]}`
|
filename: `twitter_${id}_${i + 1}.${new URL(url).pathname.split(".", 2)[1]}`
|
||||||
})
|
})
|
||||||
|
|
||||||
const picker = media.map((content, i) => {
|
const picker = media.map((content, i) => {
|
||||||
|
@ -194,7 +194,7 @@ export default async function({ id, index, toGif, dispatcher }) {
|
||||||
return {
|
return {
|
||||||
type: "photo",
|
type: "photo",
|
||||||
url,
|
url,
|
||||||
thumb: proxyThumb(url),
|
thumb: proxyThumb(url, i),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ export default async function({ id, index, toGif, dispatcher }) {
|
||||||
return {
|
return {
|
||||||
type,
|
type,
|
||||||
url,
|
url,
|
||||||
thumb: proxyThumb(content.media_url_https),
|
thumb: proxyThumb(content.media_url_https, i),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return { picker };
|
return { picker };
|
||||||
|
|
Loading…
Reference in a new issue