from youtube_dl import YoutubeDL audio_downloder = YoutubeDL({'format':'bestaudio'}) audio_downloader.extract_info(link to the video)