2017-01-06 64 views
0

我怎样才能在后的永久链接的图片?例如,我可以获取有关一个帖子的所有信息:Facebook的GraphAPI图片/ full_picture永久链路

912163612218997/?fields=picture,full_picture,attachments 

    { 
    "picture": "https://scontent.xx.fbcdn.net/v/t1.0-0/s130x130/15390764_10154771322382505_5131571043698309499_n.jpg?oh=de4126b3944deb9fb7fca6b534e5e987&oe=58E45F29", 
    "full_picture": "https://scontent.xx.fbcdn.net/v/t31.0-8/s720x720/15326300_10154771322382505_5131571043698309499_o.jpg?oh=414291d1c1fbc88988afb887177a03c5&oe=59156F5D", 
    "id": "189675924467773_912163612218997", 
    "attachments": { 
     "data": [ 
     { 
      "description": ..., 
      "media": { 
      "image": { 
       "height": 372, 
       "src": "https://scontent.xx.fbcdn.net/v/t31.0-8/s720x720/15326300_10154771322382505_5131571043698309499_o.jpg?oh=414291d1c1fbc88988afb887177a03c5&oe=59156F5D", 
       "width": 720 
      } 
      }, 
      "target": { 
      "id": "10154771322382505", 
      "url": "https://www.facebook.com/photo.php?fbid=10154771322382505&set=gm.912163612218997&type=3" 
      }, 
      "type": "photo", 
      "url": "https://www.facebook.com/photo.php?fbid=10154771322382505&set=gm.912163612218997&type=3" 
     } 
     ] 
    } 
    } 

但是,这些图片链接是暂时的。几个小时后将无法使用。

有没有什么办法让来自Facebook GraphAPI永久网址的图片?

+1

没有没有。你只会获得CDN网址,而且他们总是暂时的 – WizKid

回答

0

我有点想出利用重定向解决方法:使用对象ID

  1. 消防图形API,让CDN URL
  2. 重定向到CDN URL

基本上,只要我们知道对象ID,我们可以得到URL。不幸的是,它有点慢。