Last active
February 26, 2023 15:47
-
-
Save YiLi225/35248ecdea0da463923f3213cd267a1d 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 pytube import YouTube | |
def DownloadYT(url): | |
youtubeObject = YouTube(url) | |
youtubeObject = youtubeObject.streams.get_highest_resolution() | |
try: | |
youtubeObject.download() | |
print("Title:", youtubeObject.title) | |
print("=== Download is completed successfully ===\n") | |
except: | |
print("An error has occurred") | |
urls = ['https://www.youtube.com/shorts/EqTi6ysLd80', | |
'https://www.youtube.com/shorts/SnPD7jK3HHc'] | |
for url in urls: | |
DownloadYT(url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment