16 November 2016

Download music from youtube using Linux



Simple procedure to download music from youtube using the command line in Lubuntu (probably works also in other Linux distributions)

16/11/2016
  • Open Xterm
  • Download software (needed only once):

    • sudo apt-get install parcellite
      (this helps to copy & paste from e.g. firefox navigaton bar to Xterm window)
    • sudo apt-get install lame
      More info about the mp3 encoder Lame
    • sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
    • sudo chmod a+rx /usr/local/bin/youtube-dl
       
  • Download a song (put everything on 1 line !)
    /usr/local/bin/youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=.......
    
  • The mp3 file is saved in the current directory op your Xterm window
References:
  • http://askubuntu.com/questions/237942/how-does-copy-paste-work-with-xterm
  • http://askubuntu.com/questions/791969/error-while-using-youtube-dl
  • http://askubuntu.com/questions/178481/how-to-download-an-mp3-track-from-a-youtube-video