Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting large thumbnail photos from Instagram is no longer working with "replace"

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.

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.

https://scontent.cdninstagram.com/vp/94387bd7b8a247f3f4039f8789772142/5AEE2A9E/t51.2885-15/s320x320/e35/c0.135.1080.1080/26335890_2247807142112483_5882778660510892032_n.jpg

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.

like image 694
Hai Tien Avatar asked Jan 14 '18 03:01

Hai Tien


3 Answers

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.

like image 124
gorkill Avatar answered Oct 18 '22 10:10

gorkill


Copy the link of the profile pic after the "/s150x150/xxxxxxxx......jpg" to the end of this:

"https://instagram.flju2-1.fna.fbcdn.net/vp/e890a9f0b7b40abe5667b06d0fa750e5/"

like: https://instagram.flju2-1.fna.fbcdn.net/vp/e890a9f0b7b40abe5667b06d0fa750e5/xxxxxxxx......jpg

Works right now.

like image 33
mr.vain Avatar answered Oct 18 '22 09:10

mr.vain


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… 

This is my personal solution at the moment… 

like image 22
iMax Avatar answered Oct 18 '22 10:10

iMax