aria2c.1.txt 81 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361
  1. ARIA2C(1)
  2. =========
  3. Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
  4. :man source: Aria2
  5. :man manual: Aria2 Manual
  6. :man version: 1.10.1
  7. NAME
  8. ----
  9. aria2c - The ultra fast download utility
  10. SYNOPSIS
  11. --------
  12. aria2c ['OPTIONS'] ['URI' | 'MAGNET' | 'TORRENT_FILE' | 'METALINK_FILE']...
  13. DESCRIPTION
  14. -----------
  15. aria2 is a utility for downloading files. The supported protocols are
  16. HTTP(S), FTP, BitTorrent, and Metalink. aria2 can download a file from
  17. multiple sources/protocols and tries to utilize your maximum download
  18. bandwidth. It supports downloading a file from HTTP(S)/FTP and
  19. BitTorrent at the same time, while the data downloaded from
  20. HTTP(S)/FTP is uploaded to the BitTorrent swarm. Using Metalink's
  21. chunk checksums, aria2 automatically validates chunks of data while
  22. downloading a file like BitTorrent.
  23. OPTIONS
  24. -------
  25. Basic Options
  26. ~~~~~~~~~~~~~
  27. *-d*, *--dir*=DIR::
  28. The directory to store the downloaded file.
  29. *-i*, *--input-file*=FILE::
  30. Downloads URIs found in FILE. You can specify multiple URIs for a single
  31. entity: separate URIs on a single line using the TAB character.
  32. Reads input from stdin when '-' is specified.
  33. The additional *out* and *dir* options can be specified after each line of
  34. URIs. This optional line must start with white space(s).
  35. See *Input File* subsection for details.
  36. *-l*, *--log*=LOG::
  37. The file name of the log file. If '-' is specified, log is written to
  38. stdout. If empty string("") is specified, log is not written to file.
  39. *-j*, *--max-concurrent-downloads*=N::
  40. Set maximum number of parallel downloads for every static (HTTP/FTP) URI,
  41. torrent and metalink. See also *-s* and *-C* option.
  42. Default: '5'
  43. *-V*, *--check-integrity*[='true'|'false']::
  44. Check file integrity by validating piece hashes.
  45. This option has effect only in BitTorrent and Metalink downloads with
  46. chunk checksums.
  47. Use this option to re-download a damaged portion of a file.
  48. Default: 'false'
  49. *-c*, *--continue*::
  50. Continue downloading a partially downloaded file.
  51. Use this option to resume a download started by a web browser or another
  52. program which downloads files sequentially from the beginning.
  53. Currently this option is only applicable to HTTP(S)/FTP downloads.
  54. *-h*, *--help*[=TAG|KEYWORD]::
  55. The help messages are classified with tags. A tag starts with
  56. "#". For example, type "--help=#http" to get the usage for the
  57. options tagged with "#http". If non-tag word is given, print the
  58. usage for the options whose name includes that word.
  59. Available Values: '#basic', '#advanced', '#http', '#https', '#ftp',
  60. '#metalink', '#bittorrent', '#cookie', '#hook', '#file',
  61. '#xml-rpc', '#experimental', '#all'
  62. Default: '#basic'
  63. HTTP/FTP Options
  64. ~~~~~~~~~~~~~~~~
  65. *--all-proxy*=PROXY::
  66. Use this proxy server for all protocols. To erase previously
  67. defined proxy, use "". You can override this setting and specify a
  68. proxy server for a particular protocol using *--http-proxy*,
  69. *--https-proxy* and *--ftp-proxy* options. This affects all URIs.
  70. The format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
  71. [NOTE]
  72. If user and password are embedded in proxy URI and they are also
  73. specified by *--{http,https,ftp,all}-proxy-{user,passwd}* options,
  74. those appeared later have precedence. For example, you have
  75. http-proxy-user="myname", http-proxy-passwd="mypass" in aria2.conf and
  76. you specify --http-proxy="http://proxy" in command-line, then you get
  77. HTTP proxy "http://proxy" with user "myname" and password
  78. "mypass". Another example: if you specified in command-line
  79. --http-proxy="http://user:pass@proxy" --http-proxy-user="myname"
  80. --http-proxy-passwd="mypass", then you will get HTTP proxy
  81. "http://proxy" with user "myname" and password "mypass". One more
  82. example: if you specified in command-line --http-proxy-user="myname"
  83. --http-proxy-passwd="mypass" --http-proxy="http://user:pass@proxy",
  84. then you get HTTP proxy "http://proxy" with user "user" and password
  85. "pass".
  86. *--all-proxy-passwd*=PASSWD::
  87. Set password for *--all-proxy* option.
  88. *--all-proxy-user*=USER::
  89. Set user for *--all-proxy* option.
  90. *--connect-timeout*=SEC::
  91. Set the connect timeout in seconds to establish connection to
  92. HTTP/FTP/proxy server. After the connection is established, this
  93. option makes no effect and *--timeout* option is used instead.
  94. Default: '60'
  95. *--dry-run*[='true'|'false']::
  96. If 'true' is given, aria2 just checks whether the remote file is
  97. available and doesn't download data. This option has effect on
  98. HTTP/FTP download. BitTorrent downloads are canceled if 'true' is
  99. specified. Default: 'false'
  100. *--lowest-speed-limit*=SPEED::
  101. Close connection if download speed is lower than or equal to this
  102. value(bytes per sec).
  103. '0' means aria2 does not have a lowest speed limit.
  104. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  105. This option does not affect BitTorrent downloads.
  106. Default: '0'
  107. *--max-file-not-found*=NUM::
  108. If aria2 receives `file not found' status from the remote HTTP/FTP
  109. servers NUM times without getting a single byte, then force the
  110. download to fail. Specify '0' to disable this option. This options is
  111. effective only when using HTTP/FTP servers.
  112. Default: '0'
  113. *-m*, *--max-tries*=N::
  114. Set number of tries. '0' means unlimited.
  115. Default: '5'
  116. *-n*, *--no-netrc*::
  117. Disables netrc support. netrc support is enabled by default.
  118. *--no-proxy*=DOMAINS::
  119. Specify comma separated hostnames, domains and network address with
  120. or without CIDR block where proxy should not be used.
  121. [NOTE]
  122. For network address with CIDR block, only IPv4 address works. Current
  123. implementation does not resolve hostname in URI to compare network
  124. address specified in *--no-proxy*. So it is only effecive if URI has
  125. numeric IP addresses.
  126. *-o*, *--out*=FILE::
  127. The file name of the downloaded file. When *-Z* option is used, this
  128. option is ignored.
  129. [NOTE]
  130. In Metalink or BitTorrent download you cannot specify file name.
  131. The file name specified here is only used when the URIs fed to aria2
  132. are done by command line without *-i*, *-Z* option. For example:
  133. aria2c -o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip"
  134. *--proxy-method*=METHOD::
  135. Set the method to use in proxy request. 'METHOD' is either 'get' or
  136. 'tunnel'. HTTPS downloads always use 'tunnel' regardless of this
  137. option.
  138. Default: 'get'
  139. *-R*, *--remote-time*[='true'|'false']::
  140. Retrieve timestamp of the remote file from the remote HTTP/FTP
  141. server and if it is available, apply it to the local file.
  142. Default: 'false'
  143. *--reuse-uri[='true'|'false']::
  144. Reuse already used URIs if no unused URIs are left.
  145. Default: 'true'
  146. *--server-stat-of*=FILE::
  147. Specify the filename to which performance profile of the servers is
  148. saved. You can load saved data using *--server-stat-if* option. See
  149. *Server Performance Profile* subsection below for file format.
  150. *--server-stat-if*=FILE::
  151. Specify the filename to load performance profile of the servers. The
  152. loaded data will be used in some URI selector such as 'feedback'.
  153. See also *--uri-selector* option. See *Server Performance Profile*
  154. subsection below for file format.
  155. *--server-stat-timeout*=SEC::
  156. Specifies timeout in seconds to invalidate performance profile of
  157. the servers since the last contact to them.
  158. Default: '86400' (24hours)
  159. *-s*, *--split*=N::
  160. Download a file using N connections. If more than N URIs are given,
  161. first N URIs are used and remaining URIs are used for backup. If
  162. less than N URIs are given, those URIs are used more than once so
  163. that N connections total are made simultaneously. The number of
  164. connections to the same host is restricted by
  165. *--max-connection-per-server* option. Please see *-j* and
  166. *--min-split-size* option too. Please note that in Metalink
  167. download, this option has no effect and use *-C* option instead.
  168. Default: '5'
  169. *-t*, *--timeout*=SEC::
  170. Set timeout in seconds.
  171. Default: '60'
  172. *--uri-selector*=SELECTOR::
  173. Specify URI selection algorithm. The possible values are 'inorder',
  174. 'feedback' and 'adaptive'. If 'inorder' is given, URI is tried in
  175. the order appeared in the URI list. If 'feedback' is given, aria2
  176. uses download speed observed in the previous downloads and choose
  177. fastest server in the URI list. This also effectively skips dead
  178. mirrors. The observed download speed is a part of performance
  179. profile of servers mentioned in *--server-stat-of* and
  180. *--server-stat-if* options. If 'adaptive' is given, selects one of
  181. the best mirrors for the first and reserved connections. For
  182. supplementary ones, it returns mirrors which has not been tested
  183. yet, and if each of them has already been tested, returns mirrors
  184. which has to be tested again. Otherwise, it doesn't select anymore
  185. mirrors. Like 'feedback', it uses a performance profile of servers.
  186. Default: 'feedback'
  187. HTTP Specific Options
  188. ~~~~~~~~~~~~~~~~~~~~~
  189. *--ca-certificate*=FILE::
  190. Use the certificate authorities in FILE to verify the peers.
  191. The certificate file must be in PEM format and can contain multiple CA
  192. certificates.
  193. Use *--check-certificate* option to enable verification.
  194. *--certificate*=FILE::
  195. Use the client certificate in FILE.
  196. The certificate must be in PEM format.
  197. You may use *--private-key* option to specify the private key.
  198. *--check-certificate*[='true'|'false']::
  199. Verify the peer using certificates specified in *--ca-certificate* option.
  200. Default: 'true'
  201. *--http-accept-gzip*[='true'|'false']::
  202. Send "Accept: deflate, gzip" request header and inflate response if
  203. remote server responds with "Content-Encoding: gzip" or
  204. "Content-Encoding: deflate". Default: 'false'
  205. [NOTE]
  206. Some server responds with "Content-Encoding: gzip" for files which
  207. itself is gzipped file. aria2 inflates them anyway because of the
  208. response header.
  209. *--http-auth-challenge*[='true'|'false']::
  210. Send HTTP authorization header only when it is requested by the
  211. server. If 'false' is set, then authorization header is always sent
  212. to the server. There is an exception: if username and password are
  213. embedded in URI, authorization header is always sent to the server
  214. regardless of this option. Default: 'false'
  215. *--http-no-cache*[='true'|'false']::
  216. Send Cache-Control: no-cache and Pragma: no-cache header to avoid
  217. cached content. If 'false' is given, these headers are not sent
  218. and you can add Cache-Control header with a directive you like
  219. using *--header* option. Default: 'true'
  220. *--http-user*=USER::
  221. Set HTTP user. This affects all URIs.
  222. *--http-passwd*=PASSWD::
  223. Set HTTP password. This affects all URIs.
  224. *--http-proxy*=PROXY::
  225. Use this proxy server for HTTP. To erase previously defined proxy,
  226. use "". See also *--all-proxy* option. This affects all URIs. The
  227. format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
  228. *--http-proxy-passwd*=PASSWD::
  229. Set password for *--http-proxy* option.
  230. *--http-proxy-user*=USER:
  231. Set user for *--http-proxy* option.
  232. *--https-proxy*=PROXY::
  233. Use this proxy server for HTTPS. To erase previously defined proxy,
  234. use "". See also *--all-proxy* option. This affects all URIs. The
  235. format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
  236. *--https-proxy-passwd*=PASSWD::
  237. Set password for *--https-proxy* option.
  238. *--https-proxy-user*=USER::
  239. Set user for *--https-proxy* option.
  240. *--private-key*=FILE::
  241. Use the private key in FILE.
  242. The private key must be decrypted and in PEM format.
  243. The behavior when encrypted one is given is undefined.
  244. See also *--certificate* option.
  245. *--referer*=REFERER::
  246. Set Referer. This affects all URIs.
  247. *--enable-http-keep-alive*[='true'|'false']::
  248. Enable HTTP/1.1 persistent connection.
  249. Default: 'true'
  250. *--enable-http-pipelining*[='true'|'false']::
  251. Enable HTTP/1.1 pipelining.
  252. Default: 'false'
  253. *--header*=HEADER::
  254. Append HEADER to HTTP request header.
  255. You can use this option repeatedly to specify more than one header:
  256. aria2c *--header*="X-A: b78" *--header*="X-B: 9J1" "http://host/file"
  257. *--load-cookies*=FILE::
  258. Load Cookies from FILE using the Firefox3 format (SQLite3),
  259. Chromium/Google Chrome (SQLite3) and the
  260. Mozilla/Firefox(1.x/2.x)/Netscape format.
  261. [NOTE]
  262. If aria2 is built without libsqlite3, then it doesn't support Firefox3
  263. and Chromium/Google Chrome cookie format.
  264. *--save-cookies*=FILE::
  265. Save Cookies to FILE in Mozilla/Firefox(1.x/2.x)/ Netscape
  266. format. If FILE already exists, it is overwritten. Session Cookies
  267. are also saved and their expiry values are treated as 0. Possible
  268. Values: '/path/to/file'
  269. *--use-head*[='true'|'false']::
  270. Use HEAD method for the first request to the HTTP server.
  271. Default: 'false'
  272. *-U*, *--user-agent*=USER_AGENT::
  273. Set user agent for HTTP(S) downloads.
  274. Default: 'aria2/$VERSION', $VERSION is replaced by package version.
  275. FTP Specific Options
  276. ~~~~~~~~~~~~~~~~~~~~
  277. *--ftp-user*=USER::
  278. Set FTP user. This affects all URIs.
  279. Default: 'anonymous'
  280. *--ftp-passwd*=PASSWD::
  281. Set FTP password. This affects all URIs.
  282. If user name is embedded but password is missing in URI, aria2 tries
  283. to resolve password using .netrc. If password is found in .netrc,
  284. then use it as password. If not, use the password specified in this
  285. option.
  286. Default: 'ARIA2USER@'
  287. *-p*, *--ftp-pasv*[='true'|'false']::
  288. Use the passive mode in FTP.
  289. If 'false' is given, the active mode will be used.
  290. Default: 'true'
  291. *--ftp-proxy*=PROXY::
  292. Use this proxy server for FTP. To erase previously defined proxy,
  293. use "". See also *--all-proxy* option. This affects all URIs. The
  294. format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
  295. *--ftp-proxy-passwd*=PASSWD::
  296. Set password for *--ftp-proxy* option.
  297. *--ftp-proxy-user*=USER::
  298. Set user for *--ftp-proxy* option.
  299. *--ftp-type*=TYPE::
  300. Set FTP transfer type. TYPE is either 'binary' or 'ascii'.
  301. Default: 'binary'
  302. *--ftp-reuse-connection*[='true'|'false']::
  303. Reuse connection in FTP.
  304. Default: 'true'
  305. BitTorrent/Metalink Options
  306. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  307. *--select-file*=INDEX...::
  308. Set file to download by specifying its index.
  309. You can find the file index using the *--show-files* option.
  310. Multiple indexes can be specified by using ",", for example: '3,6'.
  311. You can also use "-" to specify a range: '1-5'.
  312. "," and "-" can be used together: '1-5,8,9'.
  313. When used with the -M option, index may vary depending on the query
  314. (see *--metalink-** options).
  315. [NOTE]
  316. In multi file torrent, the adjacent files specified by this option may
  317. also be downloaded. This is by design, not a bug.
  318. A single piece may include several files or part of files, and aria2
  319. writes the piece to the appropriate files.
  320. *-S*, *--show-files*::
  321. Print file listing of .torrent or .metalink file and exit.
  322. In case of .torrent file, additional information
  323. (infohash, piece length, etc) is also printed.
  324. BitTorrent Specific Options
  325. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  326. *--bt-enable-lpd*[='true'|'false']::
  327. Enable Local Peer Discovery. If a private flag is set in a torrent,
  328. aria2 doesn't use this feature for that download even if 'true' is
  329. given. Default: 'false'
  330. *--bt-exclude-tracker*=URI[,...]::
  331. Comma separated list of BitTorrent tracker's announce URI to
  332. remove. You can use special value "\*" which matches all URIs, thus
  333. removes all announce URIs. When specifying "\*" in shell
  334. command-line, don't forget to escape or quote it. See also
  335. *--bt-tracker* option.
  336. *--bt-external-ip*=IPADDRESS::
  337. Specify the external IP address to report to a BitTorrent
  338. tracker. Although this function is named "external", it can accept
  339. any kind of IP addresses. IPADDRESS must be a numeric IP address.
  340. *--bt-hash-check-seed*[='true'|'false']::
  341. If 'true' is given, after hash check using *--check-integrity* option and
  342. file is complete, continue to seed file. If you want to check file
  343. and download it only when it is damaged or incomplete, set this
  344. option to 'false'. This option has effect only on BitTorrent download.
  345. Default: 'true'
  346. *--bt-lpd-interface*=INTERFACE::
  347. Use given interface for Local Peer Discovery. If this option is not
  348. specified, the default interface is chosen. You can specify
  349. interface name and IP address. Possible Values: interface, IP
  350. addres
  351. *--bt-max-open-files*=NUM::
  352. Specify maximum number of files to open in each BitTorrent download.
  353. Default: '100'
  354. *--bt-max-peers*=NUM::
  355. Specify the maximum number of peers per torrent. '0' means
  356. unlimited. See also *--bt-request-peer-speed-limit* option.
  357. Default: '55'
  358. *--bt-metadata-only*[='true'|'false']::
  359. Download metadata only. The file(s) described in metadata will not
  360. be downloaded. This option has effect only when BitTorrent Magnet
  361. URI is used. See also *--bt-save-metadata* option. Default: 'false'
  362. *--bt-min-crypto-level*='plain'|'arc4'::
  363. Set minimum level of encryption method.
  364. If several encryption methods are provided by a peer, aria2 chooses the lowest
  365. one which satisfies the given level.
  366. Default: 'plain'
  367. *--bt-prioritize-piece*='head'[=SIZE],'tail'[=SIZE]::
  368. Try to download first and last pieces of each file first. This is
  369. useful for previewing files. The argument can contain 2 keywords:
  370. 'head' and 'tail'. To include both keywords, they must be separated
  371. by comma. These keywords can take one parameter, SIZE. For example,
  372. if 'head'=SIZE is specified, pieces in the range of first SIZE bytes
  373. of each file get higher priority. 'tail'=SIZE means the range of
  374. last SIZE bytes of each file. SIZE can include 'K' or 'M'(1K = 1024,
  375. 1M = 1024K). If SIZE is omitted, SIZE=1M is used.
  376. *--bt-require-crypto*='true'|'false'::
  377. If true is given, aria2 doesn't accept and establish connection with legacy
  378. BitTorrent handshake(\19BitTorrent protocol).
  379. Thus aria2 always uses Obfuscation handshake.
  380. Default: 'false'
  381. *--bt-request-peer-speed-limit*=SPEED::
  382. If the whole download speed of every torrent is lower than SPEED,
  383. aria2 temporarily increases the number of peers to try for more
  384. download speed. Configuring this option with your preferred download
  385. speed can increase your download speed in some cases.
  386. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  387. Default: '50K'
  388. *--bt-save-metadata*[='true'|'false']::
  389. Save metadata as .torrent file. This option has effect only when
  390. BitTorrent Magnet URI is used. The filename is hex encoded info
  391. hash with suffix .torrent. The directory to be saved is the same
  392. directory where download file is saved. If the same file already
  393. exists, metadata is not saved. See also *--bt-metadata-only*
  394. option. Default: 'false'
  395. *--bt-seed-unverified*[='true'|'false']::
  396. Seed previously downloaded files without verifying piece hashes.
  397. Default: 'false'
  398. *--bt-stop-timeout*=SEC::
  399. Stop BitTorrent download if download speed is 0 in consecutive SEC
  400. seconds. If '0' is given, this feature is disabled. Default: '0'
  401. *--bt-tracker*=URI[,...]::
  402. Comma separated list of additional BitTorrent tracker's announce
  403. URI. These URIs are not affected by *--bt-exclude-tracker* option
  404. because they are added after URIs in *--bt-exclude-tracker* option are
  405. removed.
  406. *--bt-tracker-connect-timeout*=SEC::
  407. Set the connect timeout in seconds to establish connection to
  408. tracker. After the connection is established, this option makes no
  409. effect and *--bt-tracker-timeout* option is used instead. Default:
  410. '60'
  411. *--bt-tracker-interval*=SEC::
  412. Set the interval in seconds between tracker requests. This
  413. completely overrides interval value and aria2 just uses this value
  414. and ignores the min interval and interval value in the response of
  415. tracker. If '0' is set, aria2 determines interval based on the
  416. response of tracker and the download progress. Default: '0'
  417. *--bt-tracker-timeout*=SEC::
  418. Set timeout in seconds. Default: '60'
  419. *--dht-entry-point*=HOST:PORT::
  420. Set host and port as an entry point to IPv4 DHT network.
  421. *--dht-entry-point6*=HOST:PORT::
  422. Set host and port as an entry point to IPv6 DHT network.
  423. *--dht-file-path*=PATH::
  424. Change the IPv4 DHT routing table file to PATH.
  425. Default: '$HOME/.aria2/dht.dat'
  426. *--dht-file-path6*=PATH::
  427. Change the IPv6 DHT routing table file to PATH.
  428. Default: '$HOME/.aria2/dht6.dat'
  429. *--dht-listen-addr6*=ADDR::
  430. Specify address to bind socket for IPv6 DHT. It should be a global
  431. unicast IPv6 address of the host.
  432. *--dht-listen-port*=PORT...::
  433. Set UDP listening port for both IPv4 and IPv6 DHT.
  434. Multiple ports can be specified by using ",", for example: '6881,6885'.
  435. You can also use "-" to specify a range: '6881-6999'. "," and "-" can be used
  436. together.
  437. Default: '6881-6999'
  438. [NOTE]
  439. Make sure that the specified ports are open for incoming UDP traffic.
  440. *--dht-message-timeout*=SEC::
  441. Set timeout in seconds. Default: '10'
  442. *--enable-dht*[='true'|'false']::
  443. Enable IPv4 DHT functionality. If a private flag is set in a
  444. torrent, aria2 doesn't use DHT for that download even if 'true' is
  445. given. Default: 'true'
  446. *--enable-dht6*[='true'|'false']::
  447. Enable IPv6 DHT functionality. If a private flag is set in a
  448. torrent, aria2 doesn't use DHT for that download even if 'true' is
  449. given. Use *--dht-listen-port* option to specify port number to
  450. listen on. See also *--dht-listen-addr6* option.
  451. *--enable-peer-exchange*[='true'|'false']::
  452. Enable Peer Exchange extension. If a private flag is set in a torrent, this
  453. feature is disabled for that download even if 'true' is given.
  454. Default: 'true'
  455. *--follow-torrent*='true'|'false'|'mem'::
  456. If 'true' or 'mem' is specified, when a file whose suffix is ".torrent" or content
  457. type is "application/x-bittorrent" is downloaded, aria2 parses it as a torrent
  458. file and downloads files mentioned in it.
  459. If 'mem' is specified, a torrent file is not written to the disk, but is just
  460. kept in memory.
  461. If 'false' is specified, the action mentioned above is not taken.
  462. Default: 'true'
  463. *-O*, *--index-out*=INDEX=PATH::
  464. Set file path for file with index=INDEX. You can find the file index
  465. using the *--show-files* option. PATH is a relative path to the
  466. path specified in *--dir* option. You can use this option multiple
  467. times. Using this option, you can specify the output filenames of
  468. BitTorrent downloads.
  469. *--listen-port*=PORT...::
  470. Set TCP port number for BitTorrent downloads.
  471. Multiple ports can be specified by using ",", for example: '6881,6885'.
  472. You can also use "-" to specify a range: '6881-6999'.
  473. "," and "-" can be used together: '6881-6889,6999'.
  474. Default: '6881-6999'
  475. [NOTE]
  476. Make sure that the specified ports are open for incoming TCP traffic.
  477. *--max-overall-upload-limit*=SPEED::
  478. Set max overall upload speed in bytes/sec.
  479. '0' means unrestricted.
  480. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  481. To limit the upload speed per torrent, use *--max-upload-limit* option.
  482. Default: '0'
  483. *-u*, *--max-upload-limit*=SPEED::
  484. Set max upload speed per each torrent in bytes/sec.
  485. '0' means unrestricted.
  486. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  487. To limit the overall upload speed, use *--max-overall-upload-limit* option.
  488. Default: '0'
  489. *--peer-id-prefix*=PEER_ID_PREFIX::
  490. Specify the prefix of peer ID. The peer ID in
  491. BitTorrent is 20 byte length. If more than 20
  492. bytes are specified, only first 20 bytes are
  493. used. If less than 20 bytes are specified, random
  494. byte data are added to make its length 20 bytes.
  495. Default: 'aria2/$VERSION-', $VERSION is replaced by package version.
  496. *--seed-ratio*=RATIO::
  497. Specify share ratio. Seed completed torrents until share ratio reaches
  498. RATIO.
  499. You are strongly encouraged to specify equals or more than '1.0' here.
  500. Specify '0.0' if you intend to do seeding regardless of share ratio.
  501. If *--seed-time* option is specified along with this option, seeding ends when
  502. at least one of the conditions is satisfied.
  503. Default: '1.0'
  504. *--seed-time*=MINUTES::
  505. Specify seeding time in minutes. Also see the *--seed-ratio* option.
  506. [NOTE]
  507. Specifying *--seed-time*='0' disables seeding after download completed.
  508. *-T*, *--torrent-file*=TORRENT_FILE::
  509. The path to the .torrent file. You are not required to use this
  510. option because you can specify .torrent files without *-T*.
  511. Metalink Specific Options
  512. ~~~~~~~~~~~~~~~~~~~~~~~~~
  513. *--follow-metalink*='true'|'false'|'mem'::
  514. If 'true' or 'mem' is specified, when a file whose suffix is ".metalink" or content
  515. type of "application/metalink+xml" is downloaded, aria2 parses it as a metalink
  516. file and downloads files mentioned in it.
  517. If 'mem' is specified, a metalink file is not written to the disk, but is just
  518. kept in memory.
  519. If 'false' is specified, the action mentioned above is not taken.
  520. Default: 'true'
  521. *-M*, *--metalink-file*=METALINK_FILE::
  522. The file path to .metalink file. Reads input from stdin when '-' is
  523. specified. You are not required to use this option because you can
  524. specify .metalink files without *-M*.
  525. *-C*, *--metalink-servers*=NUM_SERVERS::
  526. The number of servers to connect to simultaneously.
  527. Some Metalinks regulate the number of servers to connect.
  528. aria2 strictly respects them.
  529. This means that if Metalink defines the maxconnections attribute lower
  530. than NUM_SERVERS, then aria2 uses the value of maxconnections attribute
  531. instead of NUM_SERVERS.
  532. See also *-s* and *-j* options.
  533. Default: '5'
  534. *--metalink-language*=LANGUAGE::
  535. The language of the file to download.
  536. *--metalink-location*=LOCATION[,...]::
  537. The location of the preferred server.
  538. A comma-delimited list of locations is acceptable, for example, 'jp,us'.
  539. *--metalink-os*=OS::
  540. The operating system of the file to download.
  541. *--metalink-version*=VERSION::
  542. The version of the file to download.
  543. *--metalink-preferred-protocol*=PROTO::
  544. Specify preferred protocol.
  545. The possible values are 'http', 'https', 'ftp' and 'none'.
  546. Specify 'none' to disable this feature.
  547. Default: 'none'
  548. *--metalink-enable-unique-protocol*='true'|'false'::
  549. If 'true' is given and several protocols are available for a mirror in a
  550. metalink file, aria2 uses one of them.
  551. Use *--metalink-preferred-protocol* option to specify the preference of
  552. protocol.
  553. Default: 'true'
  554. XML-RPC Options
  555. ~~~~~~~~~~~~~~~
  556. *--enable-xml-rpc*[='true'|'false']::
  557. Enable XML-RPC server. It is strongly recommended to set username
  558. and password using *--xml-rpc-user* and *--xml-rpc-passwd*
  559. option. See also *--xml-rpc-listen-port* option. Default: 'false'
  560. *--xml-rpc-listen-all*[='true'|'false']::
  561. Listen incoming XML-RPC requests on all network interfaces. If false
  562. is given, listen only on local loopback interface. Default: 'false'
  563. *--xml-rpc-listen-port*=PORT::
  564. Specify a port number for XML-RPC server to listen to. Possible
  565. Values: '1024'-'65535' Default: '6800'
  566. *--xml-rpc-max-request-size*=SIZE::
  567. Set max size of XML-RPC request. If aria2 detects the request is
  568. more than SIZE bytes, it drops connection. Default: '2M'
  569. *--xml-rpc-passwd*=PASSWD::
  570. Set XML-RPC password.
  571. *--xml-rpc-user*=USER::
  572. Set XML-RPC user.
  573. Advanced Options
  574. ~~~~~~~~~~~~~~~~
  575. *--allow-overwrite*='true'|'false'::
  576. Restart download from scratch if the corresponding control file
  577. doesn't exist. See also *--auto-file-renaming* option. Default:
  578. 'false'
  579. *--allow-piece-length-change*='true'|'false'::
  580. If false is given, aria2 aborts download when a piece length is different
  581. from one in a control file.
  582. If true is given, you can proceed but some download progress will be lost.
  583. Default: 'false'
  584. *--always-resume*[='true'|'false']::
  585. Always resume download. If 'true' is given, aria2 always tries to
  586. resume download and if resume is not possible, aborts download. If
  587. 'false' is given, when all given URIs do not support resume or aria2
  588. encounters 'N' URIs which does not support resume ('N' is the value
  589. specified using *--max-resume-failure-tries* option), aria2
  590. downloads file from scratch. See *--max-resume-failure-tries*
  591. option. Default: 'true'
  592. *--async-dns*[='true'|'false']::
  593. Enable asynchronous DNS.
  594. Default: 'true'
  595. *--auto-file-renaming*[='true'|'false']::
  596. Rename file name if the same file already exists.
  597. This option works only in HTTP(S)/FTP download.
  598. The new file name has a dot and a number(1..9999) appended.
  599. Default: 'true'
  600. *--auto-save-interval*=SEC::
  601. Save a control file(*.aria2) every SEC seconds.
  602. If '0' is given, a control file is not saved during download. aria2 saves a
  603. control file when it stops regardless of the value.
  604. The possible values are between '0' to '600'.
  605. Default: '60'
  606. *--conditional-get*[='true'|'false']::
  607. Download file only when the local file is older than remote
  608. file. This function only works with HTTP(S) downloads only. It does
  609. not work if file size is specified in Metalink. It also ignores
  610. Content-Disposition header. If a control file exists, this option
  611. will be ignored. This function uses If-Modified-Since header to get
  612. only newer file conditionally. When getting modification time of
  613. local file, it uses user supplied filename(see *--out* option) or
  614. filename part in URI if *--out* is not specified. Default: 'false'
  615. *--conf-path*=PATH::
  616. Change the configuration file path to PATH.
  617. Default: '$HOME/.aria2/aria2.conf'
  618. *-D*, *--daemon*::
  619. Run as daemon. The current working directory will be changed to '/'
  620. and standard input, standard output and standard error will be
  621. redirected to '/dev/null'. Default: 'false'
  622. *--disable-ipv6*[='true'|'false']::
  623. Disable IPv6. This is useful if you have to use broken DNS and want
  624. to avoid terribly slow AAAA record lookup. Default: 'false'
  625. *--enable-async-dns6*[='true'|'false']::
  626. Enable IPv6 name resolution in asynchronous DNS resolver. This
  627. option will be ignored when *--async-dns*='false'.
  628. Default: 'false'
  629. *--enable-direct-io*[='true'|'false']::
  630. Enable directI/O, which lowers cpu usage while allocating/checking files.
  631. Turn off if you encounter any error.
  632. Default: 'true'
  633. *--event-poll*=POLL::
  634. Specify the method for polling events. The possible values are
  635. 'epoll', 'kqueue', 'port', 'poll' and 'select'. For each 'epoll',
  636. 'kqueue', 'port' and 'poll', it is available if system supports it.
  637. 'epoll' is available on recent Linux. 'kqueue' is available on
  638. various *BSD systems including Mac OS X. 'port' is available on Open
  639. Solaris. The default value may vary depending on the system you use.
  640. *--file-allocation*=METHOD::
  641. Specify file allocation method.
  642. 'none' doesn't pre-allocate file space. 'prealloc' pre-allocates file space
  643. before download begins. This may take some time depending on the size of the
  644. file.
  645. If you are using newer file systems such as ext4
  646. (with extents support), btrfs or xfs, 'falloc' is
  647. your best choice. It allocates large(few GiB)
  648. files almost instantly. Don't use 'falloc' with
  649. legacy file systems such as ext3 because it takes
  650. almost same time as 'prealloc' and it blocks aria2
  651. entirely until allocation finishes. 'falloc' may
  652. not be available if your system doesn't have
  653. *posix_fallocate*() function.
  654. Possible Values: 'none', 'prealloc', 'falloc'
  655. Default: 'prealloc'
  656. *--human-readable*[='true'|'false']::
  657. Print sizes and speed in human readable format (e.g., 1.2Ki, 3.4Mi)
  658. in the console readout. Default: 'true'
  659. *--interface*=INTERFACE::
  660. Bind sockets to given interface. You can specify interface name, IP
  661. address and hostname.
  662. Possible Values: interface, IP address, hostname
  663. [NOTE]
  664. If an interface has multiple addresses, it is highly recommended to
  665. specify IP address explicitly. See also *--disable-ipv6*. If your
  666. system doesn't have getifaddrs(), this option doesn't accept interface
  667. name.
  668. *--max-connection-per-server*=NUM::
  669. The maximum number of connections to one server for each download.
  670. Possible Values: '1'-'4'
  671. Default: '1'
  672. *--max-resume-failure-tries*=N::
  673. When used with *--always-resume*='false', aria2 downloads file from
  674. scratch when aria2 detects 'N' number of URIs that does not support
  675. resume. If 'N' is '0', aria2 downloads file from scratch when all
  676. given URIs do not support resume. See *--always-resume* option.
  677. Default: '0'
  678. *--min-split-size*=SIZE::
  679. aria2 does not split less than 2*SIZE byte range. For example,
  680. let's consider downloading 20MiB file. If SIZE is 10M, aria2 can
  681. split file into 2 range [0-10MiB) and [10MiB-20MiB) and download it
  682. using 2 sources(if *--split* >= 2, of course). If SIZE is 15M,
  683. since 2*15M > 20MiB, aria2 does not split file and download it using
  684. 1 source. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  685. Possible Values: '1M'-'1024M' Default: '20M'
  686. *--log-level*=LEVEL::
  687. Set log level to output.
  688. LEVEL is either 'debug', 'info', 'notice', 'warn' or 'error'.
  689. Default: 'debug'
  690. *--on-bt-download-complete*=COMMAND::
  691. For BitTorrent, a command specified in *--on-download-complete* is
  692. called when download completes and seeding is over. On the other
  693. hand, this option set the command to be executed when download
  694. completes but before seeding. See *--on-download-start* option for
  695. the requirement of COMMAND. Possible Values: '/path/to/command'
  696. *--on-download-complete*=COMMAND::
  697. Set the command to be executed when download completes. See
  698. *--on-download-start* option for the requirement of COMMAND. See
  699. also *--on-download-stop* option. Possible Values:
  700. '/path/to/command'
  701. *--on-download-error*=COMMAND::
  702. Set the command to be executed when download aborts due to error.
  703. See *--on-download-start* option for the requirement of COMMAND.
  704. See also *--on-download-stop* option. Possible Values:
  705. '/path/to/command'
  706. *--on-download-pause*=COMMAND::
  707. Set the command to be executed when download is paused. See
  708. *--on-download-start* option for the requirement of COMMAND.
  709. Possible Values: '/path/to/command'
  710. *--on-download-start*=COMMAND::
  711. Set the command to be executed when download starts up. COMMAND must
  712. take just one argument and GID is passed to COMMAND as a first
  713. argument. Possible Values: '/path/to/command'
  714. *--on-download-stop*=COMMAND::
  715. Set the command to be executed when download stops. You can override
  716. the command to be executed for particular download result using
  717. *--on-download-complete* and *--on-download-error*. If they are
  718. specified, command specified in this option is not executed. See
  719. *--on-download-start* option for the requirement of COMMAND.
  720. Possible Values: '/path/to/command'
  721. *--summary-interval*=SEC::
  722. Set interval in seconds to output download progress summary.
  723. Setting '0' suppresses the output.
  724. Default: '60'
  725. [NOTE]
  726. In multi file torrent downloads, the files adjacent forward to the specified files
  727. are also allocated if they share the same piece.
  728. *-Z*, *--force-sequential*[='true'|'false']::
  729. Fetch URIs in the command-line sequentially and download each URI in a
  730. separate session, like the usual command-line download utilities.
  731. Default: 'false'
  732. *--max-overall-download-limit*=SPEED::
  733. Set max overall download speed in bytes/sec. '0' means
  734. unrestricted. You can append 'K' or 'M'(1K = 1024, 1M = 1024K). To
  735. limit the download speed per download, use *--max-download-limit*
  736. option. Default: '0'
  737. *--max-download-limit*=SPEED::
  738. Set max download speed per each download in bytes/sec. '0' means
  739. unrestricted. You can append 'K' or 'M'(1K = 1024, 1M = 1024K). To
  740. limit the overall download speed, use *--max-overall-download-limit*
  741. option. Default: '0'
  742. *--no-conf*::
  743. Disable loading aria2.conf file.
  744. *--no-file-allocation-limit*=SIZE::
  745. No file allocation is made for files whose size is smaller than SIZE.
  746. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  747. Default: '5M'
  748. *-P*, *--parameterized-uri*[='true'|'false']::
  749. Enable parameterized URI support.
  750. You can specify set of parts: 'http://{sv1,sv2,sv3}/foo.iso'.
  751. Also you can specify numeric sequences with step counter:
  752. '\http://host/image[000-100:2].img'.
  753. A step counter can be omitted.
  754. If all URIs do not point to the same file, such as the second example above,
  755. -Z option is required.
  756. Default: 'false'
  757. *-q*, *--quiet*[='true'|'false']::
  758. Make aria2 quiet (no console output).
  759. Default: 'false'
  760. *--realtime-chunk-checksum*='true'|'false'::
  761. Validate chunk of data by calculating checksum while downloading a file if
  762. chunk checksums are provided.
  763. Default: 'true'
  764. *--remove-control-file*[='true'|'false']::
  765. Remove control file before download. Using with
  766. *--allow-overwrite*='true', download always starts from
  767. scratch. This will be useful for users behind proxy server which
  768. disables resume.
  769. [NOTE]
  770. For Metalink downloads, -C1 is recommended for proxy server which
  771. disables resume, in order to avoid establishing unnecessary
  772. connections.
  773. *--save-session*=FILE::
  774. Save error/unfinished downloads to FILE on exit. You can pass this
  775. output file to aria2c with *-i* option on restart. Please note that
  776. downloads added by *aria2.addTorrent* and *aria2.addMetalink*
  777. XML-RPC method are not saved.
  778. *--stop*=SEC::
  779. Stop application after SEC seconds has passed.
  780. If '0' is given, this feature is disabled.
  781. Default: '0'
  782. *-v*, *--version*::
  783. Print the version number, copyright and the configuration information and
  784. exit.
  785. Options That Take An Optional Argument
  786. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  787. The options that have its argument surrounded by square brackets([])
  788. take an optional argument. Usually omiting the argument is evaluated to 'true'.
  789. If you use short form of these options(such as '-V') and give
  790. an argument, then the option name and its argument should be concatenated(e.g.
  791. '-Vfalse'). If any spaces are inserted between the option name and the argument,
  792. the argument will be treated as URI and usually this is not what you expect.
  793. URI, MAGNET, TORRENT_FILE, METALINK_FILE
  794. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  795. You can specify multiple URIs in command-line. Unless you specify
  796. *-Z* option, all URIs must point to the same file or downloading will
  797. fail.
  798. You can specify arbitrary number of BitTorrent Magnet URI. Please note
  799. that they are always treated as a separate download. Both hex encoded
  800. 40 characters Info Hash and Base32 encoded 32 characters Info Hash are
  801. supported. The multiple "tr" parameters are supported. Because
  802. BitTorrent Magnet URI is likely to contain "&" character, it is highly
  803. recommended to always quote URI with single(') or double(") quotation.
  804. It is strongly recommended to enable DHT especially when "tr"
  805. parameter is missing. See http://www.bittorrent.org/beps/bep_0009.html
  806. for more details about BitTorrent Magnet URI.
  807. You can also specify arbitrary number of torrent files and Metalink
  808. documents stored on a local drive. Please note that they are always
  809. treated as a separate download. Both Metalink4 and Metalink version
  810. 3.0 are supported.
  811. You can specify both torrent file with -T option and URIs. By doing
  812. this, you can download a file from both torrent swarm and HTTP(S)/FTP
  813. server at the same time, while the data from HTTP(S)/FTP are uploaded
  814. to the torrent swarm. For single file torrents, URI can be a complete
  815. URI pointing to the resource or if URI ends with /, name in torrent
  816. file in torrent is added. For multi-file torrents, name and path are
  817. added to form a URI for each file.
  818. [NOTE]
  819. Make sure that URI is quoted with single(') or double(") quotation if it
  820. contains "&" or any characters that have special meaning in shell.
  821. Resuming Download
  822. ~~~~~~~~~~~~~~~~~
  823. Usually, you can resume transfer by just issuing same command(aria2c
  824. URI) if the previous transfer is made by aria2.
  825. If the previous transfer is made by a browser or wget like sequential
  826. download manager, then use -c option to continue the transfer(aria2c
  827. *-c* URI).
  828. EXIT STATUS
  829. -----------
  830. Because aria2 can handle multiple downloads at once, it encounters
  831. lots of errors in a session. aria2 returns the following exit status
  832. based on the last error encountered.
  833. *0*::
  834. If all downloads are successful.
  835. *1*::
  836. If an unknown error occurs.
  837. *2*::
  838. If time out occurs.
  839. *3*::
  840. If a resource is not found.
  841. *4*::
  842. If aria2 sees the specfied number of "resource not found" error.
  843. See *--max-file-not-found* option).
  844. *5*::
  845. If a download aborts because download speed is too slow.
  846. See *--lowest-speed-limit* option)
  847. *6*::
  848. If network problem occurs.
  849. *7*::
  850. If there are unfinished downloads. This error is only reported if
  851. all finished downloads are successful and there are unfinished
  852. downloads in a queue when aria2 exits by pressing Ctrl-C by an user
  853. or sending TERM or INT signal.
  854. *8*::
  855. If server does not support resume when resume is required to
  856. complete download.
  857. [NOTE]
  858. An error occurred in a finished download will not be reported
  859. as exit status.
  860. ENVIRONMENT
  861. -----------
  862. aria2 recognizes the following environment variables.
  863. http_proxy [\http://][USER:PASSWORD@]HOST[:PORT]::
  864. Specify proxy server for use in HTTP.
  865. Overrides http-proxy value in configuration file.
  866. The command-line option *--http-proxy* overrides this value.
  867. https_proxy [\http://][USER:PASSWORD@]HOST[:PORT]::
  868. Specify proxy server for use in HTTPS.
  869. Overrides https-proxy value in configuration file.
  870. The command-line option *--https-proxy* overrides this value.
  871. ftp_proxy [\http://][USER:PASSWORD@]HOST[:PORT]::
  872. Specify proxy server for use in FTP.
  873. Overrides ftp-proxy value in configuration file.
  874. The command-line option *--ftp-proxy* overrides this value.
  875. all_proxy [\http://][USER:PASSWORD@]HOST[:PORT]::
  876. Specify proxy server for use if no protocol-specific proxy is specified.
  877. Overrides all-proxy value in configuration file.
  878. The command-line option *--all-proxy* overrides this value.
  879. no_proxy [DOMAIN,...]::
  880. Specify comma-separated hostname, domains and network address with
  881. or without CIDR block to which proxy should not be used. Overrides
  882. no-proxy value in configuration file. The command-line option
  883. *--no-proxy* overrides this value.
  884. FILES
  885. -----
  886. aria2.conf
  887. ~~~~~~~~~~
  888. By default, aria2 parses '$HOME/.aria2/aria2.conf' as a configuraiton
  889. file. You can specify the path to configuration file using
  890. *--conf-path* option. If you don't want to use the configuraitonf
  891. file, use *--no-conf* option.
  892. The configuration file is a text file and has 1 option per each
  893. line. In each line, you can specify name-value pair in the format:
  894. NAME=VALUE, where name is the long command-line option name without
  895. "--" prefix. You can use same syntax for the command-line option. The
  896. lines beginning "#" are treated as comments.
  897. --------------------------------------
  898. # sample configuration file for aria2c
  899. listen-port=60000
  900. dht-listen-port=60000
  901. seed-ratio=1.0
  902. max-upload-limit=50K
  903. ftp-pasv=true
  904. --------------------------------------
  905. dht.dat
  906. ~~~~~~~~
  907. By default, the routing table of DHT is saved to the path $HOME/.aria2/dht.dat.
  908. Control File
  909. ~~~~~~~~~~~~
  910. aria2 uses a control file to track the progress of a download. A
  911. control file is placed in the same directory as the downloading file
  912. and its filename is the filename of downloading file with ".aria2"
  913. appended. For example, if you are downloading file.zip, then the
  914. control file should be file.zip.aria2. (There is a exception for this
  915. naming convention. If you are downloading a multi torrent, its
  916. control file is the "top directory" name of the torrent with ".aria2"
  917. appended. The "top directory" name is a value of "name" key in "info"
  918. directory in a torrent file.)
  919. Usually a control file is deleted once download completed. If aria2
  920. decides that download cannot be resumed(for example, when downloading
  921. a file from a HTTP server which doesn't support resume), a control
  922. file is not created.
  923. Normally if you lose a control file, you cannot resume download. But
  924. if you have a torrent or metalink with chunk checksums for the file,
  925. you can resume the download without a control file by giving -V option
  926. to aria2c in command-line.
  927. Input File
  928. ~~~~~~~~~~
  929. The input file can contain a list of URIs for aria2 to download. You
  930. can specify multiple URIs for a single entity: separate URIs on a
  931. single line using the TAB character.
  932. Each line is treated as if it is provided in command-line argument.
  933. Therefore they are affected by *-Z* and *-P* options.
  934. Lines starting with "#" are treated as comments and skipped.
  935. Additionally, the following options can be specified after each line
  936. of URIs. These optional lines must start with white space(s).
  937. * dir
  938. * check-integrity
  939. * continue
  940. * all-proxy
  941. * all-proxy-user
  942. * all-proxy-passwd
  943. * connect-timeout
  944. * dry-run
  945. * lowest-speed-limit
  946. * max-file-not-found
  947. * max-tries
  948. * no-proxy
  949. * out
  950. * proxy-method
  951. * remote-time
  952. * split
  953. * timeout
  954. * http-auth-challenge
  955. * http-no-cache
  956. * http-user
  957. * http-passwd
  958. * http-proxy
  959. * http-proxy-user
  960. * http-proxy-passwd
  961. * https-proxy
  962. * https-proxy-user
  963. * https-proxy-passwd
  964. * referer
  965. * enable-http-keep-alive
  966. * enable-http-pipelining
  967. * header
  968. * use-head
  969. * user-agent
  970. * ftp-user
  971. * ftp-passwd
  972. * ftp-pasv
  973. * ftp-proxy
  974. * ftp-proxy-user
  975. * ftp-proxy-passwd
  976. * ftp-type
  977. * ftp-reuse-connection
  978. * no-netrc
  979. * reuse-uri
  980. * select-file
  981. * bt-enable-lpd
  982. * bt-external-ip
  983. * bt-hash-check-seed
  984. * bt-max-open-files
  985. * bt-max-peers
  986. * bt-metadata-only
  987. * bt-min-crypto-level
  988. * bt-prioritize-piece
  989. * bt-require-crypto
  990. * bt-request-peer-speed-limit
  991. * bt-save-metadata
  992. * bt-seed-unverified
  993. * bt-stop-timeout
  994. * bt-tracker-interval
  995. * bt-tracker-timeout
  996. * bt-tracker-connect-timeout
  997. * enable-peer-exchange
  998. * follow-torrent
  999. * index-out
  1000. * max-upload-limit
  1001. * seed-ratio
  1002. * seed-time
  1003. * follow-metalink
  1004. * metalink-servers
  1005. * metalink-language
  1006. * metalink-location
  1007. * metalink-os
  1008. * metalink-version
  1009. * metalink-preferred-protocol
  1010. * metalink-enable-unique-protocol
  1011. * allow-overwrite
  1012. * allow-piece-length-change
  1013. * async-dns
  1014. * auto-file-renaming
  1015. * file-allocation
  1016. * max-download-limit
  1017. * no-file-allocation-limit
  1018. * parameterized-uri
  1019. * realtime-chunk-checksum
  1020. * remove-control-file
  1021. * always-resume
  1022. * max-resume-failure-tries
  1023. * http-accept-gzip
  1024. * max-connection-per-server
  1025. * min-split-size
  1026. * conditional-get
  1027. * enable-async-dns6
  1028. These options have exactly same meaning of the ones in the
  1029. command-line options, but it just applies to the URIs it belongs to.
  1030. For example, the content of uri.txt is
  1031. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1032. http://server/file.iso http://mirror/file.iso
  1033. dir=/iso_images
  1034. out=file.img
  1035. http://foo/bar
  1036. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1037. If aria2 is executed with *-i* uri.txt *-d* /tmp options, then
  1038. 'file.iso' is saved as '/iso_images/file.img' and it is downloaded
  1039. from \http://server/file.iso and \http://mirror/file.iso. The file
  1040. 'bar' is downloaded from \http://foo/bar and saved as '/tmp/bar'.
  1041. In some cases, *out* parameter has no effect. See note of *--out*
  1042. option for the restrictions.
  1043. Server Performance Profile
  1044. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  1045. This section describes the format of server performance profile. The
  1046. file is plain text and each line has several NAME=VALUE pair,
  1047. delimited by comma. Currently following NAMEs are recognized:
  1048. host::
  1049. Hostname of the server. Required.
  1050. protocol::
  1051. Protocol for this profile, such as ftp, http. Required.
  1052. dl_speed::
  1053. The average download speed observed in the previous download in
  1054. bytes per sec. Required.
  1055. sc_avg_speed::
  1056. The average download speed observed in the previous download in
  1057. bytes per sec. This value is only updated if the download is done in
  1058. single connection environment and only used by
  1059. AdaptiveURISelector. Optional.
  1060. mc_avg_speed::
  1061. The average download speed observed in the previous download in
  1062. bytes per sec. This value is only updated if the download is done in
  1063. multi connection environment and only used by
  1064. AdaptiveURISelector. Optional.
  1065. counter::
  1066. How many times the server is used. Currently this value is only used
  1067. by AdaptiveURISelector. Optional.
  1068. last_updated::
  1069. Last contact time in GMT with this server, specified in the seconds
  1070. since the Epoch(00:00:00 on January 1, 1970, UTC). Required.
  1071. status::
  1072. ERROR is set when server cannot be reached or out-of-service or
  1073. timeout occurred. Otherwise, OK is set.
  1074. Those fields must exist in one line. The order of the fields is not
  1075. significant. You can put pairs other than the above; they are simply
  1076. ignored.
  1077. An example follows:
  1078. --------------------------------------------------------------------------------
  1079. host=localhost, protocol=http, dl_speed=32000, last_updated=1222491640, status=OK
  1080. host=localhost, protocol=ftp, dl_speed=0, last_updated=1222491632, status=ERROR
  1081. --------------------------------------------------------------------------------
  1082. XML-RPC INTERFACE
  1083. -----------------
  1084. Terminology
  1085. ~~~~~~~~~~~
  1086. GID::
  1087. GID(or gid) is the key to manage each download. Each download has an
  1088. unique GID. Currently GID looks like an integer, but don't treat it
  1089. as integer because it may be changed to another type in the future
  1090. release. Please note that GID is session local and not persisted
  1091. when aria2 exits.
  1092. Methods
  1093. ~~~~~~~
  1094. *aria2.addUri* 'uris[, options[, position]]'
  1095. This method adds new HTTP(S)/FTP/BitTorrent Magnet URI. 'uris' is of
  1096. type array and its element is URI which is of type string. For
  1097. BitTorrent Magnet URI, 'uris' must have only one element and it should
  1098. be BitTorrent Magnet URI. URIs in 'uris' must point to the same
  1099. file. For example, a file chunkybaconlinux.iso is hosted in 2
  1100. locations: http://server/chunkybaconlinux.iso and
  1101. http://mirror/chunkybaconlinux.iso. You can download this iso image
  1102. using 2 URIs by issuing
  1103. aria2.addUri(['http://server/chunkybaconlinux.iso',
  1104. 'http://mirror/chunkybaconlinux.iso']). Imagine there is an another
  1105. file URI, say, http://mirror2/chunkydonutslinux.iso, which is
  1106. different iso image. You cannot mix this URI with previous URIs in
  1107. one aria2.addUri command. If you do, aria2 does not complain but
  1108. download may fail. 'options' is of type struct and its members are a
  1109. pair of option name and value. See *Options* below for more details.
  1110. If 'position' is given as an integer starting from 0, the new download
  1111. is inserted at 'position' in the waiting queue. If 'position' is not
  1112. given or 'position' is larger than the size of the queue, it is
  1113. appended at the end of the queue. This method returns GID of
  1114. registered download.
  1115. *aria2.addTorrent* 'torrent[, uris[, options[, position]]]'
  1116. This method adds BitTorrent download by uploading .torrent file. If
  1117. you want to add BitTorrent Magnet URI, use *aria2.addUri* method
  1118. instead. 'torrent' is of type base64 which contains Base64-encoded
  1119. .torrent file. 'uris' is of type array and its element is URI which
  1120. is of type string. 'uris' is used for Web-seeding. For single file
  1121. torrents, URI can be a complete URI pointing to the resource or if URI
  1122. ends with /, name in torrent file is added. For multi-file torrents,
  1123. name and path in torrent are added to form a URI for each file.
  1124. 'options' is of type struct and its members are a pair of option name
  1125. and value. See *Options* below for more details. If 'position' is
  1126. given as an integer starting from 0, the new download is inserted at
  1127. 'position' in the waiting queue. If 'position' is not given or
  1128. 'position' is larger than the size of the queue, it is appended at the
  1129. end of the queue. This method returns GID of registered download.
  1130. Please note that the downloads added by this method are not saved by
  1131. *--save-session*.
  1132. *aria2.addMetalink* 'metalink[, options[, position]]'
  1133. This method adds Metalink download by uploading .metalink file.
  1134. 'metalink' is of type base64 which contains Base64-encoded .metalink
  1135. file. 'options' is of type struct and its members are a pair of
  1136. option name and value. See *Options* below for more details. If
  1137. 'position' is given as an integer starting from 0, the new download is
  1138. inserted at 'position' in the waiting queue. If 'position' is not
  1139. given or 'position' is larger than the size of the queue, it is
  1140. appended at the end of the queue. This method returns array of GID of
  1141. registered download. Please note that the downloads added by this
  1142. method are not saved by *--save-session*.
  1143. *aria2.remove* 'gid'
  1144. This method removes the download denoted by 'gid'. 'gid' is of type
  1145. string. If specified download is in progress, it is stopped at
  1146. first. The status of removed download becomes "removed". This method
  1147. returns GID of removed download.
  1148. *aria2.forceRemove* 'gid'
  1149. This method removes the download denoted by 'gid'. This method
  1150. behaves just like *aria2.remove* except that this method removes
  1151. download without any action which takes time such as contacting
  1152. BitTorrent tracker.
  1153. *aria2.pause* 'gid'
  1154. This method pauses the download denoted by 'gid'. 'gid' is of type
  1155. string. The status of paused download becomes "paused". If the
  1156. download is active, the download is placed on the first position of
  1157. waiting queue. As long as the status is "paused", the download is not
  1158. started. To change status to "waiting", use *aria2.unpause* method.
  1159. This method returns GID of paused download.
  1160. *aria2.pauseAll*
  1161. This method is equal to calling *aria2.pause* for every active/waiting
  1162. download. This methods returns "OK" for success.
  1163. *aria2.forcePause* 'pid'
  1164. This method pauses the download denoted by 'gid'. This method
  1165. behaves just like *aria2.pause* except that this method pauses
  1166. download without any action which takes time such as contacting
  1167. BitTorrent tracker.
  1168. *aria2.forcePauseAll*
  1169. This method is equal to calling *aria2.forcePause* for every
  1170. active/waiting download. This methods returns "OK" for success.
  1171. *aria2.unpause* 'gid'
  1172. This method changes the status of the download denoted by 'gid' from
  1173. "paused" to "waiting". This makes the download eligible to restart.
  1174. 'gid' is of type string. This method returns GID of unpaused
  1175. download.
  1176. *aria2.unpauseAll*
  1177. This method is equal to calling *aria2.unpause* for every active/waiting
  1178. download. This methods returns "OK" for success.
  1179. *aria2.tellStatus* 'gid'
  1180. This method returns download progress of the download denoted by
  1181. 'gid'. 'gid' is of type string. The response is of type struct and it
  1182. contains following keys. The value type is string.
  1183. gid::
  1184. GID of this download.
  1185. status::
  1186. "active" for currently downloading/seeding entry. "waiting" for the
  1187. entry in the queue; download is not started. "paused" for the
  1188. paused entry. "error" for the stopped download because of
  1189. error. "complete" for the stopped and completed download. "removed"
  1190. for the download removed by user.
  1191. totalLength::
  1192. Total length of this download in bytes.
  1193. completedLength::
  1194. Completed length of this download in bytes.
  1195. uploadLength::
  1196. Uploaded length of this download in bytes.
  1197. bitfield::
  1198. Hexadecimal representation of the download progress. The highest bit
  1199. corresponds to piece index 0. The set bits indicate the piece is
  1200. available and unset bits indicate the piece is missing. The spare
  1201. bits at the end are set to zero. When download has not started yet,
  1202. this key will not be included in the response.
  1203. downloadSpeed::
  1204. Download speed of this download measured in bytes/sec.
  1205. uploadSpeed::
  1206. Upload speed of this download measured in bytes/sec.
  1207. infoHash::
  1208. InfoHash. BitTorrent only.
  1209. numSeeders::
  1210. The number of seeders the client has connected to. BitTorrent only.
  1211. pieceLength::
  1212. Piece length in bytes.
  1213. numPieces::
  1214. The number of pieces.
  1215. connections::
  1216. The number of peers/servers the client has connected to.
  1217. errorCode::
  1218. The last error code occurred in this download. The value is of type
  1219. string. The error codes are defined in EXIT STATUS section. This
  1220. value is only available for stopped/completed downloads.
  1221. followedBy::
  1222. List of GIDs which are generated by the consequence of this
  1223. download. For example, when aria2 downloaded Metalink file, it
  1224. generates downloads described in it(see *--follow-metalink*
  1225. option). This value is useful to track these auto generated
  1226. downloads. If there is no such downloads, this key will not
  1227. be included in the response.
  1228. belongsTo::
  1229. GID of a parent download. Some downloads are a part of another
  1230. download. For example, if a file in Metalink has BitTorrent
  1231. resource, the download of .torrent is a part of that file. If this
  1232. download has no parent, this key will not be included in the
  1233. response.
  1234. dir::
  1235. Directory to save files. This key is not available for stopped
  1236. downloads.
  1237. files::
  1238. Returns the list of files. The element of list is the same struct
  1239. used in *aria2.getFiles* method.
  1240. bittorrent::
  1241. Struct which contains information retrieved from .torrent
  1242. file. BitTorrent only. It contains following keys.
  1243. announceList;;
  1244. List of lists of announce URI. If .torrent file contains announce
  1245. and no announce-list, announce is converted to announce-list
  1246. format.
  1247. comment;;
  1248. The comment for the torrent. comment.utf-8 is used if available.
  1249. creationDate;;
  1250. The creation time of the torrent. The value is an integer since
  1251. the Epoch, measured in seconds.
  1252. mode;;
  1253. File mode of the torrent. The value is either 'single' or 'multi'.
  1254. info;;
  1255. Struct which contains data from Info dictionary. It contains
  1256. following keys.
  1257. name:::
  1258. name in info dictionary. name.utf-8 is used if available.
  1259. *aria2.getUris* 'gid'
  1260. This method returns URIs used in the download denoted by 'gid'. 'gid'
  1261. is of type string. The response is of type array and its element is of
  1262. type struct and it contains following keys. The value type is string.
  1263. uri::
  1264. URI
  1265. status::
  1266. 'used' if the URI is already used. 'waiting' if the URI is waiting
  1267. in the queue.
  1268. *aria2.getFiles* 'gid'
  1269. This method returns file list of the download denoted by 'gid'. 'gid'
  1270. is of type string. The response is of type array and its element is of
  1271. type struct and it contains following keys. The value type is string.
  1272. index::
  1273. Index of file. Starting with 1. This is the same order with the
  1274. files in multi-file torrent.
  1275. path::
  1276. File path.
  1277. length::
  1278. File size in bytes.
  1279. selected::
  1280. "true" if this file is selected by *--select-file* option. If
  1281. *--select-file* is not specified or this is single torrent or no
  1282. torrent download, this value is always "true". Otherwise "false".
  1283. uris::
  1284. Returns the list of URI for this file. The element of list is the
  1285. same struct used in *aria2.getUris* method.
  1286. *aria2.getPeers* 'gid'
  1287. This method returns peer list of the download denoted by 'gid'. 'gid'
  1288. is of type string. This method is for BitTorrent only. The response
  1289. is of type array and its element is of type struct and it contains
  1290. following keys. The value type is string.
  1291. peerId::
  1292. Percent-encoded peer ID.
  1293. ip::
  1294. IP address of the peer.
  1295. port::
  1296. Port number of the peer.
  1297. bitfield::
  1298. Hexadecimal representation of the download progress of the peer. The
  1299. highest bit corresponds to piece index 0. The set bits indicate the
  1300. piece is available and unset bits indicate the piece is missing. The
  1301. spare bits at the end are set to zero.
  1302. amChoking::
  1303. "true" if this client is choking the peer. Otherwise "false".
  1304. peerChoking::
  1305. "true" if the peer is choking this client. Otherwise "false".
  1306. downloadSpeed::
  1307. Download speed (byte/sec) that this client obtains from the peer.
  1308. uploadSpeed::
  1309. Upload speed(byte/sec) that this client uploads to the peer.
  1310. seeder::
  1311. "true" is this client is a seeder. Otherwise "false".
  1312. *aria2.getServers* 'gid'
  1313. This method returns currently connected HTTP(S)/FTP servers of the download denoted by 'gid'. 'gid' is of type string. The response
  1314. is of type array and its element is of type struct and it contains
  1315. following keys. The value type is string.
  1316. index::
  1317. Index of file. Starting with 1. This is the same order with the
  1318. files in multi-file torrent.
  1319. servers::
  1320. The list of struct which contains following keys.
  1321. uri;;
  1322. URI originally added.
  1323. currentUri;;
  1324. This is the URI currently used for downloading. If redirection is
  1325. involved, currentUri and uri may differ.
  1326. downloadSpeed;;
  1327. Download speed (byte/sec)
  1328. *aria2.tellActive*
  1329. This method returns the list of active downloads. The response is of
  1330. type array and its element is the same struct returned by
  1331. *aria2.tellStatus* method.
  1332. *aria2.tellWaiting* 'offset, num'
  1333. This method returns the list of waiting download, including paused
  1334. downloads. 'offset' is of type integer and specifies the offset from
  1335. the download waiting at the front. 'num' is of type integer and
  1336. specifies the number of downloads to be returned.
  1337. If offset is a positive integer, this method returns downloads in the
  1338. range of ['offset', 'offset'+'num').
  1339. 'offset' can be a negative integer. 'offset' == -1 points last
  1340. download in the waiting queue and 'offset' == -2 points the download
  1341. before the last download, and so on. The downloads in the response are
  1342. in reversed order.
  1343. For example, imagine that three downloads "A","B" and "C" are waiting
  1344. in this order. aria2.tellWaiting(0, 1) returns
  1345. ["A"]. aria2.tellWaiting(1, 2) returns ["B", "C"].
  1346. aria2.tellWaiting(-1, 2) returns ["C", "B"].
  1347. The response is of type array and its element is the same struct
  1348. returned by *aria2.tellStatus* method.
  1349. *aria2.tellStopped* 'offset, num'
  1350. This method returns the list of stopped download. 'offset' is of type
  1351. integer and specifies the offset from the oldest download. 'num' is of
  1352. type integer and specifies the number of downloads to be returned.
  1353. 'offset' and 'num' have the same semantics as *aria2.tellWaiting*
  1354. method.
  1355. The response is of type array and its element is the same struct
  1356. returned by *aria2.tellStatus* method.
  1357. *aria2.changePosition* 'gid, pos, how'
  1358. This method changes the position of the download denoted by
  1359. 'gid'. 'pos' is of type integer. 'how' is of type string. If 'how' is
  1360. "POS_SET", it moves the download to a position relative to the
  1361. beginning of the queue. If 'how' is "POS_CUR", it moves the download
  1362. to a position relative to the current position. If 'how' is "POS_END",
  1363. it moves the download to a position relative to the end of the
  1364. queue. If the destination position is less than 0 or beyond the end of
  1365. the queue, it moves the download to the beginning or the end of the
  1366. queue respectively. The response is of type integer and it is the
  1367. destination position.
  1368. For example, if GID#1 is placed in position 3, aria2.changePosition(1,
  1369. -1, POS_CUR) will change its position to 2. Additional
  1370. aria2.changePosition(1, 0, POS_SET) will change its position to 0(the
  1371. beginning of the queue).
  1372. *aria2.changeUri* 'gid, fileIndex, delUris, addUris[, position]'
  1373. This method removes URIs in 'delUris' from and appends URIs in
  1374. 'addUris' to download denoted by 'gid'. 'delUris' and 'addUris' are
  1375. list of string. A download can contain multiple files and URIs are
  1376. attached to each file. 'fileIndex' is used to select which file to
  1377. remove/attach given URIs. 'fileIndex' is 1-based. 'position' is used
  1378. to specify where URIs are inserted in the existing waiting URI
  1379. list. 'position' is 0-based. When 'position' is omitted, URIs are
  1380. appended to the back of the list. This method first execute removal
  1381. and then addition. 'position' is the position after URIs are removed,
  1382. not the position when this method is called. When removing URI, if
  1383. same URIs exist in download, only one of them is removed for each URI
  1384. in 'delUris'. In other words, there are three URIs
  1385. "http://example.org/aria2" and you want remove them all, you have to
  1386. specify (at least) 3 "http://example.org/aria2" in 'delUris'. This
  1387. method returns a list which contains 2 integers. The first integer is
  1388. the number of URIs deleted. The second integer is the number of URIs
  1389. added.
  1390. *aria2.getOption* 'gid'
  1391. This method returns options of the download denoted by 'gid'. The
  1392. response is of type struct. Its key is the name of option. The value type
  1393. is string.
  1394. *aria2.changeOption* 'gid, options'
  1395. This method changes options of the download denoted by 'gid'
  1396. dynamically. 'gid' is of type string. 'options' is of type struct
  1397. and the available options are: *bt-max-peers*,
  1398. *bt-request-peer-speed-limit*, *max-download-limit* and
  1399. *max-upload-limit*. This method returns "OK" for success.
  1400. *aria2.getGlobalOption*
  1401. This method returns global options. The response is of type
  1402. struct. Its key is the name of option. The value type is string.
  1403. Because global options are used as a template for the options of newly
  1404. added download, the response contains keys returned by
  1405. *aria2.getOption* method.
  1406. *aria2.changeGlobalOption* 'options'
  1407. This method changes global options dynamically. 'options' is of type
  1408. struct and the available options are *max-concurrent-downloads*,
  1409. *max-overall-download-limit*, *max-overall-upload-limit*, *log-level*
  1410. and *log*. Using *log* option, you can dynamically start logging or
  1411. change log file. To stop logging, give empty string("") as a parameter
  1412. value. Note that log file is always opened in append mode. This method
  1413. returns "OK" for success.
  1414. *aria2.purgeDownloadResult*
  1415. This method purges completed/error/removed downloads to free memory.
  1416. This method returns "OK".
  1417. *aria2.getVersion*
  1418. This method returns version of the program and the list of enabled
  1419. features. The response is of type struct and contains following keys.
  1420. version::
  1421. Version number of the program in string.
  1422. enabledFeatures::
  1423. List of enabled features. Each feature name is of type string.
  1424. *aria2.getSessionInfo*
  1425. This method returns session information.
  1426. The response is of type struct and contains following key.
  1427. sessionId::
  1428. Session ID, which is generated each time when aria2 is invoked.
  1429. *aria2.shutdown*
  1430. This method shutdowns aria2. This method returns "OK".
  1431. *aria2.forceShutdown*
  1432. This method shutdowns aria2. This method behaves like *aria2.shutdown*
  1433. except that any actions which takes time such as contacting BitTorrent
  1434. tracker are skipped. This method returns "OK".
  1435. *system.multicall* 'methods'
  1436. This methods encapsulates multiple method calls in a single request.
  1437. 'methods' is of type array and its element is struct. The struct
  1438. contains two keys: "methodName" and "params". "methodName" is the
  1439. method name to call and "params" is array containing parameters to the
  1440. method. This method returns array of responses. The element of array
  1441. will either be a one-item array containing the return value of each
  1442. method call or struct of fault element if an encapsulated method call
  1443. fails.
  1444. Error Handling
  1445. ~~~~~~~~~~~~~~
  1446. In case of error, aria2 returns faultCode=1 and the error message in
  1447. faultString.
  1448. Options
  1449. ~~~~~~~
  1450. Same options for *-i* list are available. See *Input File* subsection
  1451. for complete list of options.
  1452. In the option struct, name element is option name(without preceding
  1453. "--") and value element is argument as string.
  1454. -------------------------------------------------
  1455. <struct>
  1456. <member>
  1457. <name>split</name>
  1458. <value><string>1</string></value>
  1459. </member>
  1460. <member>
  1461. <name>http-proxy</name>
  1462. <value><string>http://proxy/</string></value>
  1463. </member>
  1464. </struct>
  1465. -------------------------------------------------
  1466. *header* and *index-out* option are allowed multiple times in
  1467. command-line. Since name should be unique in struct(many XML-RPC
  1468. library implementation uses hash or dict for struct), single string is
  1469. not enough. To overcome this situation, they can take array as value
  1470. as well as string.
  1471. ---------------------------------------------------------------
  1472. <struct>
  1473. <member>
  1474. <name>header</name>
  1475. <value>
  1476. <array>
  1477. <data>
  1478. <value><string>Accept-Language: ja</string></value>
  1479. <value><string>Accept-Charset: utf-8</string></value>
  1480. </data>
  1481. </array>
  1482. </value>
  1483. </member>
  1484. </struct>
  1485. ---------------------------------------------------------------
  1486. Sample XML-RPC Client Code
  1487. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  1488. The following Ruby script adds 'http://localhost/aria2.tar.bz2' to
  1489. aria2c operated on localhost with option *--dir*='/downloads' and
  1490. prints its reponse.
  1491. ----------------------------------------------
  1492. #!/usr/bin/env ruby
  1493. require 'xmlrpc/client'
  1494. require 'pp'
  1495. client=XMLRPC::Client.new2("http://localhost:6800/rpc")
  1496. options={ "dir" => "/downloads" }
  1497. result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options)
  1498. pp result
  1499. ----------------------------------------------
  1500. If you are a Python lover, you can use xmlrpclib(for Python3.x, use
  1501. xmlrpc.client instead) to interact with aria2.
  1502. ----------------------------------------------
  1503. import xmlrpclib
  1504. from pprint import pprint
  1505. s = xmlrpclib.ServerProxy("http://localhost:6800/rpc")
  1506. r = s.aria2.addUri(["http://localhost/aria2.tar.bz2"], {"dir":"/downloads"})
  1507. pprint(r)
  1508. ----------------------------------------------
  1509. EXAMPLE
  1510. -------
  1511. HTTP/FTP Segmented Download
  1512. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1513. Download a file
  1514. ^^^^^^^^^^^^^^^
  1515. --------------------------------
  1516. aria2c "http://host/file.zip"
  1517. --------------------------------
  1518. [NOTE]
  1519. To stop a download, press Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory. You can change URIs as long as they are pointing to the same file.
  1520. Download a file from 2 different HTTP servers
  1521. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1522. ------------------------------------------------------
  1523. aria2c "http://host/file.zip" "http://mirror/file.zip"
  1524. ------------------------------------------------------
  1525. Download a file from HTTP and FTP servers
  1526. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1527. -----------------------------------------------------
  1528. aria2c "http://host1/file.zip" "ftp://host2/file.zip"
  1529. -----------------------------------------------------
  1530. Download files listed in a text file concurrently
  1531. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1532. ------------------------
  1533. aria2c -ifiles.txt -j2
  1534. ------------------------
  1535. [NOTE]
  1536. -j option specifies the number of parallel downloads.
  1537. Using proxy
  1538. ^^^^^^^^^^^
  1539. For HTTP:
  1540. ----------------------------------------------------------
  1541. aria2c --http-proxy="http://proxy:8080" "http://host/file"
  1542. ----------------------------------------------------------
  1543. ----------------------------------------------------------
  1544. aria2c --http-proxy="http://proxy:8080" --no-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://host/file"
  1545. ----------------------------------------------------------
  1546. For FTP:
  1547. --------------------------------------------------------
  1548. aria2c --ftp-proxy="http://proxy:8080" "ftp://host/file"
  1549. --------------------------------------------------------
  1550. [NOTE]
  1551. See *--http-proxy*, *--https-proxy*, *--ftp-proxy*, *--all-proxy* and
  1552. *--no-proxy* for details. You can specify proxy in the environment
  1553. variables. See *ENVIRONMENT* section.
  1554. Proxy with authorization
  1555. ^^^^^^^^^^^^^^^^^^^^^^^^
  1556. ----------------------------------------------------------------------------
  1557. aria2c --http-proxy="http://username:password@proxy:8080" "http://host/file"
  1558. ----------------------------------------------------------------------------
  1559. ----------------------------------------------------------------------------
  1560. aria2c --http-proxy="http://proxy:8080" --http-proxy-user="username" --http-proxy-passwd="password" "http://host/file"
  1561. ----------------------------------------------------------------------------
  1562. Metalink Download
  1563. ~~~~~~~~~~~~~~~~~
  1564. Download files with remote Metalink
  1565. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1566. --------------------------------------------------------
  1567. aria2c --follow-metalink=mem "http://host/file.metalink"
  1568. --------------------------------------------------------
  1569. Download using a local metalink file
  1570. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1571. ----------------------------------------------------------
  1572. aria2c -p --lowest-speed-limit=4000 file.metalink
  1573. ----------------------------------------------------------
  1574. [NOTE]
  1575. To stop a download, press Ctrl-C.
  1576. You can resume the transfer by running aria2c with the same argument in the same
  1577. directory.
  1578. Download several local metalink files
  1579. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1580. ----------------------------------------
  1581. aria2c -j2 file1.metalink file2.metalink
  1582. ----------------------------------------
  1583. Download only selected files using index
  1584. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1585. -------------------------------------------
  1586. aria2c --select-file=1-4,8 file.metalink
  1587. -------------------------------------------
  1588. [NOTE]
  1589. The index is printed to the console using -S option.
  1590. Download a file using a local .metalink file with user preference
  1591. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1592. ------------------------------------------------------------------------------
  1593. aria2c --metalink-location=jp,us --metalink-version=1.1 --metalink-language=en-US file.metalink
  1594. ------------------------------------------------------------------------------
  1595. BitTorrent Download
  1596. ~~~~~~~~~~~~~~~~~~~
  1597. Download files from remote BitTorrent file
  1598. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1599. ------------------------------------------------------
  1600. aria2c --follow-torrent=mem "http://host/file.torrent"
  1601. ------------------------------------------------------
  1602. Download using a local torrent file
  1603. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1604. ---------------------------------------------
  1605. aria2c --max-upload-limit=40K file.torrent
  1606. ---------------------------------------------
  1607. [NOTE]
  1608. --max-upload-limit specifies the max of upload rate.
  1609. [NOTE]
  1610. To stop a download, press Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory.
  1611. Download using BitTorrent Magnet URI
  1612. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1613. ------------------------------------------------------------------------------
  1614. aria2c "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C&dn=aria2"
  1615. ------------------------------------------------------------------------------
  1616. [NOTE]
  1617. Don't forget to quote BitTorrent Magnet URI which includes "&"
  1618. character with single(') or double(") quotation.
  1619. Download 2 torrents
  1620. ^^^^^^^^^^^^^^^^^^^
  1621. --------------------------------------
  1622. aria2c -j2 file1.torrent file2.torrent
  1623. --------------------------------------
  1624. Download a file using torrent and HTTP/FTP server
  1625. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1626. ------------------------------------------------------------
  1627. aria2c -Ttest.torrent "http://host1/file" "ftp://host2/file"
  1628. ------------------------------------------------------------
  1629. [NOTE]
  1630. Downloading multi file torrent with HTTP/FTP is not supported.
  1631. Download only selected files using index(usually called "selectable download")
  1632. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1633. ---------------------------------------
  1634. aria2c --select-file=1-4,8 file.torrent
  1635. ---------------------------------------
  1636. [NOTE]
  1637. The index is printed to the console using -S option.
  1638. Specify output filename
  1639. ^^^^^^^^^^^^^^^^^^^^^^^
  1640. To specify output filename for BitTorrent downloads, you need to know
  1641. the index of file in torrent file using *-S* option. For example, the
  1642. output looks like this:
  1643. --------------------------
  1644. idx|path/length
  1645. ===+======================
  1646. 1|dist/base-2.6.18.iso
  1647. |99.9MiB
  1648. ---+----------------------
  1649. 2|dist/driver-2.6.18.iso
  1650. |169.0MiB
  1651. ---+----------------------
  1652. --------------------------
  1653. To save 'dist/base-2.6.18.iso' in '/tmp/mydir/base.iso' and
  1654. 'dist/driver-2.6.18.iso' in '/tmp/dir/driver.iso', use the following
  1655. command:
  1656. -----------------------------------------------------------------------------------------
  1657. aria2c --dir=/tmp --index-out=1=mydir/base.iso --index-out=2=dir/driver.iso file.torrent
  1658. -----------------------------------------------------------------------------------------
  1659. Change the listening port for incoming peer
  1660. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1661. ---------------------------------------------------
  1662. aria2c --listen-port=7000-7001,8000 file.torrent
  1663. ---------------------------------------------------
  1664. [NOTE]
  1665. Since aria2 doesn't configure firewall or router for port forwarding, it's up
  1666. to you to do it manually.
  1667. Specify the condition to stop program after torrent download finished
  1668. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1669. -------------------------------------------------------
  1670. aria2c --seed-time=120 --seed-ratio=1.0 file.torrent
  1671. -------------------------------------------------------
  1672. [NOTE]
  1673. In the above example, the program exits when the 120 minutes has elapsed since download completed or seed ratio reaches 1.0.
  1674. Throttle upload speed
  1675. ^^^^^^^^^^^^^^^^^^^^^
  1676. ----------------------------------------------
  1677. aria2c --max-upload-limit=100K file.torrent
  1678. ----------------------------------------------
  1679. Enable IPv4 DHT
  1680. ^^^^^^^^^^^^^^^
  1681. ---------------------------------------------------------
  1682. aria2c --enable-dht --dht-listen-port=6881 file.torrent
  1683. ---------------------------------------------------------
  1684. [NOTE]
  1685. DHT uses udp port. Since aria2 doesn't configure firewall or router for port
  1686. forwarding, it's up to you to do it manually.
  1687. Enable IPv6 DHT
  1688. ^^^^^^^^^^^^^^^
  1689. -----------------------------------------------------------------------------------------------------------
  1690. aria2c --enable-dht6 --dht-listen-port=6881 --dht-listen-addr6=YOUR_GLOBAL_UNICAST_ADDR --enable-async-dns6
  1691. -----------------------------------------------------------------------------------------------------------
  1692. [NOTE]
  1693. If aria2c is not built with c-ares, *--enable-async-dns6* is
  1694. unnecessary. aria2 shares same port between IPv4 and IPv6 DHT.
  1695. Add and remove tracker URI
  1696. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  1697. Removes all tracker announce URIs described in file.torrent and use
  1698. http://tracker1/announce and http://tracker2/announce instead.
  1699. ---------------------------------------------------------------------------------------------------------
  1700. aria2c --bt-exclude-tracker="*" --bt-tracker="http://tracker1/announce,http://tracker2/announce" file.torrent
  1701. ---------------------------------------------------------------------------------------------------------
  1702. More advanced HTTP features
  1703. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1704. Load cookies
  1705. ^^^^^^^^^^^^
  1706. --------------------------------------------------------
  1707. aria2c --load-cookies=cookies.txt "http://host/file.zip"
  1708. --------------------------------------------------------
  1709. [NOTE]
  1710. You can use Firefox/Mozilla/Chromium's cookie file without modification.
  1711. Resume download started by web browsers or another programs
  1712. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1713. -------------------------------------------------------
  1714. aria2c -c -s2 "http://host/partiallydownloadedfile.zip"
  1715. -------------------------------------------------------
  1716. Client certificate authorization for SSL/TLS
  1717. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1718. ------------------------------------------------------------------------------------------
  1719. aria2c --certificate=/path/to/mycert.pem --private-key=/path/to/mykey.pem https://host/file
  1720. ------------------------------------------------------------------------------------------
  1721. [NOTE]
  1722. The file specified in *--private-key* must be decrypted. The behavior when
  1723. encrypted one is given is undefined.
  1724. Verify peer in SSL/TLS using given CA certificates
  1725. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1726. ------------------------------------------------------------------------------------------
  1727. aria2c --ca-certificate=/path/to/ca-certificates.crt --check-certificate https://host/file
  1728. ------------------------------------------------------------------------------------------
  1729. And more advanced features
  1730. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  1731. Throttle download speed
  1732. ^^^^^^^^^^^^^^^^^^^^^^^
  1733. -------------------------------------------------
  1734. aria2c --max-download-limit=100K file.metalink
  1735. -------------------------------------------------
  1736. Repair a damaged download
  1737. ^^^^^^^^^^^^^^^^^^^^^^^^^
  1738. -----------------------
  1739. aria2c -V file.metalink
  1740. -----------------------
  1741. [NOTE]
  1742. This option is only available used with BitTorrent or metalink with chunk
  1743. checksums.
  1744. Drop connection if download speed is lower than specified value
  1745. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1746. ------------------------------------------------
  1747. aria2c --lowest-speed-limit=10K file.metalink
  1748. ------------------------------------------------
  1749. Parameterized URI support
  1750. ^^^^^^^^^^^^^^^^^^^^^^^^^
  1751. You can specify set of parts:
  1752. -----------------------------------------------
  1753. aria2c -P "http://{host1,host2,host3}/file.iso"
  1754. -----------------------------------------------
  1755. You can specify numeric sequence:
  1756. ---------------------------------------------
  1757. aria2c -Z -P "http://host/image[000-100].png"
  1758. ---------------------------------------------
  1759. [NOTE]
  1760. -Z option is required if the all URIs don't point to the same file, such as the above example.
  1761. You can specify step counter:
  1762. -------------------------------------------
  1763. aria2c -Z -P "http://host/image[A-Z:2].png"
  1764. -------------------------------------------
  1765. Parallel downloads of arbitrary number of URI,metalink,torrent
  1766. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1767. --------------------------------------------------------------
  1768. aria2c -j3 -Z "http://host/file1" file2.torrent file3.metalink
  1769. --------------------------------------------------------------
  1770. BitTorrent Encryption
  1771. ^^^^^^^^^^^^^^^^^^^^^
  1772. Encrypt whole payload using ARC4:
  1773. -------------------------------------------------------------------------
  1774. aria2c --bt-min-crypto-level=arc4 --bt-require-crypto=true file.torrent
  1775. -------------------------------------------------------------------------
  1776. SEE ALSO
  1777. --------
  1778. Project Web Site: http://aria2.sourceforge.net/
  1779. aria2 Wiki: http://sourceforge.net/apps/trac/aria2/wiki
  1780. Metalink Homepage: http://www.metalinker.org/
  1781. The Metalink Download Description Format: http://tools.ietf.org/html/rfc5854
  1782. COPYRIGHT
  1783. ---------
  1784. Copyright (C) 2006, 2010 Tatsuhiro Tsujikawa
  1785. This program is free software; you can redistribute it and/or modify
  1786. it under the terms of the GNU General Public License as published by
  1787. the Free Software Foundation; either version 2 of the License, or
  1788. (at your option) any later version.
  1789. This program is distributed in the hope that it will be useful,
  1790. but WITHOUT ANY WARRANTY; without even the implied warranty of
  1791. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1792. GNU General Public License for more details.
  1793. You should have received a copy of the GNU General Public License
  1794. along with this program; if not, write to the Free Software
  1795. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  1796. In addition, as a special exception, the copyright holders give
  1797. permission to link the code of portions of this program with the
  1798. OpenSSL library under certain conditions as described in each
  1799. individual source file, and distribute linked combinations
  1800. including the two.
  1801. You must obey the GNU General Public License in all respects
  1802. for all of the code used other than OpenSSL. If you modify
  1803. file(s) with this exception, you may extend this exception to your
  1804. version of the file(s), but you are not obligated to do so. If you
  1805. do not wish to do so, delete this exception statement from your
  1806. version. If you delete this exception statement from all source
  1807. files in the program, then also delete it here.