Skip to content

Instantly share code, notes, and snippets.

@erykml
Created July 22, 2018 11:09
Show Gist options
  • Save erykml/6a48af8d98ddb2c35f549284d70bf1f0 to your computer and use it in GitHub Desktop.
Save erykml/6a48af8d98ddb2c35f549284d70bf1f0 to your computer and use it in GitHub Desktop.
downloading youtube video with pytube
# library
from pytube import YouTube
mario_video = YouTube('https://www.youtube.com/watch?v=lXMJt5PP3kM')
# viewing available video formats
print('Title:', mario_video.title, '---')
stream = mario_video.streams.filter(file_extension = "mp4").all()
for i in stream:
print(i)
# downloading the video
mario_video.streams.get_by_itag(18).download()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment