How to extract the direct facebook video url

30,095

Solution 1

Example Facebook link: I cant post more than 2 links. Sorry about that

Video link: No more than 2 links

  1. Change the www to m https://www.facebook.com... change to https://m.facebook.com/

2.Press Ctrl + Shift + I then press Ctrl + Shift + C

3.Click on the video playback and copy the source code form the

I will give you the picture to show you how it look like

this is the pic

Solution 2

Here is an example HTTP GET command...

https://graph.facebook.com/v2.5/nerdandco/videos/?fields=backdated_time_granularity,content_category,copyrighted,backdated_time,created_time,description,embeddable,permalink_url,from,embed_html,source,icon,id,is_instagram_eligible,length,picture,place,privacy,published,status,scheduled_publish_time,title,updated_time,captions,comments,sharedposts,likes,tags,thumbnails&limit=10&access_token=<RETRIEVE YOUR OWN ACCESS TOKEN>

Notice that you can play around with the fields you're querying for, the username and the objects you're requesting (in this case, videos).

However, also notice that you must create your own access tokens and that queries you make will have your name on them, (so don't abuse this).

You can play around (and create your own access token) with Facebook's API in their Graph Explorer Tool: https://developers.facebook.com/tools/explorer/

And I'd recommend reading up some more in the Facebook Developers site.

Good luck! :)

Solution 3

Well i have not tried this in PHP, as per the facebook they have removed option in API to return source for the video, so i got it working using Python ;)

import requests as r
import re

url = "EntervideoURLhere"
html = r.get(url)
# for low Quality version
video_url = re.search('sd_src:"(.+?)"', html.text).group(1)
print(video_url)

# for HD version
video_url = re.search('hd_src:"(.+?)"', html.text).group(1)
print(video_url)

Solution 4

276508326057504/feed?fields=message,link,created_time,type,name,id,source

source => will return url mp4 video post

  "message": "Face Bank on Banggood",
  "link": "https://www.facebook.com/BanggoodLove/videos/301299256911744/",
  "created_time": "2016-09-01T04:59:49+0000",
  "type": "video",
  "name": "Face Bank",
  "id": "276508326057504_301299256911744",
  "source": "https://video.xx.fbcdn.net/v/t42.1790-2/14226238_1158241977553000_592726978_n.mp4?efg=eyJybHIiOjMwMCwicmxhIjo1MTIsInZlbmNvZGVfdGFnIjoidjJfNDAwX2NyZl8yN19tYWluXzMuMF9zZCJ9&rl=300&vabr=100&oh=3f89165b7d605f6c5de724110ba911cf&oe=595660F7"
Share:
30,095
gapc311
Author by

gapc311

I'm a software developer and have coded several web based applications to help businesses automate their tasks. One of the most recent projects that I worked on is this: email extractor online. It's built in PHP, Javascript, HTML and helps users in email prospecting work. Also I am endorsing fair play platforms that help creative artists in programming space get the resources they need for their work. Specially when it comes to the field of AI and thus I would recommend using this GPU computing platform: Q Blocks GPU instances that offers GPUs at 1/10th the cost of other clouds using peer to peer computing. Don't stop your creativity. Let it flow :)

Updated on July 05, 2022

Comments