DEV Community

Discussion on: How to download youtube video as audio using python

Collapse
 
or_gavish_c9090992e8ec11b profile image
Or Gavish

Hey! I tried the code and stumbled upon a problem. Most of the files are downloaded as webm. How can I download the files directly as mp3 or any other format which Windows can play?

Thanks /Or

Collapse
 
kalebu profile image
Jordan Kalebu • Edited

Hello You could twist the audio downloader to be a format you want l


audio_downloader = YoutubeDL({'format':'m4a'})

 # OR 

audio_downloader = YoutubeDL({'format':'mp3'})

Enter fullscreen mode Exit fullscreen mode

and if that format is is available it will automatically download it