from pytubefix import YouTube
from pytubefix.cli import on_progress
video_or_audio = str(input("비디오(y/n)? : "))
url = str(input("링크를 입력하세요: "))
yt = YouTube(url, on_progress_callback = on_progress)
print(yt.title)
if video_or_audio in ['Y', 'y', 'yes']:
ys = yt.streams.get_highest_resolution()
ys.download()
else:
ys = yt.streams.get_audio_only()
ys.download(mp3=True)