Thursday, July 23, 2015

Download YouTube video as MP3

There are some ways to convert youtube video to mp3. I used to use online converter, but it fails when the video is lengthy (say more than 30 minutes). From my experience, the most convenient way for me is using youtube-dl (I love terminal. It is command based, so it might not very convenient for those who love GUI-based app). Here are the most convenient steps that I use:

## INSTALLATION ##
The most convenient way to install is using pip. Followings are full steps for installation:
1. Install python
2. Download pip installer here.
3. Go to folder where you put get-pip.py then write this in your terminal
$ python get-pip.py
4. Now you have pip installed. Time to download youtube-dl. Type this in your teminal
$ pip install youtube-dl
## DOWNLOAD TIME ##
1.  Now you can download youtube video and convert it to mp3. Just type this in your terminal (change the video URL to the one you want to download)
$ youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=S0hRlPacL5U
2. If you are running behind proxy, you need to add into your command
$ youtube-dl --proxy http://username:password@proxy_address:proxy_port --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=S0hRlPacL5U

Enjoy

No comments: