Facebook Image URL gets expired

那年仲夏 提交于 2019-12-04 09:51:50

问题


I am pulling Facebook posts using facebook-graph API, now the problem is Image gets expired after few days.

I have the following URL for a single Image

Old Image URL which got expired

https://scontent-a.xx.fbcdn.net/hphotos-xfp1/v/l/t1.0-9/p180x540/14377_340369866155028_6836158858133154924_n.jpg?oh=7ed0d8818ad54fac851b036d24f5e674&oe=55579EE3

New Image working URL Is

https://scontent-sin1-1.xx.fbcdn.net/hphotos-xfa1/v/l/t1.0-9/14377_340369866155028_6836158858133154924_n.jpg?oh=2f7ad72fa36fc026ad2bdcc1b0284146&oe=55C87432

I am frustrated with this issue, what could be the solution of it?


回答1:


What i came to know from other community about this issue is

"You should not store Facebook CDN URLs for long time use – they can change over time.

Either request the actual image and copy that to your server – or request the current CDN URL regularly.

(You might be tempted to try other workarounds, like extracting the actual image source URL from the CDN link, but I would advise against that – because the format of that might change at any time as well.)"




回答2:


you can not store facebook Images url for a long time, it expires for security purpose, so it would be a better solution to store images in your server.




回答3:


http://prntscr.com/h2fe45 here's the part that stays the same and that's all you need to get it every time the link is changed. I saved images back in 2013 and I still can access them.Its almost 2018.



来源:https://stackoverflow.com/questions/30477877/facebook-image-url-gets-expired

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!