Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
Krzysztof Kurzawski 992376b
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Krzysztof Kurzawski 992376b
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Krzysztof Kurzawski 992376b
<head>
Krzysztof Kurzawski 992376b
	<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
Krzysztof Kurzawski 992376b
	<title>youtube-dl: Download videos from YouTube.com</title>
Krzysztof Kurzawski 992376b
	<style type="text/css">
Krzysztof Kurzawski 992376b
		body {
Krzysztof Kurzawski 992376b
			font-family: sans-serif;
Krzysztof Kurzawski 992376b
			font-size: small;
Krzysztof Kurzawski 992376b
		}
Krzysztof Kurzawski 992376b
		h1 {
Krzysztof Kurzawski 992376b
			text-align: center;
Krzysztof Kurzawski 992376b
			text-decoration: underline;
Krzysztof Kurzawski 992376b
			color: #006699;
Krzysztof Kurzawski 992376b
		}
Krzysztof Kurzawski 992376b
		h2 {
Krzysztof Kurzawski 992376b
			color: #006699;
Krzysztof Kurzawski 992376b
		}
Krzysztof Kurzawski 992376b
		p {
Krzysztof Kurzawski 992376b
			text-align: justify;
Krzysztof Kurzawski 992376b
			margin-left: 5%;
Krzysztof Kurzawski 992376b
			margin-right: 5%;
Krzysztof Kurzawski 992376b
		}
Krzysztof Kurzawski 992376b
		ul {
Krzysztof Kurzawski 992376b
			margin-left: 5%;
Krzysztof Kurzawski 992376b
			margin-right: 5%;
Krzysztof Kurzawski 992376b
			list-style-type: square;
Krzysztof Kurzawski 992376b
		}
Krzysztof Kurzawski 992376b
		li {
Krzysztof Kurzawski 992376b
			margin-bottom: 0.5ex;
Krzysztof Kurzawski 992376b
		}
Krzysztof Kurzawski 992376b
		#copyright {
Krzysztof Kurzawski 992376b
			font-size: x-small;
Krzysztof Kurzawski 992376b
			text-align: center;
Krzysztof Kurzawski 992376b
		}
Krzysztof Kurzawski 992376b
		--></style>
Krzysztof Kurzawski 992376b
</head>
Krzysztof Kurzawski 992376b
<body>
Krzysztof Kurzawski 992376b

youtube-dl: Download videos from YouTube.com

Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b

What is it?

Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b

youtube-dl is a small command-line program to download videos

Krzysztof Kurzawski 992376b
from YouTube.com. It requires the Python
Krzysztof Kurzawski 992376b
interpreter, version 2.4 or later, and it's not platform specific.
Krzysztof Kurzawski 992376b
It should work in your Unix box, in Windows or in Mac OS X. The latest version
Krzysztof Kurzawski 992376b
is 2008.01.24. It's licensed under the MIT License, which
Krzysztof Kurzawski 992376b
means you can modify it, redistribute it or use it however you like
Krzysztof Kurzawski 992376b
complying with a few simple conditions.

Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b

I'll try to keep it updated if YouTube.com changes the way you access

Krzysztof Kurzawski 992376b
their videos. After all, it's a simple and short program. However, I can't
Krzysztof Kurzawski 992376b
guarantee anything. If you detect it stops working, check for new versions
Krzysztof Kurzawski 992376b
and/or inform me about the problem, indicating the program version you
Krzysztof Kurzawski 992376b
are using. If the program stops working and I can't solve the problem but
Krzysztof Kurzawski 992376b
you have a solution, I'd like to know it. If that happens and you feel you
Krzysztof Kurzawski 992376b
can maintain the program yourself, tell me. My contact information is
Krzysztof Kurzawski 992376b
at freshmeat.net.

Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b

Thanks for all the feedback received so far. I'm glad people find my

Krzysztof Kurzawski 992376b
program useful.

Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b

Related projects:

Krzysztof Kurzawski 992376b
metacafe-dl
Krzysztof Kurzawski 992376b
pornotube-dl
Krzysztof Kurzawski 992376b

Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b

Usage instructions

Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b

In Windows, once you have installed the Python interpreter, save the

Krzysztof Kurzawski 992376b
program with the .py extension and put it somewhere in the PATH.
Krzysztof Kurzawski 992376b
Try to follow the
Krzysztof Kurzawski 992376b
guide to
Krzysztof Kurzawski 992376b
install youtube-dl under Windows XP.

Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b

In Unix, download it, give it execution permission and copy it to one

Krzysztof Kurzawski 992376b
of the PATH directories (typically, /usr/local/bin).

Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b

After that, you should be able to call it from the command line as

Krzysztof Kurzawski 992376b
youtube-dl or youtube-dl.py. I will use youtube-dl
Krzysztof Kurzawski 992376b
in the following examples. Usage instructions are easy. Use youtube-dl
Krzysztof Kurzawski 992376b
followed by a video URL or identifier. Example: youtube-dl
Krzysztof Kurzawski 992376b
"http://www.youtube.com/watch?v=foobar". The video will be saved
Krzysztof Kurzawski 992376b
to the file foobar.flv in that example. As YouTube.com
Krzysztof Kurzawski 992376b
videos are in Flash Video format, their extension should be flv.
Krzysztof Kurzawski 992376b
In Linux and other unices, video players using a recent version of
Krzysztof Kurzawski 992376b
ffmpeg can play them. That includes MPlayer, VLC, etc. Those two
Krzysztof Kurzawski 992376b
work under Windows and other platforms, but you could also get a
Krzysztof Kurzawski 992376b
specific FLV player of your taste.

Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b

If you try to run the program and you receive an error message containing the

Krzysztof Kurzawski 992376b
keyword SyntaxError near the end, it means your Python interpreter
Krzysztof Kurzawski 992376b
is too old.

Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b

More usage tips

Krzysztof Kurzawski 992376b
Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
  • You can change the file name of the video using the -o option, like in
  • Krzysztof Kurzawski 992376b
    youtube-dl -o vid.flv "http://www.youtube.com/watch?v=foobar".
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
  • Some videos require an account to be downloaded, mostly because they're
  • Krzysztof Kurzawski 992376b
    flagged as mature content. You can pass the program a username and password
    Krzysztof Kurzawski 992376b
    for a YouTube.com account with the -u and -p options, like youtube-dl
    Krzysztof Kurzawski 992376b
    -u myusername -p mypassword "http://www.youtube.com/watch?v=foobar".
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
  • The account data can also be read from the user .netrc file by indicating
  • Krzysztof Kurzawski 992376b
    the -n or --netrc option. The machine name is youtube in that
    Krzysztof Kurzawski 992376b
    case.
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
  • The simulate mode (activated with -s or --simulate) can be used
  • Krzysztof Kurzawski 992376b
    to just get the real video URL and use it with a download manager if you
    Krzysztof Kurzawski 992376b
    prefer that option.
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
  • The quiet mode (activated with -q or --quiet) can be used to
  • Krzysztof Kurzawski 992376b
    supress all output messages. This allows, in systems featuring /dev/stdout
    Krzysztof Kurzawski 992376b
    and other similar special files, outputting the video data to standard output
    Krzysztof Kurzawski 992376b
    in order to pipe it to another program without interferences.
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
  • The program can be told to simply print the final video URL to standard
  • Krzysztof Kurzawski 992376b
    output using the -g or --get-url option.
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
  • Combined with the above option, the -2 or --title-too option tells the
  • Krzysztof Kurzawski 992376b
    program to print the video title too.
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
  • The default filename is video_id.flv. But you can also use the
  • Krzysztof Kurzawski 992376b
    video title in the filename with the -t or --title option.
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
  • youtube-dl honors the http_proxy environment variable
  • Krzysztof Kurzawski 992376b
    if you want to use a proxy. Set it to something like
    Krzysztof Kurzawski 992376b
    http://proxy.example.com:8080, and do not leave the http://
    Krzysztof Kurzawski 992376b
    prefix out.
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
  • You can get the program version by calling it as youtube-dl
  • Krzysztof Kurzawski 992376b
    -v or youtube-dl --version.
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
  • For usage instructions, use youtube-dl -h or youtube-dl
  • Krzysztof Kurzawski 992376b
    --help.
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
  • You can cancel the program at any time pressing Ctrl+C. It may print
  • Krzysztof Kurzawski 992376b
    some error lines saying something about KeyboardInterrupt.
    Krzysztof Kurzawski 992376b
    That's ok.
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b

    Download it

    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b

    Note that if you directly click on these hyperlinks, your web browser will

    Krzysztof Kurzawski 992376b
    most likely display the program contents. It's usually better to
    Krzysztof Kurzawski 992376b
    right-click on it and choose the appropriate option, normally called Save
    Krzysztof Kurzawski 992376b
    Target As or Save Link As, depending on the web browser you
    Krzysztof Kurzawski 992376b
    are using.

    Krzysztof Kurzawski 992376b
    Krzysztof Kurzawski 992376b

    2008.01.24

    Krzysztof Kurzawski 992376b
      Krzysztof Kurzawski 992376b
              
    • MD5: 48a7df743398bbfdf2710962000886cb
    • Krzysztof Kurzawski 992376b
              
    • SHA1: 05ab118a157dbeedf7430d8445963c0340188c04
    • Krzysztof Kurzawski 992376b
              
    • SHA256: 6e98f3abfa79a038e578d45441bb6675ac6d4880bae4b801d5125e364e60d5c5
    • Krzysztof Kurzawski 992376b
      Krzysztof Kurzawski 992376b
      Krzysztof Kurzawski 992376b

      Copyright © 2006-2007 Ricardo Garcia Gonzalez

      Krzysztof Kurzawski 992376b
      </body>
      Krzysztof Kurzawski 992376b
      </html>