download as mp3 youtube dl code example
Example 1: youtube-dl mp3 only
youtube-dl -x --audio-format mp3 <youtube-link>
Example 2: music youtube dl
# Use this to extract audio (you need to have installed ffmpeg)
youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=jwD4AEVBL6Q