通过Instagram API返回null.jpg以进行轮播帖子 [英] null.jpg being returned for carousel posts via Instagram API

查看:82
本文介绍了通过Instagram API返回null.jpg以进行轮播帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎Instagram API不支持新的Instagram轮播功能.图片结果仅包含 https://instagramstatic-a.akamaihd.net/null.jpg而不是封面图片.

有什么想法如何通过API检索这些信息?

解决方案

更新: 从上周一(4月24日)开始,我们将收到类型为轮播"的帖子,其中包含属性"carousel_media"以及所有轮播图片.

响应示例: https://jsonformatter.org/89e2fd

我们昨天有同样的问题.

我们在代码中添加了一种变通方法,以避免出现问题,我们将舍弃此帖子,直到Instagram修复问题为止.如果属性'type'的值为'video',我们将检查PHP中的属性'videos'是否存在:

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

我认为现在获取正确内容(直到问题解决)的唯一方法是抓取页面(例如使用curl)并从html获取图像.

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?

解决方案

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.

这篇关于通过Instagram API返回null.jpg以进行轮播帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆