Rip youtube videos in Linux and OSX - command line
by: Ted Hagos on 12.April.2012

Motivations

  1. To save youtube videos locally in the hard drive
  2. To rip the audio portion of the youtube videos
  3. To do No. 1 and No. 2 without using browser plugins
  4. To dno No. 1 and No. 2 using command line utilities

What you will need

  1. youtube-dl - This pull the youtube content, ala curl or wget
  2. 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

  1. Find the url of the youtube video you want to rip
  2. use youtube-dl to rip the content -- $ youtube-dl {http://YoutubeVideo Address}
  3. The downloaded file is a .webm file, transform it to wav -- $ ffmpeg -i {DownloadedFileName.webm} {TargetFileName.wav}
  4. 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}

customizable counter
comments powered by Disqus