php 从 Instagram 获取大缩略图照片不再使用“替换”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48246348/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Getting large thumbnail photos from Instagram is no longer working with "replace"
提问by Hai Tien
For long time I use this "replace function" to get the thumbnails by Instagram API, it worked well but now they changed somethings and I no longer to use bigger thumbnails by this way.
很长一段时间,我使用这个“替换功能”来通过 Instagram API 获取缩略图,它运行良好,但现在他们改变了一些东西,我不再通过这种方式使用更大的缩略图。
src="<?= str_replace('s150x150/', 's320x320/', $post->images->thumbnail->url) ?>">
By default thumbnail, it works well. https://scontent.cdninstagram.com/vp/94387bd7b8a247f3f4039f8789772142/5AEE2A9E/t51.2885-15/s150x150/e35/c0.135.1080.1080/26335890_2247807142112483_5882778660510892032_n.jpg
But replaced thumbnail size to bigger, it appears a msg: Invalid URL signature.
但是将缩略图大小替换为更大,它会出现一条 msg: Invalid URL signature。
Anyone can help to get bigger thumbnail of Instagram. They changed API and I feel so tired with Facebook, they have made many changes since sync with FB and everytime like this, the developers have to update with no instructions.
任何人都可以帮助获得更大的 Instagram 缩略图。他们改变了 API,我对 Facebook 感到很累,自从与 FB 同步以来,他们做了很多改变,每次这样,开发人员都必须在没有说明的情况下进行更新。
回答by gorkill
You can try with this trick
你可以试试这个技巧
src="<?= str_replace('s150x150/', 's320x320/', str_replace('vp/', '', $post->images->thumbnail->url)) ?>">
or
或者
src="<?= str_replace('s150x150/', 's640x640/', str_replace('vp/', '', $post->images->thumbnail->url)) ?>">
You have to replace (delete) also "vp/" on url, and works again. It's a really bad solution, but it's the only that i've found.
您还必须替换(删除)url 上的“vp/”,然后再次运行。这是一个非常糟糕的解决方案,但这是我找到的唯一解决方案。
回答by mr.vain
Copy the linkof the profile pic after the "/s150x150/xxxxxxxx......jpg" to the end of this:
复制“/s150x150/ xxxxxxxx......jpg”后的个人资料图片链接到此结尾:
"https://instagram.flju2-1.fna.fbcdn.net/vp/e890a9f0b7b40abe5667b06d0fa750e5/"
" https://instagram.flju2-1.fna.fbcdn.net/vp/e890a9f0b7b40abe5667b06d0fa750e5/"
like: https://instagram.flju2-1.fna.fbcdn.net/vp/e890a9f0b7b40abe5667b06d0fa750e5/xxxxxxxx......jpg
喜欢:https: //instagram.flju2-1.fna.fbcdn.net/vp/e890a9f0b7b40abe5667b06d0fa750e5/xxxxxxxx......jpg
Works right now.
现在工作。
回答by iMax
A solution would be very nice! I have also done it like you the last few month.
一个解决方案会非常好!我最近几个月也像你一样这样做了。
I think one of the solutions is to use non-squared fotos from instagram (you get with "standard_resolution") and set it as a background-image and do the "square" via css and display cover…?
我认为其中一种解决方案是使用 instagram 中的非方形照片(您使用“standard_resolution”获得)并将其设置为背景图像,然后通过 css 和显示封面来制作“方形”......?
This is my personal solution at the moment…?
这是我目前的个人解决方案......?
回答by Axe Mongolian
i opened instagram on google chrome selected the desired post, right-clicked to "save as". after opening the saved html doc. in chrome i right-clicked again to veiw page source. i scrolled down to line 217 of the page source and one of the links there gave me the picture i wanted. not sure that it is the same thing as before but it let me download the picture of the post in a .jpg format. hope this helps
我在谷歌浏览器上打开 Instagram 选择了所需的帖子,右键单击“另存为”。打开保存的 html 文档后。在 chrome 中,我再次右键单击以查看页面源。我向下滚动到页面源代码的第 217 行,那里的链接之一给了我想要的图片。不确定它是否和以前一样,但它让我以 .jpg 格式下载帖子的图片。希望这可以帮助