![]() ![]() Try: LINK = input("Enter a Facebook Video Post URL: ") html = r.get(LINK) sdvideo_url = re.search('sd_src:"(. ?)"', html.text) 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) (ERASE_LINE) print("\n") print("Video downloaded") ![]() ➡ sys for exit from the program ➡ OS - set the download path ➡ re - for search the Downloadable video URL ➡ requests - Read the URL using GET Method ➡ wget - Download the Videoįiledir = os.path.join('/home/groot/Downloads') #!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import os import re import requests as r import wget
0 Comments
Leave a Reply. |