Skip to content

Instantly share code, notes, and snippets.

@vishalbandre
Created November 29, 2022 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishalbandre/cf13a06424f9248cbd771a67f66d7862 to your computer and use it in GitHub Desktop.
Save vishalbandre/cf13a06424f9248cbd771a67f66d7862 to your computer and use it in GitHub Desktop.
# Download YouTube video
import subprocess
def download_youtube_video(url, output_file):
cmd = 'youtube-dl ' + url + ' -o ' + output_file
subprocess.call(cmd, shell=True)
download_youtube_video('https://www.youtube.com/watch?v=srVPLrmlBJY', 'output.mp4')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment