Youtube: Save the audio stream of a youtube video as mp3

Hi,

there is a python module if you want to save an audio stream of a youtube. youtube-dl is the choice for such tasks.

To install youtube-dl you need python and pip. On Windows use the installer from

root@debdev ~ # apt-get install python3 python3-pip

Then install youtube-dl in your user profile

michael@debdev ~ # python3 -m pip install youtube-dl

Locate your video in your Browser and copy the url.

michael@debdev ~ # ~/.local/bin/youtube-dl --extract-audio --audio-format mp3  'https://www.youtube.com/watch?v=f0IxxxY4'

Note: You have to update youtube-dl on a regular basis because youtube often changes the web layout. To update youtube-dl call

michael@debdev ~ # python3 -m pip install youtube-dl

again.
It’s also possible to download a playlist at once. This command line could start multiple times and skips already downloaded content.

michael@debdev ~ # ~/.local/bin/youtube-dl --download-archive finished.txt --yes-playlist --no-post-overwrites -ciwx --extract-audio --audio-format mp3  'https://www.youtube.com/watch?v=myPlaylist&index=20'

Michael

Leave a Reply Cancel reply