youtube-dl is a Python based small command-line tool that allows to download videos fromYouTube.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 Xbased systems.
Recently, youtube-dl added video download support for 17 new websites: brightcove.com,auengine.com, RingTV, instagram.com, Jukebox, 3sat, CSpan, Statigr.am, traileraddict.com,hotnewhiphop.com, wat.tv, tu.tv, gamespot.com, tudou.com, Wimp.com, archive.org andbreak.com
youtube-dl also allows to choose specific avialable video quality format to download or let the program itself automatically download higher quality video from the site. It also has supports for user specific playlist downloads, options to add custom or original title to the downloadedvideo file. proxy support and many more.
First, you need to download the file using Wget and then install it using RPM on your system to enable the EPEL repository. Use below links based on your Linux OS versions. (Make sure you must be root user).
RHEL/CentOS 6 32-64 Bit
## RHEL/CentOS 6 32-Bit ## # wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm ## RHEL/CentOS 6 64-Bit ## # wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm
RHEL/CentOS 5 32-64 Bit
## RHEL/CentOS 5 32-Bit ## # wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm # rpm -ivh epel-release-5-4.noarch.rpm ## RHEL/CentOS 5 64-Bit ## # wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm # rpm -ivh epel-release-5-4.noarch.rpm
RHEL/CentOS 4 32-64 Bit
## RHEL/CentOS 4 32-Bit ## # wget http://download.fedoraproject.org/pub/epel/4/i386/epel-release-4-10.noarch.rpm # rpm -ivh epel-release-4-10.noarch.rpm ## RHEL/CentOS 4 64-Bit ## # wget http://download.fedoraproject.org/pub/epel/4/x86_64/epel-release-4-10.noarch.rpm # rpm -ivh epel-release-4-10.noarch.rpm
Once enabled, you can install using ‘yum‘ package manager tool as shown.
# yum install youtube-dl
Install YouTube-DL in Ubuntu/Linux Mint and Debian
Ubuntu users can download and install latest youtube-dl version from the webupd8 PPA as shown.
$ sudo add-apt-repository ppa:nilarimogard/webupd8 $ sudo apt-get update $ sudo apt-get install youtube-dl
Update YouTube-DL
Youtube-dl itself can be updated to the latest version using the following command.
# youtube-dl -U
How to Use YouTube-DL to Download Videos
To download a video file, simply run the following command. Where “VIDEO_URL” is the url of the video that you want to download.
# youtube-dl http://www.youtube.com/watch?v=vKtwZmhX0lw [youtube] Setting language [youtube] VMkkaQZAK3c: Downloading video webpage [youtube] VMkkaQZAK3c: Downloading video info webpage [youtube] VMkkaQZAK3c: Extracting video information [download] Destination: Natural Skin Whitening Methods-VMkkaQZAK3c.mp4 [download] 15.3% of 218.88MiB at 968.72KiB/s ETA 03:16
To download a video in availabe file formats, use option “–all-formats” with the command.
# youtube-dl –all-formats http://www.youtube.com/watch?v=vKtwZmhX0lw [youtube] Setting language [youtube] VMkkaQZAK3c: Downloading video webpage [youtube] VMkkaQZAK3c: Downloading video info webpage [youtube] VMkkaQZAK3c: Extracting video information Available formats: 37 : mp4 [1080x1920] 46 : webm [1080x1920] 22 : mp4 [720x1280] 45 : webm [720x1280] 35 : flv [480x854] 44 : webm [480x854] 34 : flv [360x640] 18 : mp4 [360x640] 43 : webm [360x640] 5 : flv [240x400] 17 : mp4 [144x176]
To download a preferred file format, use the option ‘-f’ (video format code). For example, I would like to download flv format, So I use format code as ‘34‘ as shown below.
# youtube-dl -f 34 http://www.youtube.com/watch?v=vKtwZmhX0lw[youtube] Setting language [youtube] VMkkaQZAK3c: Downloading video webpage [youtube] VMkkaQZAK3c: Downloading video info webpage [youtube] VMkkaQZAK3c: Extracting video information [download] Destination: Natural Skin Whitening Methods-VMkkaQZAK3c.flv [download] 16.9% of 32.57MiB at 916.81KiB/s ETA 00:30
To download a list of video files, create a file and place all the YouTube links that you wish to download.
# youtube-dl -a youtube_links.txt
Type the following command in a terminal to list all the avialable options.
# man youtube-dl