Python Script To Download Facebook Videos
Maybe your like
In this tutorial, we are going to see the Method to Download Facebook Videos using Python3.
Straight forward method using GET Request Method and Python re Search Method.
Let's go to the tutorial part...
- Install required pip modules
- import the pip modules
➡ sys for exit from program ➡ OS - set the download path ➡ re - for search the Downloadable video URL ➡ requests - Read the URL using GET Method ➡ wget - Download the Video
- Setup Download Directory
- Download Low resolution video
- Download High resolution Video
- Example Script
fbvid.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import os import re import requests as r import wget filedir = os.path.join('/home/groot/Downloads') ## Download Low Resolution Video try: LINK = input("Enter a Facebook Video Post URL: ") html = r.get(LINK) sdvideo_url = re.search('sd_src:"(.+?)"', html.text)[1] except r.ConnectionError as e: print("OOPS!! Connection Error.") except r.Timeout as e: print("OOPS!! Timeout Error") except r.RequestException as e: print("OOPS!! General Error or Invalid URL") except (KeyboardInterrupt, SystemExit): print("Ok ok, quitting") sys.exit(1) except TypeError: print("Video May Private or Invalid URL") else: sd_url = sdvideo_url.replace('sd_src:"', '') print("\n") print("Normal Quality: " + sd_url) print("[+] Video Started Downloading") wget.download(sd_url, filedir) sys.stdout.write(ERASE_LINE) print("\n") print("Video downloaded")- Test the Script
- Enter the Facebook Video Post URL (Example URL: https://www.facebook.com/9gag/videos/10155721204506840/) & Start the Download
- you will get the downloadable link and Video has been stored in the location you provide
- CLI Tool - Create a New Python file named as fbvid.py
- Copy and paste this below script on the file you created & save it
- Just Execute the Script & started downloading Videos from the Facebook
Disclaimer
⚠ This is for Educational Purpose only try at your Own risk.
Tag » How To Download Facebook Videos With Pageurl Python
-
How To Download Facebook Videos With Pageurl Using Python?
-
How To Download Facebook Videos With Page Url Python
-
How To Download Facebook Videos With Pageurl Python? [Answer]
-
How To Download Facebook Videos With Pageurl Python - Infobizzz
-
How To Download Facebook Videos With Pageurl Using Python
-
Download Facebook Video Using Python - CodeSpeedy
-
How To Download Facebook Video With Python | TesKill - YouTube
-
Top 10 How To Download Facebook Videos With Page Url Python
-
Python Script To Download Facebook Videos | By Ansh Goyal
-
Reverse Engineering Facebook: Public Video Downloader
-
Downloading Facebook Videos From The Blob Infrastructure Via Python
-
Decoding Facebook's Blob Video Url - Stack Overflow
-
OEmbed - Social Plugins - Documentation - Facebook For Developers
-
Custom Home Page For Published Apps - Azure Active Directory ...