Document configuration
[youtube-dl] / youtube-dl.1
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 -a,\ --batch-file\ FILE\ \ \ \ file\ containing\ URLs\ to\ download\ (\[aq]-\[aq]\ for\ stdin)
63 -w,\ --no-overwrites\ \ \ \ \ \ do\ not\ overwrite\ files
64 -c,\ --continue\ \ \ \ \ \ \ \ \ \ \ resume\ partially\ downloaded\ files
65 --no-continue\ \ \ \ \ \ \ \ \ \ \ \ do\ not\ resume\ partially\ downloaded\ files\ (restart
66 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ from\ beginning)
67 --cookies\ FILE\ \ \ \ \ \ \ \ \ \ \ file\ to\ read\ cookies\ from\ and\ dump\ cookie\ jar\ in
68 --no-part\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ use\ .part\ files
69 --no-mtime\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ use\ the\ Last-modified\ header\ to\ set\ the\ file
70 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ modification\ time
71 --write-description\ \ \ \ \ \ write\ video\ description\ to\ a\ .description\ file
72 --write-info-json\ \ \ \ \ \ \ \ write\ video\ metadata\ to\ a\ .info.json\ file
73 \f[]
74 .fi
75 .SS Verbosity / Simulation Options:
76 .IP
77 .nf
78 \f[C]
79 -q,\ --quiet\ \ \ \ \ \ \ \ \ \ \ \ \ \ activates\ quiet\ mode
80 -s,\ --simulate\ \ \ \ \ \ \ \ \ \ \ do\ not\ download\ the\ video\ and\ do\ not\ write\ anything
81 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ to\ disk
82 --skip-download\ \ \ \ \ \ \ \ \ \ do\ not\ download\ the\ video
83 -g,\ --get-url\ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ URL
84 -e,\ --get-title\ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ title
85 --get-thumbnail\ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ thumbnail\ URL
86 --get-description\ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ video\ description
87 --get-filename\ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ output\ filename
88 --get-format\ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ output\ format
89 --no-progress\ \ \ \ \ \ \ \ \ \ \ \ do\ not\ print\ progress\ bar
90 --console-title\ \ \ \ \ \ \ \ \ \ display\ progress\ in\ console\ titlebar
91 -v,\ --verbose\ \ \ \ \ \ \ \ \ \ \ \ print\ various\ debugging\ information
92 \f[]
93 .fi
94 .SS Video Format Options:
95 .IP
96 .nf
97 \f[C]
98 -f,\ --format\ FORMAT\ \ \ \ \ \ video\ format\ code
99 --all-formats\ \ \ \ \ \ \ \ \ \ \ \ download\ all\ available\ video\ formats
100 --prefer-free-formats\ \ \ \ prefer\ free\ video\ formats\ unless\ a\ specific\ one\ is
101 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ requested
102 --max-quality\ FORMAT\ \ \ \ \ highest\ quality\ format\ to\ download
103 -F,\ --list-formats\ \ \ \ \ \ \ list\ all\ available\ formats\ (currently\ youtube\ only)
104 --write-srt\ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ video\ closed\ captions\ to\ a\ .srt\ file
105 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (currently\ youtube\ only)
106 --srt-lang\ LANG\ \ \ \ \ \ \ \ \ \ language\ of\ the\ closed\ captions\ to\ download
107 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (optional)\ use\ IETF\ language\ tags\ like\ \[aq]en\[aq]
108 \f[]
109 .fi
110 .SS Authentication Options:
111 .IP
112 .nf
113 \f[C]
114 -u,\ --username\ USERNAME\ \ account\ username
115 -p,\ --password\ PASSWORD\ \ account\ password
116 -n,\ --netrc\ \ \ \ \ \ \ \ \ \ \ \ \ \ use\ .netrc\ authentication\ data
117 \f[]
118 .fi
119 .SS Post-processing Options:
120 .IP
121 .nf
122 \f[C]
123 -x,\ --extract-audio\ \ \ \ \ \ convert\ video\ files\ to\ audio-only\ files\ (requires
124 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ffmpeg\ or\ avconv\ and\ ffprobe\ or\ avprobe)
125 --audio-format\ FORMAT\ \ \ \ "best",\ "aac",\ "vorbis",\ "mp3",\ "m4a",\ or\ "wav";
126 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ best\ by\ default
127 --audio-quality\ QUALITY\ \ ffmpeg/avconv\ audio\ quality\ specification,\ insert\ a
128 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ value\ between\ 0\ (better)\ and\ 9\ (worse)\ for\ VBR\ or\ a
129 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specific\ bitrate\ like\ 128K\ (default\ 5)
130 -k,\ --keep-video\ \ \ \ \ \ \ \ \ keeps\ the\ video\ file\ on\ disk\ after\ the\ post-
131 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ processing;\ the\ video\ is\ erased\ by\ default
132 \f[]
133 .fi
134 .SH CONFIGURATION
135 .PP
136 You can configure youtube-dl by placing default arguments (such as
137 \f[C]--extract-audio\ --no-mtime\f[] to always extract the audio and not
138 copy the mtime) into \f[C]/etc/youtube-dl.conf\f[] and/or
139 \f[C]~/.local/config/youtube-dl.conf\f[].
140 .SH FAQ
141 .SS Can you please put the -b option back?
142 .PP
143 Most people asking this question are not aware that youtube-dl now
144 defaults to downloading the highest available quality as reported by
145 YouTube, which will be 1080p or 720p in some cases, so you no longer
146 need the -b option.
147 For some specific videos, maybe YouTube does not report them to be
148 available in a specific high quality format you\[aq]\[aq]re interested
149 in.
150 In that case, simply request it with the -f option and youtube-dl will
151 try to download it.
152 .SS I get HTTP error 402 when trying to download a video. What\[aq]s
153 this?
154 .PP
155 Apparently YouTube requires you to pass a CAPTCHA test if you download
156 too much.
157 We\[aq]\[aq]re considering to provide a way to let you solve the
158 CAPTCHA (https://github.com/rg3/youtube-dl/issues/154), but at the
159 moment, your best course of action is pointing a webbrowser to the
160 youtube URL, solving the CAPTCHA, and restart youtube-dl.
161 .SS I have downloaded a video but how can I play it?
162 .PP
163 Once the video is fully downloaded, use any video player, such as
164 vlc (http://www.videolan.org) or mplayer (http://www.mplayerhq.hu/).
165 .SS The links provided by youtube-dl -g are not working anymore
166 .PP
167 The URLs youtube-dl outputs require the downloader to have the correct
168 cookies.
169 Use the \f[C]--cookies\f[] option to write the required cookies into a
170 file, and advise your downloader to read cookies from that file.
171 Some sites also require a common user agent to be used, use
172 \f[C]--dump-user-agent\f[] to see the one in use by youtube-dl.
173 .SS ERROR: no fmt_url_map or conn information found in video info
174 .PP
175 youtube has switched to a new video info format in July 2011 which is
176 not supported by old versions of youtube-dl.
177 You can update youtube-dl with \f[C]sudo\ youtube-dl\ --update\f[].
178 .SS ERROR: unable to download video
179 .PP
180 youtube requires an additional signature since September 2012 which is
181 not supported by old versions of youtube-dl.
182 You can update youtube-dl with \f[C]sudo\ youtube-dl\ --update\f[].
183 .SS SyntaxError: Non-ASCII character
184 .PP
185 The error
186 .IP
187 .nf
188 \f[C]
189 File\ "youtube-dl",\ line\ 2
190 SyntaxError:\ Non-ASCII\ character\ \[aq]\\x93\[aq]\ ...
191 \f[]
192 .fi
193 .PP
194 means you\[aq]re using an outdated version of Python.
195 Please update to Python 2.6 or 2.7.
196 .PP
197 To run youtube-dl under Python 2.5, you\[aq]ll have to manually check it
198 out like this:
199 .IP
200 .nf
201 \f[C]
202 git\ clone\ git://github.com/rg3/youtube-dl.git
203 cd\ youtube-dl
204 python\ -m\ youtube_dl\ --help
205 \f[]
206 .fi
207 .PP
208 Please note that Python 2.5 is not supported anymore.
209 .SS What is this binary file? Where has the code gone?
210 .PP
211 Since June 2012 (#342) youtube-dl is packed as an executable zipfile,
212 simply unzip it (might need renaming to \f[C]youtube-dl.zip\f[] first on
213 some systems) or clone the git repo to see the code.
214 If you modify the code, you can run it by executing the
215 \f[C]__main__.py\f[] file.
216 To recompile the executable, run \f[C]make\ compile\f[].
217 .SS The exe throws a \f[I]Runtime error from Visual C++\f[]
218 .PP
219 To run the exe you need to install first the Microsoft Visual C++ 2008
220 Redistributable
221 Package (http://www.microsoft.com/en-us/download/details.aspx?id=29).
222 .SH COPYRIGHT
223 .PP
224 youtube-dl is released into the public domain by the copyright holders.
225 .PP
226 This README file was originally written by Daniel Bolton
227 (<https://github.com/dbbolton>) and is likewise released into the public
228 domain.
229 .SH BUGS
230 .PP
231 Bugs and suggestions should be reported at:
232 <https://github.com/rg3/youtube-dl/issues>
233 .PP
234 Please include:
235 .IP \[bu] 2
236 Your exact command line, like
237 \f[C]youtube-dl\ -t\ "http://www.youtube.com/watch?v=uHlDtZ6Oc3s&feature=channel_video_title"\f[].
238 A common mistake is not to escape the \f[C]&\f[].
239 Putting URLs in quotes should solve this problem.
240 .IP \[bu] 2
241 The output of \f[C]youtube-dl\ --version\f[]
242 .IP \[bu] 2
243 The output of \f[C]python\ --version\f[]
244 .IP \[bu] 2
245 The name and version of your Operating System ("Ubuntu 11.04 x64" or
246 "Windows 7 x64" is usually enough).