I am trying to write a yt downloader program using pygame and pytube but when i run the code it does not responding and the window becomes black.Cuold you please tell me why this happens.
from pytube import YouTube
from pygame import*
#interface
init()
window = display.set_mode((900, 700))
display.set_caption("YT_DOWNLOADER")
background = transform.scale(image.load("ytback.jpg"), (900, 700))
clock = time.Clock()
fps = 70
#mechanic
link = input("Enter the link of YouTube video you want to download: ")
yt = YouTube(link)
print("Title: ",yt.title)
print("Number of views: ",yt.views)
print("Length of video: ",yt.length)
print("Rating of video: ",yt.rating)
ys = yt.streams.get_highest_resolution()
print("Downloading...")
ys.download()
print("Download completed!!")
pygame.display.update()