from pytubefix import YouTube from pytubefix.cli import on_progress url = "https://www.youtube.com/watch?v=PKHQuQF1S8k" yt = YouTube(url, on_progress_callback=on_progress) print(yt.title) ys = yt.streams.get_audio_only() ys.download(mp3=True) # pass the parameter mp3=True to save in .mp3