]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube-dl.1
cb69deed11dee9827c1d1a21930c0b4a0335b97f
[youtubedl] / youtube-dl.1
1 .TH "YOUTUBE\-DL" "1" "" "" ""
2 .SH NAME
3 .PP
4 youtube\-dl \- download videos from youtube.com or other video platforms
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.6, 2.7, or 3.2+, and it is
13 not platform specific.
14 It should work on your Unix box, on Windows or on 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.\ Make
24 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sure\ that\ you\ have\ sufficient\ permissions
25 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (run\ with\ sudo\ if\ needed)
26 \-i,\ \-\-ignore\-errors\ \ \ \ \ \ \ \ \ \ \ \ \ \ continue\ on\ download\ errors,\ for\ example\ to
27 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ skip\ unavailable\ videos\ in\ a\ playlist
28 \-\-abort\-on\-error\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Abort\ downloading\ of\ further\ videos\ (in\ the
29 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ playlist\ or\ the\ command\ line)\ if\ an\ error
30 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ occurs
31 \-\-dump\-user\-agent\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ display\ the\ current\ browser\ identification
32 \-\-list\-extractors\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ List\ all\ supported\ extractors\ and\ the\ URLs
33 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ they\ would\ handle
34 \-\-extractor\-descriptions\ \ \ \ \ \ \ \ \ Output\ descriptions\ of\ all\ supported
35 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ extractors
36 \-\-default\-search\ PREFIX\ \ \ \ \ \ \ \ \ \ Use\ this\ prefix\ for\ unqualified\ URLs.\ For
37 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example\ "gvsearch2:"\ downloads\ two\ videos
38 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ from\ google\ videos\ for\ \ youtube\-dl\ "large
39 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ apple".\ Use\ the\ value\ "auto"\ to\ let
40 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ youtube\-dl\ guess\ ("auto_warning"\ to\ emit\ a
41 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ warning\ when\ guessing).\ "error"\ just\ throws
42 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ an\ error.\ The\ default\ value\ "fixup_error"
43 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ repairs\ broken\ URLs,\ but\ emits\ an\ error\ if
44 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ this\ is\ not\ possible\ instead\ of\ searching.
45 \-\-ignore\-config\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Do\ not\ read\ configuration\ files.\ When\ given
46 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ in\ the\ global\ configuration\ file\ /etc
47 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ /youtube\-dl.conf:\ Do\ not\ read\ the\ user
48 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ configuration\ in\ ~/.config/youtube\-
49 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dl/config\ (%APPDATA%/youtube\-dl/config.txt
50 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ on\ Windows)
51 \-\-flat\-playlist\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Do\ not\ extract\ the\ videos\ of\ a\ playlist,
52 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ only\ list\ them.
53 \f[]
54 .fi
55 .SS Network Options:
56 .IP
57 .nf
58 \f[C]
59 \-\-proxy\ URL\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Use\ the\ specified\ HTTP/HTTPS\ proxy.\ Pass\ in
60 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ an\ empty\ string\ (\-\-proxy\ "")\ for\ direct
61 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ connection
62 \-\-socket\-timeout\ SECONDS\ \ \ \ \ \ \ \ \ Time\ to\ wait\ before\ giving\ up,\ in\ seconds
63 \-\-source\-address\ IP\ \ \ \ \ \ \ \ \ \ \ \ \ \ Client\-side\ IP\ address\ to\ bind\ to
64 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (experimental)
65 \-4,\ \-\-force\-ipv4\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Make\ all\ connections\ via\ IPv4
66 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (experimental)
67 \-6,\ \-\-force\-ipv6\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Make\ all\ connections\ via\ IPv6
68 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (experimental)
69 \f[]
70 .fi
71 .SS Video Selection:
72 .IP
73 .nf
74 \f[C]
75 \-\-playlist\-start\ NUMBER\ \ \ \ \ \ \ \ \ \ playlist\ video\ to\ start\ at\ (default\ is\ 1)
76 \-\-playlist\-end\ NUMBER\ \ \ \ \ \ \ \ \ \ \ \ playlist\ video\ to\ end\ at\ (default\ is\ last)
77 \-\-match\-title\ REGEX\ \ \ \ \ \ \ \ \ \ \ \ \ \ download\ only\ matching\ titles\ (regex\ or
78 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ caseless\ sub\-string)
79 \-\-reject\-title\ REGEX\ \ \ \ \ \ \ \ \ \ \ \ \ skip\ download\ for\ matching\ titles\ (regex\ or
80 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ caseless\ sub\-string)
81 \-\-max\-downloads\ NUMBER\ \ \ \ \ \ \ \ \ \ \ Abort\ after\ downloading\ NUMBER\ files
82 \-\-min\-filesize\ SIZE\ \ \ \ \ \ \ \ \ \ \ \ \ \ Do\ not\ download\ any\ videos\ smaller\ than
83 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ SIZE\ (e.g.\ 50k\ or\ 44.6m)
84 \-\-max\-filesize\ SIZE\ \ \ \ \ \ \ \ \ \ \ \ \ \ Do\ not\ download\ any\ videos\ larger\ than\ SIZE
85 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (e.g.\ 50k\ or\ 44.6m)
86 \-\-date\ DATE\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ download\ only\ videos\ uploaded\ in\ this\ date
87 \-\-datebefore\ DATE\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ download\ only\ videos\ uploaded\ on\ or\ before
88 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ this\ date\ (i.e.\ inclusive)
89 \-\-dateafter\ DATE\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ download\ only\ videos\ uploaded\ on\ or\ after
90 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ this\ date\ (i.e.\ inclusive)
91 \-\-min\-views\ COUNT\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Do\ not\ download\ any\ videos\ with\ less\ than
92 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ COUNT\ views
93 \-\-max\-views\ COUNT\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Do\ not\ download\ any\ videos\ with\ more\ than
94 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ COUNT\ views
95 \-\-no\-playlist\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ If\ the\ URL\ refers\ to\ a\ video\ and\ a
96 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ playlist,\ download\ only\ the\ video.
97 \-\-age\-limit\ YEARS\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ download\ only\ videos\ suitable\ for\ the\ given
98 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ age
99 \-\-download\-archive\ FILE\ \ \ \ \ \ \ \ \ \ Download\ only\ videos\ not\ listed\ in\ the
100 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ archive\ file.\ Record\ the\ IDs\ of\ all
101 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ downloaded\ videos\ in\ it.
102 \-\-include\-ads\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Download\ advertisements\ as\ well
103 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (experimental)
104 \f[]
105 .fi
106 .SS Download Options:
107 .IP
108 .nf
109 \f[C]
110 \-r,\ \-\-rate\-limit\ LIMIT\ \ \ \ \ \ \ \ \ \ \ maximum\ download\ rate\ in\ bytes\ per\ second
111 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (e.g.\ 50K\ or\ 4.2M)
112 \-R,\ \-\-retries\ RETRIES\ \ \ \ \ \ \ \ \ \ \ \ number\ of\ retries\ (default\ is\ 10)
113 \-\-buffer\-size\ SIZE\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ size\ of\ download\ buffer\ (e.g.\ 1024\ or\ 16K)
114 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (default\ is\ 1024)
115 \-\-no\-resize\-buffer\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ automatically\ adjust\ the\ buffer
116 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ size.\ By\ default,\ the\ buffer\ size\ is
117 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ automatically\ resized\ from\ an\ initial\ value
118 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ of\ SIZE.
119 \-\-playlist\-reverse\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Download\ playlist\ videos\ in\ reverse\ order
120 \f[]
121 .fi
122 .SS Filesystem Options:
123 .IP
124 .nf
125 \f[C]
126 \-a,\ \-\-batch\-file\ FILE\ \ \ \ \ \ \ \ \ \ \ \ file\ containing\ URLs\ to\ download\ (\[aq]\-\[aq]\ for
127 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ stdin)
128 \-\-id\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ use\ only\ video\ ID\ in\ file\ name
129 \-o,\ \-\-output\ TEMPLATE\ \ \ \ \ \ \ \ \ \ \ \ output\ filename\ template.\ Use\ %(title)s\ to
130 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ get\ the\ title,\ %(uploader)s\ for\ the
131 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uploader\ name,\ %(uploader_id)s\ for\ the
132 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uploader\ nickname\ if\ different,
133 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %(autonumber)s\ to\ get\ an\ automatically
134 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ incremented\ number,\ %(ext)s\ for\ the
135 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ filename\ extension,\ %(format)s\ for\ the
136 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ format\ description\ (like\ "22\ \-\ 1280x720"\ or
137 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "HD"),\ %(format_id)s\ for\ the\ unique\ id\ of
138 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ the\ format\ (like\ Youtube\[aq]s\ itags:\ "137"),
139 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %(upload_date)s\ for\ the\ upload\ date
140 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (YYYYMMDD),\ %(extractor)s\ for\ the\ provider
141 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (youtube,\ metacafe,\ etc),\ %(id)s\ for\ the
142 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ video\ id,\ %(playlist_title)s,
143 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %(playlist_id)s,\ or\ %(playlist)s\ (=title\ if
144 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ present,\ ID\ otherwise)\ for\ the\ playlist\ the
145 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ video\ is\ in,\ %(playlist_index)s\ for\ the
146 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ position\ in\ the\ playlist.\ %(height)s\ and
147 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %(width)s\ for\ the\ width\ and\ height\ of\ the
148 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ video\ format.\ %(resolution)s\ for\ a\ textual
149 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ description\ of\ the\ resolution\ of\ the\ video
150 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ format.\ %%\ for\ a\ literal\ percent.\ Use\ \-\ to
151 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ output\ to\ stdout.\ Can\ also\ be\ used\ to
152 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ download\ to\ a\ different\ directory,\ for
153 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example\ with\ \-o\ \[aq]/my/downloads/%(uploader)s
154 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ /%(title)s\-%(id)s.%(ext)s\[aq]\ .
155 \-\-autonumber\-size\ NUMBER\ \ \ \ \ \ \ \ \ Specifies\ the\ number\ of\ digits\ in
156 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ %(autonumber)s\ when\ it\ is\ present\ in\ output
157 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ filename\ template\ or\ \-\-auto\-number\ option
158 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ is\ given
159 \-\-restrict\-filenames\ \ \ \ \ \ \ \ \ \ \ \ \ Restrict\ filenames\ to\ only\ ASCII
160 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ characters,\ and\ avoid\ "&"\ and\ spaces\ in
161 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ filenames
162 \-A,\ \-\-auto\-number\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [deprecated;\ use\ \ \-o
163 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "%(autonumber)s\-%(title)s.%(ext)s"\ ]\ number
164 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ downloaded\ files\ starting\ from\ 00000
165 \-t,\ \-\-title\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [deprecated]\ use\ title\ in\ file\ name
166 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (default)
167 \-l,\ \-\-literal\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [deprecated]\ alias\ of\ \-\-title
168 \-w,\ \-\-no\-overwrites\ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ overwrite\ files
169 \-c,\ \-\-continue\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ force\ resume\ of\ partially\ downloaded\ files.
170 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ By\ default,\ youtube\-dl\ will\ resume
171 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ downloads\ if\ possible.
172 \-\-no\-continue\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ resume\ partially\ downloaded\ files
173 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (restart\ from\ beginning)
174 \-\-no\-part\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ use\ .part\ files\ \-\ write\ directly
175 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ into\ output\ file
176 \-\-no\-mtime\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ use\ the\ Last\-modified\ header\ to\ set
177 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ the\ file\ modification\ time
178 \-\-write\-description\ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ video\ description\ to\ a\ .description
179 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ file
180 \-\-write\-info\-json\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ video\ metadata\ to\ a\ .info.json\ file
181 \-\-write\-annotations\ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ video\ annotations\ to\ a\ .annotation
182 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ file
183 \-\-write\-thumbnail\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ thumbnail\ image\ to\ disk
184 \-\-load\-info\ FILE\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ json\ file\ containing\ the\ video\ information
185 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (created\ with\ the\ "\-\-write\-json"\ option)
186 \-\-cookies\ FILE\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ file\ to\ read\ cookies\ from\ and\ dump\ cookie
187 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ jar\ in
188 \-\-cache\-dir\ DIR\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Location\ in\ the\ filesystem\ where\ youtube\-dl
189 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ can\ store\ some\ downloaded\ information
190 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ permanently.\ By\ default\ $XDG_CACHE_HOME
191 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ /youtube\-dl\ or\ ~/.cache/youtube\-dl\ .\ At\ the
192 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ moment,\ only\ YouTube\ player\ files\ (for
193 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ videos\ with\ obfuscated\ signatures)\ are
194 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ cached,\ but\ that\ may\ change.
195 \-\-no\-cache\-dir\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Disable\ filesystem\ caching
196 \-\-rm\-cache\-dir\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Delete\ all\ filesystem\ cache\ files
197 \f[]
198 .fi
199 .SS Verbosity / Simulation Options:
200 .IP
201 .nf
202 \f[C]
203 \-q,\ \-\-quiet\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ activates\ quiet\ mode
204 \-\-no\-warnings\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Ignore\ warnings
205 \-s,\ \-\-simulate\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ download\ the\ video\ and\ do\ not\ write
206 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ anything\ to\ disk
207 \-\-skip\-download\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ download\ the\ video
208 \-g,\ \-\-get\-url\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ URL
209 \-e,\ \-\-get\-title\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ title
210 \-\-get\-id\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ id
211 \-\-get\-thumbnail\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ thumbnail\ URL
212 \-\-get\-description\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ video\ description
213 \-\-get\-duration\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ video\ length
214 \-\-get\-filename\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ output\ filename
215 \-\-get\-format\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ output\ format
216 \-j,\ \-\-dump\-json\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ JSON\ information.
217 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ See\ \-\-output\ for\ a\ description\ of\ available
218 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ keys.
219 \-J,\ \-\-dump\-single\-json\ \ \ \ \ \ \ \ \ \ \ simulate,\ quiet\ but\ print\ JSON\ information
220 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ for\ each\ command\-line\ argument.\ If\ the\ URL
221 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ refers\ to\ a\ playlist,\ dump\ the\ whole
222 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ playlist\ information\ in\ a\ single\ line.
223 \-\-print\-json\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Be\ quiet\ and\ print\ the\ video\ information\ as
224 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ JSON\ (video\ is\ still\ being\ downloaded).
225 \-\-newline\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ output\ progress\ bar\ as\ new\ lines
226 \-\-no\-progress\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ print\ progress\ bar
227 \-\-console\-title\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ display\ progress\ in\ console\ titlebar
228 \-v,\ \-\-verbose\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ print\ various\ debugging\ information
229 \-\-dump\-intermediate\-pages\ \ \ \ \ \ \ \ print\ downloaded\ pages\ to\ debug\ problems
230 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (very\ verbose)
231 \-\-write\-pages\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Write\ downloaded\ intermediary\ pages\ to
232 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ files\ in\ the\ current\ directory\ to\ debug
233 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ problems
234 \-\-print\-traffic\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Display\ sent\ and\ read\ HTTP\ traffic
235 \-C,\ \-\-call\-home\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Contact\ the\ youtube\-dl\ server\ for
236 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ debugging.
237 \-\-no\-call\-home\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Do\ NOT\ contact\ the\ youtube\-dl\ server\ for
238 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ debugging.
239 \f[]
240 .fi
241 .SS Workarounds:
242 .IP
243 .nf
244 \f[C]
245 \-\-encoding\ ENCODING\ \ \ \ \ \ \ \ \ \ \ \ \ \ Force\ the\ specified\ encoding\ (experimental)
246 \-\-no\-check\-certificate\ \ \ \ \ \ \ \ \ \ \ Suppress\ HTTPS\ certificate\ validation.
247 \-\-prefer\-insecure\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Use\ an\ unencrypted\ connection\ to\ retrieve
248 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ information\ about\ the\ video.\ (Currently
249 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ supported\ only\ for\ YouTube)
250 \-\-user\-agent\ UA\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify\ a\ custom\ user\ agent
251 \-\-referer\ URL\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify\ a\ custom\ referer,\ use\ if\ the\ video
252 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ access\ is\ restricted\ to\ one\ domain
253 \-\-add\-header\ FIELD:VALUE\ \ \ \ \ \ \ \ \ specify\ a\ custom\ HTTP\ header\ and\ its\ value,
254 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ separated\ by\ a\ colon\ \[aq]:\[aq].\ You\ can\ use\ this
255 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ option\ multiple\ times
256 \-\-bidi\-workaround\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Work\ around\ terminals\ that\ lack
257 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ bidirectional\ text\ support.\ Requires\ bidiv
258 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ or\ fribidi\ executable\ in\ PATH
259 \f[]
260 .fi
261 .SS Video Format Options:
262 .IP
263 .nf
264 \f[C]
265 \-f,\ \-\-format\ FORMAT\ \ \ \ \ \ \ \ \ \ \ \ \ \ video\ format\ code,\ specify\ the\ order\ of
266 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ preference\ using\ slashes,\ as\ in\ \-f\ 22/17/18
267 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .\ \ Instead\ of\ format\ codes,\ you\ can\ select
268 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ by\ extension\ for\ the\ extensions\ aac,\ m4a,
269 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ mp3,\ mp4,\ ogg,\ wav,\ webm.\ You\ can\ also\ use
270 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ the\ special\ names\ "best",\ "bestvideo",
271 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "bestaudio",\ "worst".\ \ By\ default,\ youtube\-
272 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dl\ will\ pick\ the\ best\ quality.\ Use\ commas
273 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ to\ download\ multiple\ audio\ formats,\ such\ as
274 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \-f
275 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 136/137/mp4/bestvideo,140/m4a/bestaudio.
276 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ You\ can\ merge\ the\ video\ and\ audio\ of\ two
277 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ formats\ into\ a\ single\ file\ using\ \-f\ <video\-
278 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ format>+<audio\-format>\ (requires\ ffmpeg\ or
279 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ avconv),\ for\ example\ \-f
280 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ bestvideo+bestaudio.
281 \-\-all\-formats\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ download\ all\ available\ video\ formats
282 \-\-prefer\-free\-formats\ \ \ \ \ \ \ \ \ \ \ \ prefer\ free\ video\ formats\ unless\ a\ specific
283 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ one\ is\ requested
284 \-\-max\-quality\ FORMAT\ \ \ \ \ \ \ \ \ \ \ \ \ highest\ quality\ format\ to\ download
285 \-F,\ \-\-list\-formats\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ list\ all\ available\ formats
286 \-\-youtube\-skip\-dash\-manifest\ \ \ \ \ Do\ not\ download\ the\ DASH\ manifest\ on
287 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ YouTube\ videos
288 \-\-merge\-output\-format\ FORMAT\ \ \ \ \ If\ a\ merge\ is\ required\ (e.g.
289 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ bestvideo+bestaudio),\ output\ to\ given
290 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ container\ format.\ One\ of\ mkv,\ mp4,\ ogg,
291 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ webm,\ flv.Ignored\ if\ no\ merge\ is\ required
292 \f[]
293 .fi
294 .SS Subtitle Options:
295 .IP
296 .nf
297 \f[C]
298 \-\-write\-sub\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ subtitle\ file
299 \-\-write\-auto\-sub\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ automatic\ subtitle\ file\ (youtube
300 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ only)
301 \-\-all\-subs\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ downloads\ all\ the\ available\ subtitles\ of
302 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ the\ video
303 \-\-list\-subs\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lists\ all\ available\ subtitles\ for\ the\ video
304 \-\-sub\-format\ FORMAT\ \ \ \ \ \ \ \ \ \ \ \ \ \ subtitle\ format\ (default=srt)\ ([sbv/vtt]
305 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ youtube\ only)
306 \-\-sub\-lang\ LANGS\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ languages\ of\ the\ subtitles\ to\ download
307 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (optional)\ separated\ by\ commas,\ use\ IETF
308 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ language\ tags\ like\ \[aq]en,pt\[aq]
309 \f[]
310 .fi
311 .SS Authentication Options:
312 .IP
313 .nf
314 \f[C]
315 \-u,\ \-\-username\ USERNAME\ \ \ \ \ \ \ \ \ \ login\ with\ this\ account\ ID
316 \-p,\ \-\-password\ PASSWORD\ \ \ \ \ \ \ \ \ \ account\ password
317 \-2,\ \-\-twofactor\ TWOFACTOR\ \ \ \ \ \ \ \ two\-factor\ auth\ code
318 \-n,\ \-\-netrc\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ use\ .netrc\ authentication\ data
319 \-\-video\-password\ PASSWORD\ \ \ \ \ \ \ \ video\ password\ (vimeo,\ smotri)
320 \f[]
321 .fi
322 .SS Post\-processing Options:
323 .IP
324 .nf
325 \f[C]
326 \-x,\ \-\-extract\-audio\ \ \ \ \ \ \ \ \ \ \ \ \ \ convert\ video\ files\ to\ audio\-only\ files
327 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (requires\ ffmpeg\ or\ avconv\ and\ ffprobe\ or
328 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ avprobe)
329 \-\-audio\-format\ FORMAT\ \ \ \ \ \ \ \ \ \ \ \ "best",\ "aac",\ "vorbis",\ "mp3",\ "m4a",
330 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "opus",\ or\ "wav";\ "best"\ by\ default
331 \-\-audio\-quality\ QUALITY\ \ \ \ \ \ \ \ \ \ ffmpeg/avconv\ audio\ quality\ specification,
332 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ insert\ a\ value\ between\ 0\ (better)\ and\ 9
333 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (worse)\ for\ VBR\ or\ a\ specific\ bitrate\ like
334 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 128K\ (default\ 5)
335 \-\-recode\-video\ FORMAT\ \ \ \ \ \ \ \ \ \ \ \ Encode\ the\ video\ to\ another\ format\ if
336 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ necessary\ (currently\ supported:
337 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ mp4|flv|ogg|webm|mkv)
338 \-k,\ \-\-keep\-video\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ keeps\ the\ video\ file\ on\ disk\ after\ the
339 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ post\-processing;\ the\ video\ is\ erased\ by
340 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ default
341 \-\-no\-post\-overwrites\ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ overwrite\ post\-processed\ files;\ the
342 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ post\-processed\ files\ are\ overwritten\ by
343 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ default
344 \-\-embed\-subs\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ embed\ subtitles\ in\ the\ video\ (only\ for\ mp4
345 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ videos)
346 \-\-embed\-thumbnail\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ embed\ thumbnail\ in\ the\ audio\ as\ cover\ art
347 \-\-add\-metadata\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ metadata\ to\ the\ video\ file
348 \-\-xattrs\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ write\ metadata\ to\ the\ video\ file\[aq]s\ xattrs
349 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (using\ dublin\ core\ and\ xdg\ standards)
350 \-\-fixup\ POLICY\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (experimental)\ Automatically\ correct\ known
351 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ faults\ of\ the\ file.\ One\ of\ never\ (do
352 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ nothing),\ warn\ (only\ emit\ a\ warning),
353 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ detect_or_warn(check\ whether\ we\ can\ do
354 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ anything\ about\ it,\ warn\ otherwise
355 \-\-prefer\-avconv\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Prefer\ avconv\ over\ ffmpeg\ for\ running\ the
356 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ postprocessors\ (default)
357 \-\-prefer\-ffmpeg\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Prefer\ ffmpeg\ over\ avconv\ for\ running\ the
358 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ postprocessors
359 \-\-exec\ CMD\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Execute\ a\ command\ on\ the\ file\ after
360 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ downloading,\ similar\ to\ find\[aq]s\ \-exec
361 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ syntax.\ Example:\ \-\-exec\ \[aq]adb\ push\ {}
362 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ /sdcard/Music/\ &&\ rm\ {}\[aq]
363 \f[]
364 .fi
365 .SH CONFIGURATION
366 .PP
367 You can configure youtube\-dl by placing default arguments (such as
368 \f[C]\-\-extract\-audio\ \-\-no\-mtime\f[] to always extract the audio
369 and not copy the mtime) into \f[C]/etc/youtube\-dl.conf\f[] and/or
370 \f[C]~/.config/youtube\-dl/config\f[].
371 On Windows, the configuration file locations are
372 \f[C]%APPDATA%\\youtube\-dl\\config.txt\f[] and
373 \f[C]C:\\Users\\<user\ name>\\youtube\-dl.conf\f[].
374 .SH OUTPUT TEMPLATE
375 .PP
376 The \f[C]\-o\f[] option allows users to indicate a template for the
377 output file names.
378 The basic usage is not to set any template arguments when downloading a
379 single file, like in
380 \f[C]youtube\-dl\ \-o\ funny_video.flv\ "http://some/video"\f[].
381 However, it may contain special sequences that will be replaced when
382 downloading each video.
383 The special sequences have the format \f[C]%(NAME)s\f[].
384 To clarify, that is a percent symbol followed by a name in parenthesis,
385 followed by a lowercase S.
386 Allowed names are:
387 .IP \[bu] 2
388 \f[C]id\f[]: The sequence will be replaced by the video identifier.
389 .IP \[bu] 2
390 \f[C]url\f[]: The sequence will be replaced by the video URL.
391 .IP \[bu] 2
392 \f[C]uploader\f[]: The sequence will be replaced by the nickname of the
393 person who uploaded the video.
394 .IP \[bu] 2
395 \f[C]upload_date\f[]: The sequence will be replaced by the upload date
396 in YYYYMMDD format.
397 .IP \[bu] 2
398 \f[C]title\f[]: The sequence will be replaced by the video title.
399 .IP \[bu] 2
400 \f[C]ext\f[]: The sequence will be replaced by the appropriate extension
401 (like flv or mp4).
402 .IP \[bu] 2
403 \f[C]epoch\f[]: The sequence will be replaced by the Unix epoch when
404 creating the file.
405 .IP \[bu] 2
406 \f[C]autonumber\f[]: The sequence will be replaced by a five\-digit
407 number that will be increased with each download, starting at zero.
408 .IP \[bu] 2
409 \f[C]playlist\f[]: The name or the id of the playlist that contains the
410 video.
411 .IP \[bu] 2
412 \f[C]playlist_index\f[]: The index of the video in the playlist, a
413 five\-digit number.
414 .PP
415 The current default template is \f[C]%(title)s\-%(id)s.%(ext)s\f[].
416 .PP
417 In some cases, you don\[aq]t want special characters such as äø­, spaces,
418 or &, such as when transferring the downloaded filename to a Windows
419 system or the filename through an 8bit\-unsafe channel.
420 In these cases, add the \f[C]\-\-restrict\-filenames\f[] flag to get a
421 shorter title:
422 .IP
423 .nf
424 \f[C]
425 $\ youtube\-dl\ \-\-get\-filename\ \-o\ "%(title)s.%(ext)s"\ BaW_jenozKc
426 youtube\-dl\ test\ video\ \[aq]\[aq]_Ƥā†­š•.mp4\ \ \ \ #\ All\ kinds\ of\ weird\ characters
427 $\ youtube\-dl\ \-\-get\-filename\ \-o\ "%(title)s.%(ext)s"\ BaW_jenozKc\ \-\-restrict\-filenames
428 youtube\-dl_test_video_.mp4\ \ \ \ \ \ \ \ \ \ #\ A\ simple\ file\ name
429 \f[]
430 .fi
431 .SH VIDEO SELECTION
432 .PP
433 Videos can be filtered by their upload date using the options
434 \f[C]\-\-date\f[], \f[C]\-\-datebefore\f[] or \f[C]\-\-dateafter\f[],
435 they accept dates in two formats:
436 .IP \[bu] 2
437 Absolute dates: Dates in the format \f[C]YYYYMMDD\f[].
438 .IP \[bu] 2
439 Relative dates: Dates in the format
440 \f[C](now|today)[+\-][0\-9](day|week|month|year)(s)?\f[]
441 .PP
442 Examples:
443 .IP
444 .nf
445 \f[C]
446 #\ Download\ only\ the\ videos\ uploaded\ in\ the\ last\ 6\ months
447 $\ youtube\-dl\ \-\-dateafter\ now\-6months
448
449 #\ Download\ only\ the\ videos\ uploaded\ on\ January\ 1,\ 1970
450 $\ youtube\-dl\ \-\-date\ 19700101
451
452 $\ #\ will\ only\ download\ the\ videos\ uploaded\ in\ the\ 200x\ decade
453 $\ youtube\-dl\ \-\-dateafter\ 20000101\ \-\-datebefore\ 20091231
454 \f[]
455 .fi
456 .SH FAQ
457 .SS How do I update youtube\-dl?
458 .PP
459 If you\[aq]ve followed our manual installation
460 instructions (http://rg3.github.io/youtube-dl/download.html), you can
461 simply run \f[C]youtube\-dl\ \-U\f[] (or, on Linux,
462 \f[C]sudo\ youtube\-dl\ \-U\f[]).
463 .PP
464 If you have used pip, a simple
465 \f[C]sudo\ pip\ install\ \-U\ youtube\-dl\f[] is sufficient to update.
466 .PP
467 If you have installed youtube\-dl using a package manager like
468 \f[I]apt\-get\f[] or \f[I]yum\f[], use the standard system update
469 mechanism to update.
470 Note that distribution packages are often outdated.
471 As a rule of thumb, youtube\-dl releases at least once a month, and
472 often weekly or even daily.
473 Simply go to http://yt\-dl.org/ to find out the current version.
474 Unfortunately, there is nothing we youtube\-dl developers can do if your
475 distributions serves a really outdated version.
476 You can (and should) complain to your distribution in their bugtracker
477 or support forum.
478 .PP
479 As a last resort, you can also uninstall the version installed by your
480 package manager and follow our manual installation instructions.
481 For that, remove the distribution\[aq]s package, with a line like
482 .IP
483 .nf
484 \f[C]
485 sudo\ apt\-get\ remove\ \-y\ youtube\-dl
486 \f[]
487 .fi
488 .PP
489 Afterwards, simply follow our manual installation
490 instructions (http://rg3.github.io/youtube-dl/download.html):
491 .IP
492 .nf
493 \f[C]
494 sudo\ wget\ https://yt\-dl.org/latest/youtube\-dl\ \-O\ /usr/local/bin/youtube\-dl
495 sudo\ chmod\ a+x\ /usr/local/bin/youtube\-dl
496 hash\ \-r
497 \f[]
498 .fi
499 .PP
500 Again, from then on you\[aq]ll be able to update with
501 \f[C]sudo\ youtube\-dl\ \-U\f[].
502 .SS I\[aq]m getting an error
503 \f[C]Unable\ to\ extract\ OpenGraph\ title\f[] on YouTube playlists
504 .PP
505 YouTube changed their playlist format in March 2014 and later on, so
506 you\[aq]ll need at least youtube\-dl 2014.07.25 to download all YouTube
507 videos.
508 .PP
509 If you have installed youtube\-dl with a package manager, pip, setup.py
510 or a tarball, please use that to update.
511 Note that Ubuntu packages do not seem to get updated anymore.
512 Since we are not affiliated with Ubuntu, there is little we can do.
513 Feel free to report
514 bugs (https://bugs.launchpad.net/ubuntu/+source/youtube-dl/+filebug) to
515 the Ubuntu packaging
516 guys (mailto:ubuntu-motu@lists.ubuntu.com?subject=outdated%20version%20of%20youtube-dl)
517 \- all they have to do is update the package to a somewhat recent
518 version.
519 See above for a way to update.
520 .SS Do I always have to pass in \f[C]\-\-max\-quality\ FORMAT\f[], or
521 \f[C]\-citw\f[]?
522 .PP
523 By default, youtube\-dl intends to have the best options (incidentally,
524 if you have a convincing case that these should be different, please
525 file an issue where you explain that (https://yt-dl.org/bug)).
526 Therefore, it is unnecessary and sometimes harmful to copy long option
527 strings from webpages.
528 In particular, \f[C]\-\-max\-quality\f[] \f[I]limits\f[] the video
529 quality (so if you want the best quality, do NOT pass it in), and the
530 only option out of \f[C]\-citw\f[] that is regularly useful is
531 \f[C]\-i\f[].
532 .SS Can you please put the \-b option back?
533 .PP
534 Most people asking this question are not aware that youtube\-dl now
535 defaults to downloading the highest available quality as reported by
536 YouTube, which will be 1080p or 720p in some cases, so you no longer
537 need the \f[C]\-b\f[] option.
538 For some specific videos, maybe YouTube does not report them to be
539 available in a specific high quality format you\[aq]re interested in.
540 In that case, simply request it with the \f[C]\-f\f[] option and
541 youtube\-dl will try to download it.
542 .SS I get HTTP error 402 when trying to download a video. What\[aq]s
543 this?
544 .PP
545 Apparently YouTube requires you to pass a CAPTCHA test if you download
546 too much.
547 We\[aq]re considering to provide a way to let you solve the
548 CAPTCHA (https://github.com/rg3/youtube-dl/issues/154), but at the
549 moment, your best course of action is pointing a webbrowser to the
550 youtube URL, solving the CAPTCHA, and restart youtube\-dl.
551 .SS I have downloaded a video but how can I play it?
552 .PP
553 Once the video is fully downloaded, use any video player, such as
554 vlc (http://www.videolan.org) or mplayer (http://www.mplayerhq.hu/).
555 .SS I extracted a video URL with \-g, but it does not play on another
556 machine / in my webbrowser.
557 .PP
558 It depends a lot on the service.
559 In many cases, requests for the video (to download/play it) must come
560 from the same IP address and with the same cookies.
561 Use the \f[C]\-\-cookies\f[] option to write the required cookies into a
562 file, and advise your downloader to read cookies from that file.
563 Some sites also require a common user agent to be used, use
564 \f[C]\-\-dump\-user\-agent\f[] to see the one in use by youtube\-dl.
565 .PP
566 It may be beneficial to use IPv6; in some cases, the restrictions are
567 only applied to IPv4.
568 Some services (sometimes only for a subset of videos) do not restrict
569 the video URL by IP address, cookie, or user\-agent, but these are the
570 exception rather than the rule.
571 .PP
572 Please bear in mind that some URL protocols are \f[B]not\f[] supported
573 by browsers out of the box, including RTMP.
574 If you are using \-g, your own downloader must support these as well.
575 .PP
576 If you want to play the video on a machine that is not running
577 youtube\-dl, you can relay the video content from the machine that runs
578 youtube\-dl.
579 You can use \f[C]\-o\ \-\f[] to let youtube\-dl stream a video to
580 stdout, or simply allow the player to download the files written by
581 youtube\-dl in turn.
582 .SS ERROR: no fmt_url_map or conn information found in video info
583 .PP
584 youtube has switched to a new video info format in July 2011 which is
585 not supported by old versions of youtube\-dl.
586 You can update youtube\-dl with \f[C]sudo\ youtube\-dl\ \-\-update\f[].
587 .SS ERROR: unable to download video
588 .PP
589 youtube requires an additional signature since September 2012 which is
590 not supported by old versions of youtube\-dl.
591 You can update youtube\-dl with \f[C]sudo\ youtube\-dl\ \-\-update\f[].
592 .SS SyntaxError: Non\-ASCII character
593 .PP
594 The error
595 .IP
596 .nf
597 \f[C]
598 File\ "youtube\-dl",\ line\ 2
599 SyntaxError:\ Non\-ASCII\ character\ \[aq]\\x93\[aq]\ ...
600 \f[]
601 .fi
602 .PP
603 means you\[aq]re using an outdated version of Python.
604 Please update to Python 2.6 or 2.7.
605 .SS What is this binary file? Where has the code gone?
606 .PP
607 Since June 2012 (#342) youtube\-dl is packed as an executable zipfile,
608 simply unzip it (might need renaming to \f[C]youtube\-dl.zip\f[] first
609 on some systems) or clone the git repository, as laid out above.
610 If you modify the code, you can run it by executing the
611 \f[C]__main__.py\f[] file.
612 To recompile the executable, run \f[C]make\ youtube\-dl\f[].
613 .SS The exe throws a \f[I]Runtime error from Visual C++\f[]
614 .PP
615 To run the exe you need to install first the Microsoft Visual C++ 2008
616 Redistributable
617 Package (http://www.microsoft.com/en-us/download/details.aspx?id=29).
618 .SS On Windows, how should I set up ffmpeg and youtube\-dl? Where should
619 I put the exe files?
620 .PP
621 If you put youtube\-dl and ffmpeg in the same directory that you\[aq]re
622 running the command from, it will work, but that\[aq]s rather
623 cumbersome.
624 .PP
625 To make a different directory work \- either for ffmpeg, or for
626 youtube\-dl, or for both \- simply create the directory (say,
627 \f[C]C:\\bin\f[], or \f[C]C:\\Users\\<User\ name>\\bin\f[]), put all the
628 executables directly in there, and then set your PATH environment
629 variable (https://www.java.com/en/download/help/path.xml) to include
630 that directory.
631 .PP
632 From then on, after restarting your shell, you will be able to access
633 both youtube\-dl and ffmpeg (and youtube\-dl will be able to find
634 ffmpeg) by simply typing \f[C]youtube\-dl\f[] or \f[C]ffmpeg\f[], no
635 matter what directory you\[aq]re in.
636 .SS How can I detect whether a given URL is supported by youtube\-dl?
637 .PP
638 For one, have a look at the list of supported
639 sites (docs/supportedsites).
640 Note that it can sometimes happen that the site changes its URL scheme
641 (say, from http://example.com/v/1234567 to http://example.com/v/1234567
642 ) and youtube\-dl reports an URL of a service in that list as
643 unsupported.
644 In that case, simply report a bug.
645 .PP
646 It is \f[I]not\f[] possible to detect whether a URL is supported or not.
647 That\[aq]s because youtube\-dl contains a generic extractor which
648 matches \f[B]all\f[] URLs.
649 You may be tempted to disable, exclude, or remove the generic extractor,
650 but the generic extractor not only allows users to extract videos from
651 lots of websites that embed a video from another service, but may also
652 be used to extract video from a service that it\[aq]s hosting itself.
653 Therefore, we neither recommend nor support disabling, excluding, or
654 removing the generic extractor.
655 .PP
656 If you want to find out whether a given URL is supported, simply call
657 youtube\-dl with it.
658 If you get no videos back, chances are the URL is either not referring
659 to a video or unsupported.
660 You can find out which by examining the output (if you run youtube\-dl
661 on the console) or catching an \f[C]UnsupportedError\f[] exception if
662 you run it from a Python program.
663 .SH DEVELOPER INSTRUCTIONS
664 .PP
665 Most users do not need to build youtube\-dl and can download the
666 builds (http://rg3.github.io/youtube-dl/download.html) or get them from
667 their distribution.
668 .PP
669 To run youtube\-dl as a developer, you don\[aq]t need to build anything
670 either.
671 Simply execute
672 .IP
673 .nf
674 \f[C]
675 python\ \-m\ youtube_dl
676 \f[]
677 .fi
678 .PP
679 To run the test, simply invoke your favorite test runner, or execute a
680 test file directly; any of the following work:
681 .IP
682 .nf
683 \f[C]
684 python\ \-m\ unittest\ discover
685 python\ test/test_download.py
686 nosetests
687 \f[]
688 .fi
689 .PP
690 If you want to create a build of youtube\-dl yourself, you\[aq]ll need
691 .IP \[bu] 2
692 python
693 .IP \[bu] 2
694 make
695 .IP \[bu] 2
696 pandoc
697 .IP \[bu] 2
698 zip
699 .IP \[bu] 2
700 nosetests
701 .SS Adding support for a new site
702 .PP
703 If you want to add support for a new site, you can follow this quick
704 list (assuming your service is called \f[C]yourextractor\f[]):
705 .IP " 1." 4
706 Fork this repository (https://github.com/rg3/youtube-dl/fork)
707 .IP " 2." 4
708 Check out the source code with
709 \f[C]git\ clone\ git\@github.com:YOUR_GITHUB_USERNAME/youtube\-dl.git\f[]
710 .IP " 3." 4
711 Start a new git branch with
712 \f[C]cd\ youtube\-dl;\ git\ checkout\ \-b\ yourextractor\f[]
713 .IP " 4." 4
714 Start with this simple template and save it to
715 \f[C]youtube_dl/extractor/yourextractor.py\f[]:
716 .RS 4
717 .IP
718 .nf
719 \f[C]
720 #\ coding:\ utf\-8
721 from\ __future__\ import\ unicode_literals
722
723 from\ .common\ import\ InfoExtractor
724
725
726 class\ YourExtractorIE(InfoExtractor):
727 \ \ \ \ _VALID_URL\ =\ r\[aq]https?://(?:www\\.)?yourextractor\\.com/watch/(?P<id>[0\-9]+)\[aq]
728 \ \ \ \ _TEST\ =\ {
729 \ \ \ \ \ \ \ \ \[aq]url\[aq]:\ \[aq]http://yourextractor.com/watch/42\[aq],
730 \ \ \ \ \ \ \ \ \[aq]md5\[aq]:\ \[aq]TODO:\ md5\ sum\ of\ the\ first\ 10241\ bytes\ of\ the\ video\ file\ (use\ \-\-test)\[aq],
731 \ \ \ \ \ \ \ \ \[aq]info_dict\[aq]:\ {
732 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]id\[aq]:\ \[aq]42\[aq],
733 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]ext\[aq]:\ \[aq]mp4\[aq],
734 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]title\[aq]:\ \[aq]Video\ title\ goes\ here\[aq],
735 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]thumbnail\[aq]:\ \[aq]re:^https?://.*\\.jpg$\[aq],
736 \ \ \ \ \ \ \ \ \ \ \ \ #\ TODO\ more\ properties,\ either\ as:
737 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ A\ value
738 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ MD5\ checksum;\ start\ the\ string\ with\ md5:
739 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ A\ regular\ expression;\ start\ the\ string\ with\ re:
740 \ \ \ \ \ \ \ \ \ \ \ \ #\ *\ Any\ Python\ type\ (for\ example\ int\ or\ float)
741 \ \ \ \ \ \ \ \ }
742 \ \ \ \ }
743
744 \ \ \ \ def\ _real_extract(self,\ url):
745 \ \ \ \ \ \ \ \ video_id\ =\ self._match_id(url)
746 \ \ \ \ \ \ \ \ webpage\ =\ self._download_webpage(url,\ video_id)
747
748 \ \ \ \ \ \ \ \ #\ TODO\ more\ code\ goes\ here,\ for\ example\ ...
749 \ \ \ \ \ \ \ \ title\ =\ self._html_search_regex(r\[aq]<h1>(.*?)</h1>\[aq],\ webpage,\ \[aq]title\[aq])
750
751 \ \ \ \ \ \ \ \ return\ {
752 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]id\[aq]:\ video_id,
753 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]title\[aq]:\ title,
754 \ \ \ \ \ \ \ \ \ \ \ \ \[aq]description\[aq]:\ self._og_search_description(webpage),
755 \ \ \ \ \ \ \ \ \ \ \ \ #\ TODO\ more\ properties\ (see\ youtube_dl/extractor/common.py)
756 \ \ \ \ \ \ \ \ }
757 \f[]
758 .fi
759 .RE
760 .IP " 5." 4
761 Add an import in
762 \f[C]youtube_dl/extractor/__init__.py\f[] (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/__init__.py).
763 .IP " 6." 4
764 Run
765 \f[C]python\ test/test_download.py\ TestDownload.test_YourExtractor\f[].
766 This \f[I]should fail\f[] at first, but you can continually re\-run it
767 until you\[aq]re done.
768 If you decide to add more than one test, then rename \f[C]_TEST\f[] to
769 \f[C]_TESTS\f[] and make it into a list of dictionaries.
770 The tests will be then be named
771 \f[C]TestDownload.test_YourExtractor\f[],
772 \f[C]TestDownload.test_YourExtractor_1\f[],
773 \f[C]TestDownload.test_YourExtractor_2\f[], etc.
774 .IP " 7." 4
775 Have a look at
776 \f[C]youtube_dl/common/extractor/common.py\f[] (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py)
777 for possible helper methods and a detailed description of what your
778 extractor should
779 return (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L38).
780 Add tests and code for as many as you want.
781 .IP " 8." 4
782 If you can, check the code with
783 pyflakes (https://pypi.python.org/pypi/pyflakes) (a good idea) and
784 pep8 (https://pypi.python.org/pypi/pep8) (optional, ignore E501).
785 .IP " 9." 4
786 When the tests pass, add (http://git-scm.com/docs/git-add) the new files
787 and commit (http://git-scm.com/docs/git-commit) them and
788 push (http://git-scm.com/docs/git-push) the result, like this:
789 .RS 4
790 .IP
791 .nf
792 \f[C]
793 $\ git\ add\ youtube_dl/extractor/__init__.py
794 $\ git\ add\ youtube_dl/extractor/yourextractor.py
795 $\ git\ commit\ \-m\ \[aq][yourextractor]\ Add\ new\ extractor\[aq]
796 $\ git\ push\ origin\ yourextractor
797 \f[]
798 .fi
799 .RE
800 .IP "10." 4
801 Finally, create a pull
802 request (https://help.github.com/articles/creating-a-pull-request).
803 We\[aq]ll then review and merge it.
804 .PP
805 In any case, thank you very much for your contributions!
806 .SH EMBEDDING YOUTUBE\-DL
807 .PP
808 youtube\-dl makes the best effort to be a good command\-line program,
809 and thus should be callable from any programming language.
810 If you encounter any problems parsing its output, feel free to create a
811 report (https://github.com/rg3/youtube-dl/issues/new).
812 .PP
813 From a Python program, you can embed youtube\-dl in a more powerful
814 fashion, like this:
815 .IP
816 .nf
817 \f[C]
818 import\ youtube_dl
819
820 ydl_opts\ =\ {}
821 with\ youtube_dl.YoutubeDL(ydl_opts)\ as\ ydl:
822 \ \ \ \ ydl.download([\[aq]http://www.youtube.com/watch?v=BaW_jenozKc\[aq]])
823 \f[]
824 .fi
825 .PP
826 Most likely, you\[aq]ll want to use various options.
827 For a list of what can be done, have a look at
828 youtube_dl/YoutubeDL.py (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L69).
829 For a start, if you want to intercept youtube\-dl\[aq]s output, set a
830 \f[C]logger\f[] object.
831 .PP
832 Here\[aq]s a more complete example of a program that outputs only errors
833 (and a short message after the download is finished), and
834 downloads/converts the video to an mp3 file:
835 .IP
836 .nf
837 \f[C]
838 import\ youtube_dl
839
840
841 class\ MyLogger(object):
842 \ \ \ \ def\ debug(self,\ msg):
843 \ \ \ \ \ \ \ \ pass
844
845 \ \ \ \ def\ warning(self,\ msg):
846 \ \ \ \ \ \ \ \ pass
847
848 \ \ \ \ def\ error(self,\ msg):
849 \ \ \ \ \ \ \ \ print(msg)
850
851
852 def\ my_hook(d):
853 \ \ \ \ if\ d[\[aq]status\[aq]]\ ==\ \[aq]finished\[aq]:
854 \ \ \ \ \ \ \ \ print(\[aq]Done\ downloading,\ now\ converting\ ...\[aq])
855
856
857 ydl_opts\ =\ {
858 \ \ \ \ \[aq]format\[aq]:\ \[aq]bestaudio/best\[aq],
859 \ \ \ \ \[aq]postprocessors\[aq]:\ [{
860 \ \ \ \ \ \ \ \ \[aq]key\[aq]:\ \[aq]FFmpegExtractAudio\[aq],
861 \ \ \ \ \ \ \ \ \[aq]preferredcodec\[aq]:\ \[aq]mp3\[aq],
862 \ \ \ \ \ \ \ \ \[aq]preferredquality\[aq]:\ \[aq]192\[aq],
863 \ \ \ \ }],
864 \ \ \ \ \[aq]logger\[aq]:\ MyLogger(),
865 \ \ \ \ \[aq]progress_hooks\[aq]:\ [my_hook],
866 }
867 with\ youtube_dl.YoutubeDL(ydl_opts)\ as\ ydl:
868 \ \ \ \ ydl.download([\[aq]http://www.youtube.com/watch?v=BaW_jenozKc\[aq]])
869 \f[]
870 .fi
871 .SH BUGS
872 .PP
873 Bugs and suggestions should be reported at:
874 <https://github.com/rg3/youtube-dl/issues> .
875 Unless you were prompted so or there is another pertinent reason (e.g.
876 GitHub fails to accept the bug report), please do not send bug reports
877 via personal email.
878 For discussions, join us in the irc channel #youtube\-dl on freenode.
879 .PP
880 \f[B]Please include the full output of youtube\-dl when run with
881 \f[C]\-v\f[]\f[].
882 .PP
883 The output (including the first lines) contain important debugging
884 information.
885 Issues without the full output are often not reproducible and therefore
886 do not get solved in short order, if ever.
887 .PP
888 Please re\-read your issue once again to avoid a couple of common
889 mistakes (you can and should use this as a checklist):
890 .SS Is the description of the issue itself sufficient?
891 .PP
892 We often get issue reports that we cannot really decipher.
893 While in most cases we eventually get the required information after
894 asking back multiple times, this poses an unnecessary drain on our
895 resources.
896 Many contributors, including myself, are also not native speakers, so we
897 may misread some parts.
898 .PP
899 So please elaborate on what feature you are requesting, or what bug you
900 want to be fixed.
901 Make sure that it\[aq]s obvious
902 .IP \[bu] 2
903 What the problem is
904 .IP \[bu] 2
905 How it could be fixed
906 .IP \[bu] 2
907 How your proposed solution would look like
908 .PP
909 If your report is shorter than two lines, it is almost certainly missing
910 some of these, which makes it hard for us to respond to it.
911 We\[aq]re often too polite to close the issue outright, but the missing
912 info makes misinterpretation likely.
913 As a commiter myself, I often get frustrated by these issues, since the
914 only possible way for me to move forward on them is to ask for
915 clarification over and over.
916 .PP
917 For bug reports, this means that your report should contain the
918 \f[I]complete\f[] output of youtube\-dl when called with the \-v flag.
919 The error message you get for (most) bugs even says so, but you would
920 not believe how many of our bug reports do not contain this information.
921 .PP
922 Site support requests \f[B]must contain an example URL\f[].
923 An example URL is a URL you might want to download, like
924 http://www.youtube.com/watch?v=BaW_jenozKc .
925 There should be an obvious video present.
926 Except under very special circumstances, the main page of a video
927 service (e.g.
928 http://www.youtube.com/ ) is \f[I]not\f[] an example URL.
929 .SS Are you using the latest version?
930 .PP
931 Before reporting any issue, type youtube\-dl \-U.
932 This should report that you\[aq]re up\-to\-date.
933 About 20% of the reports we receive are already fixed, but people are
934 using outdated versions.
935 This goes for feature requests as well.
936 .SS Is the issue already documented?
937 .PP
938 Make sure that someone has not already opened the issue you\[aq]re
939 trying to open.
940 Search at the top of the window or at
941 https://github.com/rg3/youtube\-dl/search?type=Issues .
942 If there is an issue, feel free to write something along the lines of
943 "This affects me as well, with version 2015.01.01.
944 Here is some more information on the issue: ...".
945 While some issues may be old, a new post into them often spurs rapid
946 activity.
947 .SS Why are existing options not enough?
948 .PP
949 Before requesting a new feature, please have a quick peek at the list of
950 supported
951 options (https://github.com/rg3/youtube-dl/blob/master/README.md#synopsis).
952 Many feature requests are for features that actually exist already!
953 Please, absolutely do show off your work in the issue report and detail
954 how the existing similar options do \f[I]not\f[] solve your problem.
955 .SS Is there enough context in your bug report?
956 .PP
957 People want to solve problems, and often think they do us a favor by
958 breaking down their larger problems (e.g.
959 wanting to skip already downloaded files) to a specific request (e.g.
960 requesting us to look whether the file exists before downloading the
961 info page).
962 However, what often happens is that they break down the problem into two
963 steps: One simple, and one impossible (or extremely complicated one).
964 .PP
965 We are then presented with a very complicated request when the original
966 problem could be solved far easier, e.g.
967 by recording the downloaded video IDs in a separate file.
968 To avoid this, you must include the greater context where it is
969 non\-obvious.
970 In particular, every feature request that does not consist of adding
971 support for a new site should contain a use case scenario that explains
972 in what situation the missing feature would be useful.
973 .SS Does the issue involve one problem, and one problem only?
974 .PP
975 Some of our users seem to think there is a limit of issues they can or
976 should open.
977 There is no limit of issues they can or should open.
978 While it may seem appealing to be able to dump all your issues into one
979 ticket, that means that someone who solves one of your issues cannot
980 mark the issue as closed.
981 Typically, reporting a bunch of issues leads to the ticket lingering
982 since nobody wants to attack that behemoth, until someone mercifully
983 splits the issue into multiple ones.
984 .PP
985 In particular, every site support request issue should only pertain to
986 services at one site (generally under a common domain, but always using
987 the same backend technology).
988 Do not request support for vimeo user videos, Whitehouse podcasts, and
989 Google Plus pages in the same issue.
990 Also, make sure that you don\[aq]t post bug reports alongside feature
991 requests.
992 As a rule of thumb, a feature request does not include outputs of
993 youtube\-dl that are not immediately related to the feature at hand.
994 Do not post reports of a network error alongside the request for a new
995 video service.
996 .SS Is anyone going to need the feature?
997 .PP
998 Only post features that you (or an incapicated friend you can personally
999 talk to) require.
1000 Do not post features because they seem like a good idea.
1001 If they are really useful, they will be requested by someone who
1002 requires them.
1003 .SS Is your question about youtube\-dl?
1004 .PP
1005 It may sound strange, but some bug reports we receive are completely
1006 unrelated to youtube\-dl and relate to a different or even the
1007 reporter\[aq]s own application.
1008 Please make sure that you are actually using youtube\-dl.
1009 If you are using a UI for youtube\-dl, report the bug to the maintainer
1010 of the actual application providing the UI.
1011 On the other hand, if your UI for youtube\-dl fails in some way you
1012 believe is related to youtube\-dl, by all means, go ahead and report the
1013 bug.
1014 .SH COPYRIGHT
1015 .PP
1016 youtube\-dl is released into the public domain by the copyright holders.
1017 .PP
1018 This README file was originally written by Daniel Bolton
1019 (<https://github.com/dbbolton>) and is likewise released into the public
1020 domain.