DEV Community

Harendra Kumar Kanojiya
Harendra Kumar Kanojiya

Posted on • Originally published at harendraverma21.Medium on

4 line code to download full youtube playlist videos

Download youtube video using python

YouTube is the most popular video-sharing platform as a hacker you may encounter a situation where you want to script something to download videos. For this, I present to you pytube. https://pypi.org/project/pytube/

from pytube import Playlist
pl = Playlist("https://www.youtube.com/watch?v=Edpy1szoG80&list=PL153hDY-y1E00uQtCVCVC8xJ25TYX8yPU")
for video in pl.videos:
  video.streams.first().download()
Enter fullscreen mode Exit fullscreen mode

Subscribe to my newsletter to be informed when I publish an article. Or sign up for a Medium Membership Here (I will receive part of your Membership)

Discussion (0)