Download playlist from youtube on Ubuntu Linux

  • Download youtube-dl sudo apt-get install youtube-dl
  • Update your system sudo apt-get update
  • Check your version youtube-dl --version
  • Update to the last version sudo youtube-dl -U
  • Download all videos ignoring and retrying on errors and extracting using the best quality of video and audio on mp4 format
youtube-dl -citf 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' https://www.youtube.com/playlist?list=[replace with the code after the equal] 

i.e. if your youtube's shared link is:
https://www.youtube.com/watch?v=u78iVL-6htc&list=PL05kpwpMmS0aQVNMGn3jSbYYLZzRXI4wF

your command will be:

youtube-dl -citf 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' https://www.youtube.com/playlist?list=PL05kpwpMmS0aQVNMGn3jSbYYLZzRXI4wF



If you only want the mp3 file:

youtube-dl -f bestaudio "https://www.youtube.com/watch?v=[replace with the code after the equal]" --exec "ffmpeg -i {} -codec:a libmp3lame -qscale:a 0 {}.mp3 && rm {} "
Attention: replace & by the correct double ampersand


you must have installed ffmpeg:
Manually installing ffmpeg with libmp3lame encoder support.
  1. Install lame encoder Download and extract lame from https://sourceforge.net/projects/lame
  2. To extract use this command: tar xvzf lame-[your version].tar.gz
  3. access your extracted directory cd lame-*
  4. Create the Makefile ./configure
  5. make
  6. sudo make install
  7. Clone and install ffmpeg git clone https://git.ffmpeg.org/ffmpeg.git
  8. Create Makefile using lame MP3 parameters ./configure --enable-libmp3lame
  9. make
  10. sudo make install
After all of these steps, you can use the youtube-dl command

Olafo - Virutas Dulces

Olafo - Una mano lava la otra