hi guys I'm new to python and i was trying to make a YouTube video downloader, the code is working but the completion message is not shown when video download is completed and I don't know why
the code:
from pytube import YouTube
link = input("VIDEO URL: ")
video = YouTube(link)
def done():
print("Download Complete")
High_Quality_720p = video.streams.get_highest_resolution().download(output_path="/Users/tahaw/OneDrive/Desktop/download_path")
def highQ_vid_comp():
print(video.register_on_complete_callback("Download Complete 720p"))
Low_Quality_360p = video.streams.get_lowest_resolution().download(output_path="/Users/tahaw/OneDrive/Desktop/download_path")
def lowQ_vid_comp():
print(video.register_on_complete_callback("Download Complete 360p"))
for video in video.streams.filter(progressive=True):
print(video)
res=input("Resolution(720p/360p): ")
if res == ("720p"):
print(High_Quality_720p)
highQ_vid_comp()
elif res == ("360p"):
print(Low_Quality_360p)
lowQ_vid_comp()
print("Download Complete")insidedone()but you never executedone()so it doesn't display it.register_on_complete_callback(..)? Maybe it should be function's name likeregister_on_complete_callback(done)to executedone()when it is completed.'Stream' object has no attribute 'register_on_complete_callback'. As for me it seems one mess.