You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

229 lines
9.2 KiB

  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5. <head>
  6. <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
  7. <title>youtube-dl: Download videos from YouTube.com</title>
  8. <style type="text/css"><!--
  9. body {
  10. font-family: sans-serif;
  11. font-size: small;
  12. }
  13. h1 {
  14. text-align: center;
  15. text-decoration: underline;
  16. color: #006699;
  17. }
  18. h2 {
  19. color: #006699;
  20. }
  21. p {
  22. text-align: justify;
  23. margin-left: 5%;
  24. margin-right: 5%;
  25. }
  26. ul {
  27. margin-left: 5%;
  28. margin-right: 5%;
  29. list-style-type: square;
  30. }
  31. li {
  32. margin-bottom: 0.5ex;
  33. }
  34. .smallnote {
  35. font-size: x-small;
  36. text-align: center;
  37. }
  38. --></style>
  39. </head>
  40. <body>
  41. <h1>youtube-dl: Download videos from YouTube.com</h1>
  42. <p class="smallnote">(and more...)</p>
  43. <h2>What is it?</h2>
  44. <p><em>youtube-dl</em> is a small command-line program to download videos
  45. from YouTube.com. It requires the <a href="http://www.python.org/">Python
  46. interpreter</a>, version 2.4 or later, and it's not platform specific.
  47. It should work in your Unix box, in Windows or in Mac OS X. The latest version
  48. is <strong>@PROGRAM_VERSION@</strong>. It's released to the public domain,
  49. which means you can modify it, redistribute it or use it however you like.</p>
  50. <p>I'll try to keep it updated if YouTube.com changes the way you access
  51. their videos. After all, it's a simple and short program. However, I can't
  52. guarantee anything. If you detect it stops working, check for new versions
  53. and/or inform me about the problem, indicating the program version you
  54. are using. If the program stops working and I can't solve the problem but
  55. you have a solution, I'd like to know it. If that happens and you feel you
  56. can maintain the program yourself, tell me. My contact information is
  57. at <a href="http://freshmeat.net/~rg3/">freshmeat.net</a>.</p>
  58. <p>Thanks for all the feedback received so far. I'm glad people find my
  59. program useful.</p>
  60. <h2>Usage instructions</h2>
  61. <p>In Windows, once you have installed the Python interpreter, save the
  62. program with the <em>.py</em> extension and put it somewhere in the PATH.
  63. Try to follow the
  64. <a href="http://rg03.wordpress.com/youtube-dl-under-windows-xp/">guide to
  65. install youtube-dl under Windows XP</a>.</p>
  66. <p>In Unix, download it, give it execution permission and copy it to one
  67. of the PATH directories (typically, <em>/usr/local/bin</em>).</p>
  68. <p>After that, you should be able to call it from the command line as
  69. <em>youtube-dl</em> or <em>youtube-dl.py</em>. I will use <em>youtube-dl</em>
  70. in the following examples. Usage instructions are easy. Use <em>youtube-dl</em>
  71. followed by a video URL or identifier. Example: <em>youtube-dl
  72. "http://www.youtube.com/watch?v=foobar"</em>. The video will be saved
  73. to the file <em>foobar.flv</em> in that example. As YouTube.com
  74. videos are in Flash Video format, their extension should be <em>flv</em>.
  75. In Linux and other unices, video players using a recent version of
  76. <em>ffmpeg</em> can play them. That includes MPlayer, VLC, etc. Those two
  77. work under Windows and other platforms, but you could also get a
  78. specific FLV player of your taste.</p>
  79. <p>If you try to run the program and you receive an error message containing the
  80. keyword <em>SyntaxError</em> near the end, it means your Python interpreter
  81. is too old.</p>
  82. <h2>More usage tips</h2>
  83. <ul>
  84. <li>You can change the file name of the video using the -o option, like in
  85. <em>youtube-dl -o vid.flv "http://www.youtube.com/watch?v=foobar"</em>.
  86. Read the <a href="#otpl">Output template</a> section for more details on
  87. this.</li>
  88. <li>Some videos require an account to be downloaded, mostly because they're
  89. flagged as mature content. You can pass the program a username and password
  90. for a YouTube.com account with the -u and -p options, like <em>youtube-dl
  91. -u myusername -p mypassword "http://www.youtube.com/watch?v=foobar"</em>.</li>
  92. <li>The account data can also be read from the user .netrc file by indicating
  93. the -n or --netrc option. The machine name is <em>youtube</em> in that
  94. case.</li>
  95. <li>The <em>simulate mode</em> (activated with -s or --simulate) can be used
  96. to just get the real video URL and use it with a download manager if you
  97. prefer that option.</li>
  98. <li>The <em>quiet mode</em> (activated with -q or --quiet) can be used to
  99. supress all output messages. This allows, in systems featuring /dev/stdout
  100. and other similar special files, outputting the video data to standard output
  101. in order to pipe it to another program without interferences.</li>
  102. <li>The program can be told to simply print the final video URL to standard
  103. output using the -g or --get-url option.</li>
  104. <li>In a similar line, the -e or --get-title option tells the program to print
  105. the video title.</li>
  106. <li>The default filename is <em>video_id.flv</em>. But you can also use the
  107. video title in the filename with the -t or --title option, or preserve the
  108. literal title in the filename with the -l or --literal option.</li>
  109. <li>You can make the program append <em>&amp;fmt=something</em> to the URL
  110. by using the -f or --format option. This makes it possible to download high
  111. quality versions of the videos when available.</li>
  112. <li>The -b or --best-quality option is an alias for -f 18.</li>
  113. <li>The -m or --mobile-version option is an alias for -f 17.</li>
  114. <li>Normally, the program will stop on the first error, but you can tell it
  115. to attempt to download every video with the -i or --ignore-errors option.</li>
  116. <li>The -a or --batch-file option lets you specify a file to read URLs from.
  117. The file must contain one URL per line.</li>
  118. <li>The program can be told not to overwrite existing files using the -w or
  119. --no-overwrites option.</li>
  120. <li>For YouTube, you can also use the URL of a playlist, and it will download
  121. all the videos in that playlist.</li>
  122. <li>For YouTube, you can also use the special word <em>ytsearch</em> to
  123. download search results. With <em>ytsearch</em> it will download the
  124. first search result. With <em>ytsearchN</em>, where N is a number, it
  125. will download the first N results. With <em>ytsearchall</em> it will
  126. download every result for that search. In most systems you'll need to
  127. use quotes for multiple words. Example: <em>youtube-dl "ytsearch3:cute
  128. kittens"</em>.
  129. <li><em>youtube-dl</em> honors the <em>http_proxy</em> environment variable
  130. if you want to use a proxy. Set it to something like
  131. <em>http://proxy.example.com:8080</em>, and do not leave the <em>http://</em>
  132. prefix out.</li>
  133. <li>You can get the program version by calling it as <em>youtube-dl
  134. -v</em> or <em>youtube-dl --version</em>.</li>
  135. <li>For usage instructions, use <em>youtube-dl -h</em> or <em>youtube-dl
  136. --help.</em></li>
  137. <li>You can cancel the program at any time pressing Ctrl+C. It may print
  138. some error lines saying something about <em>KeyboardInterrupt</em>.
  139. That's ok.</li>
  140. </ul>
  141. <h2>Download it</h2>
  142. <p>Note that if you directly click on these hyperlinks, your web browser will
  143. most likely display the program contents. It's usually better to
  144. right-click on it and choose the appropriate option, normally called <em>Save
  145. Target As</em> or <em>Save Link As</em>, depending on the web browser you
  146. are using.</p>
  147. <p><a href="youtube-dl">@PROGRAM_VERSION@</a></p>
  148. <ul>
  149. <li><strong>MD5</strong>: @PROGRAM_MD5SUM@</li>
  150. <li><strong>SHA1</strong>: @PROGRAM_SHA1SUM@</li>
  151. <li><strong>SHA256</strong>: @PROGRAM_SHA256SUM@</li>
  152. </ul>
  153. <h2 id="otpl">Output template</h2>
  154. <p>The -o option allows users to indicate a template for the output file names.
  155. The basic usage is not to set any template arguments when downloading a single
  156. file, like in <em>youtube-dl -o funny_video.flv 'http://some/video'</em>.
  157. However, it may contain special sequences that will be replaced when
  158. downloading each video. The special sequences have the format
  159. <strong>%(NAME)s</strong>. To clarify, that's a percent symbol followed by a
  160. name in parenthesis, followed by a lowercase S. Allowed names are:</p>
  161. <ul>
  162. <li><em>id</em>: The sequence will be replaced by the video identifier.</li>
  163. <li><em>url</em>: The sequence will be replaced by the video URL.</li>
  164. <li><em>uploader</em>: The sequence will be replaced by the nickname of the
  165. person who uploaded the video.</li>
  166. <li><em>title</em>: The sequence will be replaced by the literal video
  167. title.</li>
  168. <li><em>stitle</em>: The sequence will be replaced by a simplified video
  169. title, restricted to alphanumeric characters and dashes.</li>
  170. <li><em>ext</em>: The sequence will be replaced by the appropriate
  171. extension (like <em>flv</em> or <em>mp4</em>).</li>
  172. </ul>
  173. <p>As you may have guessed, the default template is <em>%(id)s.%(ext)s</em>.
  174. When some command line options are used, it's replaced by other templates like
  175. <em>%(title)s-%(id)s.%(ext)s</em>. You can specify your own.</p>
  176. <h2>Authors</h2>
  177. <ul>
  178. <li>Ricardo Garcia Gonzalez: program core, YouTube.com InfoExtractor,
  179. metacafe.com InfoExtractor and YouTube playlist InfoExtractor.</li>
  180. <li>Danny Colligan: YouTube search InfoExtractor, ideas and patches.</li>
  181. <li>Many other people contributing patches, code, ideas and kind messages. Too
  182. many to be listed here. You know who you are. Thank you very much.</li>
  183. </ul>
  184. <p class="smallnote">Copyright &copy; 2006-2007 Ricardo Garcia Gonzalez</p>
  185. </body>
  186. </html>