Skip to content

Instantly share code, notes, and snippets.

@0xConstant
Created March 10, 2020 20:01
Show Gist options
  • Save 0xConstant/bed7ec922bdf091b7073a4cc7445adf2 to your computer and use it in GitHub Desktop.
Save 0xConstant/bed7ec922bdf091b7073a4cc7445adf2 to your computer and use it in GitHub Desktop.
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