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.

301 lines
13 KiB

12 years ago
  1. .TH youtube-dl 1 ""
  2. .SH NAME
  3. .PP
  4. youtube-dl
  5. .SH SYNOPSIS
  6. .PP
  7. \f[B]youtube-dl\f[] [OPTIONS] URL [URL...]
  8. .SH DESCRIPTION
  9. .PP
  10. \f[B]youtube-dl\f[] is a small command-line program to download videos
  11. from YouTube.com and a few more sites.
  12. It requires the Python interpreter, version 2.x (x being at least 6),
  13. and it is not platform specific.
  14. It should work in your Unix box, in Windows or in Mac OS X.
  15. It is released to the public domain, which means you can modify it,
  16. redistribute it or use it however you like.
  17. .SH OPTIONS
  18. .IP
  19. .nf
  20. \f[C]
  21. -h,\ --help\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ print\ this\ help\ text\ and\ exit
  22. --version\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ print\ program\ version\ and\ exit
  23. -U,\ --update\ \ \ \ \ \ \ \ \ \ \ \ \ update\ this\ program\ to\ latest\ version
  24. -i,\ --ignore-errors\ \ \ \ \ \ continue\ on\ download\ errors
  25. -r,\ --rate-limit\ LIMIT\ \ \ download\ rate\ limit\ (e.g.\ 50k\ or\ 44.6m)
  26. -R,\ --retries\ RETRIES\ \ \ \ number\ of\ retries\ (default\ is\ 10)
  27. --dump-user-agent\ \ \ \ \ \ \ \ display\ the\ current\ browser\ identification
  28. --user-agent\ UA\ \ \ \ \ \ \ \ \ \ specify\ a\ custom\ user\ agent
  29. --list-extractors\ \ \ \ \ \ \ \ List\ all\ supported\ extractors\ and\ the\ URLs\ they
  30. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ would\ handle
  31. \f[]
  32. .fi
  33. .SS Video Selection:
  34. .IP
  35. .nf
  36. \f[C]
  37. --playlist-start\ NUMBER\ \ playlist\ video\ to\ start\ at\ (default\ is\ 1)
  38. --playlist-end\ NUMBER\ \ \ \ playlist\ video\ to\ end\ at\ (default\ is\ last)
  39. --match-title\ REGEX\ \ \ \ \ \ download\ only\ matching\ titles\ (regex\ or\ caseless
  40. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sub-string)
  41. --reject-title\ REGEX\ \ \ \ \ skip\ download\ for\ matching\ titles\ (regex\ or
  42. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ caseless\ sub-string)
  43. --max-downloads\ NUMBER\ \ \ Abort\ after\ downloading\ NUMBER\ files
  44. \f[]
  45. .fi
  46. .SS Filesystem Options:
  47. .IP
  48. .nf
  49. \f[C]
  50. -t,\ --title\ \ \ \ \ \ \ \ \ \ \ \ \ \ use\ title\ in\ file\ name
  51. --id\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ use\ video\ ID\ in\ file\ name
  52. -l,\ --literal\ \ \ \ \ \ \ \ \ \ \ \ [deprecated]\ alias\ of\ --title
  53. -A,\ --auto-number\ \ \ \ \ \ \ \ number\ downloaded\ files\ starting\ from\ 00000
  54. -o,\ --output\ TEMPLATE\ \ \ \ output\ filename\ template.\ Use\ %(title)s\ to\ get\ the
  55. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ title,\ %(uploader)s\ for\ the\ uploader\ name,
  56. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %(autonumber)s\ to\ get\ an\ automatically\ incremented
  57. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ number,\ %(ext)s\ for\ the\ filename\ extension,
  58. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %(upload_date)s\ for\ the\ upload\ date\ (YYYYMMDD),
  59. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %(extractor)s\ for\ the\ provider\ (youtube,\ metacafe,
  60. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ etc),\ %(id)s\ for\ the\ video\ id\ and\ %%\ for\ a\ literal
  61. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ percent.\ Use\ -\ to\ output\ to\ stdout.
  62. --restrict-filenames\ \ \ \ \ Restrict\ filenames\ to\ only\ ASCII\ characters,\ and
  63. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ avoid\ "&"\ and\ spaces\ in\ filenames
  64. -a,\ --batch-file\ FILE\ \ \ \ file\ containing\ URLs\ to\ download\ (\[aq]-\[aq]\ for\ stdin)
  65. -w,\ --no-overwrites\ \ \ \ \ \ do\ not\ overwrite\ files
  66. -c,\ --continue\ \ \ \ \ \ \ \ \ \ \ resume\ partially\ downloaded\ files
  67. --no-continue\ \ \ \ \ \ \ \ \ \ \ \ do\ not\ resume\ partially\ downloaded\ files\ (restart
  68. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ from\ beginning)
  69. --cookies\ FILE\ \ \ \ \ \ \ \ \ \ \ file\ to\ read\ cookies\ from\ and\ dump\ cookie\ jar\ in
  70. --no-part\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ use\ .part\ files
  71. --no-mtime\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ use\ the\ Last-modified\ header\ to\ set\ the\ file
  72. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ modification\ time
  73. --write-description\ \ \ \ \ \ write\ video\ description\ to\ a\ .description\ file
  74. --write-info-json\ \ \ \ \ \ \ \ write\ video\ metadata\ to\ a\ .info.json\ file
  75. \f[]
  76. .fi
  77. .SS Verbosity / Simulation Options:
  78. .IP
  79. .nf
  80. \f[C]
  81. -q,\ --quiet\ \ \ \ \ \ \ \ \ \ \ \ \ \ activates\ quiet\ mode
  82. -s,\ --simulate\ \ \ \ \ \ \ \ \ \ \ do\ not\ download\ the\ video\ and\ do\ not\ write\ anything
  83. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ to\ disk
  84. --skip-download\ \ \ \ \ \ \ \ \ \ do\ not\ download\ the\ video
  85. -g,\ --get-url\ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ URL
  86. -e,\ --get-title\ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ title
  87. --get-thumbnail\ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ thumbnail\ URL
  88. --get-description\ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ video\ description
  89. --get-filename\ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ output\ filename
  90. --get-format\ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ output\ format
  91. --no-progress\ \ \ \ \ \ \ \ \ \ \ \ do\ not\ print\ progress\ bar
  92. --console-title\ \ \ \ \ \ \ \ \ \ display\ progress\ in\ console\ titlebar
  93. -v,\ --verbose\ \ \ \ \ \ \ \ \ \ \ \ print\ various\ debugging\ information
  94. \f[]
  95. .fi
  96. .SS Video Format Options:
  97. .IP
  98. .nf
  99. \f[C]
  100. -f,\ --format\ FORMAT\ \ \ \ \ \ video\ format\ code
  101. --all-formats\ \ \ \ \ \ \ \ \ \ \ \ download\ all\ available\ video\ formats
  102. --prefer-free-formats\ \ \ \ prefer\ free\ video\ formats\ unless\ a\ specific\ one\ is
  103. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ requested
  104. --max-quality\ FORMAT\ \ \ \ \ highest\ quality\ format\ to\ download
  105. -F,\ --list-formats\ \ \ \ \ \ \ list\ all\ available\ formats\ (currently\ youtube\ only)
  106. --write-srt\ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ video\ closed\ captions\ to\ a\ .srt\ file
  107. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (currently\ youtube\ only)
  108. --srt-lang\ LANG\ \ \ \ \ \ \ \ \ \ language\ of\ the\ closed\ captions\ to\ download
  109. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (optional)\ use\ IETF\ language\ tags\ like\ \[aq]en\[aq]
  110. \f[]
  111. .fi
  112. .SS Authentication Options:
  113. .IP
  114. .nf
  115. \f[C]
  116. -u,\ --username\ USERNAME\ \ account\ username
  117. -p,\ --password\ PASSWORD\ \ account\ password
  118. -n,\ --netrc\ \ \ \ \ \ \ \ \ \ \ \ \ \ use\ .netrc\ authentication\ data
  119. \f[]
  120. .fi
  121. .SS Post-processing Options:
  122. .IP
  123. .nf
  124. \f[C]
  125. -x,\ --extract-audio\ \ \ \ \ \ convert\ video\ files\ to\ audio-only\ files\ (requires
  126. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ffmpeg\ or\ avconv\ and\ ffprobe\ or\ avprobe)
  127. --audio-format\ FORMAT\ \ \ \ "best",\ "aac",\ "vorbis",\ "mp3",\ "m4a",\ or\ "wav";
  128. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ best\ by\ default
  129. --audio-quality\ QUALITY\ \ ffmpeg/avconv\ audio\ quality\ specification,\ insert\ a
  130. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ value\ between\ 0\ (better)\ and\ 9\ (worse)\ for\ VBR\ or\ a
  131. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specific\ bitrate\ like\ 128K\ (default\ 5)
  132. -k,\ --keep-video\ \ \ \ \ \ \ \ \ keeps\ the\ video\ file\ on\ disk\ after\ the\ post-
  133. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ processing;\ the\ video\ is\ erased\ by\ default
  134. \f[]
  135. .fi
  136. .SH CONFIGURATION
  137. .PP
  138. You can configure youtube-dl by placing default arguments (such as
  139. \f[C]--extract-audio\ --no-mtime\f[] to always extract the audio and not
  140. copy the mtime) into \f[C]/etc/youtube-dl.conf\f[] and/or
  141. \f[C]~/.local/config/youtube-dl.conf\f[].
  142. .SH OUTPUT TEMPLATE
  143. .PP
  144. The \f[C]-o\f[] option allows users to indicate a template for the
  145. output file names.
  146. The basic usage is not to set any template arguments when downloading a
  147. single file, like in
  148. \f[C]youtube-dl\ -o\ funny_video.flv\ "http://some/video"\f[].
  149. However, it may contain special sequences that will be replaced when
  150. downloading each video.
  151. The special sequences have the format \f[C]%(NAME)s\f[].
  152. To clarify, that is a percent symbol followed by a name in parenthesis,
  153. followed by a lowercase S.
  154. Allowed names are:
  155. .IP \[bu] 2
  156. \f[C]id\f[]: The sequence will be replaced by the video identifier.
  157. .IP \[bu] 2
  158. \f[C]url\f[]: The sequence will be replaced by the video URL.
  159. .IP \[bu] 2
  160. \f[C]uploader\f[]: The sequence will be replaced by the nickname of the
  161. person who uploaded the video.
  162. .IP \[bu] 2
  163. \f[C]upload_date\f[]: The sequence will be replaced by the upload date
  164. in YYYYMMDD format.
  165. .IP \[bu] 2
  166. \f[C]title\f[]: The sequence will be replaced by the video title.
  167. .IP \[bu] 2
  168. \f[C]ext\f[]: The sequence will be replaced by the appropriate extension
  169. (like flv or mp4).
  170. .IP \[bu] 2
  171. \f[C]epoch\f[]: The sequence will be replaced by the Unix epoch when
  172. creating the file.
  173. .IP \[bu] 2
  174. \f[C]autonumber\f[]: The sequence will be replaced by a five-digit
  175. number that will be increased with each download, starting at zero.
  176. .PP
  177. The current default template is \f[C]%(id)s.%(ext)s\f[], but that will
  178. be switchted to \f[C]%(title)s-%(id)s.%(ext)s\f[] (which can be
  179. requested with \f[C]-t\f[] at the moment).
  180. .PP
  181. In some cases, you don\[aq]t want special characters such as 中, spaces,
  182. or &, such as when transferring the downloaded filename to a Windows
  183. system or the filename through an 8bit-unsafe channel.
  184. In these cases, add the \f[C]--restrict-filenames\f[] flag to get a
  185. shorter title:
  186. .IP
  187. .nf
  188. \f[C]
  189. $\ youtube-dl\ --get-filename\ -o\ "%(title)s.%(ext)s"\ BaW_jenozKc
  190. youtube-dl\ test\ video\ \[aq]\[aq]_ä↭𝕐.mp4\ \ \ \ #\ All\ kinds\ of\ weird\ characters
  191. $\ youtube-dl\ --get-filename\ -o\ "%(title)s.%(ext)s"\ BaW_jenozKc\ --restrict-filenames
  192. youtube-dl_test_video_.mp4\ \ \ \ \ \ \ \ \ \ #\ A\ simple\ file\ name
  193. \f[]
  194. .fi
  195. .SH FAQ
  196. .SS Can you please put the -b option back?
  197. .PP
  198. Most people asking this question are not aware that youtube-dl now
  199. defaults to downloading the highest available quality as reported by
  200. YouTube, which will be 1080p or 720p in some cases, so you no longer
  201. need the -b option.
  202. For some specific videos, maybe YouTube does not report them to be
  203. available in a specific high quality format you\[aq]\[aq]re interested
  204. in.
  205. In that case, simply request it with the -f option and youtube-dl will
  206. try to download it.
  207. .SS I get HTTP error 402 when trying to download a video. What\[aq]s
  208. this?
  209. .PP
  210. Apparently YouTube requires you to pass a CAPTCHA test if you download
  211. too much.
  212. We\[aq]\[aq]re considering to provide a way to let you solve the
  213. CAPTCHA (https://github.com/rg3/youtube-dl/issues/154), but at the
  214. moment, your best course of action is pointing a webbrowser to the
  215. youtube URL, solving the CAPTCHA, and restart youtube-dl.
  216. .SS I have downloaded a video but how can I play it?
  217. .PP
  218. Once the video is fully downloaded, use any video player, such as
  219. vlc (http://www.videolan.org) or mplayer (http://www.mplayerhq.hu/).
  220. .SS The links provided by youtube-dl -g are not working anymore
  221. .PP
  222. The URLs youtube-dl outputs require the downloader to have the correct
  223. cookies.
  224. Use the \f[C]--cookies\f[] option to write the required cookies into a
  225. file, and advise your downloader to read cookies from that file.
  226. Some sites also require a common user agent to be used, use
  227. \f[C]--dump-user-agent\f[] to see the one in use by youtube-dl.
  228. .SS ERROR: no fmt_url_map or conn information found in video info
  229. .PP
  230. youtube has switched to a new video info format in July 2011 which is
  231. not supported by old versions of youtube-dl.
  232. You can update youtube-dl with \f[C]sudo\ youtube-dl\ --update\f[].
  233. .SS ERROR: unable to download video
  234. .PP
  235. youtube requires an additional signature since September 2012 which is
  236. not supported by old versions of youtube-dl.
  237. You can update youtube-dl with \f[C]sudo\ youtube-dl\ --update\f[].
  238. .SS SyntaxError: Non-ASCII character
  239. .PP
  240. The error
  241. .IP
  242. .nf
  243. \f[C]
  244. File\ "youtube-dl",\ line\ 2
  245. SyntaxError:\ Non-ASCII\ character\ \[aq]\\x93\[aq]\ ...
  246. \f[]
  247. .fi
  248. .PP
  249. means you\[aq]re using an outdated version of Python.
  250. Please update to Python 2.6 or 2.7.
  251. .PP
  252. To run youtube-dl under Python 2.5, you\[aq]ll have to manually check it
  253. out like this:
  254. .IP
  255. .nf
  256. \f[C]
  257. git\ clone\ git://github.com/rg3/youtube-dl.git
  258. cd\ youtube-dl
  259. python\ -m\ youtube_dl\ --help
  260. \f[]
  261. .fi
  262. .PP
  263. Please note that Python 2.5 is not supported anymore.
  264. .SS What is this binary file? Where has the code gone?
  265. .PP
  266. Since June 2012 (#342) youtube-dl is packed as an executable zipfile,
  267. simply unzip it (might need renaming to \f[C]youtube-dl.zip\f[] first on
  268. some systems) or clone the git repository, as laid out above.
  269. If you modify the code, you can run it by executing the
  270. \f[C]__main__.py\f[] file.
  271. To recompile the executable, run \f[C]make\ youtube-dl\f[].
  272. .SS The exe throws a \f[I]Runtime error from Visual C++\f[]
  273. .PP
  274. To run the exe you need to install first the Microsoft Visual C++ 2008
  275. Redistributable
  276. Package (http://www.microsoft.com/en-us/download/details.aspx?id=29).
  277. .SH COPYRIGHT
  278. .PP
  279. youtube-dl is released into the public domain by the copyright holders.
  280. .PP
  281. This README file was originally written by Daniel Bolton
  282. (<https://github.com/dbbolton>) and is likewise released into the public
  283. domain.
  284. .SH BUGS
  285. .PP
  286. Bugs and suggestions should be reported at:
  287. <https://github.com/rg3/youtube-dl/issues>
  288. .PP
  289. Please include:
  290. .IP \[bu] 2
  291. Your exact command line, like
  292. \f[C]youtube-dl\ -t\ "http://www.youtube.com/watch?v=uHlDtZ6Oc3s&feature=channel_video_title"\f[].
  293. A common mistake is not to escape the \f[C]&\f[].
  294. Putting URLs in quotes should solve this problem.
  295. .IP \[bu] 2
  296. The output of \f[C]youtube-dl\ --version\f[]
  297. .IP \[bu] 2
  298. The output of \f[C]python\ --version\f[]
  299. .IP \[bu] 2
  300. The name and version of your Operating System ("Ubuntu 11.04 x64" or
  301. "Windows 7 x64" is usually enough).