Getting large thumbnails from Instagram no longer works with “swap”

For a long time I use this “replace function” to get thumbnails using the Instagram API, it worked fine, but now they have changed something, and I will no longer use large thumbnails this way.

src="<?= str_replace('s150x150/', 's320x320/', $post->images->thumbnail->url) ?>">

The default thumbnail, it works well.   https://scontent.cdninstagram.com/vp/94387bd7b8a247f3f4039f8789772142/5AEE2A9E/t51.2885-15/s150x150/e35/c0.135.1080.1080/26335890_2247807142112483_58827760_58827786

But replacing the thumbnail size with a larger one, the message msg: Invalid URL will appear.

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

Anyone can help get a larger Instagram image. They changed the API, and I'm so tired of Facebook, they made a lot of changes since synchronizing with FB, and every time like this, developers should update without instructions.

+4
source share
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 need to replace (delete) also "vp /" with url and work again. This is a really bad decision, but it is the only thing I have found.

+6
source

! , , .

, instagram ( "standard_resolution" ) "" css ...

...

0

Source: https://habr.com/ru/post/1692153/


All Articles