youtube-dl.html 84 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526
  1. <!-- Creator : groff version 1.22.3 -->
  2. <!-- CreationDate: Thu Dec 31 02:05:01 2015 -->
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  4. "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta name="generator" content="groff -Thtml, see www.gnu.org">
  8. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  9. <meta name="Content-Style" content="text/css">
  10. <style type="text/css">
  11. p { margin-top: 0; margin-bottom: 0; vertical-align: top }
  12. pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
  13. table { margin-top: 0; margin-bottom: 0; vertical-align: top }
  14. h1 { text-align: center }
  15. </style>
  16. <title>YOUTUBE&minus;DL</title>
  17. </head>
  18. <body>
  19. <h1 align="center">YOUTUBE&minus;DL</h1>
  20. <a href="#NAME">NAME</a><br>
  21. <a href="#SYNOPSIS">SYNOPSIS</a><br>
  22. <a href="#DESCRIPTION">DESCRIPTION</a><br>
  23. <a href="#OPTIONS">OPTIONS</a><br>
  24. <a href="#CONFIGURATION">CONFIGURATION</a><br>
  25. <a href="#OUTPUT TEMPLATE">OUTPUT TEMPLATE</a><br>
  26. <a href="#FORMAT SELECTION">FORMAT SELECTION</a><br>
  27. <a href="#VIDEO SELECTION">VIDEO SELECTION</a><br>
  28. <a href="#FAQ">FAQ</a><br>
  29. <a href="#DEVELOPER INSTRUCTIONS">DEVELOPER INSTRUCTIONS</a><br>
  30. <a href="#EMBEDDING YOUTUBE&minus;DL">EMBEDDING YOUTUBE&minus;DL</a><br>
  31. <a href="#BUGS">BUGS</a><br>
  32. <a href="#COPYRIGHT">COPYRIGHT</a><br>
  33. <hr>
  34. <h2>NAME
  35. <a name="NAME"></a>
  36. </h2>
  37. <p style="margin-left:11%; margin-top: 1em">youtube&minus;dl
  38. &minus; download videos from youtube.com or other video
  39. platforms</p>
  40. <h2>SYNOPSIS
  41. <a name="SYNOPSIS"></a>
  42. </h2>
  43. <p style="margin-left:11%; margin-top: 1em"><b>youtube&minus;dl</b>
  44. [OPTIONS] URL [URL...]</p>
  45. <h2>DESCRIPTION
  46. <a name="DESCRIPTION"></a>
  47. </h2>
  48. <p style="margin-left:11%; margin-top: 1em"><b>youtube&minus;dl</b>
  49. is a small command&minus;line program to download videos
  50. from YouTube.com and a few more sites. It requires the
  51. Python interpreter, version 2.6, 2.7, or 3.2+, and it is not
  52. platform specific. It should work on your Unix box, on
  53. Windows or on Mac OS X. It is released to the public domain,
  54. which means you can modify it, redistribute it or use it
  55. however you like.</p>
  56. <h2>OPTIONS
  57. <a name="OPTIONS"></a>
  58. </h2>
  59. <p style="margin-left:11%; margin-top: 1em"><b>&minus;h,
  60. &minus;&minus;help</b></p>
  61. <p style="margin-left:22%;">Print this help text and
  62. exit</p>
  63. <p style="margin-left:11%;"><b>&minus;&minus;version</b></p>
  64. <p style="margin-left:22%;">Print program version and
  65. exit</p>
  66. <p style="margin-left:11%;"><b>&minus;U,
  67. &minus;&minus;update</b></p>
  68. <p style="margin-left:22%;">Update this program to latest
  69. version. Make sure that you have sufficient permissions (run
  70. with sudo if needed)</p>
  71. <p style="margin-left:11%;"><b>&minus;i,
  72. &minus;&minus;ignore&minus;errors</b></p>
  73. <p style="margin-left:22%;">Continue on download errors,
  74. for example to skip unavailable videos in a playlist</p>
  75. <p style="margin-left:11%;"><b>&minus;&minus;abort&minus;on&minus;error</b></p>
  76. <p style="margin-left:22%;">Abort downloading of further
  77. videos (in the playlist or the command line) if an error
  78. occurs</p>
  79. <p style="margin-left:11%;"><b>&minus;&minus;dump&minus;user&minus;agent</b></p>
  80. <p style="margin-left:22%;">Display the current browser
  81. identification</p>
  82. <p style="margin-left:11%;"><b>&minus;&minus;list&minus;extractors</b></p>
  83. <p style="margin-left:22%;">List all supported
  84. extractors</p>
  85. <p style="margin-left:11%;"><b>&minus;&minus;extractor&minus;descriptions</b></p>
  86. <p style="margin-left:22%;">Output descriptions of all
  87. supported extractors</p>
  88. <p style="margin-left:11%;"><b>&minus;&minus;force&minus;generic&minus;extractor</b></p>
  89. <p style="margin-left:22%;">Force extraction to use the
  90. generic extractor</p>
  91. <p style="margin-left:11%;"><b>&minus;&minus;default&minus;search</b>
  92. <i>PREFIX</i></p>
  93. <p style="margin-left:22%;">Use this prefix for unqualified
  94. URLs. For example &quot;gvsearch2:&quot; downloads two
  95. videos from google videos for youtube&minus;dl &quot;large
  96. apple&quot;. Use the value &quot;auto&quot; to let
  97. youtube&minus;dl guess (&quot;auto_warning&quot; to emit a
  98. warning when guessing). &quot;error&quot; just throws an
  99. error. The default value &quot;fixup_error&quot; repairs
  100. broken URLs, but emits an error if this is not possible
  101. instead of searching.</p>
  102. <p style="margin-left:11%;"><b>&minus;&minus;ignore&minus;config</b></p>
  103. <p style="margin-left:22%;">Do not read configuration
  104. files. When given in the global configuration file /etc
  105. /youtube&minus;dl.conf: Do not read the user configuration
  106. in ~/.config/youtube&minus; dl/config
  107. (%APPDATA%/youtube&minus;dl/config.txt on Windows)</p>
  108. <p style="margin-left:11%;"><b>&minus;&minus;flat&minus;playlist</b></p>
  109. <p style="margin-left:22%;">Do not extract the videos of a
  110. playlist, only list them.</p>
  111. <p style="margin-left:11%;"><b>&minus;&minus;no&minus;color</b></p>
  112. <p style="margin-left:22%;">Do not emit color codes in
  113. output</p>
  114. <p style="margin-left:11%; margin-top: 1em"><b>Network
  115. Options: <br>
  116. &minus;&minus;proxy</b> <i>URL</i></p>
  117. <p style="margin-left:22%;">Use the specified HTTP/HTTPS
  118. proxy. Pass in an empty string (&minus;&minus;proxy
  119. &quot;&quot;) for direct connection</p>
  120. <p style="margin-left:11%;"><b>&minus;&minus;socket&minus;timeout</b>
  121. <i>SECONDS</i></p>
  122. <p style="margin-left:22%;">Time to wait before giving up,
  123. in seconds</p>
  124. <p style="margin-left:11%;"><b>&minus;&minus;source&minus;address</b>
  125. <i>IP</i></p>
  126. <p style="margin-left:22%;">Client&minus;side IP address to
  127. bind to (experimental)</p>
  128. <p style="margin-left:11%;"><b>&minus;4,
  129. &minus;&minus;force&minus;ipv4</b></p>
  130. <p style="margin-left:22%;">Make all connections via IPv4
  131. (experimental)</p>
  132. <p style="margin-left:11%;"><b>&minus;6,
  133. &minus;&minus;force&minus;ipv6</b></p>
  134. <p style="margin-left:22%;">Make all connections via IPv6
  135. (experimental)</p>
  136. <p style="margin-left:11%;"><b>&minus;&minus;cn&minus;verification&minus;proxy</b>
  137. <i>URL</i></p>
  138. <p style="margin-left:22%;">Use this proxy to verify the IP
  139. address for some Chinese sites. The default proxy specified
  140. by &minus;&minus;proxy (or none, if the options is not
  141. present) is used for the actual downloading.
  142. (experimental)</p>
  143. <p style="margin-left:11%; margin-top: 1em"><b>Video
  144. Selection: <br>
  145. &minus;&minus;playlist&minus;start</b> <i>NUMBER</i></p>
  146. <p style="margin-left:22%;">Playlist video to start at
  147. (default is 1)</p>
  148. <p style="margin-left:11%;"><b>&minus;&minus;playlist&minus;end</b>
  149. <i>NUMBER</i></p>
  150. <p style="margin-left:22%;">Playlist video to end at
  151. (default is last)</p>
  152. <p style="margin-left:11%;"><b>&minus;&minus;playlist&minus;items</b>
  153. <i>ITEM_SPEC</i></p>
  154. <p style="margin-left:22%;">Playlist video items to
  155. download. Specify indices of the videos in the playlist
  156. separated by commas like:
  157. &quot;&minus;&minus;playlist&minus;items 1,2,5,8&quot; if
  158. you want to download videos indexed 1, 2, 5, 8 in the
  159. playlist. You can specify range:
  160. &quot;&minus;&minus;playlist&minus;items
  161. 1&minus;3,7,10&minus;13&quot;, it will download the videos
  162. at index 1, 2, 3, 7, 10, 11, 12 and 13.</p>
  163. <p style="margin-left:11%;"><b>&minus;&minus;match&minus;title</b>
  164. <i>REGEX</i></p>
  165. <p style="margin-left:22%;">Download only matching titles
  166. (regex or caseless sub&minus;string)</p>
  167. <p style="margin-left:11%;"><b>&minus;&minus;reject&minus;title</b>
  168. <i>REGEX</i></p>
  169. <p style="margin-left:22%;">Skip download for matching
  170. titles (regex or caseless sub&minus;string)</p>
  171. <p style="margin-left:11%;"><b>&minus;&minus;max&minus;downloads</b>
  172. <i>NUMBER</i></p>
  173. <p style="margin-left:22%;">Abort after downloading NUMBER
  174. files</p>
  175. <p style="margin-left:11%;"><b>&minus;&minus;min&minus;filesize</b>
  176. <i>SIZE</i></p>
  177. <p style="margin-left:22%;">Do not download any videos
  178. smaller than SIZE (e.g. 50k or 44.6m)</p>
  179. <p style="margin-left:11%;"><b>&minus;&minus;max&minus;filesize</b>
  180. <i>SIZE</i></p>
  181. <p style="margin-left:22%;">Do not download any videos
  182. larger than SIZE (e.g. 50k or 44.6m)</p>
  183. <p style="margin-left:11%;"><b>&minus;&minus;date</b>
  184. <i>DATE</i></p>
  185. <p style="margin-left:22%;">Download only videos uploaded
  186. in this date</p>
  187. <p style="margin-left:11%;"><b>&minus;&minus;datebefore</b>
  188. <i>DATE</i></p>
  189. <p style="margin-left:22%;">Download only videos uploaded
  190. on or before this date (i.e. inclusive)</p>
  191. <p style="margin-left:11%;"><b>&minus;&minus;dateafter</b>
  192. <i>DATE</i></p>
  193. <p style="margin-left:22%;">Download only videos uploaded
  194. on or after this date (i.e. inclusive)</p>
  195. <p style="margin-left:11%;"><b>&minus;&minus;min&minus;views</b>
  196. <i>COUNT</i></p>
  197. <p style="margin-left:22%;">Do not download any videos with
  198. less than COUNT views</p>
  199. <p style="margin-left:11%;"><b>&minus;&minus;max&minus;views</b>
  200. <i>COUNT</i></p>
  201. <p style="margin-left:22%;">Do not download any videos with
  202. more than COUNT views</p>
  203. <p style="margin-left:11%;"><b>&minus;&minus;match&minus;filter</b>
  204. <i>FILTER</i></p>
  205. <p style="margin-left:22%;">Generic video filter
  206. (experimental). Specify any key (see help for &minus;o for a
  207. list of available keys) to match if the key is present, !key
  208. to check if the key is not present,key &gt; NUMBER (like
  209. &quot;comment_count &gt; 12&quot;, also works with &gt;=,
  210. &lt;, &lt;=, !=, =) to compare against a number, and &amp;
  211. to require multiple matches. Values which are not known are
  212. excluded unless you put a question mark (?) after the
  213. operator.For example, to only match videos that have been
  214. liked more than 100 times and disliked less than 50 times
  215. (or the dislike functionality is not available at the given
  216. service), but who also have a description, use
  217. &minus;&minus;match&minus;filter &quot;like_count &gt; 100
  218. &amp; dislike_count &lt;? 50 &amp; description&quot; .</p>
  219. <p style="margin-left:11%;"><b>&minus;&minus;no&minus;playlist</b></p>
  220. <p style="margin-left:22%;">Download only the video, if the
  221. URL refers to a video and a playlist.</p>
  222. <p style="margin-left:11%;"><b>&minus;&minus;yes&minus;playlist</b></p>
  223. <p style="margin-left:22%;">Download the playlist, if the
  224. URL refers to a video and a playlist.</p>
  225. <p style="margin-left:11%;"><b>&minus;&minus;age&minus;limit</b>
  226. <i>YEARS</i></p>
  227. <p style="margin-left:22%;">Download only videos suitable
  228. for the given age</p>
  229. <p style="margin-left:11%;"><b>&minus;&minus;download&minus;archive</b>
  230. <i>FILE</i></p>
  231. <p style="margin-left:22%;">Download only videos not listed
  232. in the archive file. Record the IDs of all downloaded videos
  233. in it.</p>
  234. <p style="margin-left:11%;"><b>&minus;&minus;include&minus;ads</b></p>
  235. <p style="margin-left:22%;">Download advertisements as well
  236. (experimental)</p>
  237. <p style="margin-left:11%; margin-top: 1em"><b>Download
  238. Options: <br>
  239. &minus;r, &minus;&minus;rate&minus;limit</b>
  240. <i>LIMIT</i></p>
  241. <p style="margin-left:22%;">Maximum download rate in bytes
  242. per second (e.g. 50K or 4.2M)</p>
  243. <p style="margin-left:11%;"><b>&minus;R,
  244. &minus;&minus;retries</b> <i>RETRIES</i></p>
  245. <p style="margin-left:22%;">Number of retries (default is
  246. 10), or &quot;infinite&quot;.</p>
  247. <p style="margin-left:11%;"><b>&minus;&minus;buffer&minus;size</b>
  248. <i>SIZE</i></p>
  249. <p style="margin-left:22%;">Size of download buffer (e.g.
  250. 1024 or 16K) (default is 1024)</p>
  251. <p style="margin-left:11%;"><b>&minus;&minus;no&minus;resize&minus;buffer</b></p>
  252. <p style="margin-left:22%;">Do not automatically adjust the
  253. buffer size. By default, the buffer size is automatically
  254. resized from an initial value of SIZE.</p>
  255. <p style="margin-left:11%;"><b>&minus;&minus;playlist&minus;reverse</b></p>
  256. <p style="margin-left:22%;">Download playlist videos in
  257. reverse order</p>
  258. <p style="margin-left:11%;"><b>&minus;&minus;xattr&minus;set&minus;filesize</b></p>
  259. <p style="margin-left:22%;">Set file xattribute
  260. ytdl.filesize with expected filesize (experimental)</p>
  261. <p style="margin-left:11%;"><b>&minus;&minus;hls&minus;prefer&minus;native</b></p>
  262. <p style="margin-left:22%;">Use the native HLS downloader
  263. instead of ffmpeg (experimental)</p>
  264. <p style="margin-left:11%;"><b>&minus;&minus;external&minus;downloader</b>
  265. <i>COMMAND</i></p>
  266. <p style="margin-left:22%;">Use the specified external
  267. downloader. Currently supports
  268. aria2c,axel,curl,httpie,wget</p>
  269. <p style="margin-left:11%;"><b>&minus;&minus;external&minus;downloader&minus;args</b>
  270. <i>ARGS</i></p>
  271. <p style="margin-left:22%;">Give these arguments to the
  272. external downloader</p>
  273. <p style="margin-left:11%; margin-top: 1em"><b>Filesystem
  274. Options: <br>
  275. &minus;a, &minus;&minus;batch&minus;file</b> <i>FILE</i></p>
  276. <p style="margin-left:22%;">File containing URLs to
  277. download ('&minus;' for stdin)</p>
  278. <table width="100%" border="0" rules="none" frame="void"
  279. cellspacing="0" cellpadding="0">
  280. <tr valign="top" align="left">
  281. <td width="11%"></td>
  282. <td width="6%">
  283. <p><b>&minus;&minus;id</b></p></td>
  284. <td width="5%"></td>
  285. <td width="46%">
  286. <p>Use only video ID in file name</p></td>
  287. <td width="32%">
  288. </td></tr>
  289. </table>
  290. <p style="margin-left:11%;"><b>&minus;o,
  291. &minus;&minus;output</b> <i>TEMPLATE</i></p>
  292. <p style="margin-left:22%;">Output filename template. Use
  293. %(title)s to get the title, %(uploader)s for the uploader
  294. name, %(uploader_id)s for the uploader nickname if
  295. different, %(autonumber)s to get an automatically
  296. incremented number, %(ext)s for the filename extension,
  297. %(format)s for the format description (like &quot;22 &minus;
  298. 1280x720&quot; or &quot;HD&quot;), %(format_id)s for the
  299. unique id of the format (like YouTube's itags:
  300. &quot;137&quot;), %(upload_date)s for the upload date
  301. (YYYYMMDD), %(extractor)s for the provider (youtube,
  302. metacafe, etc), %(id)s for the video id, %(playlist_title)s,
  303. %(playlist_id)s, or %(playlist)s (=title if present, ID
  304. otherwise) for the playlist the video is in,
  305. %(playlist_index)s for the position in the playlist.
  306. %(height)s and %(width)s for the width and height of the
  307. video format. %(resolution)s for a textual description of
  308. the resolution of the video format. %% for a literal
  309. percent. Use &minus; to output to stdout. Can also be used
  310. to download to a different directory, for example with
  311. &minus;o '/my/downloads/%(uploader)s
  312. /%(title)s&minus;%(id)s.%(ext)s' .</p>
  313. <p style="margin-left:11%;"><b>&minus;&minus;autonumber&minus;size</b>
  314. <i>NUMBER</i></p>
  315. <p style="margin-left:22%;">Specify the number of digits in
  316. %(autonumber)s when it is present in output filename
  317. template or &minus;&minus;auto&minus;number option is
  318. given</p>
  319. <p style="margin-left:11%;"><b>&minus;&minus;restrict&minus;filenames</b></p>
  320. <p style="margin-left:22%;">Restrict filenames to only
  321. ASCII characters, and avoid &quot;&amp;&quot; and spaces in
  322. filenames</p>
  323. <p style="margin-left:11%;"><b>&minus;A,
  324. &minus;&minus;auto&minus;number</b></p>
  325. <p style="margin-left:22%;">[deprecated; use &minus;o
  326. &quot;%(autonumber)s&minus;%(title)s.%(ext)s&quot; ] Number
  327. downloaded files starting from 00000</p>
  328. <p style="margin-left:11%;"><b>&minus;t,
  329. &minus;&minus;title</b></p>
  330. <p style="margin-left:22%;">[deprecated] Use title in file
  331. name (default)</p>
  332. <p style="margin-left:11%;"><b>&minus;l,
  333. &minus;&minus;literal</b></p>
  334. <p style="margin-left:22%;">[deprecated] Alias of
  335. &minus;&minus;title</p>
  336. <p style="margin-left:11%;"><b>&minus;w,
  337. &minus;&minus;no&minus;overwrites</b></p>
  338. <p style="margin-left:22%;">Do not overwrite files</p>
  339. <p style="margin-left:11%;"><b>&minus;c,
  340. &minus;&minus;continue</b></p>
  341. <p style="margin-left:22%;">Force resume of partially
  342. downloaded files. By default, youtube&minus;dl will resume
  343. downloads if possible.</p>
  344. <p style="margin-left:11%;"><b>&minus;&minus;no&minus;continue</b></p>
  345. <p style="margin-left:22%;">Do not resume partially
  346. downloaded files (restart from beginning)</p>
  347. <p style="margin-left:11%;"><b>&minus;&minus;no&minus;part</b></p>
  348. <p style="margin-left:22%;">Do not use .part files &minus;
  349. write directly into output file</p>
  350. <p style="margin-left:11%;"><b>&minus;&minus;no&minus;mtime</b></p>
  351. <p style="margin-left:22%;">Do not use the
  352. Last&minus;modified header to set the file modification
  353. time</p>
  354. <p style="margin-left:11%;"><b>&minus;&minus;write&minus;description</b></p>
  355. <p style="margin-left:22%;">Write video description to a
  356. .description file</p>
  357. <p style="margin-left:11%;"><b>&minus;&minus;write&minus;info&minus;json</b></p>
  358. <p style="margin-left:22%;">Write video metadata to a
  359. .info.json file</p>
  360. <p style="margin-left:11%;"><b>&minus;&minus;write&minus;annotations</b></p>
  361. <p style="margin-left:22%;">Write video annotations to a
  362. .annotations.xml file</p>
  363. <p style="margin-left:11%;"><b>&minus;&minus;load&minus;info</b>
  364. <i>FILE</i></p>
  365. <p style="margin-left:22%;">JSON file containing the video
  366. information (created with the
  367. &quot;&minus;&minus;write&minus;info&minus;json&quot;
  368. option)</p>
  369. <p style="margin-left:11%;"><b>&minus;&minus;cookies</b>
  370. <i>FILE</i></p>
  371. <p style="margin-left:22%;">File to read cookies from and
  372. dump cookie jar in</p>
  373. <p style="margin-left:11%;"><b>&minus;&minus;cache&minus;dir</b>
  374. <i>DIR</i></p>
  375. <p style="margin-left:22%;">Location in the filesystem
  376. where youtube&minus;dl can store some downloaded information
  377. permanently. By default $XDG_CACHE_HOME /youtube&minus;dl or
  378. ~/.cache/youtube&minus;dl . At the moment, only YouTube
  379. player files (for videos with obfuscated signatures) are
  380. cached, but that may change.</p>
  381. <p style="margin-left:11%;"><b>&minus;&minus;no&minus;cache&minus;dir</b></p>
  382. <p style="margin-left:22%;">Disable filesystem caching</p>
  383. <p style="margin-left:11%;"><b>&minus;&minus;rm&minus;cache&minus;dir</b></p>
  384. <p style="margin-left:22%;">Delete all filesystem cache
  385. files</p>
  386. <p style="margin-left:11%; margin-top: 1em"><b>Thumbnail
  387. images: <br>
  388. &minus;&minus;write&minus;thumbnail</b></p>
  389. <p style="margin-left:22%;">Write thumbnail image to
  390. disk</p>
  391. <p style="margin-left:11%;"><b>&minus;&minus;write&minus;all&minus;thumbnails</b></p>
  392. <p style="margin-left:22%;">Write all thumbnail image
  393. formats to disk</p>
  394. <p style="margin-left:11%;"><b>&minus;&minus;list&minus;thumbnails</b></p>
  395. <p style="margin-left:22%;">Simulate and list all available
  396. thumbnail formats</p>
  397. <p style="margin-left:11%; margin-top: 1em"><b>Verbosity /
  398. Simulation Options: <br>
  399. &minus;q, &minus;&minus;quiet</b></p>
  400. <p style="margin-left:22%;">Activate quiet mode</p>
  401. <p style="margin-left:11%;"><b>&minus;&minus;no&minus;warnings</b></p>
  402. <p style="margin-left:22%;">Ignore warnings</p>
  403. <p style="margin-left:11%;"><b>&minus;s,
  404. &minus;&minus;simulate</b></p>
  405. <p style="margin-left:22%;">Do not download the video and
  406. do not write anything to disk</p>
  407. <p style="margin-left:11%;"><b>&minus;&minus;skip&minus;download</b></p>
  408. <p style="margin-left:22%;">Do not download the video</p>
  409. <p style="margin-left:11%;"><b>&minus;g,
  410. &minus;&minus;get&minus;url</b></p>
  411. <p style="margin-left:22%;">Simulate, quiet but print
  412. URL</p>
  413. <p style="margin-left:11%;"><b>&minus;e,
  414. &minus;&minus;get&minus;title</b></p>
  415. <p style="margin-left:22%;">Simulate, quiet but print
  416. title</p>
  417. <p style="margin-left:11%;"><b>&minus;&minus;get&minus;id</b></p>
  418. <p style="margin-left:22%;">Simulate, quiet but print
  419. id</p>
  420. <p style="margin-left:11%;"><b>&minus;&minus;get&minus;thumbnail</b></p>
  421. <p style="margin-left:22%;">Simulate, quiet but print
  422. thumbnail URL</p>
  423. <p style="margin-left:11%;"><b>&minus;&minus;get&minus;description</b></p>
  424. <p style="margin-left:22%;">Simulate, quiet but print video
  425. description</p>
  426. <p style="margin-left:11%;"><b>&minus;&minus;get&minus;duration</b></p>
  427. <p style="margin-left:22%;">Simulate, quiet but print video
  428. length</p>
  429. <p style="margin-left:11%;"><b>&minus;&minus;get&minus;filename</b></p>
  430. <p style="margin-left:22%;">Simulate, quiet but print
  431. output filename</p>
  432. <p style="margin-left:11%;"><b>&minus;&minus;get&minus;format</b></p>
  433. <p style="margin-left:22%;">Simulate, quiet but print
  434. output format</p>
  435. <p style="margin-left:11%;"><b>&minus;j,
  436. &minus;&minus;dump&minus;json</b></p>
  437. <p style="margin-left:22%;">Simulate, quiet but print JSON
  438. information. See &minus;&minus;output for a description of
  439. available keys.</p>
  440. <p style="margin-left:11%;"><b>&minus;J,
  441. &minus;&minus;dump&minus;single&minus;json</b></p>
  442. <p style="margin-left:22%;">Simulate, quiet but print JSON
  443. information for each command&minus;line argument. If the URL
  444. refers to a playlist, dump the whole playlist information in
  445. a single line.</p>
  446. <p style="margin-left:11%;"><b>&minus;&minus;print&minus;json</b></p>
  447. <p style="margin-left:22%;">Be quiet and print the video
  448. information as JSON (video is still being downloaded).</p>
  449. <p style="margin-left:11%;"><b>&minus;&minus;newline</b></p>
  450. <p style="margin-left:22%;">Output progress bar as new
  451. lines</p>
  452. <p style="margin-left:11%;"><b>&minus;&minus;no&minus;progress</b></p>
  453. <p style="margin-left:22%;">Do not print progress bar</p>
  454. <p style="margin-left:11%;"><b>&minus;&minus;console&minus;title</b></p>
  455. <p style="margin-left:22%;">Display progress in console
  456. titlebar</p>
  457. <p style="margin-left:11%;"><b>&minus;v,
  458. &minus;&minus;verbose</b></p>
  459. <p style="margin-left:22%;">Print various debugging
  460. information</p>
  461. <p style="margin-left:11%;"><b>&minus;&minus;dump&minus;pages</b></p>
  462. <p style="margin-left:22%;">Print downloaded pages encoded
  463. using base64 to debug problems (very verbose)</p>
  464. <p style="margin-left:11%;"><b>&minus;&minus;write&minus;pages</b></p>
  465. <p style="margin-left:22%;">Write downloaded intermediary
  466. pages to files in the current directory to debug
  467. problems</p>
  468. <p style="margin-left:11%;"><b>&minus;&minus;print&minus;traffic</b></p>
  469. <p style="margin-left:22%;">Display sent and read HTTP
  470. traffic</p>
  471. <p style="margin-left:11%;"><b>&minus;C,
  472. &minus;&minus;call&minus;home</b></p>
  473. <p style="margin-left:22%;">Contact the youtube&minus;dl
  474. server for debugging</p>
  475. <p style="margin-left:11%;"><b>&minus;&minus;no&minus;call&minus;home</b></p>
  476. <p style="margin-left:22%;">Do NOT contact the
  477. youtube&minus;dl server for debugging</p>
  478. <p style="margin-left:11%; margin-top: 1em"><b>Workarounds:
  479. <br>
  480. &minus;&minus;encoding</b> <i>ENCODING</i></p>
  481. <p style="margin-left:22%;">Force the specified encoding
  482. (experimental)</p>
  483. <p style="margin-left:11%;"><b>&minus;&minus;no&minus;check&minus;certificate</b></p>
  484. <p style="margin-left:22%;">Suppress HTTPS certificate
  485. validation</p>
  486. <p style="margin-left:11%;"><b>&minus;&minus;prefer&minus;insecure</b></p>
  487. <p style="margin-left:22%;">Use an unencrypted connection
  488. to retrieve information about the video. (Currently
  489. supported only for YouTube)</p>
  490. <p style="margin-left:11%;"><b>&minus;&minus;user&minus;agent</b>
  491. <i>UA</i></p>
  492. <p style="margin-left:22%;">Specify a custom user agent</p>
  493. <p style="margin-left:11%;"><b>&minus;&minus;referer</b>
  494. <i>URL</i></p>
  495. <p style="margin-left:22%;">Specify a custom referer, use
  496. if the video access is restricted to one domain</p>
  497. <p style="margin-left:11%;"><b>&minus;&minus;add&minus;header</b>
  498. <i>FIELD:VALUE</i></p>
  499. <p style="margin-left:22%;">Specify a custom HTTP header
  500. and its value, separated by a colon ':'. You can use this
  501. option multiple times</p>
  502. <p style="margin-left:11%;"><b>&minus;&minus;bidi&minus;workaround</b></p>
  503. <p style="margin-left:22%;">Work around terminals that lack
  504. bidirectional text support. Requires bidiv or fribidi
  505. executable in PATH</p>
  506. <p style="margin-left:11%;"><b>&minus;&minus;sleep&minus;interval</b>
  507. <i>SECONDS</i></p>
  508. <p style="margin-left:22%;">Number of seconds to sleep
  509. before each download.</p>
  510. <p style="margin-left:11%; margin-top: 1em"><b>Video Format
  511. Options: <br>
  512. &minus;f, &minus;&minus;format</b> <i>FORMAT</i></p>
  513. <p style="margin-left:22%;">Video format code, see the
  514. &quot;FORMAT SELECTION&quot; for all the info</p>
  515. <p style="margin-left:11%;"><b>&minus;&minus;all&minus;formats</b></p>
  516. <p style="margin-left:22%;">Download all available video
  517. formats</p>
  518. <p style="margin-left:11%;"><b>&minus;&minus;prefer&minus;free&minus;formats</b></p>
  519. <p style="margin-left:22%;">Prefer free video formats
  520. unless a specific one is requested</p>
  521. <p style="margin-left:11%;"><b>&minus;F,
  522. &minus;&minus;list&minus;formats</b></p>
  523. <p style="margin-left:22%;">List all available formats of
  524. requested videos</p>
  525. <p style="margin-left:11%;"><b>&minus;&minus;youtube&minus;skip&minus;dash&minus;manifest</b></p>
  526. <p style="margin-left:22%;">Do not download the DASH
  527. manifests and related data on YouTube videos</p>
  528. <p style="margin-left:11%;"><b>&minus;&minus;merge&minus;output&minus;format</b>
  529. <i>FORMAT</i></p>
  530. <p style="margin-left:22%;">If a merge is required (e.g.
  531. bestvideo+bestaudio), output to given container format. One
  532. of mkv, mp4, ogg, webm, flv. Ignored if no merge is
  533. required</p>
  534. <p style="margin-left:11%; margin-top: 1em"><b>Subtitle
  535. Options: <br>
  536. &minus;&minus;write&minus;sub</b></p>
  537. <p style="margin-left:22%;">Write subtitle file</p>
  538. <p style="margin-left:11%;"><b>&minus;&minus;write&minus;auto&minus;sub</b></p>
  539. <p style="margin-left:22%;">Write automatically generated
  540. subtitle file (YouTube only)</p>
  541. <p style="margin-left:11%;"><b>&minus;&minus;all&minus;subs</b></p>
  542. <p style="margin-left:22%;">Download all the available
  543. subtitles of the video</p>
  544. <p style="margin-left:11%;"><b>&minus;&minus;list&minus;subs</b></p>
  545. <p style="margin-left:22%;">List all available subtitles
  546. for the video</p>
  547. <p style="margin-left:11%;"><b>&minus;&minus;sub&minus;format</b>
  548. <i>FORMAT</i></p>
  549. <p style="margin-left:22%;">Subtitle format, accepts
  550. formats preference, for example: &quot;srt&quot; or
  551. &quot;ass/srt/best&quot;</p>
  552. <p style="margin-left:11%;"><b>&minus;&minus;sub&minus;lang</b>
  553. <i>LANGS</i></p>
  554. <p style="margin-left:22%;">Languages of the subtitles to
  555. download (optional) separated by commas, use IETF language
  556. tags like 'en,pt'</p>
  557. <p style="margin-left:11%; margin-top: 1em"><b>Authentication
  558. Options: <br>
  559. &minus;u, &minus;&minus;username</b> <i>USERNAME</i></p>
  560. <p style="margin-left:22%;">Login with this account ID</p>
  561. <p style="margin-left:11%;"><b>&minus;p,
  562. &minus;&minus;password</b> <i>PASSWORD</i></p>
  563. <p style="margin-left:22%;">Account password. If this
  564. option is left out, youtube&minus;dl will ask
  565. interactively.</p>
  566. <p style="margin-left:11%;"><b>&minus;2,
  567. &minus;&minus;twofactor</b> <i>TWOFACTOR</i></p>
  568. <p style="margin-left:22%;">Two&minus;factor auth code</p>
  569. <p style="margin-left:11%;"><b>&minus;n,
  570. &minus;&minus;netrc</b></p>
  571. <p style="margin-left:22%;">Use .netrc authentication
  572. data</p>
  573. <p style="margin-left:11%;"><b>&minus;&minus;video&minus;password</b>
  574. <i>PASSWORD</i></p>
  575. <p style="margin-left:22%;">Video password (vimeo, smotri,
  576. youku)</p>
  577. <p style="margin-left:11%; margin-top: 1em"><b>Post&minus;processing
  578. Options: <br>
  579. &minus;x, &minus;&minus;extract&minus;audio</b></p>
  580. <p style="margin-left:22%;">Convert video files to
  581. audio&minus;only files (requires ffmpeg or avconv and
  582. ffprobe or avprobe)</p>
  583. <p style="margin-left:11%;"><b>&minus;&minus;audio&minus;format</b>
  584. <i>FORMAT</i></p>
  585. <p style="margin-left:22%;">Specify audio format:
  586. &quot;best&quot;, &quot;aac&quot;, &quot;vorbis&quot;,
  587. &quot;mp3&quot;, &quot;m4a&quot;, &quot;opus&quot;, or
  588. &quot;wav&quot;; &quot;best&quot; by default</p>
  589. <p style="margin-left:11%;"><b>&minus;&minus;audio&minus;quality</b>
  590. <i>QUALITY</i></p>
  591. <p style="margin-left:22%;">Specify ffmpeg/avconv audio
  592. quality, insert a value between 0 (better) and 9 (worse) for
  593. VBR or a specific bitrate like 128K (default 5)</p>
  594. <p style="margin-left:11%;"><b>&minus;&minus;recode&minus;video</b>
  595. <i>FORMAT</i></p>
  596. <p style="margin-left:22%;">Encode the video to another
  597. format if necessary (currently supported:
  598. mp4|flv|ogg|webm|mkv|avi)</p>
  599. <p style="margin-left:11%;"><b>&minus;&minus;postprocessor&minus;args</b>
  600. <i>ARGS</i></p>
  601. <p style="margin-left:22%;">Give these arguments to the
  602. postprocessor</p>
  603. <p style="margin-left:11%;"><b>&minus;k,
  604. &minus;&minus;keep&minus;video</b></p>
  605. <p style="margin-left:22%;">Keep the video file on disk
  606. after the post&minus; processing; the video is erased by
  607. default</p>
  608. <p style="margin-left:11%;"><b>&minus;&minus;no&minus;post&minus;overwrites</b></p>
  609. <p style="margin-left:22%;">Do not overwrite
  610. post&minus;processed files; the post&minus;processed files
  611. are overwritten by default</p>
  612. <p style="margin-left:11%;"><b>&minus;&minus;embed&minus;subs</b></p>
  613. <p style="margin-left:22%;">Embed subtitles in the video
  614. (only for mkv and mp4 videos)</p>
  615. <p style="margin-left:11%;"><b>&minus;&minus;embed&minus;thumbnail</b></p>
  616. <p style="margin-left:22%;">Embed thumbnail in the audio as
  617. cover art</p>
  618. <p style="margin-left:11%;"><b>&minus;&minus;add&minus;metadata</b></p>
  619. <p style="margin-left:22%;">Write metadata to the video
  620. file</p>
  621. <p style="margin-left:11%;"><b>&minus;&minus;metadata&minus;from&minus;title</b>
  622. <i>FORMAT</i></p>
  623. <p style="margin-left:22%;">Parse additional metadata like
  624. song title / artist from the video title. The format syntax
  625. is the same as &minus;&minus;output, the parsed parameters
  626. replace existing values. Additional templates: %(album)s,
  627. %(artist)s. Example:
  628. &minus;&minus;metadata&minus;from&minus;title
  629. &quot;%(artist)s &minus; %(title)s&quot; matches a title
  630. like &quot;Coldplay &minus; Paradise&quot;</p>
  631. <p style="margin-left:11%;"><b>&minus;&minus;xattrs</b></p>
  632. <p style="margin-left:22%;">Write metadata to the video
  633. file's xattrs (using dublin core and xdg standards)</p>
  634. <p style="margin-left:11%;"><b>&minus;&minus;fixup</b>
  635. <i>POLICY</i></p>
  636. <p style="margin-left:22%;">Automatically correct known
  637. faults of the file. One of never (do nothing), warn (only
  638. emit a warning), detect_or_warn (the default; fix file if we
  639. can, warn otherwise)</p>
  640. <p style="margin-left:11%;"><b>&minus;&minus;prefer&minus;avconv</b></p>
  641. <p style="margin-left:22%;">Prefer avconv over ffmpeg for
  642. running the postprocessors (default)</p>
  643. <p style="margin-left:11%;"><b>&minus;&minus;prefer&minus;ffmpeg</b></p>
  644. <p style="margin-left:22%;">Prefer ffmpeg over avconv for
  645. running the postprocessors</p>
  646. <p style="margin-left:11%;"><b>&minus;&minus;ffmpeg&minus;location</b>
  647. <i>PATH</i></p>
  648. <p style="margin-left:22%;">Location of the ffmpeg/avconv
  649. binary; either the path to the binary or its containing
  650. directory.</p>
  651. <p style="margin-left:11%;"><b>&minus;&minus;exec</b>
  652. <i>CMD</i></p>
  653. <p style="margin-left:22%;">Execute a command on the file
  654. after downloading, similar to find's &minus;exec syntax.
  655. Example: &minus;&minus;exec 'adb push {} /sdcard/Music/
  656. &amp;&amp; rm {}'</p>
  657. <p style="margin-left:11%;"><b>&minus;&minus;convert&minus;subtitles</b>
  658. <i>FORMAT</i></p>
  659. <p style="margin-left:22%;">Convert the subtitles to other
  660. format (currently supported: srt|ass|vtt)</p>
  661. <h2>CONFIGURATION
  662. <a name="CONFIGURATION"></a>
  663. </h2>
  664. <p style="margin-left:11%; margin-top: 1em">You can
  665. configure youtube&minus;dl by placing any supported command
  666. line option to a configuration file. On Linux, the system
  667. wide configuration file is located at
  668. <tt>/etc/youtube&minus;dl.conf</tt> and the user wide
  669. configuration file at
  670. <tt>~/.config/youtube&minus;dl/config</tt>. On Windows, the
  671. user wide configuration file locations are
  672. <tt>%APPDATA%\youtube&minus;dl\config.txt</tt> or
  673. <tt>C:\Users\&lt;user&nbsp;name&gt;\youtube&minus;dl.conf</tt>.
  674. For example, with the following configuration file
  675. youtube&minus;dl will always extract the audio, not copy the
  676. mtime and use a proxy:</p>
  677. <pre style="margin-left:22%; margin-top: 1em">&minus;&minus;extract&minus;audio
  678. &minus;&minus;no&minus;mtime
  679. &minus;&minus;proxy&nbsp;127.0.0.1:3128</pre>
  680. <p style="margin-left:11%; margin-top: 1em">You can use
  681. <tt>&minus;&minus;ignore&minus;config</tt> if you want to
  682. disable the configuration file for a particular
  683. youtube&minus;dl run.</p>
  684. <p style="margin-left:11%; margin-top: 1em"><b>Authentication
  685. with</b> <tt>.netrc</tt> <b>file</b> <br>
  686. You may also want to configure automatic credentials storage
  687. for extractors that support authentication (by providing
  688. login and password with <tt>&minus;&minus;username</tt> and
  689. <tt>&minus;&minus;password</tt>) in order not to pass
  690. credentials as command line arguments on every
  691. youtube&minus;dl execution and prevent tracking plain text
  692. passwords in the shell command history. You can achieve this
  693. using a <tt>.netrc</tt> file
  694. (http://stackoverflow.com/tags/.netrc/info) on per extractor
  695. basis. For that you will need to create a<tt>.netrc</tt>
  696. file in your <tt>$HOME</tt> and restrict permissions to
  697. read/write by you only:</p>
  698. <pre style="margin-left:22%; margin-top: 1em">touch&nbsp;$HOME/.netrc
  699. chmod&nbsp;a&minus;rwx,u+rw&nbsp;$HOME/.netrc</pre>
  700. <p style="margin-left:11%; margin-top: 1em">After that you
  701. can add credentials for extractor in the following format,
  702. where <i>extractor</i> is the name of extractor in
  703. lowercase:</p>
  704. <pre style="margin-left:22%; margin-top: 1em">machine&nbsp;&lt;extractor&gt;&nbsp;login&nbsp;&lt;login&gt;&nbsp;password&nbsp;&lt;password&gt;</pre>
  705. <p style="margin-left:11%; margin-top: 1em">For
  706. example:</p>
  707. <pre style="margin-left:22%; margin-top: 1em">machine&nbsp;youtube&nbsp;login&nbsp;myaccount@gmail.com&nbsp;password&nbsp;my_youtube_password
  708. machine&nbsp;twitch&nbsp;login&nbsp;my_twitch_account_name&nbsp;password&nbsp;my_twitch_password</pre>
  709. <p style="margin-left:11%; margin-top: 1em">To activate
  710. authentication with the <tt>.netrc</tt> file you should pass
  711. <tt>&minus;&minus;netrc</tt> to youtube&minus;dl or place it
  712. in the configuration file (#configuration).</p>
  713. <p style="margin-left:11%; margin-top: 1em">On Windows you
  714. may also need to setup the <tt>%HOME%</tt> environment
  715. variable manually.</p>
  716. <h2>OUTPUT TEMPLATE
  717. <a name="OUTPUT TEMPLATE"></a>
  718. </h2>
  719. <p style="margin-left:11%; margin-top: 1em">The
  720. <tt>&minus;o</tt> option allows users to indicate a template
  721. for the output file names. The basic usage is not to set any
  722. template arguments when downloading a single file, like in
  723. <tt>youtube&minus;dl&nbsp;&minus;o&nbsp;funny_video.flv&nbsp;&quot;http://some/video&quot;</tt>.
  724. However, it may contain special sequences that will be
  725. replaced when downloading each video. The special sequences
  726. have the format <tt>%(NAME)s</tt>. To clarify, that is a
  727. percent symbol followed by a name in parentheses, followed
  728. by a lowercase S. Allowed names are:</p>
  729. <table width="100%" border="0" rules="none" frame="void"
  730. cellspacing="0" cellpadding="0">
  731. <tr valign="top" align="left">
  732. <td width="11%"></td>
  733. <td width="1%">
  734. <p>&bull;</p></td>
  735. <td width="2%"></td>
  736. <td width="86%">
  737. <p><tt>id</tt>: The sequence will be replaced by the video
  738. identifier.</p> </td></tr>
  739. <tr valign="top" align="left">
  740. <td width="11%"></td>
  741. <td width="1%">
  742. <p>&bull;</p></td>
  743. <td width="2%"></td>
  744. <td width="86%">
  745. <p><tt>url</tt>: The sequence will be replaced by the video
  746. URL.</p> </td></tr>
  747. <tr valign="top" align="left">
  748. <td width="11%"></td>
  749. <td width="1%">
  750. <p>&bull;</p></td>
  751. <td width="2%"></td>
  752. <td width="86%">
  753. <p><tt>uploader</tt>: The sequence will be replaced by the
  754. nickname of the person who uploaded the video.</p></td></tr>
  755. <tr valign="top" align="left">
  756. <td width="11%"></td>
  757. <td width="1%">
  758. <p>&bull;</p></td>
  759. <td width="2%"></td>
  760. <td width="86%">
  761. <p><tt>upload_date</tt>: The sequence will be replaced by
  762. the upload date in YYYYMMDD format.</p></td></tr>
  763. <tr valign="top" align="left">
  764. <td width="11%"></td>
  765. <td width="1%">
  766. <p>&bull;</p></td>
  767. <td width="2%"></td>
  768. <td width="86%">
  769. <p><tt>title</tt>: The sequence will be replaced by the
  770. video title.</p></td></tr>
  771. <tr valign="top" align="left">
  772. <td width="11%"></td>
  773. <td width="1%">
  774. <p>&bull;</p></td>
  775. <td width="2%"></td>
  776. <td width="86%">
  777. <p><tt>ext</tt>: The sequence will be replaced by the
  778. appropriate extension (like flv or mp4).</p></td></tr>
  779. <tr valign="top" align="left">
  780. <td width="11%"></td>
  781. <td width="1%">
  782. <p>&bull;</p></td>
  783. <td width="2%"></td>
  784. <td width="86%">
  785. <p><tt>epoch</tt>: The sequence will be replaced by the
  786. Unix epoch when creating the file.</p></td></tr>
  787. <tr valign="top" align="left">
  788. <td width="11%"></td>
  789. <td width="1%">
  790. <p>&bull;</p></td>
  791. <td width="2%"></td>
  792. <td width="86%">
  793. <p><tt>autonumber</tt>: The sequence will be replaced by a
  794. five&minus;digit number that will be increased with each
  795. download, starting at zero.</p></td></tr>
  796. <tr valign="top" align="left">
  797. <td width="11%"></td>
  798. <td width="1%">
  799. <p>&bull;</p></td>
  800. <td width="2%"></td>
  801. <td width="86%">
  802. <p><tt>playlist</tt>: The sequence will be replaced by the
  803. name or the id of the playlist that contains the video.</p></td></tr>
  804. <tr valign="top" align="left">
  805. <td width="11%"></td>
  806. <td width="1%">
  807. <p>&bull;</p></td>
  808. <td width="2%"></td>
  809. <td width="86%">
  810. <p><tt>playlist_index</tt>: The sequence will be replaced
  811. by the index of the video in the playlist padded with
  812. leading zeros according to the total length of the
  813. playlist.</p> </td></tr>
  814. <tr valign="top" align="left">
  815. <td width="11%"></td>
  816. <td width="1%">
  817. <p>&bull;</p></td>
  818. <td width="2%"></td>
  819. <td width="86%">
  820. <p><tt>format_id</tt>: The sequence will be replaced by the
  821. format code specified by <tt>&minus;&minus;format</tt>.</p></td></tr>
  822. <tr valign="top" align="left">
  823. <td width="11%"></td>
  824. <td width="1%">
  825. <p>&bull;</p></td>
  826. <td width="2%"></td>
  827. <td width="86%">
  828. <p><tt>duration</tt>: The sequence will be replaced by the
  829. length of the video in seconds.</p></td></tr>
  830. </table>
  831. <p style="margin-left:11%; margin-top: 1em">The current
  832. default template is
  833. <tt>%(title)s&minus;%(id)s.%(ext)s</tt>.</p>
  834. <p style="margin-left:11%; margin-top: 1em">In some cases,
  835. you don't want special characters such as &auml;&cedil;,
  836. spaces, or &amp;, such as when transferring the downloaded
  837. filename to a Windows system or the filename through an
  838. 8bit&minus;unsafe channel. In these cases, add the
  839. <tt>&minus;&minus;restrict&minus;filenames</tt> flag to get
  840. a shorter title:</p>
  841. <pre style="margin-left:22%; margin-top: 1em">$&nbsp;youtube&minus;dl&nbsp;&minus;&minus;get&minus;filename&nbsp;&minus;o&nbsp;&quot;%(title)s.%(ext)s&quot;&nbsp;BaW_jenozKc
  842. youtube&minus;dl&nbsp;test&nbsp;video&nbsp;''_&Atilde;&curren;&acirc;&eth;.mp4&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;All&nbsp;kinds&nbsp;of&nbsp;weird&nbsp;characters
  843. $&nbsp;youtube&minus;dl&nbsp;&minus;&minus;get&minus;filename&nbsp;&minus;o&nbsp;&quot;%(title)s.%(ext)s&quot;&nbsp;BaW_jenozKc&nbsp;&minus;&minus;restrict&minus;filenames
  844. youtube&minus;dl_test_video_.mp4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;A&nbsp;simple&nbsp;file&nbsp;name</pre>
  845. <h2>FORMAT SELECTION
  846. <a name="FORMAT SELECTION"></a>
  847. </h2>
  848. <p style="margin-left:11%; margin-top: 1em">By default
  849. youtube&minus;dl tries to download the best quality, but
  850. sometimes you may want to download in a different format.
  851. The simplest case is requesting a specific format, for
  852. example <tt>&minus;f&nbsp;22</tt>. You can get the list of
  853. available formats using
  854. <tt>&minus;&minus;list&minus;formats</tt>, you can also use
  855. a file extension (currently it supports aac, m4a, mp3, mp4,
  856. ogg, wav, webm) or the special names <tt>best</tt>,
  857. <tt>bestvideo</tt>, <tt>bestaudio</tt> and
  858. <tt>worst</tt>.</p>
  859. <p style="margin-left:11%; margin-top: 1em">If you want to
  860. download multiple videos and they don't have the same
  861. formats available, you can specify the order of preference
  862. using slashes, as in <tt>&minus;f&nbsp;22/17/18</tt>. You
  863. can also filter the video results by putting a condition in
  864. brackets, as in
  865. <tt>&minus;f&nbsp;&quot;best[height=720]&quot;</tt> (or
  866. <tt>&minus;f&nbsp;&quot;[filesize&gt;10M]&quot;</tt>). This
  867. works for filesize, height, width, tbr, abr, vbr, asr, and
  868. fps and the comparisons &lt;, &lt;=, &gt;, &gt;=, =, != and
  869. for ext, acodec, vcodec, container, and protocol and the
  870. comparisons =, != . Formats for which the value is not known
  871. are excluded unless you put a question mark (?) after the
  872. operator. You can combine format filters, so
  873. <tt>&minus;f&nbsp;&quot;[height&nbsp;&lt;=?&nbsp;720][tbr&gt;500]&quot;</tt>
  874. selects up to 720p videos (or videos where the height is not
  875. known) with a bitrate of at least 500 KBit/s. Use commas to
  876. download multiple formats, such as
  877. <tt>&minus;f&nbsp;136/137/mp4/bestvideo,140/m4a/bestaudio</tt>.
  878. You can merge the video and audio of two formats into a
  879. single file using
  880. <tt>&minus;f&nbsp;&lt;video&minus;format&gt;+&lt;audio&minus;format&gt;</tt>
  881. (requires ffmpeg or avconv), for example
  882. <tt>&minus;f&nbsp;bestvideo+bestaudio</tt>. Format selectors
  883. can also be grouped using parentheses, for example if you
  884. want to download the best mp4 and webm formats with a height
  885. lower than 480 you can use
  886. <tt>&minus;f&nbsp;'(mp4,webm)[height&lt;480]'</tt>.</p>
  887. <p style="margin-left:11%; margin-top: 1em">Since the end
  888. of April 2015 and version 2015.04.26 youtube&minus;dl uses
  889. <tt>&minus;f&nbsp;bestvideo+bestaudio/best</tt> as default
  890. format selection (see #5447, #5456). If ffmpeg or avconv are
  891. installed this results in downloading <tt>bestvideo</tt> and
  892. <tt>bestaudio</tt> separately and muxing them together into
  893. a single file giving the best overall quality available.
  894. Otherwise it falls back to <tt>best</tt> and results in
  895. downloading the best available quality served as a single
  896. file. <tt>best</tt> is also needed for videos that don't
  897. come from YouTube because they don't provide the audio and
  898. video in two different files. If you want to only download
  899. some dash formats (for example if you are not interested in
  900. getting videos with a resolution higher than 1080p), you can
  901. add
  902. <tt>&minus;f&nbsp;bestvideo[height&lt;=?1080]+bestaudio/best</tt>
  903. to your configuration file. Note that if you use
  904. youtube&minus;dl to stream to <tt>stdout</tt> (and most
  905. likely to pipe it to your media player then), i.e. you
  906. explicitly specify output template as
  907. <tt>&minus;o&nbsp;&minus;</tt>, youtube&minus;dl still uses
  908. <tt>&minus;f&nbsp;best</tt> format selection in order to
  909. start content delivery immediately to your player and not to
  910. wait until <tt>bestvideo</tt> and <tt>bestaudio</tt> are
  911. downloaded and muxed.</p>
  912. <p style="margin-left:11%; margin-top: 1em">If you want to
  913. preserve the old format selection behavior (prior to
  914. youtube&minus;dl 2015.04.26), i.e. you want to download the
  915. best available quality media served as a single file, you
  916. should explicitly specify your choice with
  917. <tt>&minus;f&nbsp;best</tt>. You may want to add it to the
  918. configuration file (#configuration) in order not to type it
  919. every time you run youtube&minus;dl.</p>
  920. <h2>VIDEO SELECTION
  921. <a name="VIDEO SELECTION"></a>
  922. </h2>
  923. <p style="margin-left:11%; margin-top: 1em">Videos can be
  924. filtered by their upload date using the options
  925. <tt>&minus;&minus;date</tt>,
  926. <tt>&minus;&minus;datebefore</tt> or
  927. <tt>&minus;&minus;dateafter</tt>. They accept dates in two
  928. formats:</p>
  929. <table width="100%" border="0" rules="none" frame="void"
  930. cellspacing="0" cellpadding="0">
  931. <tr valign="top" align="left">
  932. <td width="11%"></td>
  933. <td width="1%">
  934. <p style="margin-top: 1em">&bull;</p></td>
  935. <td width="2%"></td>
  936. <td width="86%">
  937. <p style="margin-top: 1em">Absolute dates: Dates in the
  938. format <tt>YYYYMMDD</tt>.</p></td></tr>
  939. <tr valign="top" align="left">
  940. <td width="11%"></td>
  941. <td width="1%">
  942. <p>&bull;</p></td>
  943. <td width="2%"></td>
  944. <td width="86%">
  945. <p>Relative dates: Dates in the format
  946. <tt>(now|today)[+&minus;][0&minus;9](day|week|month|year)(s)?</tt></p> </td></tr>
  947. </table>
  948. <p style="margin-left:11%; margin-top: 1em">Examples:</p>
  949. <pre style="margin-left:22%; margin-top: 1em">#&nbsp;Download&nbsp;only&nbsp;the&nbsp;videos&nbsp;uploaded&nbsp;in&nbsp;the&nbsp;last&nbsp;6&nbsp;months
  950. $&nbsp;youtube&minus;dl&nbsp;&minus;&minus;dateafter&nbsp;now&minus;6months
  951. #&nbsp;Download&nbsp;only&nbsp;the&nbsp;videos&nbsp;uploaded&nbsp;on&nbsp;January&nbsp;1,&nbsp;1970
  952. $&nbsp;youtube&minus;dl&nbsp;&minus;&minus;date&nbsp;19700101
  953. $&nbsp;#&nbsp;Download&nbsp;only&nbsp;the&nbsp;videos&nbsp;uploaded&nbsp;in&nbsp;the&nbsp;200x&nbsp;decade
  954. $&nbsp;youtube&minus;dl&nbsp;&minus;&minus;dateafter&nbsp;20000101&nbsp;&minus;&minus;datebefore&nbsp;20091231</pre>
  955. <h2>FAQ
  956. <a name="FAQ"></a>
  957. </h2>
  958. <p style="margin-left:11%; margin-top: 1em"><b>How do I
  959. update youtube&minus;dl?</b> <br>
  960. If you've followed our manual installation instructions
  961. (http://rg3.github.io/youtube-dl/download.html), you can
  962. simply run <tt>youtube&minus;dl&nbsp;&minus;U</tt> (or, on
  963. Linux,
  964. <tt>sudo&nbsp;youtube&minus;dl&nbsp;&minus;U</tt>).</p>
  965. <p style="margin-left:11%; margin-top: 1em">If you have
  966. used pip, a simple
  967. <tt>sudo&nbsp;pip&nbsp;install&nbsp;&minus;U&nbsp;youtube&minus;dl</tt>
  968. is sufficient to update.</p>
  969. <p style="margin-left:11%; margin-top: 1em">If you have
  970. installed youtube&minus;dl using a package manager like
  971. <i>apt&minus;get</i> or <i>yum</i>, use the standard system
  972. update mechanism to update. Note that distribution packages
  973. are often outdated. As a rule of thumb, youtube&minus;dl
  974. releases at least once a month, and often weekly or even
  975. daily. Simply go to http://yt&minus;dl.org/ to find out the
  976. current version. Unfortunately, there is nothing we
  977. youtube&minus;dl developers can do if your distribution
  978. serves a really outdated version. You can (and should)
  979. complain to your distribution in their bugtracker or support
  980. forum.</p>
  981. <p style="margin-left:11%; margin-top: 1em">As a last
  982. resort, you can also uninstall the version installed by your
  983. package manager and follow our manual installation
  984. instructions. For that, remove the distribution's package,
  985. with a line like</p>
  986. <pre style="margin-left:22%; margin-top: 1em">sudo&nbsp;apt&minus;get&nbsp;remove&nbsp;&minus;y&nbsp;youtube&minus;dl</pre>
  987. <p style="margin-left:11%; margin-top: 1em">Afterwards,
  988. simply follow our manual installation instructions
  989. (http://rg3.github.io/youtube-dl/download.html):</p>
  990. <pre style="margin-left:22%; margin-top: 1em">sudo&nbsp;wget&nbsp;https://yt&minus;dl.org/latest/youtube&minus;dl&nbsp;&minus;O&nbsp;/usr/local/bin/youtube&minus;dl
  991. sudo&nbsp;chmod&nbsp;a+x&nbsp;/usr/local/bin/youtube&minus;dl
  992. hash&nbsp;&minus;r</pre>
  993. <p style="margin-left:11%; margin-top: 1em">Again, from
  994. then on you'll be able to update with
  995. <tt>sudo&nbsp;youtube&minus;dl&nbsp;&minus;U</tt>.</p>
  996. <p style="margin-left:11%; margin-top: 1em"><b>I'm getting
  997. an error</b> <tt><br>
  998. Unable&nbsp;to&nbsp;extract&nbsp;OpenGraph&nbsp;title</tt>
  999. on YouTube playlists</p>
  1000. <p style="margin-left:11%; margin-top: 1em">YouTube changed
  1001. their playlist format in March 2014 and later on, so you'll
  1002. need at least youtube&minus;dl 2014.07.25 to download all
  1003. YouTube videos.</p>
  1004. <p style="margin-left:11%; margin-top: 1em">If you have
  1005. installed youtube&minus;dl with a package manager, pip,
  1006. setup.py or a tarball, please use that to update. Note that
  1007. Ubuntu packages do not seem to get updated anymore. Since we
  1008. are not affiliated with Ubuntu, there is little we can do.
  1009. Feel free to report bugs
  1010. (https://bugs.launchpad.net/ubuntu/+source/youtube-dl/+filebug)
  1011. to the Ubuntu packaging guys
  1012. (mailto:ubuntu-motu@lists.ubuntu.com?subject=outdated%20version%20of%20youtube-dl)
  1013. &minus; all they have to do is update the package to a
  1014. somewhat recent version. See above for a way to update.</p>
  1015. <p style="margin-left:11%; margin-top: 1em"><b>Do I always
  1016. have to pass</b> <tt>&minus;citw</tt><b>?</b> <br>
  1017. By default, youtube&minus;dl intends to have the best
  1018. options (incidentally, if you have a convincing case that
  1019. these should be different, please file an issue where you
  1020. explain that (https://yt-dl.org/bug)). Therefore, it is
  1021. unnecessary and sometimes harmful to copy long option
  1022. strings from webpages. In particular, the only option out of
  1023. <tt>&minus;citw</tt> that is regularly useful is
  1024. <tt>&minus;i</tt>.</p>
  1025. <p style="margin-left:11%; margin-top: 1em"><b>Can you
  1026. please put the</b> <tt>&minus;b</tt> <b>option back?</b>
  1027. <br>
  1028. Most people asking this question are not aware that
  1029. youtube&minus;dl now defaults to downloading the highest
  1030. available quality as reported by YouTube, which will be
  1031. 1080p or 720p in some cases, so you no longer need the
  1032. <tt>&minus;b</tt> option. For some specific videos, maybe
  1033. YouTube does not report them to be available in a specific
  1034. high quality format you're interested in. In that case,
  1035. simply request it with the <tt>&minus;f</tt> option and
  1036. youtube&minus;dl will try to download it.</p>
  1037. <p style="margin-left:11%; margin-top: 1em"><b>I get HTTP
  1038. error 402 when trying to download a video. What's</b> <br>
  1039. this?</p>
  1040. <p style="margin-left:11%; margin-top: 1em">Apparently
  1041. YouTube requires you to pass a CAPTCHA test if you download
  1042. too much. We're considering to provide a way to let you
  1043. solve the CAPTCHA
  1044. (https://github.com/rg3/youtube-dl/issues/154), but at the
  1045. moment, your best course of action is pointing a webbrowser
  1046. to the youtube URL, solving the CAPTCHA, and restart
  1047. youtube&minus;dl.</p>
  1048. <p style="margin-left:11%; margin-top: 1em"><b>Do I need
  1049. any other programs?</b> <br>
  1050. youtube&minus;dl works fine on its own on most sites.
  1051. However, if you want to convert video/audio, you'll need
  1052. avconv (https://libav.org/) or ffmpeg
  1053. (https://www.ffmpeg.org/). On some sites &minus; most
  1054. notably YouTube &minus; videos can be retrieved in a higher
  1055. quality format without sound. youtube&minus;dl will detect
  1056. whether avconv/ffmpeg is present and automatically pick the
  1057. best option.</p>
  1058. <p style="margin-left:11%; margin-top: 1em">Videos or video
  1059. formats streamed via RTMP protocol can only be downloaded
  1060. when rtmpdump (https://rtmpdump.mplayerhq.hu/) is installed.
  1061. Downloading MMS and RTSP videos requires either mplayer
  1062. (http://mplayerhq.hu/) or mpv (https://mpv.io/) to be
  1063. installed.</p>
  1064. <p style="margin-left:11%; margin-top: 1em"><b>I have
  1065. downloaded a video but how can I play it?</b> <br>
  1066. Once the video is fully downloaded, use any video player,
  1067. such as vlc (http://www.videolan.org) or mplayer
  1068. (http://www.mplayerhq.hu/).</p>
  1069. <p style="margin-left:11%; margin-top: 1em"><b>I extracted
  1070. a video URL with</b> <tt>&minus;g</tt><b>, but it does not
  1071. play on</b> <br>
  1072. another machine / in my webbrowser.</p>
  1073. <p style="margin-left:11%; margin-top: 1em">It depends a
  1074. lot on the service. In many cases, requests for the video
  1075. (to download/play it) must come from the same IP address and
  1076. with the same cookies. Use the
  1077. <tt>&minus;&minus;cookies</tt> option to write the required
  1078. cookies into a file, and advise your downloader to read
  1079. cookies from that file. Some sites also require a common
  1080. user agent to be used, use
  1081. <tt>&minus;&minus;dump&minus;user&minus;agent</tt> to see
  1082. the one in use by youtube&minus;dl.</p>
  1083. <p style="margin-left:11%; margin-top: 1em">It may be
  1084. beneficial to use IPv6; in some cases, the restrictions are
  1085. only applied to IPv4. Some services (sometimes only for a
  1086. subset of videos) do not restrict the video URL by IP
  1087. address, cookie, or user&minus;agent, but these are the
  1088. exception rather than the rule.</p>
  1089. <p style="margin-left:11%; margin-top: 1em">Please bear in
  1090. mind that some URL protocols are <b>not</b> supported by
  1091. browsers out of the box, including RTMP. If you are using
  1092. <tt>&minus;g</tt>, your own downloader must support these as
  1093. well.</p>
  1094. <p style="margin-left:11%; margin-top: 1em">If you want to
  1095. play the video on a machine that is not running
  1096. youtube&minus;dl, you can relay the video content from the
  1097. machine that runs youtube&minus;dl. You can use
  1098. <tt>&minus;o&nbsp;&minus;</tt> to let youtube&minus;dl
  1099. stream a video to stdout, or simply allow the player to
  1100. download the files written by youtube&minus;dl in turn.</p>
  1101. <p style="margin-left:11%; margin-top: 1em"><b>ERROR: no
  1102. fmt_url_map or conn information found in video info</b> <br>
  1103. YouTube has switched to a new video info format in July 2011
  1104. which is not supported by old versions of youtube&minus;dl.
  1105. See above (#how-do-i-update-youtube-dl) for how to update
  1106. youtube&minus;dl.</p>
  1107. <p style="margin-left:11%; margin-top: 1em"><b>ERROR:
  1108. unable to download video</b> <br>
  1109. YouTube requires an additional signature since September
  1110. 2012 which is not supported by old versions of
  1111. youtube&minus;dl. See above (#how-do-i-update-youtube-dl)
  1112. for how to update youtube&minus;dl.</p>
  1113. <p style="margin-left:11%; margin-top: 1em"><b>Video URL
  1114. contains an ampersand and I'm getting some strange</b> <br>
  1115. output <tt>[1]&nbsp;2839</tt> or
  1116. <tt>'v'&nbsp;is&nbsp;not&nbsp;recognized&nbsp;as&nbsp;an&nbsp;internal&nbsp;or&nbsp;external&nbsp;command</tt></p>
  1117. <p style="margin-left:11%; margin-top: 1em">That's actually
  1118. the output from your shell. Since ampersand is one of the
  1119. special shell characters it's interpreted by the shell
  1120. preventing you from passing the whole URL to
  1121. youtube&minus;dl. To disable your shell from interpreting
  1122. the ampersands (or any other special characters) you have to
  1123. either put the whole URL in quotes or escape them with a
  1124. backslash (which approach will work depends on your
  1125. shell).</p>
  1126. <p style="margin-left:11%; margin-top: 1em">For example if
  1127. your URL is
  1128. https://www.youtube.com/watch?t=4&amp;v=BaW_jenozKc you
  1129. should end up with following command:</p>
  1130. <p style="margin-left:11%; margin-top: 1em"><tt>youtube&minus;dl&nbsp;'https://www.youtube.com/watch?t=4&amp;v=BaW_jenozKc'</tt></p>
  1131. <p style="margin-left:11%; margin-top: 1em">or</p>
  1132. <p style="margin-left:11%; margin-top: 1em"><tt>youtube&minus;dl&nbsp;https://www.youtube.com/watch?t=4\&amp;v=BaW_jenozKc</tt></p>
  1133. <p style="margin-left:11%; margin-top: 1em">For Windows you
  1134. have to use the double quotes:</p>
  1135. <p style="margin-left:11%; margin-top: 1em"><tt>youtube&minus;dl&nbsp;&quot;https://www.youtube.com/watch?t=4&amp;v=BaW_jenozKc&quot;</tt></p>
  1136. <p style="margin-left:11%; margin-top: 1em"><b>ExtractorError:
  1137. Could not find JS function u'OF'</b> <br>
  1138. In February 2015, the new YouTube player contained a
  1139. character sequence in a string that was misinterpreted by
  1140. old versions of youtube&minus;dl. See above
  1141. (#how-do-i-update-youtube-dl) for how to update
  1142. youtube&minus;dl.</p>
  1143. <p style="margin-left:11%; margin-top: 1em"><b>HTTP Error
  1144. 429: Too Many Requests or 402: Payment Required</b> <br>
  1145. These two error codes indicate that the service is blocking
  1146. your IP address because of overuse. Contact the service and
  1147. ask them to unblock your IP address, or &minus; if you have
  1148. acquired a whitelisted IP address already &minus; use the
  1149. <tt>&minus;&minus;proxy</tt> or
  1150. <tt>&minus;&minus;source&minus;address</tt> options
  1151. (#network-options) to select another IP address.</p>
  1152. <p style="margin-left:11%; margin-top: 1em"><b>SyntaxError:
  1153. Non&minus;ASCII character</b> <br>
  1154. The error</p>
  1155. <pre style="margin-left:22%; margin-top: 1em">File&nbsp;&quot;youtube&minus;dl&quot;,&nbsp;line&nbsp;2
  1156. SyntaxError:&nbsp;Non&minus;ASCII&nbsp;character&nbsp;'\x93'&nbsp;...</pre>
  1157. <p style="margin-left:11%; margin-top: 1em">means you're
  1158. using an outdated version of Python. Please update to Python
  1159. 2.6 or 2.7.</p>
  1160. <p style="margin-left:11%; margin-top: 1em"><b>What is this
  1161. binary file? Where has the code gone?</b> <br>
  1162. Since June 2012 (#342) youtube&minus;dl is packed as an
  1163. executable zipfile, simply unzip it (might need renaming to
  1164. <tt>youtube&minus;dl.zip</tt> first on some systems) or
  1165. clone the git repository, as laid out above. If you modify
  1166. the code, you can run it by executing the
  1167. <tt>__main__.py</tt> file. To recompile the executable, run
  1168. <tt>make&nbsp;youtube&minus;dl</tt>.</p>
  1169. <p style="margin-left:11%; margin-top: 1em"><b>The exe
  1170. throws a</b> <i>Runtime error from Visual C++</i> <br>
  1171. To run the exe you need to install first the Microsoft
  1172. Visual C++ 2008 Redistributable Package
  1173. (http://www.microsoft.com/en-us/download/details.aspx?id=29).</p>
  1174. <p style="margin-left:11%; margin-top: 1em"><b>On Windows,
  1175. how should I set up ffmpeg and youtube&minus;dl? Where
  1176. should</b> <br>
  1177. I put the exe files?</p>
  1178. <p style="margin-left:11%; margin-top: 1em">If you put
  1179. youtube&minus;dl and ffmpeg in the same directory that
  1180. you're running the command from, it will work, but that's
  1181. rather cumbersome.</p>
  1182. <p style="margin-left:11%; margin-top: 1em">To make a
  1183. different directory work &minus; either for ffmpeg, or for
  1184. youtube&minus;dl, or for both &minus; simply create the
  1185. directory (say, <tt>C:\bin</tt>, or
  1186. <tt>C:\Users\&lt;User&nbsp;name&gt;\bin</tt>), put all the
  1187. executables directly in there, and then set your PATH
  1188. environment variable
  1189. (https://www.java.com/en/download/help/path.xml) to include
  1190. that directory.</p>
  1191. <p style="margin-left:11%; margin-top: 1em">From then on,
  1192. after restarting your shell, you will be able to access both
  1193. youtube&minus;dl and ffmpeg (and youtube&minus;dl will be
  1194. able to find ffmpeg) by simply typing
  1195. <tt>youtube&minus;dl</tt> or <tt>ffmpeg</tt>, no matter what
  1196. directory you're in.</p>
  1197. <p style="margin-left:11%; margin-top: 1em"><b>How do I put
  1198. downloads into a specific folder?</b> <br>
  1199. Use the <tt>&minus;o</tt> to specify an output template
  1200. (#output-template), for example
  1201. <tt>&minus;o&nbsp;&quot;/home/user/videos/%(title)s&minus;%(id)s.%(ext)s&quot;</tt>.
  1202. If you want this for all of your downloads, put the option
  1203. into your configuration file (#configuration).</p>
  1204. <p style="margin-left:11%; margin-top: 1em"><b>How do I
  1205. download a video starting with a</b>
  1206. <tt>&minus;</tt><b>?</b> <br>
  1207. Either prepend <tt>http://www.youtube.com/watch?v=</tt> or
  1208. separate the ID from the options with
  1209. <tt>&minus;&minus;</tt>:</p>
  1210. <pre style="margin-left:22%; margin-top: 1em">youtube&minus;dl&nbsp;&minus;&minus;&nbsp;&minus;wNyEUrxzFU
  1211. youtube&minus;dl&nbsp;&quot;http://www.youtube.com/watch?v=&minus;wNyEUrxzFU&quot;</pre>
  1212. <p style="margin-left:11%; margin-top: 1em"><b>How do I
  1213. pass cookies to youtube&minus;dl?</b> <br>
  1214. Use the <tt>&minus;&minus;cookies</tt> option, for example
  1215. <tt>&minus;&minus;cookies&nbsp;/path/to/cookies/file.txt</tt>.
  1216. Note that the cookies file must be in Mozilla/Netscape
  1217. format and the first line of the cookies file must be either
  1218. <tt>#&nbsp;HTTP&nbsp;Cookie&nbsp;File</tt> or
  1219. <tt>#&nbsp;Netscape&nbsp;HTTP&nbsp;Cookie&nbsp;File</tt>.
  1220. Make sure you have correct newline format
  1221. (https://en.wikipedia.org/wiki/Newline) in the cookies file
  1222. and convert newlines if necessary to correspond with your
  1223. OS, namely <tt>CRLF</tt> (<tt>\r\n</tt>) for Windows,
  1224. <tt>LF</tt> (<tt>\n</tt>) for Linux and <tt>CR</tt>
  1225. (<tt>\r</tt>) for Mac OS.
  1226. <tt>HTTP&nbsp;Error&nbsp;400:&nbsp;Bad&nbsp;Request</tt>
  1227. when using <tt>&minus;&minus;cookies</tt> is a good sign of
  1228. invalid newline format.</p>
  1229. <p style="margin-left:11%; margin-top: 1em">Passing cookies
  1230. to youtube&minus;dl is a good way to workaround login when a
  1231. particular extractor does not implement it explicitly.</p>
  1232. <p style="margin-left:11%; margin-top: 1em"><b>Can you add
  1233. support for this anime video site, or site which shows</b>
  1234. <br>
  1235. current movies for free?</p>
  1236. <p style="margin-left:11%; margin-top: 1em">As a matter of
  1237. policy (as well as legality), youtube&minus;dl does not
  1238. include support for services that specialize in infringing
  1239. copyright. As a rule of thumb, if you cannot easily find a
  1240. video that the service is quite obviously allowed to
  1241. distribute (i.e. that has been uploaded by the creator, the
  1242. creator's distributor, or is published under a free
  1243. license), the service is probably unfit for inclusion to
  1244. youtube&minus;dl.</p>
  1245. <p style="margin-left:11%; margin-top: 1em">A note on the
  1246. service that they don't host the infringing content, but
  1247. just link to those who do, is evidence that the service
  1248. should <b>not</b> be included into youtube&minus;dl. The
  1249. same goes for any DMCA note when the whole front page of the
  1250. service is filled with videos they are not allowed to
  1251. distribute. A &quot;fair use&quot; note is equally
  1252. unconvincing if the service shows copyright&minus;protected
  1253. videos in full without authorization.</p>
  1254. <p style="margin-left:11%; margin-top: 1em">Support
  1255. requests for services that <b>do</b> purchase the rights to
  1256. distribute their content are perfectly fine though. If in
  1257. doubt, you can simply include a source that mentions the
  1258. legitimate purchase of content.</p>
  1259. <p style="margin-left:11%; margin-top: 1em"><b>How can I
  1260. speed up work on my issue?</b> <br>
  1261. (Also known as: Help, my important issue not being solved!)
  1262. The youtube&minus;dl core developer team is quite small.
  1263. While we do our best to solve as many issues as possible,
  1264. sometimes that can take quite a while. To speed up your
  1265. issue, here's what you can do:</p>
  1266. <p style="margin-left:11%; margin-top: 1em">First of all,
  1267. please do report the issue at our issue tracker
  1268. (https://yt-dl.org/bugs). That allows us to coordinate all
  1269. efforts by users and developers, and serves as a unified
  1270. point. Unfortunately, the youtube&minus;dl project has grown
  1271. too large to use personal email as an effective
  1272. communication channel.</p>
  1273. <p style="margin-left:11%; margin-top: 1em">Please read the
  1274. bug reporting instructions (#bugs) below. A lot of bugs lack
  1275. all the necessary information. If you can, offer proxy, VPN,
  1276. or shell access to the youtube&minus;dl developers. If you
  1277. are able to, test the issue from multiple computers in
  1278. multiple countries to exclude local censorship or
  1279. misconfiguration issues.</p>
  1280. <p style="margin-left:11%; margin-top: 1em">If nobody is
  1281. interested in solving your issue, you are welcome to take
  1282. matters into your own hands and submit a pull request (or
  1283. coerce/pay somebody else to do so).</p>
  1284. <p style="margin-left:11%; margin-top: 1em">Feel free to
  1285. bump the issue from time to time by writing a small comment
  1286. (&quot;Issue is still present in youtube&minus;dl version
  1287. ...from France, but fixed from Belgium&quot;), but please
  1288. not more than once a month. Please do not declare your issue
  1289. as <tt>important</tt> or <tt>urgent</tt>.</p>
  1290. <p style="margin-left:11%; margin-top: 1em"><b>How can I
  1291. detect whether a given URL is supported by
  1292. youtube&minus;dl?</b> <br>
  1293. For one, have a look at the list of supported sites
  1294. (docs/supportedsites.md). Note that it can sometimes happen
  1295. that the site changes its URL scheme (say, from
  1296. http://example.com/video/1234567 to
  1297. http://example.com/v/1234567 ) and youtube&minus;dl reports
  1298. an URL of a service in that list as unsupported. In that
  1299. case, simply report a bug.</p>
  1300. <p style="margin-left:11%; margin-top: 1em">It is
  1301. <i>not</i> possible to detect whether a URL is supported or
  1302. not. That's because youtube&minus;dl contains a generic
  1303. extractor which matches <b>all</b> URLs. You may be tempted
  1304. to disable, exclude, or remove the generic extractor, but
  1305. the generic extractor not only allows users to extract
  1306. videos from lots of websites that embed a video from another
  1307. service, but may also be used to extract video from a
  1308. service that it's hosting itself. Therefore, we neither
  1309. recommend nor support disabling, excluding, or removing the
  1310. generic extractor.</p>
  1311. <p style="margin-left:11%; margin-top: 1em">If you want to
  1312. find out whether a given URL is supported, simply call
  1313. youtube&minus;dl with it. If you get no videos back, chances
  1314. are the URL is either not referring to a video or
  1315. unsupported. You can find out which by examining the output
  1316. (if you run youtube&minus;dl on the console) or catching an
  1317. <tt>UnsupportedError</tt> exception if you run it from a
  1318. Python program.</p>
  1319. <h2>DEVELOPER INSTRUCTIONS
  1320. <a name="DEVELOPER INSTRUCTIONS"></a>
  1321. </h2>
  1322. <p style="margin-left:11%; margin-top: 1em">Most users do
  1323. not need to build youtube&minus;dl and can download the
  1324. builds (http://rg3.github.io/youtube-dl/download.html) or
  1325. get them from their distribution.</p>
  1326. <p style="margin-left:11%; margin-top: 1em">To run
  1327. youtube&minus;dl as a developer, you don't need to build
  1328. anything either. Simply execute</p>
  1329. <pre style="margin-left:22%; margin-top: 1em">python&nbsp;&minus;m&nbsp;youtube_dl</pre>
  1330. <p style="margin-left:11%; margin-top: 1em">To run the
  1331. test, simply invoke your favorite test runner, or execute a
  1332. test file directly; any of the following work:</p>
  1333. <pre style="margin-left:22%; margin-top: 1em">python&nbsp;&minus;m&nbsp;unittest&nbsp;discover
  1334. python&nbsp;test/test_download.py
  1335. nosetests</pre>
  1336. <p style="margin-left:11%; margin-top: 1em">If you want to
  1337. create a build of youtube&minus;dl yourself, you'll need</p>
  1338. <table width="100%" border="0" rules="none" frame="void"
  1339. cellspacing="0" cellpadding="0">
  1340. <tr valign="top" align="left">
  1341. <td width="11%"></td>
  1342. <td width="1%">
  1343. <p style="margin-top: 1em">&bull;</p></td>
  1344. <td width="2%"></td>
  1345. <td width="14%">
  1346. <p style="margin-top: 1em">python</p></td>
  1347. <td width="72%">
  1348. </td></tr>
  1349. <tr valign="top" align="left">
  1350. <td width="11%"></td>
  1351. <td width="1%">
  1352. <p>&bull;</p></td>
  1353. <td width="2%"></td>
  1354. <td width="14%">
  1355. <p>make</p></td>
  1356. <td width="72%">
  1357. </td></tr>
  1358. <tr valign="top" align="left">
  1359. <td width="11%"></td>
  1360. <td width="1%">
  1361. <p>&bull;</p></td>
  1362. <td width="2%"></td>
  1363. <td width="14%">
  1364. <p>pandoc</p></td>
  1365. <td width="72%">
  1366. </td></tr>
  1367. <tr valign="top" align="left">
  1368. <td width="11%"></td>
  1369. <td width="1%">
  1370. <p>&bull;</p></td>
  1371. <td width="2%"></td>
  1372. <td width="14%">
  1373. <p>zip</p></td>
  1374. <td width="72%">
  1375. </td></tr>
  1376. <tr valign="top" align="left">
  1377. <td width="11%"></td>
  1378. <td width="1%">
  1379. <p>&bull;</p></td>
  1380. <td width="2%"></td>
  1381. <td width="14%">
  1382. <p>nosetests</p></td>
  1383. <td width="72%">
  1384. </td></tr>
  1385. </table>
  1386. <p style="margin-left:11%; margin-top: 1em"><b>Adding
  1387. support for a new site</b> <br>
  1388. If you want to add support for a new site, you can follow
  1389. this quick list (assuming your service is called
  1390. <tt>yourextractor</tt>):</p>
  1391. <table width="100%" border="0" rules="none" frame="void"
  1392. cellspacing="0" cellpadding="0">
  1393. <tr valign="top" align="left">
  1394. <td width="12%"></td>
  1395. <td width="3%">
  1396. <p style="margin-top: 1em">1.</p></td>
  1397. <td width="2%"></td>
  1398. <td width="83%">
  1399. <p style="margin-top: 1em">Fork this repository
  1400. (https://github.com/rg3/youtube-dl/fork)</p> </td></tr>
  1401. <tr valign="top" align="left">
  1402. <td width="12%"></td>
  1403. <td width="3%">
  1404. <p>2.</p></td>
  1405. <td width="2%"></td>
  1406. <td width="83%">
  1407. <p>Check out the source code with
  1408. <tt>git&nbsp;clone&nbsp;git@github.com:YOUR_GITHUB_USERNAME/youtube&minus;dl.git</tt></p> </td></tr>
  1409. <tr valign="top" align="left">
  1410. <td width="12%"></td>
  1411. <td width="3%">
  1412. <p>3.</p></td>
  1413. <td width="2%"></td>
  1414. <td width="83%">
  1415. <p>Start a new git branch with
  1416. <tt>cd&nbsp;youtube&minus;dl;&nbsp;git&nbsp;checkout&nbsp;&minus;b&nbsp;yourextractor</tt></p> </td></tr>
  1417. <tr valign="top" align="left">
  1418. <td width="12%"></td>
  1419. <td width="3%">
  1420. <p>4.</p></td>
  1421. <td width="2%"></td>
  1422. <td width="83%">
  1423. <p>Start with this simple template and save it to
  1424. <tt>youtube_dl/extractor/yourextractor.py</tt>:</p> </td></tr>
  1425. </table>
  1426. <pre style="margin-left:28%; margin-top: 1em">#&nbsp;coding:&nbsp;utf&minus;8
  1427. from&nbsp;__future__&nbsp;import&nbsp;unicode_literals
  1428. from&nbsp;.common&nbsp;import&nbsp;InfoExtractor
  1429. class&nbsp;YourExtractorIE(InfoExtractor):&nbsp;&nbsp;&nbsp;&nbsp;
  1430. _VALID_URL&nbsp;=&nbsp;r'https?://(?:www\.)?yourextractor\.com/watch/(?P&lt;id&gt;[0&minus;9]+)'&nbsp;&nbsp;&nbsp;&nbsp;
  1431. _TEST&nbsp;=&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1432. 'url':&nbsp;'http://yourextractor.com/watch/42',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1433. 'md5':&nbsp;'TODO:&nbsp;md5&nbsp;sum&nbsp;of&nbsp;the&nbsp;first&nbsp;10241&nbsp;bytes&nbsp;of&nbsp;the&nbsp;video&nbsp;file&nbsp;(use&nbsp;&minus;&minus;test)',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1434. 'info_dict':&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1435. 'id':&nbsp;'42',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1436. 'ext':&nbsp;'mp4',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1437. 'title':&nbsp;'Video&nbsp;title&nbsp;goes&nbsp;here',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1438. 'thumbnail':&nbsp;'re:^https?://.*\.jpg$',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1439. #&nbsp;TODO&nbsp;more&nbsp;properties,&nbsp;either&nbsp;as:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1440. #&nbsp;*&nbsp;A&nbsp;value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1441. #&nbsp;*&nbsp;MD5&nbsp;checksum;&nbsp;start&nbsp;the&nbsp;string&nbsp;with&nbsp;md5:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1442. #&nbsp;*&nbsp;A&nbsp;regular&nbsp;expression;&nbsp;start&nbsp;the&nbsp;string&nbsp;with&nbsp;re:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1443. #&nbsp;*&nbsp;Any&nbsp;Python&nbsp;type&nbsp;(for&nbsp;example&nbsp;int&nbsp;or&nbsp;float)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1444. }&nbsp;&nbsp;&nbsp;&nbsp;
  1445. }&nbsp;&nbsp;&nbsp;&nbsp;
  1446. def&nbsp;_real_extract(self,&nbsp;url):&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1447. video_id&nbsp;=&nbsp;self._match_id(url)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1448. webpage&nbsp;=&nbsp;self._download_webpage(url,&nbsp;video_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1449. #&nbsp;TODO&nbsp;more&nbsp;code&nbsp;goes&nbsp;here,&nbsp;for&nbsp;example&nbsp;...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1450. title&nbsp;=&nbsp;self._html_search_regex(r'&lt;h1&gt;(.+?)&lt;/h1&gt;',&nbsp;webpage,&nbsp;'title')&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1451. return&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1452. 'id':&nbsp;video_id,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1453. 'title':&nbsp;title,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1454. 'description':&nbsp;self._og_search_description(webpage),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1455. 'uploader':&nbsp;self._search_regex(r'&lt;div[^&gt;]+id=&quot;uploader&quot;[^&gt;]*&gt;([^&lt;]+)&lt;',&nbsp;webpage,&nbsp;'uploader',&nbsp;fatal=False),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1456. #&nbsp;TODO&nbsp;more&nbsp;properties&nbsp;(see&nbsp;youtube_dl/extractor/common.py)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1457. }</pre>
  1458. <table width="100%" border="0" rules="none" frame="void"
  1459. cellspacing="0" cellpadding="0">
  1460. <tr valign="top" align="left">
  1461. <td width="12%"></td>
  1462. <td width="3%">
  1463. <p style="margin-top: 1em">5.</p></td>
  1464. <td width="2%"></td>
  1465. <td width="83%">
  1466. <p style="margin-top: 1em">Add an import in
  1467. <tt>youtube_dl/extractor/__init__.py</tt>
  1468. (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/__init__.py).</p> </td></tr>
  1469. <tr valign="top" align="left">
  1470. <td width="12%"></td>
  1471. <td width="3%">
  1472. <p>6.</p></td>
  1473. <td width="2%"></td>
  1474. <td width="83%">
  1475. <p>Run
  1476. <tt>python&nbsp;test/test_download.py&nbsp;TestDownload.test_YourExtractor</tt>.
  1477. This <i>should fail</i> at first, but you can continually
  1478. re&minus;run it until you're done. If you decide to add more
  1479. than one test, then rename <tt>_TEST</tt> to <tt>_TESTS</tt>
  1480. and make it into a list of dictionaries. The tests will then
  1481. be named <tt>TestDownload.test_YourExtractor</tt>,
  1482. <tt>TestDownload.test_YourExtractor_1</tt>,
  1483. <tt>TestDownload.test_YourExtractor_2</tt>, etc.</p></td></tr>
  1484. <tr valign="top" align="left">
  1485. <td width="12%"></td>
  1486. <td width="3%">
  1487. <p>7.</p></td>
  1488. <td width="2%"></td>
  1489. <td width="83%">
  1490. <p>Have a look at <tt>youtube_dl/extractor/common.py</tt>
  1491. (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py)
  1492. for possible helper methods and a detailed description of
  1493. what your extractor should and may return
  1494. (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L62-L200).
  1495. Add tests and code for as many as you want.</p></td></tr>
  1496. <tr valign="top" align="left">
  1497. <td width="12%"></td>
  1498. <td width="3%">
  1499. <p>8.</p></td>
  1500. <td width="2%"></td>
  1501. <td width="83%">
  1502. <p>If you can, check the code with flake8
  1503. (https://pypi.python.org/pypi/flake8).</p> </td></tr>
  1504. <tr valign="top" align="left">
  1505. <td width="12%"></td>
  1506. <td width="3%">
  1507. <p>9.</p></td>
  1508. <td width="2%"></td>
  1509. <td width="83%">
  1510. <p>When the tests pass, add
  1511. (http://git-scm.com/docs/git-add) the new files and commit
  1512. (http://git-scm.com/docs/git-commit) them and push
  1513. (http://git-scm.com/docs/git-push) the result, like
  1514. this:</p> </td></tr>
  1515. </table>
  1516. <pre style="margin-left:28%; margin-top: 1em">$&nbsp;git&nbsp;add&nbsp;youtube_dl/extractor/__init__.py
  1517. $&nbsp;git&nbsp;add&nbsp;youtube_dl/extractor/yourextractor.py
  1518. $&nbsp;git&nbsp;commit&nbsp;&minus;m&nbsp;'[yourextractor]&nbsp;Add&nbsp;new&nbsp;extractor'
  1519. $&nbsp;git&nbsp;push&nbsp;origin&nbsp;yourextractor</pre>
  1520. <table width="100%" border="0" rules="none" frame="void"
  1521. cellspacing="0" cellpadding="0">
  1522. <tr valign="top" align="left">
  1523. <td width="11%"></td>
  1524. <td width="4%">
  1525. <p style="margin-top: 1em">10.</p></td>
  1526. <td width="2%"></td>
  1527. <td width="83%">
  1528. <p style="margin-top: 1em">Finally, create a pull request
  1529. (https://help.github.com/articles/creating-a-pull-request).
  1530. We'll then review and merge it.</p></td></tr>
  1531. </table>
  1532. <p style="margin-left:11%; margin-top: 1em">In any case,
  1533. thank you very much for your contributions!</p>
  1534. <h2>EMBEDDING YOUTUBE&minus;DL
  1535. <a name="EMBEDDING YOUTUBE&minus;DL"></a>
  1536. </h2>
  1537. <p style="margin-left:11%; margin-top: 1em">youtube&minus;dl
  1538. makes the best effort to be a good command&minus;line
  1539. program, and thus should be callable from any programming
  1540. language. If you encounter any problems parsing its output,
  1541. feel free to create a report
  1542. (https://github.com/rg3/youtube-dl/issues/new).</p>
  1543. <p style="margin-left:11%; margin-top: 1em">From a Python
  1544. program, you can embed youtube&minus;dl in a more powerful
  1545. fashion, like this:</p>
  1546. <pre style="margin-left:22%; margin-top: 1em">from&nbsp;__future__&nbsp;import&nbsp;unicode_literals
  1547. import&nbsp;youtube_dl
  1548. ydl_opts&nbsp;=&nbsp;{}
  1549. with&nbsp;youtube_dl.YoutubeDL(ydl_opts)&nbsp;as&nbsp;ydl:&nbsp;&nbsp;&nbsp;&nbsp;
  1550. ydl.download(['http://www.youtube.com/watch?v=BaW_jenozKc'])</pre>
  1551. <p style="margin-left:11%; margin-top: 1em">Most likely,
  1552. you'll want to use various options. For a list of what can
  1553. be done, have a look at <tt>youtube_dl/YoutubeDL.py</tt>
  1554. (https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L121-L269).
  1555. For a start, if you want to intercept youtube&minus;dl's
  1556. output, set a <tt>logger</tt> object.</p>
  1557. <p style="margin-left:11%; margin-top: 1em">Here's a more
  1558. complete example of a program that outputs only errors (and
  1559. a short message after the download is finished), and
  1560. downloads/converts the video to an mp3 file:</p>
  1561. <pre style="margin-left:22%; margin-top: 1em">from&nbsp;__future__&nbsp;import&nbsp;unicode_literals
  1562. import&nbsp;youtube_dl
  1563. class&nbsp;MyLogger(object):&nbsp;&nbsp;&nbsp;&nbsp;
  1564. def&nbsp;debug(self,&nbsp;msg):&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1565. pass&nbsp;&nbsp;&nbsp;&nbsp;
  1566. def&nbsp;warning(self,&nbsp;msg):&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1567. pass&nbsp;&nbsp;&nbsp;&nbsp;
  1568. def&nbsp;error(self,&nbsp;msg):&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1569. print(msg)
  1570. def&nbsp;my_hook(d):&nbsp;&nbsp;&nbsp;&nbsp;
  1571. if&nbsp;d['status']&nbsp;==&nbsp;'finished':&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1572. print('Done&nbsp;downloading,&nbsp;now&nbsp;converting&nbsp;...')
  1573. ydl_opts&nbsp;=&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;
  1574. 'format':&nbsp;'bestaudio/best',&nbsp;&nbsp;&nbsp;&nbsp;
  1575. 'postprocessors':&nbsp;[{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1576. 'key':&nbsp;'FFmpegExtractAudio',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1577. 'preferredcodec':&nbsp;'mp3',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1578. 'preferredquality':&nbsp;'192',&nbsp;&nbsp;&nbsp;&nbsp;
  1579. }],&nbsp;&nbsp;&nbsp;&nbsp;
  1580. 'logger':&nbsp;MyLogger(),&nbsp;&nbsp;&nbsp;&nbsp;
  1581. 'progress_hooks':&nbsp;[my_hook],
  1582. }
  1583. with&nbsp;youtube_dl.YoutubeDL(ydl_opts)&nbsp;as&nbsp;ydl:&nbsp;&nbsp;&nbsp;&nbsp;
  1584. ydl.download(['http://www.youtube.com/watch?v=BaW_jenozKc'])</pre>
  1585. <h2>BUGS
  1586. <a name="BUGS"></a>
  1587. </h2>
  1588. <p style="margin-left:11%; margin-top: 1em">Bugs and
  1589. suggestions should be reported at:
  1590. &lt;https://github.com/rg3/youtube-dl/issues&gt;. Unless you
  1591. were prompted so or there is another pertinent reason (e.g.
  1592. GitHub fails to accept the bug report), please do not send
  1593. bug reports via personal email. For discussions, join us in
  1594. the IRC channel #youtube&minus;dl
  1595. (irc://chat.freenode.net/#youtube-dl) on freenode (webchat
  1596. (http://webchat.freenode.net/?randomnick=1&amp;channels=youtube-dl)).</p>
  1597. <p style="margin-left:11%; margin-top: 1em"><b>Please
  1598. include the full output of youtube&minus;dl when run
  1599. with</b> <tt>&minus;v, i.e. add &minus;v flag to your
  1600. command line, copy the</tt> <b>whole</b> <tt>output and post
  1601. it in the issue body wrapped in &lsquo;&lsquo;&lsquo; for
  1602. better formatting. It should look similar to this:</tt></p>
  1603. <p style="margin-left:22%; margin-top: 1em"><tt>$&nbsp;youtube&minus;dl&nbsp;&minus;v&nbsp;http://www.youtube.com/watch?v=BaW_jenozKcj
  1604. <br>
  1605. [debug]&nbsp;System&nbsp;config:&nbsp;[] <br>
  1606. [debug]&nbsp;User&nbsp;config:&nbsp;[] <br>
  1607. [debug]&nbsp;Command&minus;line&nbsp;args:&nbsp;[u'&minus;v',&nbsp;u'http://www.youtube.com/watch?v=BaW_jenozKcj']
  1608. <br>
  1609. [debug]&nbsp;Encodings:&nbsp;locale&nbsp;cp1251,&nbsp;fs&nbsp;mbcs,&nbsp;out&nbsp;cp866,&nbsp;pref&nbsp;cp1251
  1610. <br>
  1611. [debug]&nbsp;youtube&minus;dl&nbsp;version&nbsp;2015.12.06
  1612. <br>
  1613. [debug]&nbsp;Git&nbsp;HEAD:&nbsp;135392e <br>
  1614. [debug]&nbsp;Python&nbsp;version&nbsp;2.6.6&nbsp;&minus;&nbsp;Windows&minus;2003Server&minus;5.2.3790&minus;SP2
  1615. <br>
  1616. [debug]&nbsp;exe&nbsp;versions:&nbsp;ffmpeg&nbsp;N&minus;75573&minus;g1d0487f,&nbsp;ffprobe&nbsp;N&minus;75573&minus;g1d0487f,&nbsp;rtmpdump&nbsp;2.4
  1617. <br>
  1618. [debug]&nbsp;Proxy&nbsp;map:&nbsp;{} <br>
  1619. ...</tt></p>
  1620. <p style="margin-left:11%; margin-top: 1em"><b>Do not post
  1621. screenshots of verbose log only plain text is
  1622. acceptable.</b></p>
  1623. <p style="margin-left:11%; margin-top: 1em">The output
  1624. (including the first lines) contains important debugging
  1625. information. Issues without the full output are often not
  1626. reproducible and therefore do not get solved in short order,
  1627. if ever.</p>
  1628. <p style="margin-left:11%; margin-top: 1em">Please
  1629. re&minus;read your issue once again to avoid a couple of
  1630. common mistakes (you can and should use this as a
  1631. checklist):</p>
  1632. <p style="margin-left:11%; margin-top: 1em"><b>Is the
  1633. description of the issue itself sufficient?</b> <br>
  1634. We often get issue reports that we cannot really decipher.
  1635. While in most cases we eventually get the required
  1636. information after asking back multiple times, this poses an
  1637. unnecessary drain on our resources. Many contributors,
  1638. including myself, are also not native speakers, so we may
  1639. misread some parts.</p>
  1640. <p style="margin-left:11%; margin-top: 1em">So please
  1641. elaborate on what feature you are requesting, or what bug
  1642. you want to be fixed. Make sure that it's obvious</p>
  1643. <table width="100%" border="0" rules="none" frame="void"
  1644. cellspacing="0" cellpadding="0">
  1645. <tr valign="top" align="left">
  1646. <td width="11%"></td>
  1647. <td width="1%">
  1648. <p style="margin-top: 1em">&bull;</p></td>
  1649. <td width="2%"></td>
  1650. <td width="64%">
  1651. <p style="margin-top: 1em">What the problem is</p></td>
  1652. <td width="22%">
  1653. </td></tr>
  1654. <tr valign="top" align="left">
  1655. <td width="11%"></td>
  1656. <td width="1%">
  1657. <p>&bull;</p></td>
  1658. <td width="2%"></td>
  1659. <td width="64%">
  1660. <p>How it could be fixed</p></td>
  1661. <td width="22%">
  1662. </td></tr>
  1663. <tr valign="top" align="left">
  1664. <td width="11%"></td>
  1665. <td width="1%">
  1666. <p>&bull;</p></td>
  1667. <td width="2%"></td>
  1668. <td width="64%">
  1669. <p>How your proposed solution would look like</p></td>
  1670. <td width="22%">
  1671. </td></tr>
  1672. </table>
  1673. <p style="margin-left:11%; margin-top: 1em">If your report
  1674. is shorter than two lines, it is almost certainly missing
  1675. some of these, which makes it hard for us to respond to it.
  1676. We're often too polite to close the issue outright, but the
  1677. missing info makes misinterpretation likely. As a committer
  1678. myself, I often get frustrated by these issues, since the
  1679. only possible way for me to move forward on them is to ask
  1680. for clarification over and over.</p>
  1681. <p style="margin-left:11%; margin-top: 1em">For bug
  1682. reports, this means that your report should contain the
  1683. <i>complete</i> output of youtube&minus;dl when called with
  1684. the <tt>&minus;v</tt> flag. The error message you get for
  1685. (most) bugs even says so, but you would not believe how many
  1686. of our bug reports do not contain this information.</p>
  1687. <p style="margin-left:11%; margin-top: 1em">If your server
  1688. has multiple IPs or you suspect censorship, adding
  1689. <tt>&minus;&minus;call&minus;home</tt> may be a good idea to
  1690. get more diagnostics. If the error is
  1691. <tt>ERROR:&nbsp;Unable&nbsp;to&nbsp;extract&nbsp;...</tt>
  1692. and you cannot reproduce it from multiple countries, add
  1693. <tt>&minus;&minus;dump&minus;pages</tt> (warning: this will
  1694. yield a rather large output, redirect it to the file
  1695. <tt>log.txt</tt> by adding
  1696. <tt>&gt;log.txt&nbsp;2&gt;&amp;1</tt> to your
  1697. command&minus;line) or upload the <tt>.dump</tt> files you
  1698. get when you add <tt>&minus;&minus;write&minus;pages</tt>
  1699. somewhere (https://gist.github.com/).</p>
  1700. <p style="margin-left:11%; margin-top: 1em"><b>Site support
  1701. requests must contain an example URL</b>. An example URL is
  1702. a URL you might want to download, like
  1703. <tt>http://www.youtube.com/watch?v=BaW_jenozKc</tt>. There
  1704. should be an obvious video present. Except under very
  1705. special circumstances, the main page of a video service
  1706. (e.g. <tt>http://www.youtube.com/</tt>) is <i>not</i> an
  1707. example URL.</p>
  1708. <p style="margin-left:11%; margin-top: 1em"><b>Are you
  1709. using the latest version?</b> <br>
  1710. Before reporting any issue, type
  1711. <tt>youtube&minus;dl&nbsp;&minus;U</tt>. This should report
  1712. that you're up&minus;to&minus;date. About 20% of the reports
  1713. we receive are already fixed, but people are using outdated
  1714. versions. This goes for feature requests as well.</p>
  1715. <p style="margin-left:11%; margin-top: 1em"><b>Is the issue
  1716. already documented?</b> <br>
  1717. Make sure that someone has not already opened the issue
  1718. you're trying to open. Search at the top of the window or
  1719. browse the GitHub Issues
  1720. (https://github.com/rg3/youtube-dl/search?type=Issues) of
  1721. this repository. If there is an issue, feel free to write
  1722. something along the lines of &quot;This affects me as well,
  1723. with version 2015.01.01. Here is some more information on
  1724. the issue: ...&quot;. While some issues may be old, a new
  1725. post into them often spurs rapid activity.</p>
  1726. <p style="margin-left:11%; margin-top: 1em"><b>Why are
  1727. existing options not enough?</b> <br>
  1728. Before requesting a new feature, please have a quick peek at
  1729. the list of supported options
  1730. (https://github.com/rg3/youtube-dl/blob/master/README.md#synopsis).
  1731. Many feature requests are for features that actually exist
  1732. already! Please, absolutely do show off your work in the
  1733. issue report and detail how the existing similar options do
  1734. <i>not</i> solve your problem.</p>
  1735. <p style="margin-left:11%; margin-top: 1em"><b>Is there
  1736. enough context in your bug report?</b> <br>
  1737. People want to solve problems, and often think they do us a
  1738. favor by breaking down their larger problems (e.g. wanting
  1739. to skip already downloaded files) to a specific request
  1740. (e.g. requesting us to look whether the file exists before
  1741. downloading the info page). However, what often happens is
  1742. that they break down the problem into two steps: One simple,
  1743. and one impossible (or extremely complicated one).</p>
  1744. <p style="margin-left:11%; margin-top: 1em">We are then
  1745. presented with a very complicated request when the original
  1746. problem could be solved far easier, e.g. by recording the
  1747. downloaded video IDs in a separate file. To avoid this, you
  1748. must include the greater context where it is
  1749. non&minus;obvious. In particular, every feature request that
  1750. does not consist of adding support for a new site should
  1751. contain a use case scenario that explains in what situation
  1752. the missing feature would be useful.</p>
  1753. <p style="margin-left:11%; margin-top: 1em"><b>Does the
  1754. issue involve one problem, and one problem only?</b> <br>
  1755. Some of our users seem to think there is a limit of issues
  1756. they can or should open. There is no limit of issues they
  1757. can or should open. While it may seem appealing to be able
  1758. to dump all your issues into one ticket, that means that
  1759. someone who solves one of your issues cannot mark the issue
  1760. as closed. Typically, reporting a bunch of issues leads to
  1761. the ticket lingering since nobody wants to attack that
  1762. behemoth, until someone mercifully splits the issue into
  1763. multiple ones.</p>
  1764. <p style="margin-left:11%; margin-top: 1em">In particular,
  1765. every site support request issue should only pertain to
  1766. services at one site (generally under a common domain, but
  1767. always using the same backend technology). Do not request
  1768. support for vimeo user videos, Whitehouse podcasts, and
  1769. Google Plus pages in the same issue. Also, make sure that
  1770. you don't post bug reports alongside feature requests. As a
  1771. rule of thumb, a feature request does not include outputs of
  1772. youtube&minus;dl that are not immediately related to the
  1773. feature at hand. Do not post reports of a network error
  1774. alongside the request for a new video service.</p>
  1775. <p style="margin-left:11%; margin-top: 1em"><b>Is anyone
  1776. going to need the feature?</b> <br>
  1777. Only post features that you (or an incapacitated friend you
  1778. can personally talk to) require. Do not post features
  1779. because they seem like a good idea. If they are really
  1780. useful, they will be requested by someone who requires
  1781. them.</p>
  1782. <p style="margin-left:11%; margin-top: 1em"><b>Is your
  1783. question about youtube&minus;dl?</b> <br>
  1784. It may sound strange, but some bug reports we receive are
  1785. completely unrelated to youtube&minus;dl and relate to a
  1786. different or even the reporter's own application. Please
  1787. make sure that you are actually using youtube&minus;dl. If
  1788. you are using a UI for youtube&minus;dl, report the bug to
  1789. the maintainer of the actual application providing the UI.
  1790. On the other hand, if your UI for youtube&minus;dl fails in
  1791. some way you believe is related to youtube&minus;dl, by all
  1792. means, go ahead and report the bug.</p>
  1793. <h2>COPYRIGHT
  1794. <a name="COPYRIGHT"></a>
  1795. </h2>
  1796. <p style="margin-left:11%; margin-top: 1em">youtube&minus;dl
  1797. is released into the public domain by the copyright
  1798. holders.</p>
  1799. <p style="margin-left:11%; margin-top: 1em">This README
  1800. file was originally written by Daniel Bolton
  1801. (https://github.com/dbbolton) and is likewise released into
  1802. the public domain.</p>
  1803. <hr>
  1804. </body>
  1805. </html>