This commit is contained in:
ponei 2026-05-08 00:17:44 -03:00 committed by GitHub
commit 9d5f5277c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -305,6 +305,8 @@ export default function instagram(obj) {
if (sidecar) {
const picker = sidecar.edges.filter(e => e.node?.display_url)
.map((e, i) => {
// if extracted from HTML embed, the first GraphVideo node from a "multipost" post sometimes
// reports `is_video` without a `video_url`. this also breaks the official Instagram "multipost" embed.
const type = e.node?.is_video && e.node?.video_url ? "video" : "photo";
let url;
@ -436,13 +438,13 @@ export default function instagram(obj) {
if (media_id && !hasData(data)) data = await requestMobileApi(media_id);
if (media_id && cookie && !hasData(data)) data = await requestMobileApi(media_id, { cookie });
// html embed (no cookie, cookie)
if (!hasData(data)) data = await requestHTML(id);
if (!hasData(data) && cookie) data = await requestHTML(id, cookie);
// web app graphql api (no cookie, cookie)
if (!hasData(data)) data = await requestGQL(id);
if (!hasData(data) && cookie) data = await requestGQL(id, cookie);
// html embed (no cookie, cookie)
if (!hasData(data)) data = await requestHTML(id);
if (!hasData(data) && cookie) data = await requestHTML(id, cookie);
} catch {}
if (!hasData(data)) {