Created
February 23, 2022 17:58
-
-
Save FelipeSBarros/d1bfe745d154cd1bb3272cf0549f99bb to your computer and use it in GitHub Desktop.
This file contains 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 re import sub | |
from pytube import Playlist | |
# where to save | |
SAVE_PATH = "./" | |
# link of the playlist to be downloaded | |
p = Playlist("https://www.youtube.com/playlist?list=PLqa06jy1NEM3PI3eQGemUgEmKS5oHAw7B") | |
for video in p.videos: | |
try: | |
# downloading the video | |
print(f'Downloading: {video.title}') | |
talk = video.streams \ | |
.filter(progressive=True, | |
file_extension='mp4') \ | |
.order_by('resolution') \ | |
.desc() \ | |
.first() | |
talk_name = sub(pattern='FOSS4G -', repl='FOSS4G 2021 -', string=talk.title) | |
talk.download(filename=talk_name) # output_path=SAVE_PATH) | |
except: | |
print(f'Error in: {video.title}') | |
print('Task Completed!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment