如何从Instagram API获取全分辨率图像
当我呼叫端点时如何从Instagram API获取全分辨率图像,instagram,instagram-api,Instagram,Instagram Api,当我呼叫端点时 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: {
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文档,我看不到任何获得原始图像路径的方法。有人知道怎么做吗?看起来和这里讨论的问题一样: 那么,您如何获得上传照片的原始图像 风景画还是肖像画? 因为API只返回1组图像作为 现在,但该网站能够显示原始的纵横比图像, 我四处挖掘了一下,发现如果你把最后一个 但是方形图像url的url的1部分(在本例中, 移除/c0.135.1080.1080)您将获得原始纵横比大小 (和未裁剪的)风景画、肖像画 例如:
"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
}
看看这里:谢谢@PedroCasado,这正是我所需要的。看起来Instagram已经掌握了窍门并关闭了它(从2018年1月开始)。编辑URL以获得更大分辨率的图像失败,出现“无效URL签名”