Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 views
in Technique[技术] by (71.8m points)

null.jpg being returned for carousel posts via Instagram API

It looks like the Instagram API does not support the new Instagram carousel feature. The images results only contain https://instagramstatic-a.akamaihd.net/null.jpg and not the cover image.

Any ideas how to retrieve these via the API?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

UPDATE: Since last Monday (April 24) we are receiving posts of type "carousel" containing the property "carousel_media" with all the carousel images.

Response example: https://jsonformatter.org/89e2fd

We have the same problem from yesterday.

We have added a workaround to the code to avoid problems, we will discard this posts until Instagram fixes the problem. If the value of the property 'type' is 'video' we check that the property 'videos' exists, in PHP:

if ($item->type === 'video' && !isset($item->videos)) { your code }

I think that the only way to get the right content now (until the problem is solved) is to scrap the page (with curl, for example) and get the image from the html.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...