Mar 15, 2023
Hi just wanted to point out one thing:
1) For the following block of code:
def download(link):
youtubeObject = YouTube(link)
youtubeObject = youtubeObject.streams.get_highest_resolution()
try:
youtubeObject.download()
except:
print("An error has occurred")
print("Download is completed successfully")
In the case an error occurs it will still print the successful part, so you should exit the script at that point. Also it might be helpful to actually log the error message for debugging.