mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 12:50:01 +00:00
api/instagram: add file name for proxied image thumbs
This commit is contained in:
parent
76fa1b2b87
commit
fb5d68a830
1 changed files with 4 additions and 4 deletions
|
@ -167,7 +167,7 @@ export default function(obj) {
|
||||||
const sidecar = data?.gql_data?.shortcode_media?.edge_sidecar_to_children;
|
const sidecar = data?.gql_data?.shortcode_media?.edge_sidecar_to_children;
|
||||||
if (sidecar) {
|
if (sidecar) {
|
||||||
const picker = sidecar.edges.filter(e => e.node?.display_url)
|
const picker = sidecar.edges.filter(e => e.node?.display_url)
|
||||||
.map(e => {
|
.map((e, i) => {
|
||||||
const type = e.node?.is_video ? "video" : "photo";
|
const type = e.node?.is_video ? "video" : "photo";
|
||||||
const url = type === "video" ? e.node?.video_url : e.node?.display_url;
|
const url = type === "video" ? e.node?.video_url : e.node?.display_url;
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ export default function(obj) {
|
||||||
service: "instagram",
|
service: "instagram",
|
||||||
type: "proxy",
|
type: "proxy",
|
||||||
u: e.node?.display_url,
|
u: e.node?.display_url,
|
||||||
filename: "image.jpg"
|
filename: `instagram_${id}_${i + 1}.jpg`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -203,7 +203,7 @@ export default function(obj) {
|
||||||
const carousel = data.carousel_media;
|
const carousel = data.carousel_media;
|
||||||
if (carousel) {
|
if (carousel) {
|
||||||
const picker = carousel.filter(e => e?.image_versions2)
|
const picker = carousel.filter(e => e?.image_versions2)
|
||||||
.map(e => {
|
.map((e, i) => {
|
||||||
const type = e.video_versions ? "video" : "photo";
|
const type = e.video_versions ? "video" : "photo";
|
||||||
const imageUrl = e.image_versions2.candidates[0].url;
|
const imageUrl = e.image_versions2.candidates[0].url;
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ export default function(obj) {
|
||||||
service: "instagram",
|
service: "instagram",
|
||||||
type: "proxy",
|
type: "proxy",
|
||||||
u: imageUrl,
|
u: imageUrl,
|
||||||
filename: "image.jpg"
|
filename: `instagram_${id}_${i + 1}.jpg`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue