modulitos
modulitos

Reputation: 15814

Is it possible to extract the Facebook Graph url from the image URL?

Basically, I am looking to do the inverse of this question: Getting the "real" Facebook profile picture URL from graph API

So, if this is my image URL:

https://scontent.xx.fbcdn.net/hprofile-xat1/v/t1.0-1/p200x200/1538635_10152313443182867_788243216_n.jpg?oh=72d672bc10ab01386ad5e490c097e059&oe=56A4392D

the design of Facebook's CDN will cause that URL to expire and 404 in the near future. So I am wondering, is it possible to get a URL that will not expire? For the above example, the permanent URL is this:

http://graph.facebook.com/517267866/picture?type=large

which will always 302 to an image URL. I am not sure if this is possible, but any insight would be appreciated.

I also tried looking for a solution in Facebook's Graph API documentation but I couldn't find any reference to this issue. Although I am unfamiliar with the Facebook Graph API, I think posting this question can help others in a similar position.


Update

Here is a slightly different example: How do I find a reliable image URL for the following photo:

https://www.facebook.com/DuwamishTreeCanopy/photos/pb.350520565135304.-2207520000.1444201132./401682256685801/?type=3&theater

?

Upvotes: 1

Views: 2854

Answers (1)

Tobi
Tobi

Reputation: 31479

You cannot "extract" something out of the CDN link... Why don't you just stick with the

https://graph.facebook.com/{user_id}/picture?type=large 

link? It should also work without an access token and with app-scoped user ids AFAIK.

Upvotes: -1

Related Questions