api/instagram: fall back to photo in extractOldPost if video has no url

This commit is contained in:
wukko 2025-02-11 15:42:16 +06:00
parent 14556b3190
commit 4dc7d28696
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -305,12 +305,12 @@ export default function instagram(obj) {
if (sidecar) {
const picker = sidecar.edges.filter(e => e.node?.display_url)
.map((e, i) => {
const type = e.node?.is_video ? "video" : "photo";
const type = e.node?.is_video && e.node?.video_url ? "video" : "photo";
let url;
if (type === 'video') {
if (type === "video") {
url = e.node?.video_url;
} else if (type === 'photo') {
} else if (type === "photo") {
url = e.node?.display_url;
}