如何获取Facebook视频的URL?

时间:2015-06-01 10:59:52

标签: facebook flash video embed

我想在我正在制作的网站中嵌入Facebook视频。该视频位于公司页面上。我正在为同一家公司制作网站,所以不要担心版权问题。在chrome dev工具中,我找到了一个以.swf结尾的链接,但是当我将它粘贴到我的地址栏中时,没有任何内容加载。

这是我找到的链接:

https://fbstatic-a.akamaihd.net/rsrc.php/v1/yA/r/7HOXOhotVs4.swf

并且它在

之内
<embed type="application/x-shockwave-flash" src="https://fbstatic-a.akamaihd.net/rsrc.php/v1/yA/r/7HOXOhotVs4.swf" width="745" height="600" style="display: block;" id="swf_id_556c3725cac3b0881505628" name="swf_id_556c3725cac3b0881505628" bgcolor="#000000" quality="high" allowfullscreen="true" allowscriptaccess="always" salign="tl" scale="noscale" wmode="opaque" flashvars="params=%7B%22auto_hd%22%3Afalse%2C%22autoplay_reason%22%3A%22unknown%22%2C%22default_hd%22%3Afalse%2C%22disable_native_controls%22%3Afalse%2C%22inline_player%22%3Afalse%2C%22pixel_ratio%22%3A1%2C%22preload%22%3Afalse%2C%22start_muted%22%3Afalse%2C%22video_data%22%3A%5B%7B%22hd_src%22%3A%22https%3A%5C%2F%5C%2Ffbcdn-video-p-a.akamaihd.net%5C%2Fhvideo-ak-xap1%5C%2Fv%5C%2Ft43.1792-2%5C%2F1326123_10151866439299059_44825_n.mp4%3Fefg%3DeyJybHIiOjE1MDAsInJsYSI6MTY0MH0%5Cu00253D%26rl%3D1500%26vabr%3D853%26oh%3D74581c7ec1aed810cee512cf605f59a6%26oe%3D556C6506%26__gda__%3D1433162747_d02fa4f48cca138eefa857ab4143ffcd%22%2C%22is_hds%22%3Afalse%2C%22is_hls%22%3Afalse%2C%22player_type%22%3A%22progressive%22%2C%22rotation%22%3A0%2C%22sd_src%22%3A%22https%3A%5C%2F%5C%2Fvideo-fra3-1.xx.fbcdn.net%5C%2Fhvideo-xfp1%5C%2Fv%5C%2Ft42.1790-2%5C%2F1088689_10151793358514059_13394_n.mp4%3Fefg%3DeyJybHIiOjcwMiwicmxhIjo3NTB9%26rl%3D702%26vabr%3D390%26oh%3D7ee558badea9b238dafca2ef58e7edc2%26oe%3D556C5338%22%2C%22video_id%22%3A%2210150099114814059%22%2C%22sd_tag%22%3A%22legacy_sd%22%2C%22hd_tag%22%3A%22legacy_hd%22%2C%22sd_src_no_ratelimit%22%3A%22https%3A%5C%2F%5C%2Fvideo-fra3-1.xx.fbcdn.net%5C%2Fhvideo-xfp1%5C%2Fv%5C%2Ft42.1790-2%5C%2F1088689_10151793358514059_13394_n.mp4%3Foh%3D7ee558badea9b238dafca2ef58e7edc2%26oe%3D556C5338%22%2C%22hd_src_no_ratelimit%22%3A%22https%3A%5C%2F%5C%2Ffbcdn-video-p-a.akamaihd.net%5C%2Fhvideo-ak-xap1%5C%2Fv%5C%2Ft43.1792-2%5C%2F1326123_10151866439299059_44825_n.mp4%3Foh%3D74581c7ec1aed810cee512cf605f59a6%26oe%3D556C6506%26__gda__%3D1433162747_f63ef4927642e728c87578d0a8f20b24%22%2C%22subtitles_src%22%3Anull%7D%5D%2C%22show_captions_default%22%3Afalse%2C%22persistent_volume%22%3Atrue%2C%22buffer_length%22%3A0.1%7D&amp;width=720&amp;height=576&amp;user=1485939356&amp;log=no&amp;div_id=id_556c3725cac3b0881505628&amp;swf_id=swf_id_556c3725cac3b0881505628&amp;browser=Chrome+43.0.2357.81&amp;tracking_domain=https%3A%2F%2Fpixel.facebook.com&amp;post_form_id=&amp;string_table=https%3A%2F%2Fs-static.ak.facebook.com%2Fflash_strings.php%2Ft99524%2Fen_US">

1 个答案:

答案 0 :(得分:1)

如果您有page_id页面或页面名称,则可以通过发出以下呼叫来请求Page的视频:

/?id={page_name_or_id}&fields=videos{embed_html,format}

例如

/?id=arcadefire&fields=videos{embed_html,format}

返回

{
  "videos": {
    "data": [
      {
        "embed_html": "<iframe src=\"https://www.facebook.com/video/embed?video_id=10152504597050225\" width=\"1280\" height=\"720\" frameborder=\"0\"></iframe>", 
        "format": [
          {
            "embed_html": "<iframe src=\"https://www.facebook.com/video/embed?video_id=10152504597050225\" width=\"130\" height=\"73\" frameborder=\"0\"></iframe>", 
            "filter": "130x130", 
            "height": 73, 
            "picture": "https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xap1/v/t15.0-10/s130x130/10442736_10152504602350225_10152504597050225_50690_845_b.jpg?oh=fbb990289488a174dccb11ea707d4e9e&oe=55EC60DE&__gda__=1443431681_74940fd5711f2f749a42eef6e8de4850", 
            "width": 130
          }, 
          {
            "embed_html": "<iframe src=\"https://www.facebook.com/video/embed?video_id=10152504597050225\" width=\"480\" height=\"270\" frameborder=\"0\"></iframe>", 
            "filter": "480x480", 
            "height": 270, 
            "picture": "https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xap1/v/t15.0-10/s480x480/10442736_10152504602350225_10152504597050225_50690_845_b.jpg?oh=460bc8e4c46241fbc3166da05105cec1&oe=560C729F&__gda__=1442097728_96f303b1a4f674a80af8141ae2a37c10", 
            "width": 480
          }, 
          {
            "embed_html": "<iframe src=\"https://www.facebook.com/video/embed?video_id=10152504597050225\" width=\"720\" height=\"405\" frameborder=\"0\"></iframe>", 
            "filter": "720x720", 
            "height": 405, 
            "picture": "https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xap1/v/t15.0-10/s720x720/10442736_10152504602350225_10152504597050225_50690_845_b.jpg?oh=7688991f560c76473752743c73847e95&oe=55FF622B&__gda__=1442167796_6f588e161caed3d5fefdebd3b0f78157", 
            "width": 720
          }, 
          {
            "embed_html": "<iframe src=\"https://www.facebook.com/video/embed?video_id=10152504597050225\" width=\"1280\" height=\"720\" frameborder=\"0\"></iframe>", 
            "filter": "native", 
            "height": 720, 
            "picture": "https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xap1/v/t15.0-10/10442736_10152504602350225_10152504597050225_50690_845_b.jpg?oh=863e992c8cb4b1dccbc63c5140e0b166&oe=560A85CD&__gda__=1441785373_4469686cb72f1573c8ef64c17ecfdd5a", 
            "width": 1280
          }
        ], 
        "updated_time": "2015-03-05T02:15:51+0000", 
        "id": "10152504597050225"
      }
    ], 
    "paging": {
      "cursors": {
        "before": "MTAxNTI1MDQ1OTcwNTAyMjU=", 
        "after": "MTAxNTI1MDQ1OTcwNTAyMjU="
      }, 
      "next": "https://graph.facebook.com/v2.3/152513780224/videos?pretty=0&fields=embed_html,format&limit=1&after=MTAxNTI1MDQ1OTcwNTAyMjU="
    }
  }, 
  "id": "152513780224"
}