This article covers how you can download YouTube videos on Linux using the youtube-dl utility. The youtube-dl is a handy utility with a large feature set. However, there is a lot more you can do with this utility. To explore more features, visit its official documentation . To play the downloaded videos, you can use any media players like VLC , FFmpeg , and so on.
youtube-dl is a command-line program that lets you easily download videos and audio from more than a thousand websites.
youtube-dl is a Python based small command-line tool that allows to download videos from YouTube.com, Dailymotion, Google Video, Photobucket, Facebook, Yahoo, Metacafe, Depositfiles and few more similar sites.
It written in pygtk and requires Python interpreter to run this program, it's not platform restricted. It should run on any Unix, Windows or in Mac OS X based systems.
To Install YouTube-DL in RHEL/CentOS and Fedora:
The youtube-dl program can be installed by enabling epel repository under your systems. Once enabled, you can install using 'yum' package manager tool:
$ yum install youtube-dl
Also, if you wish to add any third party repository, you can still install it right away using curl or wget command:
$ curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl
$ wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
Your system must have curl or wget packages installed to fetch the recent version youtube-dl file. If you don't have them, you may yum to get it.
After fetching the file, you need to set a executable permission on the script to execute properly:
$ chmod a+rx /usr/local/bin/youtube-dl
To Install YouTube-DL in Ubuntu/Linux Mint and Debian:
$ sudo add-apt-repository ppa:nilarimogard/webupd8
$ sudo apt-get update
$ sudo apt-get install youtube-dl
Also, instead using any third party PPA, you can use curl or wget command to install latest version of youtube-dl script:
$ sudo curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl
$ sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
After downloading the script, set the executable permission:
$ sudo chmod a+rx /usr/local/bin/youtube-dl
To Update YouTube-DL,
Youtube-dl itself can be updated to the latest version using the following command:
$ youtube-dl -U