Last active
February 10, 2022 14:47
-
-
Save xjcoan/d233d791965d162059d505f67fc6845c to your computer and use it in GitHub Desktop.
pytube download videos from playlist
This file contains hidden or 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
| from pytube import Playlist | |
| from pytube import YouTube | |
| import re | |
| def download_vids(): | |
| playlist = Playlist("PLAYLISTURL") | |
| playlist._video_regex = re.compile(r"\"url\":\"(/watch\?v=[\w-]*)") | |
| for url in playlist: | |
| print(url) | |
| yt = YouTube(url) | |
| yt.streams[0].download() | |
| download_vids() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment