Download mp3's on the Linux Command Line? What?
What is this post about? This post is to show how you can download music from youtube or soundcloud using the CLI. Before I got into Linux I was always wondering, what is so cool about the command line, and why would I want to use it for everything?
Besides the above meme, I've also felt a bit like:"I'm on this Linux thing, what now?". Its almost like the first time you installed Gentoo. Now what?
Download videos from youtube and have them converted to mp3 automatically:
For this example we are going to download one of my favourite Dave Chapelle videos.
Start by installing youtube-dl:
(You could do all of this in a virtualenv if you know what that is, if you don't know yet, don't worry about it for now.)
$ sudo apt-get install python3-pip $ sudo pip3 install youtube-dl
You should now have youtube-dl installed. You can check if it was installed with:
$ which youtube-dl
Now we navigate to the directory where we would like to download the video as an mp3:
$ cd ~/Music/
Now let's download the video which contains a cool song in my opinion:
$ youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=egIWskTD5J8
Hope this short post is of some help to somebody out there. If you would like to know how to download via the CLI from soundcloud then leave me a comment and I'll explain how you can do it.
Thanks for reading. Please follow and upvote if you enjoyed this article.
I wrote a previous post on this: https://steemit.com/linux/@netscape101/download-videos-from-youtube-and-convert-it-mp3-all-on-the-commandline and one of the users @harvhat gave a cool suggestion that I included in this post.