gpt4 book ai didi

instagram - 如何从 Instagram API 获取全分辨率图像

转载 作者:行者123 更新时间:2023-12-01 23:41:53 26 4
gpt4 key购买 nike

当我调用端点时

https://api.instagram.com/v1/users/self/media/recent/?access_token=ACCESS-TOKEN

我收到的回复包括这样的内容:

{
...
images: {
low_resolution: {
url: "http://example.com/s320x320/oijwef/filename.jpg"
},
standard_resolution: {
url: "http://example.com/s640x640/23o8dn/filename.jpg"
},
thumbnail: {
url: "http://example.com/s150x150/20398x/filename.jpg"
}
}
}

这里的问题是,即使是标准分辨率文件也不是完整的图像,如果原始文件不是正方形,则图像中会包含白条。

查看他们的 API 文档,我没有看到任何获取原始图像路径的方法。有谁知道吗?

最佳答案

看起来与此处讨论的问题相同:Instagram Square photos API

So How do you get the original image for a photo uploaded as a landscape or portrait?

Since the API returns only 1 set of images as of now, but the site is able to show the original aspect ratio images, I did some digging around, and realized that if you remove the last but 1 section of the url from the square image urls (in this example, remove /c0.135.1080.1080 ) you get to the original aspect ratio sized (and uncropped) landscape, portrait images.

例子:

"images": {
"low_resolution": {
"url": "https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/s320x320/e35/c0.135.1080.1080/11909195_1715998838621946_791786043_n.jpg",
"width": 320,
"height": 320
},
"thumbnail": {
"url": "https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/s150x150/e35/c0.135.1080.1080/11909195_1715998838621946_791786043_n.jpg",
"width": 150,
"height": 150
},
"standard_resolution": {
"url": "https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/s640x640/sh0.08/e35/c0.135.1080.1080/11909195_1715998838621946_791786043_n.jpg",
"width": 640,
"height": 640
}

关于instagram - 如何从 Instagram API 获取全分辨率图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36603503/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com