简体   繁体   English

从 Instagram API 查看 Instagram 图片时 URL 签名过期错误

[英]URL signature expired error when viewing Instagram images from Instagram API

I am getting the instagram images from instagram API.我正在从 Instagram API 获取 Instagram 图像。 (endpoint : https://api.instagram.com/v1/users/self/media/recent?access_token= ). (端点: https : //api.instagram.com/v1/users/self/media/recent?access_token= )。 Then I am saving the image URLs that returning from the API call in the database and use them in the front-end.然后我将从 API 调用返回的图像 URL 保存在数据库中并在前端使用它们。 Exmple image url is below.示例图片网址如下。

Example URL : https://scontent.cdninstagram.com/vp/xxx/xxx/xx/s150x150/xxx/xxxx/xxxx_n.jpg示例网址: https : //scontent.cdninstagram.com/vp/xxx/xxx/xx/s150x150/xxx/xxxx/xxxx_n.jpg

But sometimes the images doesn't show and when I go to the image particular link it shows 'URL signature expired'.但有时图像不显示,当我转到图像特定链接时,它显示“URL 签名已过期”。 What would be the reason for that?那是什么原因呢?

I have referred the question about the same in a previous post in stack overflow and it didn't help.我在堆栈溢出的前一篇文章中提到了相同的问题,但没有帮助。 It said to save the image in a separate server.它说将图像保存在单独的服务器中。 It won't work for me.它对我不起作用。

Instagram CDN URLs contain timestamp components that allow them to expire after a while. Instagram CDN URL 包含时间戳组件,允许它们在一段时间后过期。 If you need the image to persist, you'll have to save it somewhere and serve that instead.如果您需要保留图像,则必须将其保存在某处并改为提供该图像。

You can visit https://www.instagram.com/p/CQX8lKutaZU/media/?size=l您可以访问https://www.instagram.com/p/CQX8lKutaZU/media/?size=l

Use;用; "l" parameter for large, “l”参数为大,

"m" parameter for medium,介质的“m”参数,

"t" parameter for small pictures.小图片的“t”参数。

But sadly it doesn't work on videos (it just shows thumbnails)但遗憾的是它不适用于视频(它只显示缩略图)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM