7 \f[B]youtube-dl\f[] [OPTIONS] URL [URL...]
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.
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 --buffer-size\ SIZE\ \ \ \ \ \ \ size\ of\ download\ buffer\ (e.g.\ 1024\ or\ 16k)\ (default
28 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ is\ 1024)
29 --no-resize-buffer\ \ \ \ \ \ \ do\ not\ automatically\ adjust\ the\ buffer\ size.\ By
30 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ default,\ the\ buffer\ size\ is\ automatically\ resized
31 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ from\ an\ initial\ value\ of\ SIZE.
32 --dump-user-agent\ \ \ \ \ \ \ \ display\ the\ current\ browser\ identification
33 --user-agent\ UA\ \ \ \ \ \ \ \ \ \ specify\ a\ custom\ user\ agent
34 --list-extractors\ \ \ \ \ \ \ \ List\ all\ supported\ extractors\ and\ the\ URLs\ they
35 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ would\ handle
42 --playlist-start\ NUMBER\ \ playlist\ video\ to\ start\ at\ (default\ is\ 1)
43 --playlist-end\ NUMBER\ \ \ \ playlist\ video\ to\ end\ at\ (default\ is\ last)
44 --match-title\ REGEX\ \ \ \ \ \ download\ only\ matching\ titles\ (regex\ or\ caseless
45 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sub-string)
46 --reject-title\ REGEX\ \ \ \ \ skip\ download\ for\ matching\ titles\ (regex\ or
47 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ caseless\ sub-string)
48 --max-downloads\ NUMBER\ \ \ Abort\ after\ downloading\ NUMBER\ files
51 .SS Filesystem Options:
55 -t,\ --title\ \ \ \ \ \ \ \ \ \ \ \ \ \ use\ title\ in\ file\ name
56 --id\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ use\ video\ ID\ in\ file\ name
57 -l,\ --literal\ \ \ \ \ \ \ \ \ \ \ \ [deprecated]\ alias\ of\ --title
58 -A,\ --auto-number\ \ \ \ \ \ \ \ number\ downloaded\ files\ starting\ from\ 00000
59 -o,\ --output\ TEMPLATE\ \ \ \ output\ filename\ template.\ Use\ %(title)s\ to\ get\ the
60 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ title,\ %(uploader)s\ for\ the\ uploader\ name,
61 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %(autonumber)s\ to\ get\ an\ automatically\ incremented
62 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ number,\ %(ext)s\ for\ the\ filename\ extension,
63 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %(upload_date)s\ for\ the\ upload\ date\ (YYYYMMDD),
64 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %(extractor)s\ for\ the\ provider\ (youtube,\ metacafe,
65 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ etc),\ %(id)s\ for\ the\ video\ id\ and\ %%\ for\ a\ literal
66 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ percent.\ Use\ -\ to\ output\ to\ stdout.\ Can\ also\ be
67 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ used\ to\ download\ to\ a\ different\ directory,\ for
68 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example\ with\ -o\ \[aq]/my/downloads/%(uploader)s/%(title
69 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ )s-%(id)s.%(ext)s\[aq]\ .
70 --restrict-filenames\ \ \ \ \ Restrict\ filenames\ to\ only\ ASCII\ characters,\ and
71 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ avoid\ "&"\ and\ spaces\ in\ filenames
72 -a,\ --batch-file\ FILE\ \ \ \ file\ containing\ URLs\ to\ download\ (\[aq]-\[aq]\ for\ stdin)
73 -w,\ --no-overwrites\ \ \ \ \ \ do\ not\ overwrite\ files
74 -c,\ --continue\ \ \ \ \ \ \ \ \ \ \ resume\ partially\ downloaded\ files
75 --no-continue\ \ \ \ \ \ \ \ \ \ \ \ do\ not\ resume\ partially\ downloaded\ files\ (restart
76 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ from\ beginning)
77 --cookies\ FILE\ \ \ \ \ \ \ \ \ \ \ file\ to\ read\ cookies\ from\ and\ dump\ cookie\ jar\ in
78 --no-part\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ use\ .part\ files
79 --no-mtime\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ use\ the\ Last-modified\ header\ to\ set\ the\ file
80 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ modification\ time
81 --write-description\ \ \ \ \ \ write\ video\ description\ to\ a\ .description\ file
82 --write-info-json\ \ \ \ \ \ \ \ write\ video\ metadata\ to\ a\ .info.json\ file
85 .SS Verbosity / Simulation Options:
89 -q,\ --quiet\ \ \ \ \ \ \ \ \ \ \ \ \ \ activates\ quiet\ mode
90 -s,\ --simulate\ \ \ \ \ \ \ \ \ \ \ do\ not\ download\ the\ video\ and\ do\ not\ write\ anything
91 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ to\ disk
92 --skip-download\ \ \ \ \ \ \ \ \ \ do\ not\ download\ the\ video
93 -g,\ --get-url\ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ URL
94 -e,\ --get-title\ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ title
95 --get-thumbnail\ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ thumbnail\ URL
96 --get-description\ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ video\ description
97 --get-filename\ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ output\ filename
98 --get-format\ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ output\ format
99 --no-progress\ \ \ \ \ \ \ \ \ \ \ \ do\ not\ print\ progress\ bar
100 --console-title\ \ \ \ \ \ \ \ \ \ display\ progress\ in\ console\ titlebar
101 -v,\ --verbose\ \ \ \ \ \ \ \ \ \ \ \ print\ various\ debugging\ information
104 .SS Video Format Options:
108 -f,\ --format\ FORMAT\ \ \ \ \ \ video\ format\ code
109 --all-formats\ \ \ \ \ \ \ \ \ \ \ \ download\ all\ available\ video\ formats
110 --prefer-free-formats\ \ \ \ prefer\ free\ video\ formats\ unless\ a\ specific\ one\ is
111 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ requested
112 --max-quality\ FORMAT\ \ \ \ \ highest\ quality\ format\ to\ download
113 -F,\ --list-formats\ \ \ \ \ \ \ list\ all\ available\ formats\ (currently\ youtube\ only)
114 --write-srt\ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ video\ closed\ captions\ to\ a\ .srt\ file
115 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (currently\ youtube\ only)
116 --srt-lang\ LANG\ \ \ \ \ \ \ \ \ \ language\ of\ the\ closed\ captions\ to\ download
117 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (optional)\ use\ IETF\ language\ tags\ like\ \[aq]en\[aq]
120 .SS Authentication Options:
124 -u,\ --username\ USERNAME\ \ account\ username
125 -p,\ --password\ PASSWORD\ \ account\ password
126 -n,\ --netrc\ \ \ \ \ \ \ \ \ \ \ \ \ \ use\ .netrc\ authentication\ data
129 .SS Post-processing Options:
133 -x,\ --extract-audio\ \ \ \ \ \ convert\ video\ files\ to\ audio-only\ files\ (requires
134 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ffmpeg\ or\ avconv\ and\ ffprobe\ or\ avprobe)
135 --audio-format\ FORMAT\ \ \ \ "best",\ "aac",\ "vorbis",\ "mp3",\ "m4a",\ or\ "wav";
136 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ best\ by\ default
137 --audio-quality\ QUALITY\ \ ffmpeg/avconv\ audio\ quality\ specification,\ insert\ a
138 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ value\ between\ 0\ (better)\ and\ 9\ (worse)\ for\ VBR\ or\ a
139 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specific\ bitrate\ like\ 128K\ (default\ 5)
140 -k,\ --keep-video\ \ \ \ \ \ \ \ \ keeps\ the\ video\ file\ on\ disk\ after\ the\ post-
141 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ processing;\ the\ video\ is\ erased\ by\ default
146 You can configure youtube-dl by placing default arguments (such as
147 \f[C]--extract-audio\ --no-mtime\f[] to always extract the audio and not
148 copy the mtime) into \f[C]/etc/youtube-dl.conf\f[] and/or
149 \f[C]~/.local/config/youtube-dl.conf\f[].
152 The \f[C]-o\f[] option allows users to indicate a template for the
154 The basic usage is not to set any template arguments when downloading a
156 \f[C]youtube-dl\ -o\ funny_video.flv\ "http://some/video"\f[].
157 However, it may contain special sequences that will be replaced when
158 downloading each video.
159 The special sequences have the format \f[C]%(NAME)s\f[].
160 To clarify, that is a percent symbol followed by a name in parenthesis,
161 followed by a lowercase S.
164 \f[C]id\f[]: The sequence will be replaced by the video identifier.
166 \f[C]url\f[]: The sequence will be replaced by the video URL.
168 \f[C]uploader\f[]: The sequence will be replaced by the nickname of the
169 person who uploaded the video.
171 \f[C]upload_date\f[]: The sequence will be replaced by the upload date
174 \f[C]title\f[]: The sequence will be replaced by the video title.
176 \f[C]ext\f[]: The sequence will be replaced by the appropriate extension
179 \f[C]epoch\f[]: The sequence will be replaced by the Unix epoch when
182 \f[C]autonumber\f[]: The sequence will be replaced by a five-digit
183 number that will be increased with each download, starting at zero.
185 The current default template is \f[C]%(id)s.%(ext)s\f[], but that will
186 be switchted to \f[C]%(title)s-%(id)s.%(ext)s\f[] (which can be
187 requested with \f[C]-t\f[] at the moment).
189 In some cases, you don\[aq]t want special characters such as 中, spaces,
190 or &, such as when transferring the downloaded filename to a Windows
191 system or the filename through an 8bit-unsafe channel.
192 In these cases, add the \f[C]--restrict-filenames\f[] flag to get a
197 $\ youtube-dl\ --get-filename\ -o\ "%(title)s.%(ext)s"\ BaW_jenozKc
198 youtube-dl\ test\ video\ \[aq]\[aq]_ä↭𝕐.mp4\ \ \ \ #\ All\ kinds\ of\ weird\ characters
199 $\ youtube-dl\ --get-filename\ -o\ "%(title)s.%(ext)s"\ BaW_jenozKc\ --restrict-filenames
200 youtube-dl_test_video_.mp4\ \ \ \ \ \ \ \ \ \ #\ A\ simple\ file\ name
204 .SS Can you please put the -b option back?
206 Most people asking this question are not aware that youtube-dl now
207 defaults to downloading the highest available quality as reported by
208 YouTube, which will be 1080p or 720p in some cases, so you no longer
210 For some specific videos, maybe YouTube does not report them to be
211 available in a specific high quality format you\[aq]\[aq]re interested
213 In that case, simply request it with the -f option and youtube-dl will
215 .SS I get HTTP error 402 when trying to download a video. What\[aq]s
218 Apparently YouTube requires you to pass a CAPTCHA test if you download
220 We\[aq]\[aq]re considering to provide a way to let you solve the
221 CAPTCHA (https://github.com/rg3/youtube-dl/issues/154), but at the
222 moment, your best course of action is pointing a webbrowser to the
223 youtube URL, solving the CAPTCHA, and restart youtube-dl.
224 .SS I have downloaded a video but how can I play it?
226 Once the video is fully downloaded, use any video player, such as
227 vlc (http://www.videolan.org) or mplayer (http://www.mplayerhq.hu/).
228 .SS The links provided by youtube-dl -g are not working anymore
230 The URLs youtube-dl outputs require the downloader to have the correct
232 Use the \f[C]--cookies\f[] option to write the required cookies into a
233 file, and advise your downloader to read cookies from that file.
234 Some sites also require a common user agent to be used, use
235 \f[C]--dump-user-agent\f[] to see the one in use by youtube-dl.
236 .SS ERROR: no fmt_url_map or conn information found in video info
238 youtube has switched to a new video info format in July 2011 which is
239 not supported by old versions of youtube-dl.
240 You can update youtube-dl with \f[C]sudo\ youtube-dl\ --update\f[].
241 .SS ERROR: unable to download video
243 youtube requires an additional signature since September 2012 which is
244 not supported by old versions of youtube-dl.
245 You can update youtube-dl with \f[C]sudo\ youtube-dl\ --update\f[].
246 .SS SyntaxError: Non-ASCII character
252 File\ "youtube-dl",\ line\ 2
253 SyntaxError:\ Non-ASCII\ character\ \[aq]\\x93\[aq]\ ...
257 means you\[aq]re using an outdated version of Python.
258 Please update to Python 2.6 or 2.7.
259 .SS What is this binary file? Where has the code gone?
261 Since June 2012 (#342) youtube-dl is packed as an executable zipfile,
262 simply unzip it (might need renaming to \f[C]youtube-dl.zip\f[] first on
263 some systems) or clone the git repository, as laid out above.
264 If you modify the code, you can run it by executing the
265 \f[C]__main__.py\f[] file.
266 To recompile the executable, run \f[C]make\ youtube-dl\f[].
267 .SS The exe throws a \f[I]Runtime error from Visual C++\f[]
269 To run the exe you need to install first the Microsoft Visual C++ 2008
271 Package (http://www.microsoft.com/en-us/download/details.aspx?id=29).
274 youtube-dl is released into the public domain by the copyright holders.
276 This README file was originally written by Daniel Bolton
277 (<https://github.com/dbbolton>) and is likewise released into the public
281 Bugs and suggestions should be reported at:
282 <https://github.com/rg3/youtube-dl/issues>
286 Your exact command line, like
287 \f[C]youtube-dl\ -t\ "http://www.youtube.com/watch?v=uHlDtZ6Oc3s&feature=channel_video_title"\f[].
288 A common mistake is not to escape the \f[C]&\f[].
289 Putting URLs in quotes should solve this problem.
291 The output of \f[C]youtube-dl\ --version\f[]
293 The output of \f[C]python\ --version\f[]
295 The name and version of your Operating System ("Ubuntu 11.04 x64" or
296 "Windows 7 x64" is usually enough).
298 For discussions, join us in the irc channel #youtube-dl on freenode.