July 25, 2008 · General · Email This Post
Share
{lang: 'en-GB'}

youtube-dl is a small command-line program to download videos from YouTube.com.

Install youtube-dl in Ubuntu

sudo aptitude install youtube-dl

This will complete the installation.

Using youtube-dl

Usage instructions are easy. Use youtube-dl followed by a video URL or identifier.

youtube-dl Example

youtube-dl “http://www.youtube.com/watch?v=foobar”

The video will be saved to the file foobar.flv in that example. As YouTube.com videos are in Flash Video format, their extension should be flv.Check this simple guide to convert .flv files to .mpg

More usage tips

You can change the file name of the video using the -o option, like in

youtube-dl -o vid.flv “http://www.youtube.com/watch?v=foobar”.

Some videos require an account to be downloaded, mostly because they’re flagged as mature content. You can pass the program a username and password for a YouTube.com account with the -u and -p options, like

youtube-dl -u myusername -p mypassword “http://www.youtube.com/watch?v=foobar”.

The account data can also be read from the user .netrc file by indicating the -n or --netrc option. The machine name is youtube in that case.

The simulate mode (activated with -s or --simulate) can be used to just get the real video URL and use it with a download manager if you prefer that option.

The quiet mode (activated with -q or --quiet) can be used to supress all output messages. This allows, in systems featuring /dev/stdout and other similar special files, outputting the video data to standard output in order to pipe it to another program without interferences.

The program can be told to simply print the final video URL to standard output using the -g or --get-url option.

Share

Related posts

133 Comments to “Youtube-dl - Download videos from youtube in Ubuntu”

  1. srinivas says:

    RTMP download detected but “rtmpdump” could not be run
    what i am do that now to over come this problem

    [Reply]

    Philipp Hagemeister Reply:

    You need to download and install rtmpdump ( http://rtmpdump.mplayerhq.hu/ ).

    [Reply]

  2. spidy says:

    1. #apt-get install youtube-dl
    2. #youtube-dl --update
    3.Following works for me..
    #youtube-dl -o test.mp4 “http://www.youtube.com/watch?v=Q7jSZJpzuDI”

    “Good Luck”

    [Reply]

    yash k Reply:

    No it’s not getting updated it gives error as

    youtube-dl --update
    Updating to latest stable version…
    ERROR: unable to download latest version
    …. and it’s not downloading as well

    [Reply]

    praveen Reply:

    youtube-dl -o test.mp4 “http://www.youtube.com/watch?v=Q7jSZJpzuDI”

    [Reply]

  3. yash k says:

    dell@dell:~$ [youtube] Setting language
    [youtube] Mq-UTP9YU_Q: Downloading video webpage
    [youtube] Mq-UTP9YU_Q: Downloading video info webpage
    [youtube] Mq-UTP9YU_Q: Extracting video information
    ERROR: no fmt_url_map or conn information found in video info
    then just cursor remains blinking idk what is wrong. help me with this I tried to update but
    response i got was

    dell@dell:~$ sudo youtube-dl -U
    Updating to latest stable version…
    ERROR: unable to download latest version

    [Reply]

  4. yash k says:

    dell@dell:~$ [youtube] Setting language
    [youtube] Mq-UTP9YU_Q: Downloading video webpage
    [youtube] Mq-UTP9YU_Q: Downloading video info webpage
    [youtube] Mq-UTP9YU_Q: Extracting video information
    ERROR: no fmt_url_map or conn information found in video info
    then just cursor remains blinking idk what is wrong. help me with this I tried to update but
    response i got was ---->

    dell@dell:~$ sudo youtube-dl -U
    Updating to latest stable version…
    ERROR: unable to download latest version

    Thanking in anticipation

    [Reply]

  5. daniel ndubi says:

    Just run the update and everything will be OK:
    #youtube-dl --update

    [Reply]

  6. juska says:

    I just run the update and get exactly the same error message.

    [Reply]

    juska Reply:

    Ok, “youtube-dl -U” did the trick, thanks for help!

    [Reply]

  7. venky says:

    ERROR: no fmt_url_map or conn information found in video info

    [Reply]

  8. haritha says:

    how to choose the destination folder..nd where to see the downloaded videos

    [Reply]

  9. box_out says:

    yeah the default download directory is not the default dir4ctory? cannot see videos anywhere….

    ooh and Happy New Years! May Your 2012 be filled with much adventure and reward!

    -bq- out^

    [Reply]

Leave a Reply