You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1066 lines
174 KiB

  1. <!doctype html PUBLIC "-//W3C//DTD html 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
  5. <meta http-equiv='X-UA-Compatible' content='IE=emulateIE7' />
  6. <title>Coverage for youtube_dl: 8%</title>
  7. <link rel='stylesheet' href='style.css' type='text/css'>
  8. <script type='text/javascript' src='jquery-1.4.3.min.js'></script>
  9. <script type='text/javascript' src='jquery.hotkeys.js'></script>
  10. <script type='text/javascript' src='jquery.isonscreen.js'></script>
  11. <script type='text/javascript' src='coverage_html.js'></script>
  12. <script type='text/javascript' charset='utf-8'>
  13. jQuery(document).ready(coverage.pyfile_ready);
  14. </script>
  15. </head>
  16. <body id='pyfile'>
  17. <div id='header'>
  18. <div class='content'>
  19. <h1>Coverage for <b>youtube_dl</b> :
  20. <span class='pc_cov'>8%</span>
  21. </h1>
  22. <img id='keyboard_icon' src='keybd_closed.png'>
  23. <h2 class='stats'>
  24. 274 statements &nbsp;
  25. <span class='run hide_run shortkey_r button_toggle_run'>23 run</span>
  26. <span class='mis shortkey_m button_toggle_mis'>251 missing</span>
  27. <span class='exc shortkey_x button_toggle_exc'>0 excluded</span>
  28. </h2>
  29. </div>
  30. </div>
  31. <div class='help_panel'>
  32. <img id='panel_icon' src='keybd_open.png'>
  33. <p class='legend'>Hot-keys on this page</p>
  34. <div>
  35. <p class='keyhelp'>
  36. <span class='key'>r</span>
  37. <span class='key'>m</span>
  38. <span class='key'>x</span>
  39. <span class='key'>p</span> &nbsp; toggle line displays
  40. </p>
  41. <p class='keyhelp'>
  42. <span class='key'>j</span>
  43. <span class='key'>k</span> &nbsp; next/prev highlighted chunk
  44. </p>
  45. <p class='keyhelp'>
  46. <span class='key'>0</span> &nbsp; (zero) top of page
  47. </p>
  48. <p class='keyhelp'>
  49. <span class='key'>1</span> &nbsp; (one) first highlighted chunk
  50. </p>
  51. </div>
  52. </div>
  53. <div id='source'>
  54. <table cellspacing='0' cellpadding='0'>
  55. <tr>
  56. <td class='linenos' valign='top'>
  57. <p id='n1' class='pln'><a href='#n1'>1</a></p>
  58. <p id='n2' class='pln'><a href='#n2'>2</a></p>
  59. <p id='n3' class='pln'><a href='#n3'>3</a></p>
  60. <p id='n4' class='stm run hide_run'><a href='#n4'>4</a></p>
  61. <p id='n5' class='stm run hide_run'><a href='#n5'>5</a></p>
  62. <p id='n6' class='pln'><a href='#n6'>6</a></p>
  63. <p id='n7' class='stm run hide_run'><a href='#n7'>7</a></p>
  64. <p id='n8' class='pln'><a href='#n8'>8</a></p>
  65. <p id='n9' class='pln'><a href='#n9'>9</a></p>
  66. <p id='n10' class='pln'><a href='#n10'>10</a></p>
  67. <p id='n11' class='pln'><a href='#n11'>11</a></p>
  68. <p id='n12' class='pln'><a href='#n12'>12</a></p>
  69. <p id='n13' class='pln'><a href='#n13'>13</a></p>
  70. <p id='n14' class='pln'><a href='#n14'>14</a></p>
  71. <p id='n15' class='pln'><a href='#n15'>15</a></p>
  72. <p id='n16' class='pln'><a href='#n16'>16</a></p>
  73. <p id='n17' class='pln'><a href='#n17'>17</a></p>
  74. <p id='n18' class='pln'><a href='#n18'>18</a></p>
  75. <p id='n19' class='pln'><a href='#n19'>19</a></p>
  76. <p id='n20' class='pln'><a href='#n20'>20</a></p>
  77. <p id='n21' class='pln'><a href='#n21'>21</a></p>
  78. <p id='n22' class='pln'><a href='#n22'>22</a></p>
  79. <p id='n23' class='pln'><a href='#n23'>23</a></p>
  80. <p id='n24' class='pln'><a href='#n24'>24</a></p>
  81. <p id='n25' class='pln'><a href='#n25'>25</a></p>
  82. <p id='n26' class='pln'><a href='#n26'>26</a></p>
  83. <p id='n27' class='stm run hide_run'><a href='#n27'>27</a></p>
  84. <p id='n28' class='pln'><a href='#n28'>28</a></p>
  85. <p id='n29' class='stm run hide_run'><a href='#n29'>29</a></p>
  86. <p id='n30' class='stm run hide_run'><a href='#n30'>30</a></p>
  87. <p id='n31' class='stm run hide_run'><a href='#n31'>31</a></p>
  88. <p id='n32' class='stm run hide_run'><a href='#n32'>32</a></p>
  89. <p id='n33' class='stm run hide_run'><a href='#n33'>33</a></p>
  90. <p id='n34' class='stm run hide_run'><a href='#n34'>34</a></p>
  91. <p id='n35' class='stm run hide_run'><a href='#n35'>35</a></p>
  92. <p id='n36' class='stm run hide_run'><a href='#n36'>36</a></p>
  93. <p id='n37' class='stm run hide_run'><a href='#n37'>37</a></p>
  94. <p id='n38' class='stm run hide_run'><a href='#n38'>38</a></p>
  95. <p id='n39' class='pln'><a href='#n39'>39</a></p>
  96. <p id='n40' class='stm run hide_run'><a href='#n40'>40</a></p>
  97. <p id='n41' class='stm run hide_run'><a href='#n41'>41</a></p>
  98. <p id='n42' class='stm run hide_run'><a href='#n42'>42</a></p>
  99. <p id='n43' class='stm run hide_run'><a href='#n43'>43</a></p>
  100. <p id='n44' class='stm run hide_run'><a href='#n44'>44</a></p>
  101. <p id='n45' class='stm run hide_run'><a href='#n45'>45</a></p>
  102. <p id='n46' class='pln'><a href='#n46'>46</a></p>
  103. <p id='n47' class='stm run hide_run'><a href='#n47'>47</a></p>
  104. <p id='n48' class='stm mis'><a href='#n48'>48</a></p>
  105. <p id='n49' class='stm mis'><a href='#n49'>49</a></p>
  106. <p id='n50' class='stm mis'><a href='#n50'>50</a></p>
  107. <p id='n51' class='stm mis'><a href='#n51'>51</a></p>
  108. <p id='n52' class='stm mis'><a href='#n52'>52</a></p>
  109. <p id='n53' class='stm mis'><a href='#n53'>53</a></p>
  110. <p id='n54' class='stm mis'><a href='#n54'>54</a></p>
  111. <p id='n55' class='stm mis'><a href='#n55'>55</a></p>
  112. <p id='n56' class='stm mis'><a href='#n56'>56</a></p>
  113. <p id='n57' class='pln'><a href='#n57'>57</a></p>
  114. <p id='n58' class='stm mis'><a href='#n58'>58</a></p>
  115. <p id='n59' class='stm mis'><a href='#n59'>59</a></p>
  116. <p id='n60' class='pln'><a href='#n60'>60</a></p>
  117. <p id='n61' class='stm mis'><a href='#n61'>61</a></p>
  118. <p id='n62' class='pln'><a href='#n62'>62</a></p>
  119. <p id='n63' class='pln'><a href='#n63'>63</a></p>
  120. <p id='n64' class='stm mis'><a href='#n64'>64</a></p>
  121. <p id='n65' class='pln'><a href='#n65'>65</a></p>
  122. <p id='n66' class='stm mis'><a href='#n66'>66</a></p>
  123. <p id='n67' class='stm mis'><a href='#n67'>67</a></p>
  124. <p id='n68' class='stm mis'><a href='#n68'>68</a></p>
  125. <p id='n69' class='stm mis'><a href='#n69'>69</a></p>
  126. <p id='n70' class='stm mis'><a href='#n70'>70</a></p>
  127. <p id='n71' class='stm mis'><a href='#n71'>71</a></p>
  128. <p id='n72' class='pln'><a href='#n72'>72</a></p>
  129. <p id='n73' class='stm mis'><a href='#n73'>73</a></p>
  130. <p id='n74' class='pln'><a href='#n74'>74</a></p>
  131. <p id='n75' class='stm mis'><a href='#n75'>75</a></p>
  132. <p id='n76' class='pln'><a href='#n76'>76</a></p>
  133. <p id='n77' class='stm mis'><a href='#n77'>77</a></p>
  134. <p id='n78' class='stm mis'><a href='#n78'>78</a></p>
  135. <p id='n79' class='stm mis'><a href='#n79'>79</a></p>
  136. <p id='n80' class='stm mis'><a href='#n80'>80</a></p>
  137. <p id='n81' class='pln'><a href='#n81'>81</a></p>
  138. <p id='n82' class='stm mis'><a href='#n82'>82</a></p>
  139. <p id='n83' class='stm mis'><a href='#n83'>83</a></p>
  140. <p id='n84' class='stm mis'><a href='#n84'>84</a></p>
  141. <p id='n85' class='stm mis'><a href='#n85'>85</a></p>
  142. <p id='n86' class='stm mis'><a href='#n86'>86</a></p>
  143. <p id='n87' class='stm mis'><a href='#n87'>87</a></p>
  144. <p id='n88' class='stm mis'><a href='#n88'>88</a></p>
  145. <p id='n89' class='pln'><a href='#n89'>89</a></p>
  146. <p id='n90' class='stm mis'><a href='#n90'>90</a></p>
  147. <p id='n91' class='stm mis'><a href='#n91'>91</a></p>
  148. <p id='n92' class='pln'><a href='#n92'>92</a></p>
  149. <p id='n93' class='pln'><a href='#n93'>93</a></p>
  150. <p id='n94' class='stm mis'><a href='#n94'>94</a></p>
  151. <p id='n95' class='stm mis'><a href='#n95'>95</a></p>
  152. <p id='n96' class='pln'><a href='#n96'>96</a></p>
  153. <p id='n97' class='stm mis'><a href='#n97'>97</a></p>
  154. <p id='n98' class='stm mis'><a href='#n98'>98</a></p>
  155. <p id='n99' class='pln'><a href='#n99'>99</a></p>
  156. <p id='n100' class='stm mis'><a href='#n100'>100</a></p>
  157. <p id='n101' class='pln'><a href='#n101'>101</a></p>
  158. <p id='n102' class='pln'><a href='#n102'>102</a></p>
  159. <p id='n103' class='pln'><a href='#n103'>103</a></p>
  160. <p id='n104' class='pln'><a href='#n104'>104</a></p>
  161. <p id='n105' class='pln'><a href='#n105'>105</a></p>
  162. <p id='n106' class='pln'><a href='#n106'>106</a></p>
  163. <p id='n107' class='stm mis'><a href='#n107'>107</a></p>
  164. <p id='n108' class='pln'><a href='#n108'>108</a></p>
  165. <p id='n109' class='pln'><a href='#n109'>109</a></p>
  166. <p id='n110' class='stm mis'><a href='#n110'>110</a></p>
  167. <p id='n111' class='stm mis'><a href='#n111'>111</a></p>
  168. <p id='n112' class='stm mis'><a href='#n112'>112</a></p>
  169. <p id='n113' class='stm mis'><a href='#n113'>113</a></p>
  170. <p id='n114' class='stm mis'><a href='#n114'>114</a></p>
  171. <p id='n115' class='stm mis'><a href='#n115'>115</a></p>
  172. <p id='n116' class='stm mis'><a href='#n116'>116</a></p>
  173. <p id='n117' class='pln'><a href='#n117'>117</a></p>
  174. <p id='n118' class='stm mis'><a href='#n118'>118</a></p>
  175. <p id='n119' class='pln'><a href='#n119'>119</a></p>
  176. <p id='n120' class='stm mis'><a href='#n120'>120</a></p>
  177. <p id='n121' class='pln'><a href='#n121'>121</a></p>
  178. <p id='n122' class='stm mis'><a href='#n122'>122</a></p>
  179. <p id='n123' class='pln'><a href='#n123'>123</a></p>
  180. <p id='n124' class='stm mis'><a href='#n124'>124</a></p>
  181. <p id='n125' class='pln'><a href='#n125'>125</a></p>
  182. <p id='n126' class='stm mis'><a href='#n126'>126</a></p>
  183. <p id='n127' class='pln'><a href='#n127'>127</a></p>
  184. <p id='n128' class='stm mis'><a href='#n128'>128</a></p>
  185. <p id='n129' class='pln'><a href='#n129'>129</a></p>
  186. <p id='n130' class='stm mis'><a href='#n130'>130</a></p>
  187. <p id='n131' class='pln'><a href='#n131'>131</a></p>
  188. <p id='n132' class='stm mis'><a href='#n132'>132</a></p>
  189. <p id='n133' class='pln'><a href='#n133'>133</a></p>
  190. <p id='n134' class='pln'><a href='#n134'>134</a></p>
  191. <p id='n135' class='stm mis'><a href='#n135'>135</a></p>
  192. <p id='n136' class='pln'><a href='#n136'>136</a></p>
  193. <p id='n137' class='pln'><a href='#n137'>137</a></p>
  194. <p id='n138' class='stm mis'><a href='#n138'>138</a></p>
  195. <p id='n139' class='pln'><a href='#n139'>139</a></p>
  196. <p id='n140' class='stm mis'><a href='#n140'>140</a></p>
  197. <p id='n141' class='pln'><a href='#n141'>141</a></p>
  198. <p id='n142' class='pln'><a href='#n142'>142</a></p>
  199. <p id='n143' class='stm mis'><a href='#n143'>143</a></p>
  200. <p id='n144' class='pln'><a href='#n144'>144</a></p>
  201. <p id='n145' class='stm mis'><a href='#n145'>145</a></p>
  202. <p id='n146' class='pln'><a href='#n146'>146</a></p>
  203. <p id='n147' class='stm mis'><a href='#n147'>147</a></p>
  204. <p id='n148' class='pln'><a href='#n148'>148</a></p>
  205. <p id='n149' class='stm mis'><a href='#n149'>149</a></p>
  206. <p id='n150' class='stm mis'><a href='#n150'>150</a></p>
  207. <p id='n151' class='stm mis'><a href='#n151'>151</a></p>
  208. <p id='n152' class='pln'><a href='#n152'>152</a></p>
  209. <p id='n153' class='stm mis'><a href='#n153'>153</a></p>
  210. <p id='n154' class='pln'><a href='#n154'>154</a></p>
  211. <p id='n155' class='stm mis'><a href='#n155'>155</a></p>
  212. <p id='n156' class='pln'><a href='#n156'>156</a></p>
  213. <p id='n157' class='stm mis'><a href='#n157'>157</a></p>
  214. <p id='n158' class='pln'><a href='#n158'>158</a></p>
  215. <p id='n159' class='pln'><a href='#n159'>159</a></p>
  216. <p id='n160' class='pln'><a href='#n160'>160</a></p>
  217. <p id='n161' class='stm mis'><a href='#n161'>161</a></p>
  218. <p id='n162' class='pln'><a href='#n162'>162</a></p>
  219. <p id='n163' class='stm mis'><a href='#n163'>163</a></p>
  220. <p id='n164' class='pln'><a href='#n164'>164</a></p>
  221. <p id='n165' class='stm mis'><a href='#n165'>165</a></p>
  222. <p id='n166' class='pln'><a href='#n166'>166</a></p>
  223. <p id='n167' class='stm mis'><a href='#n167'>167</a></p>
  224. <p id='n168' class='pln'><a href='#n168'>168</a></p>
  225. <p id='n169' class='stm mis'><a href='#n169'>169</a></p>
  226. <p id='n170' class='pln'><a href='#n170'>170</a></p>
  227. <p id='n171' class='stm mis'><a href='#n171'>171</a></p>
  228. <p id='n172' class='pln'><a href='#n172'>172</a></p>
  229. <p id='n173' class='pln'><a href='#n173'>173</a></p>
  230. <p id='n174' class='stm mis'><a href='#n174'>174</a></p>
  231. <p id='n175' class='pln'><a href='#n175'>175</a></p>
  232. <p id='n176' class='pln'><a href='#n176'>176</a></p>
  233. <p id='n177' class='pln'><a href='#n177'>177</a></p>
  234. <p id='n178' class='pln'><a href='#n178'>178</a></p>
  235. <p id='n179' class='stm mis'><a href='#n179'>179</a></p>
  236. <p id='n180' class='pln'><a href='#n180'>180</a></p>
  237. <p id='n181' class='stm mis'><a href='#n181'>181</a></p>
  238. <p id='n182' class='pln'><a href='#n182'>182</a></p>
  239. <p id='n183' class='stm mis'><a href='#n183'>183</a></p>
  240. <p id='n184' class='pln'><a href='#n184'>184</a></p>
  241. <p id='n185' class='stm mis'><a href='#n185'>185</a></p>
  242. <p id='n186' class='pln'><a href='#n186'>186</a></p>
  243. <p id='n187' class='stm mis'><a href='#n187'>187</a></p>
  244. <p id='n188' class='pln'><a href='#n188'>188</a></p>
  245. <p id='n189' class='stm mis'><a href='#n189'>189</a></p>
  246. <p id='n190' class='pln'><a href='#n190'>190</a></p>
  247. <p id='n191' class='pln'><a href='#n191'>191</a></p>
  248. <p id='n192' class='stm mis'><a href='#n192'>192</a></p>
  249. <p id='n193' class='pln'><a href='#n193'>193</a></p>
  250. <p id='n194' class='pln'><a href='#n194'>194</a></p>
  251. <p id='n195' class='stm mis'><a href='#n195'>195</a></p>
  252. <p id='n196' class='pln'><a href='#n196'>196</a></p>
  253. <p id='n197' class='pln'><a href='#n197'>197</a></p>
  254. <p id='n198' class='stm mis'><a href='#n198'>198</a></p>
  255. <p id='n199' class='pln'><a href='#n199'>199</a></p>
  256. <p id='n200' class='pln'><a href='#n200'>200</a></p>
  257. <p id='n201' class='stm mis'><a href='#n201'>201</a></p>
  258. <p id='n202' class='pln'><a href='#n202'>202</a></p>
  259. <p id='n203' class='stm mis'><a href='#n203'>203</a></p>
  260. <p id='n204' class='pln'><a href='#n204'>204</a></p>
  261. <p id='n205' class='pln'><a href='#n205'>205</a></p>
  262. <p id='n206' class='stm mis'><a href='#n206'>206</a></p>
  263. <p id='n207' class='pln'><a href='#n207'>207</a></p>
  264. <p id='n208' class='pln'><a href='#n208'>208</a></p>
  265. <p id='n209' class='pln'><a href='#n209'>209</a></p>
  266. <p id='n210' class='stm mis'><a href='#n210'>210</a></p>
  267. <p id='n211' class='pln'><a href='#n211'>211</a></p>
  268. <p id='n212' class='stm mis'><a href='#n212'>212</a></p>
  269. <p id='n213' class='pln'><a href='#n213'>213</a></p>
  270. <p id='n214' class='stm mis'><a href='#n214'>214</a></p>
  271. <p id='n215' class='pln'><a href='#n215'>215</a></p>
  272. <p id='n216' class='stm mis'><a href='#n216'>216</a></p>
  273. <p id='n217' class='pln'><a href='#n217'>217</a></p>
  274. <p id='n218' class='pln'><a href='#n218'>218</a></p>
  275. <p id='n219' class='stm mis'><a href='#n219'>219</a></p>
  276. <p id='n220' class='pln'><a href='#n220'>220</a></p>
  277. <p id='n221' class='stm mis'><a href='#n221'>221</a></p>
  278. <p id='n222' class='pln'><a href='#n222'>222</a></p>
  279. <p id='n223' class='pln'><a href='#n223'>223</a></p>
  280. <p id='n224' class='stm mis'><a href='#n224'>224</a></p>
  281. <p id='n225' class='pln'><a href='#n225'>225</a></p>
  282. <p id='n226' class='stm mis'><a href='#n226'>226</a></p>
  283. <p id='n227' class='pln'><a href='#n227'>227</a></p>
  284. <p id='n228' class='stm mis'><a href='#n228'>228</a></p>
  285. <p id='n229' class='pln'><a href='#n229'>229</a></p>
  286. <p id='n230' class='stm mis'><a href='#n230'>230</a></p>
  287. <p id='n231' class='pln'><a href='#n231'>231</a></p>
  288. <p id='n232' class='pln'><a href='#n232'>232</a></p>
  289. <p id='n233' class='stm mis'><a href='#n233'>233</a></p>
  290. <p id='n234' class='pln'><a href='#n234'>234</a></p>
  291. <p id='n235' class='stm mis'><a href='#n235'>235</a></p>
  292. <p id='n236' class='pln'><a href='#n236'>236</a></p>
  293. <p id='n237' class='stm mis'><a href='#n237'>237</a></p>
  294. <p id='n238' class='pln'><a href='#n238'>238</a></p>
  295. <p id='n239' class='pln'><a href='#n239'>239</a></p>
  296. <p id='n240' class='stm mis'><a href='#n240'>240</a></p>
  297. <p id='n241' class='pln'><a href='#n241'>241</a></p>
  298. <p id='n242' class='pln'><a href='#n242'>242</a></p>
  299. <p id='n243' class='stm mis'><a href='#n243'>243</a></p>
  300. <p id='n244' class='pln'><a href='#n244'>244</a></p>
  301. <p id='n245' class='pln'><a href='#n245'>245</a></p>
  302. <p id='n246' class='pln'><a href='#n246'>246</a></p>
  303. <p id='n247' class='pln'><a href='#n247'>247</a></p>
  304. <p id='n248' class='stm mis'><a href='#n248'>248</a></p>
  305. <p id='n249' class='pln'><a href='#n249'>249</a></p>
  306. <p id='n250' class='stm mis'><a href='#n250'>250</a></p>
  307. <p id='n251' class='pln'><a href='#n251'>251</a></p>
  308. <p id='n252' class='stm mis'><a href='#n252'>252</a></p>
  309. <p id='n253' class='pln'><a href='#n253'>253</a></p>
  310. <p id='n254' class='stm mis'><a href='#n254'>254</a></p>
  311. <p id='n255' class='pln'><a href='#n255'>255</a></p>
  312. <p id='n256' class='stm mis'><a href='#n256'>256</a></p>
  313. <p id='n257' class='pln'><a href='#n257'>257</a></p>
  314. <p id='n258' class='pln'><a href='#n258'>258</a></p>
  315. <p id='n259' class='pln'><a href='#n259'>259</a></p>
  316. <p id='n260' class='stm mis'><a href='#n260'>260</a></p>
  317. <p id='n261' class='stm mis'><a href='#n261'>261</a></p>
  318. <p id='n262' class='stm mis'><a href='#n262'>262</a></p>
  319. <p id='n263' class='stm mis'><a href='#n263'>263</a></p>
  320. <p id='n264' class='stm mis'><a href='#n264'>264</a></p>
  321. <p id='n265' class='stm mis'><a href='#n265'>265</a></p>
  322. <p id='n266' class='stm mis'><a href='#n266'>266</a></p>
  323. <p id='n267' class='pln'><a href='#n267'>267</a></p>
  324. <p id='n268' class='stm mis'><a href='#n268'>268</a></p>
  325. <p id='n269' class='stm mis'><a href='#n269'>269</a></p>
  326. <p id='n270' class='stm mis'><a href='#n270'>270</a></p>
  327. <p id='n271' class='pln'><a href='#n271'>271</a></p>
  328. <p id='n272' class='stm mis'><a href='#n272'>272</a></p>
  329. <p id='n273' class='stm mis'><a href='#n273'>273</a></p>
  330. <p id='n274' class='stm mis'><a href='#n274'>274</a></p>
  331. <p id='n275' class='pln'><a href='#n275'>275</a></p>
  332. <p id='n276' class='stm mis'><a href='#n276'>276</a></p>
  333. <p id='n277' class='pln'><a href='#n277'>277</a></p>
  334. <p id='n278' class='stm run hide_run'><a href='#n278'>278</a></p>
  335. <p id='n279' class='stm mis'><a href='#n279'>279</a></p>
  336. <p id='n280' class='pln'><a href='#n280'>280</a></p>
  337. <p id='n281' class='pln'><a href='#n281'>281</a></p>
  338. <p id='n282' class='stm mis'><a href='#n282'>282</a></p>
  339. <p id='n283' class='stm mis'><a href='#n283'>283</a></p>
  340. <p id='n284' class='pln'><a href='#n284'>284</a></p>
  341. <p id='n285' class='stm mis'><a href='#n285'>285</a></p>
  342. <p id='n286' class='stm mis'><a href='#n286'>286</a></p>
  343. <p id='n287' class='stm mis'><a href='#n287'>287</a></p>
  344. <p id='n288' class='stm mis'><a href='#n288'>288</a></p>
  345. <p id='n289' class='stm mis'><a href='#n289'>289</a></p>
  346. <p id='n290' class='stm mis'><a href='#n290'>290</a></p>
  347. <p id='n291' class='pln'><a href='#n291'>291</a></p>
  348. <p id='n292' class='stm mis'><a href='#n292'>292</a></p>
  349. <p id='n293' class='stm mis'><a href='#n293'>293</a></p>
  350. <p id='n294' class='pln'><a href='#n294'>294</a></p>
  351. <p id='n295' class='pln'><a href='#n295'>295</a></p>
  352. <p id='n296' class='stm mis'><a href='#n296'>296</a></p>
  353. <p id='n297' class='stm mis'><a href='#n297'>297</a></p>
  354. <p id='n298' class='stm mis'><a href='#n298'>298</a></p>
  355. <p id='n299' class='pln'><a href='#n299'>299</a></p>
  356. <p id='n300' class='pln'><a href='#n300'>300</a></p>
  357. <p id='n301' class='stm mis'><a href='#n301'>301</a></p>
  358. <p id='n302' class='stm mis'><a href='#n302'>302</a></p>
  359. <p id='n303' class='stm mis'><a href='#n303'>303</a></p>
  360. <p id='n304' class='stm mis'><a href='#n304'>304</a></p>
  361. <p id='n305' class='stm mis'><a href='#n305'>305</a></p>
  362. <p id='n306' class='pln'><a href='#n306'>306</a></p>
  363. <p id='n307' class='stm mis'><a href='#n307'>307</a></p>
  364. <p id='n308' class='stm mis'><a href='#n308'>308</a></p>
  365. <p id='n309' class='stm mis'><a href='#n309'>309</a></p>
  366. <p id='n310' class='stm mis'><a href='#n310'>310</a></p>
  367. <p id='n311' class='stm mis'><a href='#n311'>311</a></p>
  368. <p id='n312' class='stm mis'><a href='#n312'>312</a></p>
  369. <p id='n313' class='stm mis'><a href='#n313'>313</a></p>
  370. <p id='n314' class='stm mis'><a href='#n314'>314</a></p>
  371. <p id='n315' class='pln'><a href='#n315'>315</a></p>
  372. <p id='n316' class='pln'><a href='#n316'>316</a></p>
  373. <p id='n317' class='stm mis'><a href='#n317'>317</a></p>
  374. <p id='n318' class='stm mis'><a href='#n318'>318</a></p>
  375. <p id='n319' class='stm mis'><a href='#n319'>319</a></p>
  376. <p id='n320' class='stm mis'><a href='#n320'>320</a></p>
  377. <p id='n321' class='stm mis'><a href='#n321'>321</a></p>
  378. <p id='n322' class='pln'><a href='#n322'>322</a></p>
  379. <p id='n323' class='stm mis'><a href='#n323'>323</a></p>
  380. <p id='n324' class='pln'><a href='#n324'>324</a></p>
  381. <p id='n325' class='stm mis'><a href='#n325'>325</a></p>
  382. <p id='n326' class='stm mis'><a href='#n326'>326</a></p>
  383. <p id='n327' class='stm mis'><a href='#n327'>327</a></p>
  384. <p id='n328' class='stm mis'><a href='#n328'>328</a></p>
  385. <p id='n329' class='stm mis'><a href='#n329'>329</a></p>
  386. <p id='n330' class='stm mis'><a href='#n330'>330</a></p>
  387. <p id='n331' class='stm mis'><a href='#n331'>331</a></p>
  388. <p id='n332' class='stm mis'><a href='#n332'>332</a></p>
  389. <p id='n333' class='pln'><a href='#n333'>333</a></p>
  390. <p id='n334' class='pln'><a href='#n334'>334</a></p>
  391. <p id='n335' class='stm mis'><a href='#n335'>335</a></p>
  392. <p id='n336' class='stm mis'><a href='#n336'>336</a></p>
  393. <p id='n337' class='stm mis'><a href='#n337'>337</a></p>
  394. <p id='n338' class='stm mis'><a href='#n338'>338</a></p>
  395. <p id='n339' class='stm mis'><a href='#n339'>339</a></p>
  396. <p id='n340' class='stm mis'><a href='#n340'>340</a></p>
  397. <p id='n341' class='stm mis'><a href='#n341'>341</a></p>
  398. <p id='n342' class='stm mis'><a href='#n342'>342</a></p>
  399. <p id='n343' class='stm mis'><a href='#n343'>343</a></p>
  400. <p id='n344' class='stm mis'><a href='#n344'>344</a></p>
  401. <p id='n345' class='stm mis'><a href='#n345'>345</a></p>
  402. <p id='n346' class='stm mis'><a href='#n346'>346</a></p>
  403. <p id='n347' class='stm mis'><a href='#n347'>347</a></p>
  404. <p id='n348' class='stm mis'><a href='#n348'>348</a></p>
  405. <p id='n349' class='stm mis'><a href='#n349'>349</a></p>
  406. <p id='n350' class='stm mis'><a href='#n350'>350</a></p>
  407. <p id='n351' class='stm mis'><a href='#n351'>351</a></p>
  408. <p id='n352' class='stm mis'><a href='#n352'>352</a></p>
  409. <p id='n353' class='stm mis'><a href='#n353'>353</a></p>
  410. <p id='n354' class='stm mis'><a href='#n354'>354</a></p>
  411. <p id='n355' class='stm mis'><a href='#n355'>355</a></p>
  412. <p id='n356' class='stm mis'><a href='#n356'>356</a></p>
  413. <p id='n357' class='stm mis'><a href='#n357'>357</a></p>
  414. <p id='n358' class='stm mis'><a href='#n358'>358</a></p>
  415. <p id='n359' class='stm mis'><a href='#n359'>359</a></p>
  416. <p id='n360' class='stm mis'><a href='#n360'>360</a></p>
  417. <p id='n361' class='stm mis'><a href='#n361'>361</a></p>
  418. <p id='n362' class='stm mis'><a href='#n362'>362</a></p>
  419. <p id='n363' class='stm mis'><a href='#n363'>363</a></p>
  420. <p id='n364' class='stm mis'><a href='#n364'>364</a></p>
  421. <p id='n365' class='stm mis'><a href='#n365'>365</a></p>
  422. <p id='n366' class='stm mis'><a href='#n366'>366</a></p>
  423. <p id='n367' class='stm mis'><a href='#n367'>367</a></p>
  424. <p id='n368' class='stm mis'><a href='#n368'>368</a></p>
  425. <p id='n369' class='stm mis'><a href='#n369'>369</a></p>
  426. <p id='n370' class='stm mis'><a href='#n370'>370</a></p>
  427. <p id='n371' class='stm mis'><a href='#n371'>371</a></p>
  428. <p id='n372' class='stm mis'><a href='#n372'>372</a></p>
  429. <p id='n373' class='stm mis'><a href='#n373'>373</a></p>
  430. <p id='n374' class='stm mis'><a href='#n374'>374</a></p>
  431. <p id='n375' class='stm mis'><a href='#n375'>375</a></p>
  432. <p id='n376' class='stm mis'><a href='#n376'>376</a></p>
  433. <p id='n377' class='stm mis'><a href='#n377'>377</a></p>
  434. <p id='n378' class='stm mis'><a href='#n378'>378</a></p>
  435. <p id='n379' class='pln'><a href='#n379'>379</a></p>
  436. <p id='n380' class='stm mis'><a href='#n380'>380</a></p>
  437. <p id='n381' class='pln'><a href='#n381'>381</a></p>
  438. <p id='n382' class='stm mis'><a href='#n382'>382</a></p>
  439. <p id='n383' class='stm mis'><a href='#n383'>383</a></p>
  440. <p id='n384' class='stm mis'><a href='#n384'>384</a></p>
  441. <p id='n385' class='pln'><a href='#n385'>385</a></p>
  442. <p id='n386' class='pln'><a href='#n386'>386</a></p>
  443. <p id='n387' class='pln'><a href='#n387'>387</a></p>
  444. <p id='n388' class='pln'><a href='#n388'>388</a></p>
  445. <p id='n389' class='pln'><a href='#n389'>389</a></p>
  446. <p id='n390' class='pln'><a href='#n390'>390</a></p>
  447. <p id='n391' class='pln'><a href='#n391'>391</a></p>
  448. <p id='n392' class='pln'><a href='#n392'>392</a></p>
  449. <p id='n393' class='stm mis'><a href='#n393'>393</a></p>
  450. <p id='n394' class='pln'><a href='#n394'>394</a></p>
  451. <p id='n395' class='pln'><a href='#n395'>395</a></p>
  452. <p id='n396' class='pln'><a href='#n396'>396</a></p>
  453. <p id='n397' class='pln'><a href='#n397'>397</a></p>
  454. <p id='n398' class='pln'><a href='#n398'>398</a></p>
  455. <p id='n399' class='pln'><a href='#n399'>399</a></p>
  456. <p id='n400' class='pln'><a href='#n400'>400</a></p>
  457. <p id='n401' class='pln'><a href='#n401'>401</a></p>
  458. <p id='n402' class='pln'><a href='#n402'>402</a></p>
  459. <p id='n403' class='pln'><a href='#n403'>403</a></p>
  460. <p id='n404' class='pln'><a href='#n404'>404</a></p>
  461. <p id='n405' class='pln'><a href='#n405'>405</a></p>
  462. <p id='n406' class='pln'><a href='#n406'>406</a></p>
  463. <p id='n407' class='pln'><a href='#n407'>407</a></p>
  464. <p id='n408' class='pln'><a href='#n408'>408</a></p>
  465. <p id='n409' class='pln'><a href='#n409'>409</a></p>
  466. <p id='n410' class='pln'><a href='#n410'>410</a></p>
  467. <p id='n411' class='pln'><a href='#n411'>411</a></p>
  468. <p id='n412' class='pln'><a href='#n412'>412</a></p>
  469. <p id='n413' class='pln'><a href='#n413'>413</a></p>
  470. <p id='n414' class='pln'><a href='#n414'>414</a></p>
  471. <p id='n415' class='pln'><a href='#n415'>415</a></p>
  472. <p id='n416' class='pln'><a href='#n416'>416</a></p>
  473. <p id='n417' class='pln'><a href='#n417'>417</a></p>
  474. <p id='n418' class='pln'><a href='#n418'>418</a></p>
  475. <p id='n419' class='pln'><a href='#n419'>419</a></p>
  476. <p id='n420' class='pln'><a href='#n420'>420</a></p>
  477. <p id='n421' class='pln'><a href='#n421'>421</a></p>
  478. <p id='n422' class='pln'><a href='#n422'>422</a></p>
  479. <p id='n423' class='pln'><a href='#n423'>423</a></p>
  480. <p id='n424' class='pln'><a href='#n424'>424</a></p>
  481. <p id='n425' class='pln'><a href='#n425'>425</a></p>
  482. <p id='n426' class='pln'><a href='#n426'>426</a></p>
  483. <p id='n427' class='pln'><a href='#n427'>427</a></p>
  484. <p id='n428' class='pln'><a href='#n428'>428</a></p>
  485. <p id='n429' class='pln'><a href='#n429'>429</a></p>
  486. <p id='n430' class='pln'><a href='#n430'>430</a></p>
  487. <p id='n431' class='pln'><a href='#n431'>431</a></p>
  488. <p id='n432' class='pln'><a href='#n432'>432</a></p>
  489. <p id='n433' class='pln'><a href='#n433'>433</a></p>
  490. <p id='n434' class='pln'><a href='#n434'>434</a></p>
  491. <p id='n435' class='pln'><a href='#n435'>435</a></p>
  492. <p id='n436' class='pln'><a href='#n436'>436</a></p>
  493. <p id='n437' class='stm mis'><a href='#n437'>437</a></p>
  494. <p id='n438' class='stm mis'><a href='#n438'>438</a></p>
  495. <p id='n439' class='stm mis'><a href='#n439'>439</a></p>
  496. <p id='n440' class='stm mis'><a href='#n440'>440</a></p>
  497. <p id='n441' class='pln'><a href='#n441'>441</a></p>
  498. <p id='n442' class='stm mis'><a href='#n442'>442</a></p>
  499. <p id='n443' class='stm mis'><a href='#n443'>443</a></p>
  500. <p id='n444' class='stm mis'><a href='#n444'>444</a></p>
  501. <p id='n445' class='stm mis'><a href='#n445'>445</a></p>
  502. <p id='n446' class='stm mis'><a href='#n446'>446</a></p>
  503. <p id='n447' class='stm mis'><a href='#n447'>447</a></p>
  504. <p id='n448' class='stm mis'><a href='#n448'>448</a></p>
  505. <p id='n449' class='stm mis'><a href='#n449'>449</a></p>
  506. <p id='n450' class='pln'><a href='#n450'>450</a></p>
  507. <p id='n451' class='stm mis'><a href='#n451'>451</a></p>
  508. <p id='n452' class='stm mis'><a href='#n452'>452</a></p>
  509. <p id='n453' class='pln'><a href='#n453'>453</a></p>
  510. <p id='n454' class='pln'><a href='#n454'>454</a></p>
  511. <p id='n455' class='stm mis'><a href='#n455'>455</a></p>
  512. <p id='n456' class='stm mis'><a href='#n456'>456</a></p>
  513. <p id='n457' class='pln'><a href='#n457'>457</a></p>
  514. <p id='n458' class='pln'><a href='#n458'>458</a></p>
  515. <p id='n459' class='stm mis'><a href='#n459'>459</a></p>
  516. <p id='n460' class='stm mis'><a href='#n460'>460</a></p>
  517. <p id='n461' class='pln'><a href='#n461'>461</a></p>
  518. <p id='n462' class='pln'><a href='#n462'>462</a></p>
  519. <p id='n463' class='stm mis'><a href='#n463'>463</a></p>
  520. <p id='n464' class='stm mis'><a href='#n464'>464</a></p>
  521. <p id='n465' class='stm mis'><a href='#n465'>465</a></p>
  522. <p id='n466' class='pln'><a href='#n466'>466</a></p>
  523. <p id='n467' class='stm mis'><a href='#n467'>467</a></p>
  524. <p id='n468' class='pln'><a href='#n468'>468</a></p>
  525. <p id='n469' class='stm mis'><a href='#n469'>469</a></p>
  526. <p id='n470' class='stm mis'><a href='#n470'>470</a></p>
  527. <p id='n471' class='stm mis'><a href='#n471'>471</a></p>
  528. <p id='n472' class='stm mis'><a href='#n472'>472</a></p>
  529. <p id='n473' class='stm mis'><a href='#n473'>473</a></p>
  530. <p id='n474' class='pln'><a href='#n474'>474</a></p>
  531. <p id='n475' class='pln'><a href='#n475'>475</a></p>
  532. <p id='n476' class='stm mis'><a href='#n476'>476</a></p>
  533. <p id='n477' class='stm mis'><a href='#n477'>477</a></p>
  534. <p id='n478' class='stm mis'><a href='#n478'>478</a></p>
  535. <p id='n479' class='stm mis'><a href='#n479'>479</a></p>
  536. <p id='n480' class='stm mis'><a href='#n480'>480</a></p>
  537. <p id='n481' class='pln'><a href='#n481'>481</a></p>
  538. <p id='n482' class='stm mis'><a href='#n482'>482</a></p>
  539. <p id='n483' class='pln'><a href='#n483'>483</a></p>
  540. <p id='n484' class='stm run hide_run'><a href='#n484'>484</a></p>
  541. <p id='n485' class='stm mis'><a href='#n485'>485</a></p>
  542. <p id='n486' class='stm mis'><a href='#n486'>486</a></p>
  543. <p id='n487' class='stm mis'><a href='#n487'>487</a></p>
  544. <p id='n488' class='stm mis'><a href='#n488'>488</a></p>
  545. <p id='n489' class='stm mis'><a href='#n489'>489</a></p>
  546. <p id='n490' class='stm mis'><a href='#n490'>490</a></p>
  547. <p id='n491' class='stm mis'><a href='#n491'>491</a></p>
  548. <p id='n492' class='stm mis'><a href='#n492'>492</a></p>
  549. </td>
  550. <td class='text' valign='top'>
  551. <p id='t1' class='pln'><span class='com'>#!/usr/bin/env python</span><span class='strut'>&nbsp;</span></p>
  552. <p id='t2' class='pln'><span class='com'># -*- coding: utf-8 -*-</span><span class='strut'>&nbsp;</span></p>
  553. <p id='t3' class='pln'><span class='strut'>&nbsp;</span></p>
  554. <p id='t4' class='stm run hide_run'><span class='key'>from</span> <span class='nam'>__future__</span> <span class='key'>import</span> <span class='nam'>with_statement</span><span class='strut'>&nbsp;</span></p>
  555. <p id='t5' class='stm run hide_run'><span class='key'>from</span> <span class='nam'>__future__</span> <span class='key'>import</span> <span class='nam'>absolute_import</span><span class='strut'>&nbsp;</span></p>
  556. <p id='t6' class='pln'><span class='strut'>&nbsp;</span></p>
  557. <p id='t7' class='stm run hide_run'><span class='nam'>__authors__</span>&nbsp; <span class='op'>=</span> <span class='op'>(</span><span class='strut'>&nbsp;</span></p>
  558. <p id='t8' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Ricardo Garcia Gonzalez&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  559. <p id='t9' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Danny Colligan&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  560. <p id='t10' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Benjamin Johnson&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  561. <p id='t11' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Vasyl\&#39; Vavrychuk&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  562. <p id='t12' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Witold Baryluk&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  563. <p id='t13' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Pawe&#322; Paprota&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  564. <p id='t14' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Gergely Imreh&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  565. <p id='t15' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Rog&#233;rio Brito&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  566. <p id='t16' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Philipp Hagemeister&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  567. <p id='t17' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;S&#246;ren Schulze&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  568. <p id='t18' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Kevin Ngo&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  569. <p id='t19' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Ori Avtalion&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  570. <p id='t20' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;shizeeg&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  571. <p id='t21' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Filippo Valsorda&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  572. <p id='t22' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Christian Albrecht&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  573. <p id='t23' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Dave Vasilevsky&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  574. <p id='t24' class='pln'>&nbsp; &nbsp; <span class='str'>&#39;Jaime Marqu&#237;nez Ferr&#225;ndiz&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  575. <p id='t25' class='pln'>&nbsp; &nbsp; <span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  576. <p id='t26' class='pln'><span class='strut'>&nbsp;</span></p>
  577. <p id='t27' class='stm run hide_run'><span class='nam'>__license__</span> <span class='op'>=</span> <span class='str'>&#39;Public Domain&#39;</span><span class='strut'>&nbsp;</span></p>
  578. <p id='t28' class='pln'><span class='strut'>&nbsp;</span></p>
  579. <p id='t29' class='stm run hide_run'><span class='key'>import</span> <span class='nam'>getpass</span><span class='strut'>&nbsp;</span></p>
  580. <p id='t30' class='stm run hide_run'><span class='key'>import</span> <span class='nam'>optparse</span><span class='strut'>&nbsp;</span></p>
  581. <p id='t31' class='stm run hide_run'><span class='key'>import</span> <span class='nam'>os</span><span class='strut'>&nbsp;</span></p>
  582. <p id='t32' class='stm run hide_run'><span class='key'>import</span> <span class='nam'>re</span><span class='strut'>&nbsp;</span></p>
  583. <p id='t33' class='stm run hide_run'><span class='key'>import</span> <span class='nam'>shlex</span><span class='strut'>&nbsp;</span></p>
  584. <p id='t34' class='stm run hide_run'><span class='key'>import</span> <span class='nam'>socket</span><span class='strut'>&nbsp;</span></p>
  585. <p id='t35' class='stm run hide_run'><span class='key'>import</span> <span class='nam'>subprocess</span><span class='strut'>&nbsp;</span></p>
  586. <p id='t36' class='stm run hide_run'><span class='key'>import</span> <span class='nam'>sys</span><span class='strut'>&nbsp;</span></p>
  587. <p id='t37' class='stm run hide_run'><span class='key'>import</span> <span class='nam'>warnings</span><span class='strut'>&nbsp;</span></p>
  588. <p id='t38' class='stm run hide_run'><span class='key'>import</span> <span class='nam'>platform</span><span class='strut'>&nbsp;</span></p>
  589. <p id='t39' class='pln'><span class='strut'>&nbsp;</span></p>
  590. <p id='t40' class='stm run hide_run'><span class='key'>from</span> <span class='op'>.</span><span class='nam'>utils</span> <span class='key'>import</span> <span class='op'>*</span><span class='strut'>&nbsp;</span></p>
  591. <p id='t41' class='stm run hide_run'><span class='key'>from</span> <span class='op'>.</span><span class='nam'>update</span> <span class='key'>import</span> <span class='nam'>update_self</span><span class='strut'>&nbsp;</span></p>
  592. <p id='t42' class='stm run hide_run'><span class='key'>from</span> <span class='op'>.</span><span class='nam'>version</span> <span class='key'>import</span> <span class='nam'>__version__</span><span class='strut'>&nbsp;</span></p>
  593. <p id='t43' class='stm run hide_run'><span class='key'>from</span> <span class='op'>.</span><span class='nam'>FileDownloader</span> <span class='key'>import</span> <span class='op'>*</span><span class='strut'>&nbsp;</span></p>
  594. <p id='t44' class='stm run hide_run'><span class='key'>from</span> <span class='op'>.</span><span class='nam'>InfoExtractors</span> <span class='key'>import</span> <span class='nam'>gen_extractors</span><span class='strut'>&nbsp;</span></p>
  595. <p id='t45' class='stm run hide_run'><span class='key'>from</span> <span class='op'>.</span><span class='nam'>PostProcessor</span> <span class='key'>import</span> <span class='op'>*</span><span class='strut'>&nbsp;</span></p>
  596. <p id='t46' class='pln'><span class='strut'>&nbsp;</span></p>
  597. <p id='t47' class='stm run hide_run'><span class='key'>def</span> <span class='nam'>parseOpts</span><span class='op'>(</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  598. <p id='t48' class='stm mis'>&nbsp; &nbsp; <span class='key'>def</span> <span class='nam'>_readOptions</span><span class='op'>(</span><span class='nam'>filename_bytes</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  599. <p id='t49' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>try</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  600. <p id='t50' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>optionf</span> <span class='op'>=</span> <span class='nam'>open</span><span class='op'>(</span><span class='nam'>filename_bytes</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  601. <p id='t51' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>except</span> <span class='nam'>IOError</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  602. <p id='t52' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>return</span> <span class='op'>[</span><span class='op'>]</span> <span class='com'># silently skip if file is not present</span><span class='strut'>&nbsp;</span></p>
  603. <p id='t53' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>try</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  604. <p id='t54' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>res</span> <span class='op'>=</span> <span class='op'>[</span><span class='op'>]</span><span class='strut'>&nbsp;</span></p>
  605. <p id='t55' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>for</span> <span class='nam'>l</span> <span class='key'>in</span> <span class='nam'>optionf</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  606. <p id='t56' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>res</span> <span class='op'>+=</span> <span class='nam'>shlex</span><span class='op'>.</span><span class='nam'>split</span><span class='op'>(</span><span class='nam'>l</span><span class='op'>,</span> <span class='nam'>comments</span><span class='op'>=</span><span class='nam'>True</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  607. <p id='t57' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>finally</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  608. <p id='t58' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>optionf</span><span class='op'>.</span><span class='nam'>close</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  609. <p id='t59' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>return</span> <span class='nam'>res</span><span class='strut'>&nbsp;</span></p>
  610. <p id='t60' class='pln'><span class='strut'>&nbsp;</span></p>
  611. <p id='t61' class='stm mis'>&nbsp; &nbsp; <span class='key'>def</span> <span class='nam'>_format_option_string</span><span class='op'>(</span><span class='nam'>option</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  612. <p id='t62' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;&#39;&#39; (&#39;-o&#39;, &#39;--option&#39;) -&gt; -o, --format METAVAR&#39;&#39;&#39;</span><span class='strut'>&nbsp;</span></p>
  613. <p id='t63' class='pln'><span class='strut'>&nbsp;</span></p>
  614. <p id='t64' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>opts</span> <span class='op'>=</span> <span class='op'>[</span><span class='op'>]</span><span class='strut'>&nbsp;</span></p>
  615. <p id='t65' class='pln'><span class='strut'>&nbsp;</span></p>
  616. <p id='t66' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>option</span><span class='op'>.</span><span class='nam'>_short_opts</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  617. <p id='t67' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>append</span><span class='op'>(</span><span class='nam'>option</span><span class='op'>.</span><span class='nam'>_short_opts</span><span class='op'>[</span><span class='num'>0</span><span class='op'>]</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  618. <p id='t68' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>option</span><span class='op'>.</span><span class='nam'>_long_opts</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  619. <p id='t69' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>append</span><span class='op'>(</span><span class='nam'>option</span><span class='op'>.</span><span class='nam'>_long_opts</span><span class='op'>[</span><span class='num'>0</span><span class='op'>]</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  620. <p id='t70' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>len</span><span class='op'>(</span><span class='nam'>opts</span><span class='op'>)</span> <span class='op'>&gt;</span> <span class='num'>1</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  621. <p id='t71' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>insert</span><span class='op'>(</span><span class='num'>1</span><span class='op'>,</span> <span class='str'>&#39;, &#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  622. <p id='t72' class='pln'><span class='strut'>&nbsp;</span></p>
  623. <p id='t73' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>option</span><span class='op'>.</span><span class='nam'>takes_value</span><span class='op'>(</span><span class='op'>)</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>append</span><span class='op'>(</span><span class='str'>&#39; %s&#39;</span> <span class='op'>%</span> <span class='nam'>option</span><span class='op'>.</span><span class='nam'>metavar</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  624. <p id='t74' class='pln'><span class='strut'>&nbsp;</span></p>
  625. <p id='t75' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>return</span> <span class='str'>&quot;&quot;</span><span class='op'>.</span><span class='nam'>join</span><span class='op'>(</span><span class='nam'>opts</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  626. <p id='t76' class='pln'><span class='strut'>&nbsp;</span></p>
  627. <p id='t77' class='stm mis'>&nbsp; &nbsp; <span class='key'>def</span> <span class='nam'>_find_term_columns</span><span class='op'>(</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  628. <p id='t78' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>columns</span> <span class='op'>=</span> <span class='nam'>os</span><span class='op'>.</span><span class='nam'>environ</span><span class='op'>.</span><span class='nam'>get</span><span class='op'>(</span><span class='str'>&#39;COLUMNS&#39;</span><span class='op'>,</span> <span class='nam'>None</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  629. <p id='t79' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>columns</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  630. <p id='t80' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>return</span> <span class='nam'>int</span><span class='op'>(</span><span class='nam'>columns</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  631. <p id='t81' class='pln'><span class='strut'>&nbsp;</span></p>
  632. <p id='t82' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>try</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  633. <p id='t83' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>sp</span> <span class='op'>=</span> <span class='nam'>subprocess</span><span class='op'>.</span><span class='nam'>Popen</span><span class='op'>(</span><span class='op'>[</span><span class='str'>&#39;stty&#39;</span><span class='op'>,</span> <span class='str'>&#39;size&#39;</span><span class='op'>]</span><span class='op'>,</span> <span class='nam'>stdout</span><span class='op'>=</span><span class='nam'>subprocess</span><span class='op'>.</span><span class='nam'>PIPE</span><span class='op'>,</span> <span class='nam'>stderr</span><span class='op'>=</span><span class='nam'>subprocess</span><span class='op'>.</span><span class='nam'>PIPE</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  634. <p id='t84' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>out</span><span class='op'>,</span><span class='nam'>err</span> <span class='op'>=</span> <span class='nam'>sp</span><span class='op'>.</span><span class='nam'>communicate</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  635. <p id='t85' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>return</span> <span class='nam'>int</span><span class='op'>(</span><span class='nam'>out</span><span class='op'>.</span><span class='nam'>split</span><span class='op'>(</span><span class='op'>)</span><span class='op'>[</span><span class='num'>1</span><span class='op'>]</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  636. <p id='t86' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>except</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  637. <p id='t87' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>pass</span><span class='strut'>&nbsp;</span></p>
  638. <p id='t88' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>return</span> <span class='nam'>None</span><span class='strut'>&nbsp;</span></p>
  639. <p id='t89' class='pln'><span class='strut'>&nbsp;</span></p>
  640. <p id='t90' class='stm mis'>&nbsp; &nbsp; <span class='nam'>max_width</span> <span class='op'>=</span> <span class='num'>80</span><span class='strut'>&nbsp;</span></p>
  641. <p id='t91' class='stm mis'>&nbsp; &nbsp; <span class='nam'>max_help_position</span> <span class='op'>=</span> <span class='num'>80</span><span class='strut'>&nbsp;</span></p>
  642. <p id='t92' class='pln'><span class='strut'>&nbsp;</span></p>
  643. <p id='t93' class='pln'>&nbsp; &nbsp; <span class='com'># No need to wrap help messages if we&#39;re on a wide console</span><span class='strut'>&nbsp;</span></p>
  644. <p id='t94' class='stm mis'>&nbsp; &nbsp; <span class='nam'>columns</span> <span class='op'>=</span> <span class='nam'>_find_term_columns</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  645. <p id='t95' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>columns</span><span class='op'>:</span> <span class='nam'>max_width</span> <span class='op'>=</span> <span class='nam'>columns</span><span class='strut'>&nbsp;</span></p>
  646. <p id='t96' class='pln'><span class='strut'>&nbsp;</span></p>
  647. <p id='t97' class='stm mis'>&nbsp; &nbsp; <span class='nam'>fmt</span> <span class='op'>=</span> <span class='nam'>optparse</span><span class='op'>.</span><span class='nam'>IndentedHelpFormatter</span><span class='op'>(</span><span class='nam'>width</span><span class='op'>=</span><span class='nam'>max_width</span><span class='op'>,</span> <span class='nam'>max_help_position</span><span class='op'>=</span><span class='nam'>max_help_position</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  648. <p id='t98' class='stm mis'>&nbsp; &nbsp; <span class='nam'>fmt</span><span class='op'>.</span><span class='nam'>format_option_strings</span> <span class='op'>=</span> <span class='nam'>_format_option_string</span><span class='strut'>&nbsp;</span></p>
  649. <p id='t99' class='pln'><span class='strut'>&nbsp;</span></p>
  650. <p id='t100' class='stm mis'>&nbsp; &nbsp; <span class='nam'>kw</span> <span class='op'>=</span> <span class='op'>{</span><span class='strut'>&nbsp;</span></p>
  651. <p id='t101' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;version&#39;</span>&nbsp;&nbsp; <span class='op'>:</span> <span class='nam'>__version__</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  652. <p id='t102' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;formatter&#39;</span> <span class='op'>:</span> <span class='nam'>fmt</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  653. <p id='t103' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;usage&#39;</span> <span class='op'>:</span> <span class='str'>&#39;%prog [options] url [url...]&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  654. <p id='t104' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;conflict_handler&#39;</span> <span class='op'>:</span> <span class='str'>&#39;resolve&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  655. <p id='t105' class='pln'>&nbsp; &nbsp; <span class='op'>}</span><span class='strut'>&nbsp;</span></p>
  656. <p id='t106' class='pln'><span class='strut'>&nbsp;</span></p>
  657. <p id='t107' class='stm mis'>&nbsp; &nbsp; <span class='nam'>parser</span> <span class='op'>=</span> <span class='nam'>optparse</span><span class='op'>.</span><span class='nam'>OptionParser</span><span class='op'>(</span><span class='op'>**</span><span class='nam'>kw</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  658. <p id='t108' class='pln'><span class='strut'>&nbsp;</span></p>
  659. <p id='t109' class='pln'>&nbsp; &nbsp; <span class='com'># option groups</span><span class='strut'>&nbsp;</span></p>
  660. <p id='t110' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span>&nbsp; &nbsp; &nbsp; &nbsp; <span class='op'>=</span> <span class='nam'>optparse</span><span class='op'>.</span><span class='nam'>OptionGroup</span><span class='op'>(</span><span class='nam'>parser</span><span class='op'>,</span> <span class='str'>&#39;General Options&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  661. <p id='t111' class='stm mis'>&nbsp; &nbsp; <span class='nam'>selection</span>&nbsp; &nbsp; &nbsp; <span class='op'>=</span> <span class='nam'>optparse</span><span class='op'>.</span><span class='nam'>OptionGroup</span><span class='op'>(</span><span class='nam'>parser</span><span class='op'>,</span> <span class='str'>&#39;Video Selection&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  662. <p id='t112' class='stm mis'>&nbsp; &nbsp; <span class='nam'>authentication</span> <span class='op'>=</span> <span class='nam'>optparse</span><span class='op'>.</span><span class='nam'>OptionGroup</span><span class='op'>(</span><span class='nam'>parser</span><span class='op'>,</span> <span class='str'>&#39;Authentication Options&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  663. <p id='t113' class='stm mis'>&nbsp; &nbsp; <span class='nam'>video_format</span>&nbsp;&nbsp; <span class='op'>=</span> <span class='nam'>optparse</span><span class='op'>.</span><span class='nam'>OptionGroup</span><span class='op'>(</span><span class='nam'>parser</span><span class='op'>,</span> <span class='str'>&#39;Video Format Options&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  664. <p id='t114' class='stm mis'>&nbsp; &nbsp; <span class='nam'>postproc</span>&nbsp; &nbsp; &nbsp;&nbsp; <span class='op'>=</span> <span class='nam'>optparse</span><span class='op'>.</span><span class='nam'>OptionGroup</span><span class='op'>(</span><span class='nam'>parser</span><span class='op'>,</span> <span class='str'>&#39;Post-processing Options&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  665. <p id='t115' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span>&nbsp; &nbsp;&nbsp; <span class='op'>=</span> <span class='nam'>optparse</span><span class='op'>.</span><span class='nam'>OptionGroup</span><span class='op'>(</span><span class='nam'>parser</span><span class='op'>,</span> <span class='str'>&#39;Filesystem Options&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  666. <p id='t116' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span>&nbsp; &nbsp; &nbsp; <span class='op'>=</span> <span class='nam'>optparse</span><span class='op'>.</span><span class='nam'>OptionGroup</span><span class='op'>(</span><span class='nam'>parser</span><span class='op'>,</span> <span class='str'>&#39;Verbosity / Simulation Options&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  667. <p id='t117' class='pln'><span class='strut'>&nbsp;</span></p>
  668. <p id='t118' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-h&#39;</span><span class='op'>,</span> <span class='str'>&#39;--help&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  669. <p id='t119' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;help&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;print this help text and exit&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  670. <p id='t120' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-v&#39;</span><span class='op'>,</span> <span class='str'>&#39;--version&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  671. <p id='t121' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;version&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;print program version and exit&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  672. <p id='t122' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-U&#39;</span><span class='op'>,</span> <span class='str'>&#39;--update&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  673. <p id='t123' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;update_self&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;update this program to latest version&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  674. <p id='t124' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-i&#39;</span><span class='op'>,</span> <span class='str'>&#39;--ignore-errors&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  675. <p id='t125' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;ignoreerrors&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;continue on download errors&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  676. <p id='t126' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-r&#39;</span><span class='op'>,</span> <span class='str'>&#39;--rate-limit&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  677. <p id='t127' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;ratelimit&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;LIMIT&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;download rate limit (e.g. 50k or 44.6m)&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  678. <p id='t128' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-R&#39;</span><span class='op'>,</span> <span class='str'>&#39;--retries&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  679. <p id='t129' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;retries&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;RETRIES&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;number of retries (default is %default)&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='num'>10</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  680. <p id='t130' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--buffer-size&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  681. <p id='t131' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;buffersize&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;SIZE&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;size of download buffer (e.g. 1024 or 16k) (default is %default)&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='str'>&quot;1024&quot;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  682. <p id='t132' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--no-resize-buffer&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  683. <p id='t133' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;noresizebuffer&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  684. <p id='t134' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;do not automatically adjust the buffer size. By default, the buffer size is automatically resized from an initial value of SIZE.&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  685. <p id='t135' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--dump-user-agent&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  686. <p id='t136' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;dump_user_agent&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  687. <p id='t137' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;display the current browser identification&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  688. <p id='t138' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--user-agent&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  689. <p id='t139' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;user_agent&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;specify a custom user agent&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;UA&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  690. <p id='t140' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--list-extractors&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  691. <p id='t141' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;list_extractors&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  692. <p id='t142' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;List all supported extractors and the URLs they would handle&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  693. <p id='t143' class='stm mis'>&nbsp; &nbsp; <span class='nam'>general</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--test&#39;</span><span class='op'>,</span> <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;test&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='nam'>optparse</span><span class='op'>.</span><span class='nam'>SUPPRESS_HELP</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  694. <p id='t144' class='pln'><span class='strut'>&nbsp;</span></p>
  695. <p id='t145' class='stm mis'>&nbsp; &nbsp; <span class='nam'>selection</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--playlist-start&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  696. <p id='t146' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;playliststart&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;NUMBER&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;playlist video to start at (default is %default)&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='num'>1</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  697. <p id='t147' class='stm mis'>&nbsp; &nbsp; <span class='nam'>selection</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--playlist-end&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  698. <p id='t148' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;playlistend&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;NUMBER&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;playlist video to end at (default is last)&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='op'>-</span><span class='num'>1</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  699. <p id='t149' class='stm mis'>&nbsp; &nbsp; <span class='nam'>selection</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--match-title&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;matchtitle&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;REGEX&#39;</span><span class='op'>,</span><span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;download only matching titles (regex or caseless sub-string)&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  700. <p id='t150' class='stm mis'>&nbsp; &nbsp; <span class='nam'>selection</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--reject-title&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;rejecttitle&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;REGEX&#39;</span><span class='op'>,</span><span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;skip download for matching titles (regex or caseless sub-string)&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  701. <p id='t151' class='stm mis'>&nbsp; &nbsp; <span class='nam'>selection</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--max-downloads&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;NUMBER&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;max_downloads&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;Abort after downloading NUMBER files&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>None</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  702. <p id='t152' class='pln'><span class='strut'>&nbsp;</span></p>
  703. <p id='t153' class='stm mis'>&nbsp; &nbsp; <span class='nam'>authentication</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-u&#39;</span><span class='op'>,</span> <span class='str'>&#39;--username&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  704. <p id='t154' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;username&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;USERNAME&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;account username&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  705. <p id='t155' class='stm mis'>&nbsp; &nbsp; <span class='nam'>authentication</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-p&#39;</span><span class='op'>,</span> <span class='str'>&#39;--password&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  706. <p id='t156' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;password&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;PASSWORD&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;account password&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  707. <p id='t157' class='stm mis'>&nbsp; &nbsp; <span class='nam'>authentication</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-n&#39;</span><span class='op'>,</span> <span class='str'>&#39;--netrc&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  708. <p id='t158' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;usenetrc&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;use .netrc authentication data&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  709. <p id='t159' class='pln'><span class='strut'>&nbsp;</span></p>
  710. <p id='t160' class='pln'><span class='strut'>&nbsp;</span></p>
  711. <p id='t161' class='stm mis'>&nbsp; &nbsp; <span class='nam'>video_format</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-f&#39;</span><span class='op'>,</span> <span class='str'>&#39;--format&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  712. <p id='t162' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;format&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;FORMAT&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;video format code&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  713. <p id='t163' class='stm mis'>&nbsp; &nbsp; <span class='nam'>video_format</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--all-formats&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  714. <p id='t164' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_const&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;format&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;download all available video formats&#39;</span><span class='op'>,</span> <span class='nam'>const</span><span class='op'>=</span><span class='str'>&#39;all&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  715. <p id='t165' class='stm mis'>&nbsp; &nbsp; <span class='nam'>video_format</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--prefer-free-formats&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  716. <p id='t166' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;prefer_free_formats&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;prefer free video formats unless a specific one is requested&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  717. <p id='t167' class='stm mis'>&nbsp; &nbsp; <span class='nam'>video_format</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--max-quality&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  718. <p id='t168' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;format_limit&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;FORMAT&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;highest quality format to download&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  719. <p id='t169' class='stm mis'>&nbsp; &nbsp; <span class='nam'>video_format</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-F&#39;</span><span class='op'>,</span> <span class='str'>&#39;--list-formats&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  720. <p id='t170' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;listformats&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;list all available formats (currently youtube only)&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  721. <p id='t171' class='stm mis'>&nbsp; &nbsp; <span class='nam'>video_format</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--write-srt&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  722. <p id='t172' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;writesubtitles&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  723. <p id='t173' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;write video closed captions to a .srt file (currently youtube only)&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  724. <p id='t174' class='stm mis'>&nbsp; &nbsp; <span class='nam'>video_format</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--srt-lang&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  725. <p id='t175' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;subtitleslang&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;LANG&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  726. <p id='t176' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;language of the closed captions to download (optional) use IETF language tags like \&#39;en\&#39;&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  727. <p id='t177' class='pln'><span class='strut'>&nbsp;</span></p>
  728. <p id='t178' class='pln'><span class='strut'>&nbsp;</span></p>
  729. <p id='t179' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-q&#39;</span><span class='op'>,</span> <span class='str'>&#39;--quiet&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  730. <p id='t180' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;quiet&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;activates quiet mode&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  731. <p id='t181' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-s&#39;</span><span class='op'>,</span> <span class='str'>&#39;--simulate&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  732. <p id='t182' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;simulate&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;do not download the video and do not write anything to disk&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  733. <p id='t183' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--skip-download&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  734. <p id='t184' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;skip_download&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;do not download the video&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  735. <p id='t185' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-g&#39;</span><span class='op'>,</span> <span class='str'>&#39;--get-url&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  736. <p id='t186' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;geturl&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;simulate, quiet but print URL&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  737. <p id='t187' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-e&#39;</span><span class='op'>,</span> <span class='str'>&#39;--get-title&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  738. <p id='t188' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;gettitle&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;simulate, quiet but print title&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  739. <p id='t189' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--get-thumbnail&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  740. <p id='t190' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;getthumbnail&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  741. <p id='t191' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;simulate, quiet but print thumbnail URL&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  742. <p id='t192' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--get-description&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  743. <p id='t193' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;getdescription&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  744. <p id='t194' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;simulate, quiet but print video description&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  745. <p id='t195' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--get-filename&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  746. <p id='t196' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;getfilename&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  747. <p id='t197' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;simulate, quiet but print output filename&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  748. <p id='t198' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--get-format&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  749. <p id='t199' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;getformat&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  750. <p id='t200' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;simulate, quiet but print output format&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  751. <p id='t201' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--no-progress&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  752. <p id='t202' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;noprogress&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;do not print progress bar&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  753. <p id='t203' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--console-title&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  754. <p id='t204' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;consoletitle&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  755. <p id='t205' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;display progress in console titlebar&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  756. <p id='t206' class='stm mis'>&nbsp; &nbsp; <span class='nam'>verbosity</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-v&#39;</span><span class='op'>,</span> <span class='str'>&#39;--verbose&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  757. <p id='t207' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;verbose&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;print various debugging information&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  758. <p id='t208' class='pln'><span class='strut'>&nbsp;</span></p>
  759. <p id='t209' class='pln'><span class='strut'>&nbsp;</span></p>
  760. <p id='t210' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-t&#39;</span><span class='op'>,</span> <span class='str'>&#39;--title&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  761. <p id='t211' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;usetitle&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;use title in file name&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  762. <p id='t212' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--id&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  763. <p id='t213' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;useid&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;use video ID in file name&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  764. <p id='t214' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-l&#39;</span><span class='op'>,</span> <span class='str'>&#39;--literal&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  765. <p id='t215' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;usetitle&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;[deprecated] alias of --title&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  766. <p id='t216' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-A&#39;</span><span class='op'>,</span> <span class='str'>&#39;--auto-number&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  767. <p id='t217' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;autonumber&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  768. <p id='t218' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;number downloaded files starting from 00000&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  769. <p id='t219' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-o&#39;</span><span class='op'>,</span> <span class='str'>&#39;--output&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  770. <p id='t220' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;outtmpl&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;TEMPLATE&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;output filename template. Use %(title)s to get the title, %(uploader)s for the uploader name, %(uploader_id)s for the uploader nickname if different, %(autonumber)s to get an automatically incremented number, %(ext)s for the filename extension, %(upload_date)s for the upload date (YYYYMMDD), %(extractor)s for the provider (youtube, metacafe, etc), %(id)s for the video id and %% for a literal percent. Use - to output to stdout. Can also be used to download to a different directory, for example with -o \&#39;/my/downloads/%(uploader)s/%(title)s-%(id)s.%(ext)s\&#39; .&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  771. <p id='t221' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--restrict-filenames&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  772. <p id='t222' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;restrictfilenames&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  773. <p id='t223' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;Restrict filenames to only ASCII characters, and avoid &quot;&amp;&quot; and spaces in filenames&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  774. <p id='t224' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-a&#39;</span><span class='op'>,</span> <span class='str'>&#39;--batch-file&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  775. <p id='t225' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;batchfile&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;FILE&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;file containing URLs to download (\&#39;-\&#39; for stdin)&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  776. <p id='t226' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-w&#39;</span><span class='op'>,</span> <span class='str'>&#39;--no-overwrites&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  777. <p id='t227' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;nooverwrites&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;do not overwrite files&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  778. <p id='t228' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-c&#39;</span><span class='op'>,</span> <span class='str'>&#39;--continue&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  779. <p id='t229' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;continue_dl&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;resume partially downloaded files&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>True</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  780. <p id='t230' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--no-continue&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  781. <p id='t231' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_false&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;continue_dl&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  782. <p id='t232' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;do not resume partially downloaded files (restart from beginning)&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  783. <p id='t233' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--cookies&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  784. <p id='t234' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;cookiefile&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;FILE&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;file to read cookies from and dump cookie jar in&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  785. <p id='t235' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--no-part&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  786. <p id='t236' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;nopart&#39;</span><span class='op'>,</span> <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;do not use .part files&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  787. <p id='t237' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--no-mtime&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  788. <p id='t238' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_false&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;updatetime&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  789. <p id='t239' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;do not use the Last-modified header to set the file modification time&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>True</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  790. <p id='t240' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--write-description&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  791. <p id='t241' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;writedescription&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  792. <p id='t242' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;write video description to a .description file&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  793. <p id='t243' class='stm mis'>&nbsp; &nbsp; <span class='nam'>filesystem</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--write-info-json&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  794. <p id='t244' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;writeinfojson&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  795. <p id='t245' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;write video metadata to a .info.json file&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  796. <p id='t246' class='pln'><span class='strut'>&nbsp;</span></p>
  797. <p id='t247' class='pln'><span class='strut'>&nbsp;</span></p>
  798. <p id='t248' class='stm mis'>&nbsp; &nbsp; <span class='nam'>postproc</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-x&#39;</span><span class='op'>,</span> <span class='str'>&#39;--extract-audio&#39;</span><span class='op'>,</span> <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;extractaudio&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  799. <p id='t249' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;convert video files to audio-only files (requires ffmpeg or avconv and ffprobe or avprobe)&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  800. <p id='t250' class='stm mis'>&nbsp; &nbsp; <span class='nam'>postproc</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--audio-format&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;FORMAT&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;audioformat&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='str'>&#39;best&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  801. <p id='t251' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;&quot;best&quot;, &quot;aac&quot;, &quot;vorbis&quot;, &quot;mp3&quot;, &quot;m4a&quot;, or &quot;wav&quot;; best by default&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  802. <p id='t252' class='stm mis'>&nbsp; &nbsp; <span class='nam'>postproc</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--audio-quality&#39;</span><span class='op'>,</span> <span class='nam'>metavar</span><span class='op'>=</span><span class='str'>&#39;QUALITY&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;audioquality&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='str'>&#39;5&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  803. <p id='t253' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;ffmpeg/avconv audio quality specification, insert a value between 0 (better) and 9 (worse) for VBR or a specific bitrate like 128K (default 5)&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  804. <p id='t254' class='stm mis'>&nbsp; &nbsp; <span class='nam'>postproc</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;-k&#39;</span><span class='op'>,</span> <span class='str'>&#39;--keep-video&#39;</span><span class='op'>,</span> <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;keepvideo&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  805. <p id='t255' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;keeps the video file on disk after the post-processing; the video is erased by default&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  806. <p id='t256' class='stm mis'>&nbsp; &nbsp; <span class='nam'>postproc</span><span class='op'>.</span><span class='nam'>add_option</span><span class='op'>(</span><span class='str'>&#39;--no-post-overwrites&#39;</span><span class='op'>,</span> <span class='nam'>action</span><span class='op'>=</span><span class='str'>&#39;store_true&#39;</span><span class='op'>,</span> <span class='nam'>dest</span><span class='op'>=</span><span class='str'>&#39;nopostoverwrites&#39;</span><span class='op'>,</span> <span class='nam'>default</span><span class='op'>=</span><span class='nam'>False</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  807. <p id='t257' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>help</span><span class='op'>=</span><span class='str'>&#39;do not overwrite post-processed files; the post-processed files are overwritten by default&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  808. <p id='t258' class='pln'><span class='strut'>&nbsp;</span></p>
  809. <p id='t259' class='pln'><span class='strut'>&nbsp;</span></p>
  810. <p id='t260' class='stm mis'>&nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>add_option_group</span><span class='op'>(</span><span class='nam'>general</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  811. <p id='t261' class='stm mis'>&nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>add_option_group</span><span class='op'>(</span><span class='nam'>selection</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  812. <p id='t262' class='stm mis'>&nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>add_option_group</span><span class='op'>(</span><span class='nam'>filesystem</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  813. <p id='t263' class='stm mis'>&nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>add_option_group</span><span class='op'>(</span><span class='nam'>verbosity</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  814. <p id='t264' class='stm mis'>&nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>add_option_group</span><span class='op'>(</span><span class='nam'>video_format</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  815. <p id='t265' class='stm mis'>&nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>add_option_group</span><span class='op'>(</span><span class='nam'>authentication</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  816. <p id='t266' class='stm mis'>&nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>add_option_group</span><span class='op'>(</span><span class='nam'>postproc</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  817. <p id='t267' class='pln'><span class='strut'>&nbsp;</span></p>
  818. <p id='t268' class='stm mis'>&nbsp; &nbsp; <span class='nam'>xdg_config_home</span> <span class='op'>=</span> <span class='nam'>os</span><span class='op'>.</span><span class='nam'>environ</span><span class='op'>.</span><span class='nam'>get</span><span class='op'>(</span><span class='str'>&#39;XDG_CONFIG_HOME&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  819. <p id='t269' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>xdg_config_home</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  820. <p id='t270' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>userConf</span> <span class='op'>=</span> <span class='nam'>os</span><span class='op'>.</span><span class='nam'>path</span><span class='op'>.</span><span class='nam'>join</span><span class='op'>(</span><span class='nam'>xdg_config_home</span><span class='op'>,</span> <span class='str'>&#39;youtube-dl.conf&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  821. <p id='t271' class='pln'>&nbsp; &nbsp; <span class='key'>else</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  822. <p id='t272' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>userConf</span> <span class='op'>=</span> <span class='nam'>os</span><span class='op'>.</span><span class='nam'>path</span><span class='op'>.</span><span class='nam'>join</span><span class='op'>(</span><span class='nam'>os</span><span class='op'>.</span><span class='nam'>path</span><span class='op'>.</span><span class='nam'>expanduser</span><span class='op'>(</span><span class='str'>&#39;~&#39;</span><span class='op'>)</span><span class='op'>,</span> <span class='str'>&#39;.config&#39;</span><span class='op'>,</span> <span class='str'>&#39;youtube-dl.conf&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  823. <p id='t273' class='stm mis'>&nbsp; &nbsp; <span class='nam'>argv</span> <span class='op'>=</span> <span class='nam'>_readOptions</span><span class='op'>(</span><span class='str'>&#39;/etc/youtube-dl.conf&#39;</span><span class='op'>)</span> <span class='op'>+</span> <span class='nam'>_readOptions</span><span class='op'>(</span><span class='nam'>userConf</span><span class='op'>)</span> <span class='op'>+</span> <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>argv</span><span class='op'>[</span><span class='num'>1</span><span class='op'>:</span><span class='op'>]</span><span class='strut'>&nbsp;</span></p>
  824. <p id='t274' class='stm mis'>&nbsp; &nbsp; <span class='nam'>opts</span><span class='op'>,</span> <span class='nam'>args</span> <span class='op'>=</span> <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>parse_args</span><span class='op'>(</span><span class='nam'>argv</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  825. <p id='t275' class='pln'><span class='strut'>&nbsp;</span></p>
  826. <p id='t276' class='stm mis'>&nbsp; &nbsp; <span class='key'>return</span> <span class='nam'>parser</span><span class='op'>,</span> <span class='nam'>opts</span><span class='op'>,</span> <span class='nam'>args</span><span class='strut'>&nbsp;</span></p>
  827. <p id='t277' class='pln'><span class='strut'>&nbsp;</span></p>
  828. <p id='t278' class='stm run hide_run'><span class='key'>def</span> <span class='nam'>_real_main</span><span class='op'>(</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  829. <p id='t279' class='stm mis'>&nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>,</span> <span class='nam'>opts</span><span class='op'>,</span> <span class='nam'>args</span> <span class='op'>=</span> <span class='nam'>parseOpts</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  830. <p id='t280' class='pln'><span class='strut'>&nbsp;</span></p>
  831. <p id='t281' class='pln'>&nbsp; &nbsp; <span class='com'># Open appropriate CookieJar</span><span class='strut'>&nbsp;</span></p>
  832. <p id='t282' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>cookiefile</span> <span class='key'>is</span> <span class='nam'>None</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  833. <p id='t283' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>jar</span> <span class='op'>=</span> <span class='nam'>compat_cookiejar</span><span class='op'>.</span><span class='nam'>CookieJar</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  834. <p id='t284' class='pln'>&nbsp; &nbsp; <span class='key'>else</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  835. <p id='t285' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>try</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  836. <p id='t286' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>jar</span> <span class='op'>=</span> <span class='nam'>compat_cookiejar</span><span class='op'>.</span><span class='nam'>MozillaCookieJar</span><span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>cookiefile</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  837. <p id='t287' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>os</span><span class='op'>.</span><span class='nam'>path</span><span class='op'>.</span><span class='nam'>isfile</span><span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>cookiefile</span><span class='op'>)</span> <span class='key'>and</span> <span class='nam'>os</span><span class='op'>.</span><span class='nam'>access</span><span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>cookiefile</span><span class='op'>,</span> <span class='nam'>os</span><span class='op'>.</span><span class='nam'>R_OK</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  838. <p id='t288' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>jar</span><span class='op'>.</span><span class='nam'>load</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  839. <p id='t289' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>except</span> <span class='op'>(</span><span class='nam'>IOError</span><span class='op'>,</span> <span class='nam'>OSError</span><span class='op'>)</span> <span class='key'>as</span> <span class='nam'>err</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  840. <p id='t290' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>exit</span><span class='op'>(</span><span class='str'>u&#39;ERROR: unable to open cookie file&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  841. <p id='t291' class='pln'>&nbsp; &nbsp; <span class='com'># Set user agent</span><span class='strut'>&nbsp;</span></p>
  842. <p id='t292' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>user_agent</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  843. <p id='t293' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>std_headers</span><span class='op'>[</span><span class='str'>&#39;User-Agent&#39;</span><span class='op'>]</span> <span class='op'>=</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>user_agent</span><span class='strut'>&nbsp;</span></p>
  844. <p id='t294' class='pln'><span class='strut'>&nbsp;</span></p>
  845. <p id='t295' class='pln'>&nbsp; &nbsp; <span class='com'># Dump user agent</span><span class='strut'>&nbsp;</span></p>
  846. <p id='t296' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>dump_user_agent</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  847. <p id='t297' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>print</span><span class='op'>(</span><span class='nam'>std_headers</span><span class='op'>[</span><span class='str'>&#39;User-Agent&#39;</span><span class='op'>]</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  848. <p id='t298' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>exit</span><span class='op'>(</span><span class='num'>0</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  849. <p id='t299' class='pln'><span class='strut'>&nbsp;</span></p>
  850. <p id='t300' class='pln'>&nbsp; &nbsp; <span class='com'># Batch file verification</span><span class='strut'>&nbsp;</span></p>
  851. <p id='t301' class='stm mis'>&nbsp; &nbsp; <span class='nam'>batchurls</span> <span class='op'>=</span> <span class='op'>[</span><span class='op'>]</span><span class='strut'>&nbsp;</span></p>
  852. <p id='t302' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>batchfile</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  853. <p id='t303' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>try</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  854. <p id='t304' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>batchfile</span> <span class='op'>==</span> <span class='str'>&#39;-&#39;</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  855. <p id='t305' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>batchfd</span> <span class='op'>=</span> <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>stdin</span><span class='strut'>&nbsp;</span></p>
  856. <p id='t306' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>else</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  857. <p id='t307' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>batchfd</span> <span class='op'>=</span> <span class='nam'>open</span><span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>batchfile</span><span class='op'>,</span> <span class='str'>&#39;r&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  858. <p id='t308' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>batchurls</span> <span class='op'>=</span> <span class='nam'>batchfd</span><span class='op'>.</span><span class='nam'>readlines</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  859. <p id='t309' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>batchurls</span> <span class='op'>=</span> <span class='op'>[</span><span class='nam'>x</span><span class='op'>.</span><span class='nam'>strip</span><span class='op'>(</span><span class='op'>)</span> <span class='key'>for</span> <span class='nam'>x</span> <span class='key'>in</span> <span class='nam'>batchurls</span><span class='op'>]</span><span class='strut'>&nbsp;</span></p>
  860. <p id='t310' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>batchurls</span> <span class='op'>=</span> <span class='op'>[</span><span class='nam'>x</span> <span class='key'>for</span> <span class='nam'>x</span> <span class='key'>in</span> <span class='nam'>batchurls</span> <span class='key'>if</span> <span class='nam'>len</span><span class='op'>(</span><span class='nam'>x</span><span class='op'>)</span> <span class='op'>&gt;</span> <span class='num'>0</span> <span class='key'>and</span> <span class='key'>not</span> <span class='nam'>re</span><span class='op'>.</span><span class='nam'>search</span><span class='op'>(</span><span class='str'>r&#39;^[#/;]&#39;</span><span class='op'>,</span> <span class='nam'>x</span><span class='op'>)</span><span class='op'>]</span><span class='strut'>&nbsp;</span></p>
  861. <p id='t311' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>except</span> <span class='nam'>IOError</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  862. <p id='t312' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>exit</span><span class='op'>(</span><span class='str'>u&#39;ERROR: batch file could not be read&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  863. <p id='t313' class='stm mis'>&nbsp; &nbsp; <span class='nam'>all_urls</span> <span class='op'>=</span> <span class='nam'>batchurls</span> <span class='op'>+</span> <span class='nam'>args</span><span class='strut'>&nbsp;</span></p>
  864. <p id='t314' class='stm mis'>&nbsp; &nbsp; <span class='nam'>all_urls</span> <span class='op'>=</span> <span class='op'>[</span><span class='nam'>url</span><span class='op'>.</span><span class='nam'>strip</span><span class='op'>(</span><span class='op'>)</span> <span class='key'>for</span> <span class='nam'>url</span> <span class='key'>in</span> <span class='nam'>all_urls</span><span class='op'>]</span><span class='strut'>&nbsp;</span></p>
  865. <p id='t315' class='pln'><span class='strut'>&nbsp;</span></p>
  866. <p id='t316' class='pln'>&nbsp; &nbsp; <span class='com'># General configuration</span><span class='strut'>&nbsp;</span></p>
  867. <p id='t317' class='stm mis'>&nbsp; &nbsp; <span class='nam'>cookie_processor</span> <span class='op'>=</span> <span class='nam'>compat_urllib_request</span><span class='op'>.</span><span class='nam'>HTTPCookieProcessor</span><span class='op'>(</span><span class='nam'>jar</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  868. <p id='t318' class='stm mis'>&nbsp; &nbsp; <span class='nam'>proxy_handler</span> <span class='op'>=</span> <span class='nam'>compat_urllib_request</span><span class='op'>.</span><span class='nam'>ProxyHandler</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  869. <p id='t319' class='stm mis'>&nbsp; &nbsp; <span class='nam'>opener</span> <span class='op'>=</span> <span class='nam'>compat_urllib_request</span><span class='op'>.</span><span class='nam'>build_opener</span><span class='op'>(</span><span class='nam'>proxy_handler</span><span class='op'>,</span> <span class='nam'>cookie_processor</span><span class='op'>,</span> <span class='nam'>YoutubeDLHandler</span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  870. <p id='t320' class='stm mis'>&nbsp; &nbsp; <span class='nam'>compat_urllib_request</span><span class='op'>.</span><span class='nam'>install_opener</span><span class='op'>(</span><span class='nam'>opener</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  871. <p id='t321' class='stm mis'>&nbsp; &nbsp; <span class='nam'>socket</span><span class='op'>.</span><span class='nam'>setdefaulttimeout</span><span class='op'>(</span><span class='num'>300</span><span class='op'>)</span> <span class='com'># 5 minutes should be enough (famous last words)</span><span class='strut'>&nbsp;</span></p>
  872. <p id='t322' class='pln'><span class='strut'>&nbsp;</span></p>
  873. <p id='t323' class='stm mis'>&nbsp; &nbsp; <span class='nam'>extractors</span> <span class='op'>=</span> <span class='nam'>gen_extractors</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  874. <p id='t324' class='pln'><span class='strut'>&nbsp;</span></p>
  875. <p id='t325' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>list_extractors</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  876. <p id='t326' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>for</span> <span class='nam'>ie</span> <span class='key'>in</span> <span class='nam'>extractors</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  877. <p id='t327' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>print</span><span class='op'>(</span><span class='nam'>ie</span><span class='op'>.</span><span class='nam'>IE_NAME</span> <span class='op'>+</span> <span class='op'>(</span><span class='str'>&#39; (CURRENTLY BROKEN)&#39;</span> <span class='key'>if</span> <span class='key'>not</span> <span class='nam'>ie</span><span class='op'>.</span><span class='nam'>_WORKING</span> <span class='key'>else</span> <span class='str'>&#39;&#39;</span><span class='op'>)</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  878. <p id='t328' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>matchedUrls</span> <span class='op'>=</span> <span class='op'>[</span><span class='nam'>url</span> <span class='key'>for</span> <span class='nam'>url</span> <span class='key'>in</span> <span class='nam'>all_urls</span> <span class='key'>if</span> <span class='nam'>ie</span><span class='op'>.</span><span class='nam'>suitable</span><span class='op'>(</span><span class='nam'>url</span><span class='op'>)</span><span class='op'>]</span><span class='strut'>&nbsp;</span></p>
  879. <p id='t329' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>all_urls</span> <span class='op'>=</span> <span class='op'>[</span><span class='nam'>url</span> <span class='key'>for</span> <span class='nam'>url</span> <span class='key'>in</span> <span class='nam'>all_urls</span> <span class='key'>if</span> <span class='nam'>url</span> <span class='key'>not</span> <span class='key'>in</span> <span class='nam'>matchedUrls</span><span class='op'>]</span><span class='strut'>&nbsp;</span></p>
  880. <p id='t330' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>for</span> <span class='nam'>mu</span> <span class='key'>in</span> <span class='nam'>matchedUrls</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  881. <p id='t331' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>print</span><span class='op'>(</span><span class='str'>u&#39;&nbsp; &#39;</span> <span class='op'>+</span> <span class='nam'>mu</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  882. <p id='t332' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>exit</span><span class='op'>(</span><span class='num'>0</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  883. <p id='t333' class='pln'><span class='strut'>&nbsp;</span></p>
  884. <p id='t334' class='pln'>&nbsp; &nbsp; <span class='com'># Conflicting, missing and erroneous options</span><span class='strut'>&nbsp;</span></p>
  885. <p id='t335' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>usenetrc</span> <span class='key'>and</span> <span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>username</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>password</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  886. <p id='t336' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>error</span><span class='op'>(</span><span class='str'>u&#39;using .netrc conflicts with giving username/password&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  887. <p id='t337' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>password</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span> <span class='key'>and</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>username</span> <span class='key'>is</span> <span class='nam'>None</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  888. <p id='t338' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>error</span><span class='op'>(</span><span class='str'>u&#39;account username missing&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  889. <p id='t339' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>outtmpl</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span> <span class='key'>and</span> <span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>usetitle</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>autonumber</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>useid</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  890. <p id='t340' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>error</span><span class='op'>(</span><span class='str'>u&#39;using output template conflicts with using title, video ID or auto number&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  891. <p id='t341' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>usetitle</span> <span class='key'>and</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>useid</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  892. <p id='t342' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>error</span><span class='op'>(</span><span class='str'>u&#39;using title conflicts with using video ID&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  893. <p id='t343' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>username</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span> <span class='key'>and</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>password</span> <span class='key'>is</span> <span class='nam'>None</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  894. <p id='t344' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>password</span> <span class='op'>=</span> <span class='nam'>getpass</span><span class='op'>.</span><span class='nam'>getpass</span><span class='op'>(</span><span class='str'>u&#39;Type account password and press return:&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  895. <p id='t345' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>ratelimit</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  896. <p id='t346' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>numeric_limit</span> <span class='op'>=</span> <span class='nam'>FileDownloader</span><span class='op'>.</span><span class='nam'>parse_bytes</span><span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>ratelimit</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  897. <p id='t347' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>numeric_limit</span> <span class='key'>is</span> <span class='nam'>None</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  898. <p id='t348' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>error</span><span class='op'>(</span><span class='str'>u&#39;invalid rate limit specified&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  899. <p id='t349' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>ratelimit</span> <span class='op'>=</span> <span class='nam'>numeric_limit</span><span class='strut'>&nbsp;</span></p>
  900. <p id='t350' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>retries</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  901. <p id='t351' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>try</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  902. <p id='t352' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>retries</span> <span class='op'>=</span> <span class='nam'>int</span><span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>retries</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  903. <p id='t353' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>except</span> <span class='op'>(</span><span class='nam'>TypeError</span><span class='op'>,</span> <span class='nam'>ValueError</span><span class='op'>)</span> <span class='key'>as</span> <span class='nam'>err</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  904. <p id='t354' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>error</span><span class='op'>(</span><span class='str'>u&#39;invalid retry count specified&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  905. <p id='t355' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>buffersize</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  906. <p id='t356' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>numeric_buffersize</span> <span class='op'>=</span> <span class='nam'>FileDownloader</span><span class='op'>.</span><span class='nam'>parse_bytes</span><span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>buffersize</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  907. <p id='t357' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>numeric_buffersize</span> <span class='key'>is</span> <span class='nam'>None</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  908. <p id='t358' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>error</span><span class='op'>(</span><span class='str'>u&#39;invalid buffer size specified&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  909. <p id='t359' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>buffersize</span> <span class='op'>=</span> <span class='nam'>numeric_buffersize</span><span class='strut'>&nbsp;</span></p>
  910. <p id='t360' class='stm mis'>&nbsp; &nbsp; <span class='key'>try</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  911. <p id='t361' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>playliststart</span> <span class='op'>=</span> <span class='nam'>int</span><span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>playliststart</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  912. <p id='t362' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>playliststart</span> <span class='op'>&lt;=</span> <span class='num'>0</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  913. <p id='t363' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>raise</span> <span class='nam'>ValueError</span><span class='op'>(</span><span class='str'>u&#39;Playlist start must be positive&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  914. <p id='t364' class='stm mis'>&nbsp; &nbsp; <span class='key'>except</span> <span class='op'>(</span><span class='nam'>TypeError</span><span class='op'>,</span> <span class='nam'>ValueError</span><span class='op'>)</span> <span class='key'>as</span> <span class='nam'>err</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  915. <p id='t365' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>error</span><span class='op'>(</span><span class='str'>u&#39;invalid playlist start number specified&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  916. <p id='t366' class='stm mis'>&nbsp; &nbsp; <span class='key'>try</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  917. <p id='t367' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>playlistend</span> <span class='op'>=</span> <span class='nam'>int</span><span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>playlistend</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  918. <p id='t368' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>playlistend</span> <span class='op'>!=</span> <span class='op'>-</span><span class='num'>1</span> <span class='key'>and</span> <span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>playlistend</span> <span class='op'>&lt;=</span> <span class='num'>0</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>playlistend</span> <span class='op'>&lt;</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>playliststart</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  919. <p id='t369' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>raise</span> <span class='nam'>ValueError</span><span class='op'>(</span><span class='str'>u&#39;Playlist end must be greater than playlist start&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  920. <p id='t370' class='stm mis'>&nbsp; &nbsp; <span class='key'>except</span> <span class='op'>(</span><span class='nam'>TypeError</span><span class='op'>,</span> <span class='nam'>ValueError</span><span class='op'>)</span> <span class='key'>as</span> <span class='nam'>err</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  921. <p id='t371' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>error</span><span class='op'>(</span><span class='str'>u&#39;invalid playlist end number specified&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  922. <p id='t372' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>extractaudio</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  923. <p id='t373' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>audioformat</span> <span class='key'>not</span> <span class='key'>in</span> <span class='op'>[</span><span class='str'>&#39;best&#39;</span><span class='op'>,</span> <span class='str'>&#39;aac&#39;</span><span class='op'>,</span> <span class='str'>&#39;mp3&#39;</span><span class='op'>,</span> <span class='str'>&#39;vorbis&#39;</span><span class='op'>,</span> <span class='str'>&#39;m4a&#39;</span><span class='op'>,</span> <span class='str'>&#39;wav&#39;</span><span class='op'>]</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  924. <p id='t374' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>error</span><span class='op'>(</span><span class='str'>u&#39;invalid audio format specified&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  925. <p id='t375' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>audioquality</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  926. <p id='t376' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>audioquality</span> <span class='op'>=</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>audioquality</span><span class='op'>.</span><span class='nam'>strip</span><span class='op'>(</span><span class='str'>&#39;k&#39;</span><span class='op'>)</span><span class='op'>.</span><span class='nam'>strip</span><span class='op'>(</span><span class='str'>&#39;K&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  927. <p id='t377' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='key'>not</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>audioquality</span><span class='op'>.</span><span class='nam'>isdigit</span><span class='op'>(</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  928. <p id='t378' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>error</span><span class='op'>(</span><span class='str'>u&#39;invalid audio quality specified&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  929. <p id='t379' class='pln'><span class='strut'>&nbsp;</span></p>
  930. <p id='t380' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>version_info</span> <span class='op'>&lt;</span> <span class='op'>(</span><span class='num'>3</span><span class='op'>,</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  931. <p id='t381' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='com'># In Python 2, sys.argv is a bytestring (also note http://bugs.python.org/issue2128 for Windows systems)</span><span class='strut'>&nbsp;</span></p>
  932. <p id='t382' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>outtmpl</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  933. <p id='t383' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>outtmpl</span> <span class='op'>=</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>outtmpl</span><span class='op'>.</span><span class='nam'>decode</span><span class='op'>(</span><span class='nam'>preferredencoding</span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  934. <p id='t384' class='stm mis'>&nbsp; &nbsp; <span class='nam'>outtmpl</span> <span class='op'>=</span><span class='op'>(</span><span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>outtmpl</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span> <span class='key'>and</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>outtmpl</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  935. <p id='t385' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>or</span> <span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>format</span> <span class='op'>==</span> <span class='str'>&#39;-1&#39;</span> <span class='key'>and</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>usetitle</span> <span class='key'>and</span> <span class='str'>u&#39;%(title)s-%(id)s-%(format)s.%(ext)s&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  936. <p id='t386' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>or</span> <span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>format</span> <span class='op'>==</span> <span class='str'>&#39;-1&#39;</span> <span class='key'>and</span> <span class='str'>u&#39;%(id)s-%(format)s.%(ext)s&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  937. <p id='t387' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>or</span> <span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>usetitle</span> <span class='key'>and</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>autonumber</span> <span class='key'>and</span> <span class='str'>u&#39;%(autonumber)s-%(title)s-%(id)s.%(ext)s&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  938. <p id='t388' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>or</span> <span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>usetitle</span> <span class='key'>and</span> <span class='str'>u&#39;%(title)s-%(id)s.%(ext)s&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  939. <p id='t389' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>or</span> <span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>useid</span> <span class='key'>and</span> <span class='str'>u&#39;%(id)s.%(ext)s&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  940. <p id='t390' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>or</span> <span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>autonumber</span> <span class='key'>and</span> <span class='str'>u&#39;%(autonumber)s-%(id)s.%(ext)s&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  941. <p id='t391' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>or</span> <span class='str'>u&#39;%(id)s.%(ext)s&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  942. <p id='t392' class='pln'>&nbsp; &nbsp; <span class='com'># File downloader</span><span class='strut'>&nbsp;</span></p>
  943. <p id='t393' class='stm mis'>&nbsp; &nbsp; <span class='nam'>fd</span> <span class='op'>=</span> <span class='nam'>FileDownloader</span><span class='op'>(</span><span class='op'>{</span><span class='strut'>&nbsp;</span></p>
  944. <p id='t394' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;usenetrc&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>usenetrc</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  945. <p id='t395' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;username&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>username</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  946. <p id='t396' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;password&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>password</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  947. <p id='t397' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;quiet&#39;</span><span class='op'>:</span> <span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>quiet</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>geturl</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>gettitle</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>getthumbnail</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>getdescription</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>getfilename</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>getformat</span><span class='op'>)</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  948. <p id='t398' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;forceurl&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>geturl</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  949. <p id='t399' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;forcetitle&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>gettitle</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  950. <p id='t400' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;forcethumbnail&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>getthumbnail</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  951. <p id='t401' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;forcedescription&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>getdescription</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  952. <p id='t402' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;forcefilename&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>getfilename</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  953. <p id='t403' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;forceformat&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>getformat</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  954. <p id='t404' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;simulate&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>simulate</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  955. <p id='t405' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;skip_download&#39;</span><span class='op'>:</span> <span class='op'>(</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>skip_download</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>simulate</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>geturl</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>gettitle</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>getthumbnail</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>getdescription</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>getfilename</span> <span class='key'>or</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>getformat</span><span class='op'>)</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  956. <p id='t406' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;format&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>format</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  957. <p id='t407' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;format_limit&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>format_limit</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  958. <p id='t408' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;listformats&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>listformats</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  959. <p id='t409' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;outtmpl&#39;</span><span class='op'>:</span> <span class='nam'>outtmpl</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  960. <p id='t410' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;restrictfilenames&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>restrictfilenames</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  961. <p id='t411' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;ignoreerrors&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>ignoreerrors</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  962. <p id='t412' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;ratelimit&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>ratelimit</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  963. <p id='t413' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;nooverwrites&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>nooverwrites</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  964. <p id='t414' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;retries&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>retries</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  965. <p id='t415' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;buffersize&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>buffersize</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  966. <p id='t416' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;noresizebuffer&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>noresizebuffer</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  967. <p id='t417' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;continuedl&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>continue_dl</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  968. <p id='t418' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;noprogress&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>noprogress</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  969. <p id='t419' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;playliststart&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>playliststart</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  970. <p id='t420' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;playlistend&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>playlistend</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  971. <p id='t421' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;logtostderr&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>outtmpl</span> <span class='op'>==</span> <span class='str'>&#39;-&#39;</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  972. <p id='t422' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;consoletitle&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>consoletitle</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  973. <p id='t423' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;nopart&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>nopart</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  974. <p id='t424' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;updatetime&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>updatetime</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  975. <p id='t425' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;writedescription&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>writedescription</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  976. <p id='t426' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;writeinfojson&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>writeinfojson</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  977. <p id='t427' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;writesubtitles&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>writesubtitles</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  978. <p id='t428' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;subtitleslang&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>subtitleslang</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  979. <p id='t429' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;matchtitle&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>matchtitle</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  980. <p id='t430' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;rejecttitle&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>rejecttitle</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  981. <p id='t431' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;max_downloads&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>max_downloads</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  982. <p id='t432' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;prefer_free_formats&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>prefer_free_formats</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  983. <p id='t433' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;verbose&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>verbose</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  984. <p id='t434' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='str'>&#39;test&#39;</span><span class='op'>:</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>test</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  985. <p id='t435' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='op'>}</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  986. <p id='t436' class='pln'><span class='strut'>&nbsp;</span></p>
  987. <p id='t437' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>verbose</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  988. <p id='t438' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>fd</span><span class='op'>.</span><span class='nam'>to_screen</span><span class='op'>(</span><span class='str'>u&#39;[debug] youtube-dl version &#39;</span> <span class='op'>+</span> <span class='nam'>__version__</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  989. <p id='t439' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>try</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  990. <p id='t440' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>sp</span> <span class='op'>=</span> <span class='nam'>subprocess</span><span class='op'>.</span><span class='nam'>Popen</span><span class='op'>(</span><span class='op'>[</span><span class='str'>&#39;git&#39;</span><span class='op'>,</span> <span class='str'>&#39;rev-parse&#39;</span><span class='op'>,</span> <span class='str'>&#39;--short&#39;</span><span class='op'>,</span> <span class='str'>&#39;HEAD&#39;</span><span class='op'>]</span><span class='op'>,</span> <span class='nam'>stdout</span><span class='op'>=</span><span class='nam'>subprocess</span><span class='op'>.</span><span class='nam'>PIPE</span><span class='op'>,</span> <span class='nam'>stderr</span><span class='op'>=</span><span class='nam'>subprocess</span><span class='op'>.</span><span class='nam'>PIPE</span><span class='op'>,</span><span class='strut'>&nbsp;</span></p>
  991. <p id='t441' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>cwd</span><span class='op'>=</span><span class='nam'>os</span><span class='op'>.</span><span class='nam'>path</span><span class='op'>.</span><span class='nam'>dirname</span><span class='op'>(</span><span class='nam'>os</span><span class='op'>.</span><span class='nam'>path</span><span class='op'>.</span><span class='nam'>abspath</span><span class='op'>(</span><span class='nam'>__file__</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  992. <p id='t442' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>out</span><span class='op'>,</span> <span class='nam'>err</span> <span class='op'>=</span> <span class='nam'>sp</span><span class='op'>.</span><span class='nam'>communicate</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  993. <p id='t443' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>out</span> <span class='op'>=</span> <span class='nam'>out</span><span class='op'>.</span><span class='nam'>decode</span><span class='op'>(</span><span class='op'>)</span><span class='op'>.</span><span class='nam'>strip</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  994. <p id='t444' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>re</span><span class='op'>.</span><span class='nam'>match</span><span class='op'>(</span><span class='str'>&#39;[0-9a-f]+&#39;</span><span class='op'>,</span> <span class='nam'>out</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  995. <p id='t445' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>fd</span><span class='op'>.</span><span class='nam'>to_screen</span><span class='op'>(</span><span class='str'>u&#39;[debug] Git HEAD: &#39;</span> <span class='op'>+</span> <span class='nam'>out</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  996. <p id='t446' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>except</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  997. <p id='t447' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>pass</span><span class='strut'>&nbsp;</span></p>
  998. <p id='t448' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>fd</span><span class='op'>.</span><span class='nam'>to_screen</span><span class='op'>(</span><span class='str'>u&#39;[debug] Python version %s - %s&#39;</span> <span class='op'>%</span><span class='op'>(</span><span class='nam'>platform</span><span class='op'>.</span><span class='nam'>python_version</span><span class='op'>(</span><span class='op'>)</span><span class='op'>,</span> <span class='nam'>platform</span><span class='op'>.</span><span class='nam'>platform</span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  999. <p id='t449' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>fd</span><span class='op'>.</span><span class='nam'>to_screen</span><span class='op'>(</span><span class='str'>u&#39;[debug] Proxy map: &#39;</span> <span class='op'>+</span> <span class='nam'>str</span><span class='op'>(</span><span class='nam'>proxy_handler</span><span class='op'>.</span><span class='nam'>proxies</span><span class='op'>)</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1000. <p id='t450' class='pln'><span class='strut'>&nbsp;</span></p>
  1001. <p id='t451' class='stm mis'>&nbsp; &nbsp; <span class='key'>for</span> <span class='nam'>extractor</span> <span class='key'>in</span> <span class='nam'>extractors</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1002. <p id='t452' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>fd</span><span class='op'>.</span><span class='nam'>add_info_extractor</span><span class='op'>(</span><span class='nam'>extractor</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1003. <p id='t453' class='pln'><span class='strut'>&nbsp;</span></p>
  1004. <p id='t454' class='pln'>&nbsp; &nbsp; <span class='com'># PostProcessors</span><span class='strut'>&nbsp;</span></p>
  1005. <p id='t455' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>extractaudio</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1006. <p id='t456' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>fd</span><span class='op'>.</span><span class='nam'>add_post_processor</span><span class='op'>(</span><span class='nam'>FFmpegExtractAudioPP</span><span class='op'>(</span><span class='nam'>preferredcodec</span><span class='op'>=</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>audioformat</span><span class='op'>,</span> <span class='nam'>preferredquality</span><span class='op'>=</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>audioquality</span><span class='op'>,</span> <span class='nam'>keepvideo</span><span class='op'>=</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>keepvideo</span><span class='op'>,</span> <span class='nam'>nopostoverwrites</span><span class='op'>=</span><span class='nam'>opts</span><span class='op'>.</span><span class='nam'>nopostoverwrites</span><span class='op'>)</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1007. <p id='t457' class='pln'><span class='strut'>&nbsp;</span></p>
  1008. <p id='t458' class='pln'>&nbsp; &nbsp; <span class='com'># Update version</span><span class='strut'>&nbsp;</span></p>
  1009. <p id='t459' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>update_self</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1010. <p id='t460' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>update_self</span><span class='op'>(</span><span class='nam'>fd</span><span class='op'>.</span><span class='nam'>to_screen</span><span class='op'>,</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>verbose</span><span class='op'>,</span> <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>argv</span><span class='op'>[</span><span class='num'>0</span><span class='op'>]</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1011. <p id='t461' class='pln'><span class='strut'>&nbsp;</span></p>
  1012. <p id='t462' class='pln'>&nbsp; &nbsp; <span class='com'># Maybe do nothing</span><span class='strut'>&nbsp;</span></p>
  1013. <p id='t463' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>len</span><span class='op'>(</span><span class='nam'>all_urls</span><span class='op'>)</span> <span class='op'>&lt;</span> <span class='num'>1</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1014. <p id='t464' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>if</span> <span class='key'>not</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>update_self</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1015. <p id='t465' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>parser</span><span class='op'>.</span><span class='nam'>error</span><span class='op'>(</span><span class='str'>u&#39;you must provide at least one URL&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1016. <p id='t466' class='pln'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>else</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1017. <p id='t467' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>exit</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1018. <p id='t468' class='pln'><span class='strut'>&nbsp;</span></p>
  1019. <p id='t469' class='stm mis'>&nbsp; &nbsp; <span class='key'>try</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1020. <p id='t470' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>retcode</span> <span class='op'>=</span> <span class='nam'>fd</span><span class='op'>.</span><span class='nam'>download</span><span class='op'>(</span><span class='nam'>all_urls</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1021. <p id='t471' class='stm mis'>&nbsp; &nbsp; <span class='key'>except</span> <span class='nam'>MaxDownloadsReached</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1022. <p id='t472' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>fd</span><span class='op'>.</span><span class='nam'>to_screen</span><span class='op'>(</span><span class='str'>u&#39;--max-download limit reached, aborting.&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1023. <p id='t473' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>retcode</span> <span class='op'>=</span> <span class='num'>101</span><span class='strut'>&nbsp;</span></p>
  1024. <p id='t474' class='pln'><span class='strut'>&nbsp;</span></p>
  1025. <p id='t475' class='pln'>&nbsp; &nbsp; <span class='com'># Dump cookie jar if requested</span><span class='strut'>&nbsp;</span></p>
  1026. <p id='t476' class='stm mis'>&nbsp; &nbsp; <span class='key'>if</span> <span class='nam'>opts</span><span class='op'>.</span><span class='nam'>cookiefile</span> <span class='key'>is</span> <span class='key'>not</span> <span class='nam'>None</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1027. <p id='t477' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>try</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1028. <p id='t478' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>jar</span><span class='op'>.</span><span class='nam'>save</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1029. <p id='t479' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='key'>except</span> <span class='op'>(</span><span class='nam'>IOError</span><span class='op'>,</span> <span class='nam'>OSError</span><span class='op'>)</span> <span class='key'>as</span> <span class='nam'>err</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1030. <p id='t480' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>exit</span><span class='op'>(</span><span class='str'>u&#39;ERROR: unable to save cookie jar&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1031. <p id='t481' class='pln'><span class='strut'>&nbsp;</span></p>
  1032. <p id='t482' class='stm mis'>&nbsp; &nbsp; <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>exit</span><span class='op'>(</span><span class='nam'>retcode</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1033. <p id='t483' class='pln'><span class='strut'>&nbsp;</span></p>
  1034. <p id='t484' class='stm run hide_run'><span class='key'>def</span> <span class='nam'>main</span><span class='op'>(</span><span class='op'>)</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1035. <p id='t485' class='stm mis'>&nbsp; &nbsp; <span class='key'>try</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1036. <p id='t486' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>_real_main</span><span class='op'>(</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1037. <p id='t487' class='stm mis'>&nbsp; &nbsp; <span class='key'>except</span> <span class='nam'>DownloadError</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1038. <p id='t488' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>exit</span><span class='op'>(</span><span class='num'>1</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1039. <p id='t489' class='stm mis'>&nbsp; &nbsp; <span class='key'>except</span> <span class='nam'>SameFileError</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1040. <p id='t490' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>exit</span><span class='op'>(</span><span class='str'>u&#39;ERROR: fixed output name but more than one file to download&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1041. <p id='t491' class='stm mis'>&nbsp; &nbsp; <span class='key'>except</span> <span class='nam'>KeyboardInterrupt</span><span class='op'>:</span><span class='strut'>&nbsp;</span></p>
  1042. <p id='t492' class='stm mis'>&nbsp; &nbsp; &nbsp; &nbsp; <span class='nam'>sys</span><span class='op'>.</span><span class='nam'>exit</span><span class='op'>(</span><span class='str'>u&#39;\nERROR: Interrupted by user&#39;</span><span class='op'>)</span><span class='strut'>&nbsp;</span></p>
  1043. </td>
  1044. </tr>
  1045. </table>
  1046. </div>
  1047. <div id='footer'>
  1048. <div class='content'>
  1049. <p>
  1050. <a class='nav' href='index.html'>&#xab; index</a> &nbsp; &nbsp; <a class='nav' href='http://nedbatchelder.com/code/coverage/3.6b1'>coverage.py v3.6b1</a>
  1051. </p>
  1052. </div>
  1053. </div>
  1054. </body>
  1055. </html>