Motivations
- To save youtube videos locally in the hard drive
- To rip the audio portion of the youtube videos
- To do No. 1 and No. 2 without using browser plugins
- To dno No. 1 and No. 2 using command line utilities
What you will need
- youtube-dl - This pull the youtube content, ala curl or wget
- ffmpeg and lame - These two you will need to transform the downloaded content because youtube-dl will pull a .webm file, if you have capability to play a .webm file, you may not need to transform them. In Lubuntu, the .webm is supported
Preparing the software - Linux
This method used the Debian apt-get installer, it will be different for other Linux distros
$ sudo apt-get install ffmpeg lame youtube-dl
Preparing the software - OSX
Either BREW or MacPorts can be used. I used BREW
$ sudo brew install youtube-dl
$ sudo brew install ffmpeg
$ sudo brew install lame
How to rip youtube videos
- Find the url of the youtube video you want to rip
- use youtube-dl to rip the content -- $ youtube-dl {http://YoutubeVideo Address}
- The downloaded file is a .webm file, transform it to wav -- $ ffmpeg -i {DownloadedFileName.webm} {TargetFileName.wav}
- If .wav is okay for you, you can stop now. If you want to transform further to MP3 format use the lame utility -- $ lame {FileName.wav} {FileName.mp3}