import pytube as pt
def Download_Playlist():
url = input("Enter Playlist URL: ")
playlist = pt.Playlist(url)
res = choose_Resolution()
for url in playlist:
video = pt.YouTube(url)
stream = video.streams.get_by_itag(res)
stream.download()
def choose_Resolution():
resolution = input("\nResolutions:\n1-360p\n2-480p\n3-720p\n4-720p60fps\n5-1080p\n6-1080p60fps\n7-4k\n---------------------\n(type 1/2/3/4/5/6/7): ")
if resolution == "1":
itag = 18
elif resolution == "2":
itag = 135
elif resolution == "3":
itag = 136
elif resolution == "4":
itag = 298
elif resolution == "5":
itag = 248
elif resolution == "6":
itag = 299
elif resolution == "7":
itag = 313
else:
print("Wrong Entry!")
return itag
Download_Playlist()
Burada Download_Playlist’i çalıştırınca url’yi girip çözünürlüğü seçtikten sonra ekrana “1” yazıp programdan çıkıyor. Sebebi ne olabilir tam anlayamadım…