Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Instagram profile_picture secure url

Tags:

instagram

I'm building up a mash up retrieving by api

calls the feed from instagram/twitter/facebook

api by hashtag.

I don't have any problems to get a secure url

for the profile picture for twitter and

facebook but for instagram I do.

I tried with:

http://images.ak.instagram.com/profiles/profile_251686283_75sq_1352714126.jpg https://images.ak.instagram.com/profiles/profile_251686283_75sq_1352714126.jpg

but it doesn't work :(

UPDATE I do an api call with

https://api.instagram.com/v1/tags/mycoolhashtag/media/recent?count=100&access_token=my_access_token

I get

http://images.ak.instagram.com/profiles/profile_251686283_75sq_1352714126.jpg

but I need a secure url and this

https://images.ak.instagram.com/profiles/profile_251686283_75sq_1352714126.jpg

doesn't work

I need a secure url because all the stuff runs in a facebook app therefore with a https protocol and I don't find the way to get it !

like image 995
Whisher Avatar asked Feb 25 '14 15:02

Whisher


People also ask

Why I can't change my profile picture on Instagram?

To fix “Sorry we couldn't update your profile picture” on Instagram, log in to Instagram from a mobile browser (e.g. Safari/Chrome), and change your profile picture there. Once you've changed your profile picture from the web version of Instagram, go back to the Instagram app, and refresh your profile.


2 Answers

You can use their S3 bucket - distillery. It's not part of CDN but it will give a valid SSL functions

https://distillery.s3.amazonaws.com/profiles/profile_183641024_75sq_1372016363.jpg

like image 119
jwieland Avatar answered Sep 28 '22 16:09

jwieland


You can obtain the https url of a profile picture, given the http one the API gave you, as follows:

profile_picture.sub(%r{http://photos-([a-z]).ak.instagram.com}, 'https://igcdn-photos-\1-a.akamaihd.net')

For example: http://photos-h.ak.instagram.com/hphotos-ak-xaf1/t51.2885-19/11325003_523023611188279_332538806_a.jpg

gets mapped to: https://igcdn-photos-h-a.akamaihd.net/hphotos-ak-xaf1/t51.2885-19/11325003_523023611188279_332538806_a.jpg

like image 32
didest Avatar answered Sep 28 '22 14:09

didest