Did You Know?
Ask a Question

We are pleased to announce the Launch of our New Section "TecMint Ask"

Install YouTube-DL – A Command Line Video Download Tool for Linux

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

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.

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 and break.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 downloaded video file. proxy support and many more.

Install Youtube-dl in Linux

Youtube-dl Command Line Video Downloader

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 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

For other distributions, youtube-dl can be downloaded from the youtube-dl download page.

Ravi Saive

Owner at TecMint.com
Simple Word a Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux.

Linux Services & Free WordPress Setup

Our post is simply ‘DIY’ aka ‘Do It Yourself, still you may find difficulties and want us to help you out. We offer wide range of Linux and Web Hosting Solutions at fair minimum rates. Please submit your orders by Clicking Here.

10 Responses

  1. mpak says:

    movgrab is better :)

  2. Dude says:

    ClipGrab is better

  3. Cuthbert says:

    It does the trick, but there are loads of options available as extensions / plugins to Firefox / Chrome if you use one of those. The extensions allow you to download video in a couple of clicks – some with format conversion options at the same time if you want. Much quicker and less hassle to use than firing up the terminal and pasting in the url. Just have a browse through the extensions and pick one of those instead…

  4. snsa says:

    Incorrect – incomplete information

  5. Dan Saint-Andre says:

    Between this publication and 12 July 2013, the command-line options have changed. For example, the dash-capital-F “-F” option is no longer present. To fetch all formats for the named URL you now use “–all-formats”. I leave other details to the student.

    Also, after you install from the PPA, I had to run the program twice using ‘sudo’ permissions (to enable write into the install location) and with the “–update” option. The program reported as follows:
    ==========
    Hi! We changed distribution method and now youtube-dl needs to update itself one more time.

    This will only happen once. Simply press enter to go on. Sorry for the trouble!
    From now on, get the binaries from http://rg3.github.io/youtube-dl/download.html, not from the git repository.
    ==========

    I hope these notes save others some confusion.
    ~~~ 0;-Dan

  6. charudatt says:

    A couple of Question –
    1. Is there a GUI Client for Windows
    2. Can I change the location of stored files , config file.

  7. joe says:

    Doesnt work for Kali linux.

    sudo add-apt-repository ppa:nilarimogard/webupd8

    any suggestion?

  8. syndrael says:

    Doesn’t work for Debian after updating repositories..
    http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu/dists/wheezy/main/source/Sources 404 Not Found

  9. rodrigue says:

    how to specify a directory for the file download with youtube-dl

Leave a Reply

© 2012-2013 All Rights Reserved.