mirror of
https://github.com/wukko/cobalt.git
synced 2025-03-31 23:01:42 +02:00
api/instagram: fall back to photo in extractOldPost if video has no url
This commit is contained in:
parent
14556b3190
commit
4dc7d28696
1 changed files with 3 additions and 3 deletions
|
@ -305,12 +305,12 @@ export default function instagram(obj) {
|
||||||
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, i) => {
|
.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;
|
let url;
|
||||||
if (type === 'video') {
|
if (type === "video") {
|
||||||
url = e.node?.video_url;
|
url = e.node?.video_url;
|
||||||
} else if (type === 'photo') {
|
} else if (type === "photo") {
|
||||||
url = e.node?.display_url;
|
url = e.node?.display_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue