mirror of
https://github.com/wukko/cobalt.git
synced 2025-06-12 21:27:39 +02:00
added support for instagram images
also improved various picker
This commit is contained in:
@ -38,14 +38,12 @@ export default async function(obj) {
|
||||
data = false;
|
||||
}
|
||||
|
||||
|
||||
if (!data) return { error: 'ErrorCouldntFetch' };
|
||||
|
||||
let single, multiple = [];
|
||||
const sidecar = data?.shortcode_media?.edge_sidecar_to_children;
|
||||
if (sidecar) {
|
||||
sidecar.edges.forEach(e => {
|
||||
// todo: allow downloading images once frontend supports it
|
||||
if (e.node?.is_video) {
|
||||
multiple.push({
|
||||
type: "video",
|
||||
@ -58,6 +56,17 @@ export default async function(obj) {
|
||||
}),
|
||||
url: e.node?.video_url
|
||||
})
|
||||
} else {
|
||||
multiple.push({
|
||||
type: "photo",
|
||||
thumb: createStream({
|
||||
service: "instagram",
|
||||
type: "default",
|
||||
u: e.node?.display_url,
|
||||
filename: "image.jpg"
|
||||
}),
|
||||
url: e.node?.display_url
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (data?.shortcode_media?.video_url) {
|
||||
|
Reference in New Issue
Block a user