Created
March 10, 2020 20:01
-
-
Save 0xConstant/bed7ec922bdf091b7073a4cc7445adf2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import re | |
video_url_ = input("Enter video URL: ") | |
output_name = input("Enter a name for the output file (i.e. sample.mp4): ") | |
grab_source_code = requests.get(str(video_url_)) | |
grab_video_link = re.search(r'"video_url":"(.*?)"', str(grab_source_code.text)).group(1) | |
unicode_removed = grab_video_link.replace(r"\u0026", "&") | |
send_request_to_url = requests.get(unicode_removed) | |
download_file = open(output_name, "wb") | |
download_file.write(send_request_to_url.content) | |
download_file.close() | |
print(f"[ + ] File {output_name} has been downloaded!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment