aria2c.1.txt 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704
  1. ARIA2C(1)
  2. =========
  3. Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
  4. :man source: Aria2
  5. :man manual: Aria2 Manual
  6. NAME
  7. ----
  8. aria2c - The ultra fast download utility
  9. SYNOPSIS
  10. --------
  11. aria2c ['OPTIONS'] ['URL' | 'TORRENT_FILE' | 'METALINK_FILE']...
  12. DESCRIPTION
  13. -----------
  14. aria2 is a utility for downloading files. The supported protocols are
  15. HTTP(S), FTP, BitTorrent, and Metalink. aria2 can download a file from
  16. multiple sources/protocols and tries to utilize your maximum download
  17. bandwidth. It supports downloading a file from HTTP(S)/FTP and
  18. BitTorrent at the same time, while the data downloaded from
  19. HTTP(S)/FTP is uploaded to the BitTorrent swarm. Using Metalink's
  20. chunk checksums, aria2 automatically validates chunks of data while
  21. downloading a file like BitTorrent.
  22. OPTIONS
  23. -------
  24. Basic Options
  25. ~~~~~~~~~~~~~
  26. *-d*, *--dir*=DIR::
  27. The directory to store the downloaded file.
  28. *-i*, *--input-file*=FILE::
  29. Downloads URIs found in FILE. You can specify multiple URIs for a single
  30. entity: separate URIs on a single line using the TAB character.
  31. Reads input from stdin when '-' is specified.
  32. The additional *out* and *dir* options can be specified after each line of
  33. URIs. This optional line must start with white space(s).
  34. See *Input File* subsection for details.
  35. *-l*, *--log*=LOG::
  36. The file name of the log file. If '-' is specified, log is written to
  37. stdout.
  38. *-j*, *--max-concurrent-downloads*=N::
  39. Set maximum number of parallel downloads for every static (HTTP/FTP) URL,
  40. torrent and metalink. See also *-s* and *-C* option.
  41. Default: '5'
  42. *-V*, *--check-integrity*[='true'|'false']::
  43. Check file integrity by validating piece hashes.
  44. This option has effect only in BitTorrent and Metalink downloads with
  45. chunk checksums.
  46. Use this option to re-download a damaged portion of a file.
  47. Default: 'false'
  48. *-c*, *--continue*::
  49. Continue downloading a partially downloaded file.
  50. Use this option to resume a download started by a web browser or another
  51. program which downloads files sequentially from the beginning.
  52. Currently this option is only applicable to HTTP(S)/FTP downloads.
  53. *-h*, *--help*[=TAG|KEYWORD]::
  54. The help messages are classified with tags. A tag starts with
  55. "#". For example, type "--help=#http" to get the usage for the
  56. options tagged with "#http". If non-tag word is given, print the
  57. usage for the options whose name includes that word.
  58. Available Values: '#basic', '#advanced', '#http', '#https', '#ftp',
  59. '#metalink', '#bittorrent', '#cookie', '#hook', '#file',
  60. '#xml-rpc', '#experimental', '#all'
  61. Default: '#basic'
  62. HTTP/FTP Options
  63. ~~~~~~~~~~~~~~~~
  64. *--all-proxy*=PROXY::
  65. Use this proxy server for all protocols.
  66. You can override this setting and specify a proxy server for a particular
  67. protocol using *--http-proxy*, *--https-proxy* and *--ftp-proxy* options.
  68. This affects all URLs.
  69. The format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
  70. *--connect-timeout*=SEC::
  71. Set the connect timeout in seconds to establish connection to
  72. HTTP/FTP/proxy server. After the connection is established, this
  73. option makes no effect and *--timeout* option is used instead.
  74. Default: '60'
  75. *--dry-run*[='true'|'false']::
  76. If 'true' is given, aria2 just checks whether the remote file is
  77. available and doesn't download data. This option has effect on
  78. HTTP/FTP download. BitTorrent downloads are canceled if 'true' is
  79. specified. Default: 'false'
  80. *--lowest-speed-limit*=SPEED::
  81. Close connection if download speed is lower than or equal to this
  82. value(bytes per sec).
  83. '0' means aria2 does not have a lowest speed limit.
  84. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  85. This option does not affect BitTorrent downloads.
  86. Default: '0'
  87. *--max-file-not-found*=NUM::
  88. If aria2 receives `file not found' status from the remote HTTP/FTP
  89. servers NUM times without getting a single byte, then force the
  90. download to fail. Specify '0' to disable this option. This options is
  91. effective only when using HTTP/FTP servers.
  92. Default: '0'
  93. *-m*, *--max-tries*=N::
  94. Set number of tries. '0' means unlimited.
  95. Default: '5'
  96. *-n*, *--no-netrc*::
  97. Disables netrc support. netrc support is enabled by default.
  98. *--no-proxy*=DOMAINS::
  99. Specify comma separated hostnames or domains where proxy should not be
  100. used.
  101. *-o*, *--out*=FILE::
  102. The file name of the downloaded file.
  103. [NOTE]
  104. In Metalink or BitTorrent download you cannot specify file name.
  105. The file name specified here is only used when the URLs fed to aria2
  106. are done by command line without *-i*, *-Z* option. For example:
  107. aria2c -o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip"
  108. *--proxy-method*=METHOD::
  109. Set the method to use in proxy request. 'METHOD' is either 'get' or
  110. 'tunnel'. HTTPS downloads always use 'tunnel' regardless of this
  111. option.
  112. Default: 'get'
  113. *-R*, *--remote-time*[='true'|'false']::
  114. Retrieve timestamp of the remote file from the remote HTTP/FTP
  115. server and if it is available, apply it to the local file.
  116. Default: 'false'
  117. *--server-stat-of*=FILE::
  118. Specify the filename to which performance profile of the servers is
  119. saved. You can load saved data using *--server-stat-if* option. See
  120. *Server Performance Profile* subsection below for file format.
  121. *--server-stat-if*=FILE::
  122. Specify the filename to load performance profile of the servers. The
  123. loaded data will be used in some URI selector such as 'feedback'.
  124. See also *--uri-selector* option. See *Server Performance Profile*
  125. subsection below for file format.
  126. *--server-stat-timeout*=SEC::
  127. Specifies timeout in seconds to invalidate performance profile of
  128. the servers since the last contact to them.
  129. Default: '86400' (24hours)
  130. *-s*, *--split*=N::
  131. Download a file using N connections.
  132. If more than N URLs are given, first N URLs are used and remaining URLs are
  133. used for backup.
  134. If less than N URLs are given, those URLs are used more than once so that N
  135. connections total are made simultaneously.
  136. Please see *-j* option too.
  137. Please note that in Metalink download, this option has no effect and use
  138. *-C* option instead.
  139. Default: '5'
  140. *-t*, *--timeout*=SEC::
  141. Set timeout in seconds.
  142. Default: '60'
  143. *--uri-selector*=SELECTOR::
  144. Specify URI selection algorithm. The possible values are 'inorder',
  145. 'feedback' and 'adaptive'. If 'inorder' is given, URI is tried in
  146. the order appeared in the URI list. If 'feedback' is given, aria2
  147. uses download speed observed in the previous downloads and choose
  148. fastest server in the URI list. This also effectively skips dead
  149. mirrors. The observed download speed is a part of performance
  150. profile of servers mentioned in *--server-stat-of* and
  151. *--server-stat-if* options. If 'adaptive' is given, selects one of
  152. the best mirrors for the first and reserved connections. For
  153. supplementary ones, it returns mirrors which has not been tested
  154. yet, and if each of them has already been tested, returns mirrors
  155. which has to be tested again. Otherwise, it doesn't select anymore
  156. mirrors. Like 'feedback', it uses a performance profile of servers.
  157. Default: 'feedback'
  158. HTTP Specific Options
  159. ~~~~~~~~~~~~~~~~~~~~~
  160. *--ca-certificate*=FILE::
  161. Use the certificate authorities in FILE to verify the peers.
  162. The certificate file must be in PEM format and can contain multiple CA
  163. certificates.
  164. Use *--check-certificate* option to enable verification.
  165. *--certificate*=FILE::
  166. Use the client certificate in FILE.
  167. The certificate must be in PEM format.
  168. You may use *--private-key* option to specify the private key.
  169. *--check-certificate*[='true'|'false']::
  170. Verify the peer using certificates specified in *--ca-certificate* option.
  171. Default: 'true'
  172. *--http-auth-challenge*[='true'|'false']::
  173. Send HTTP authorization header only when it is requested by the
  174. server. If 'false' is set, then authorization header is always sent
  175. to the server. There is an exception: if username and password are
  176. embedded in URI, authorization header is always sent to the server
  177. regardless of this option. Default: 'false'
  178. *--http-auth-scheme*=SCHEME::
  179. Set HTTP authentication scheme.
  180. Currently, 'basic' is the only supported scheme.
  181. Default: 'basic'
  182. *--http-user*=USER::
  183. Set HTTP user. This affects all URLs.
  184. *--http-passwd*=PASSWD::
  185. Set HTTP password. This affects all URLs.
  186. *--http-proxy*=PROXY::
  187. Use this proxy server for HTTP. See also *--all-proxy* option.
  188. This affects all URLs.
  189. The format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
  190. *--https-proxy*=PROXY::
  191. Use this proxy server for HTTPS. See also *--all-proxy* option.
  192. This affects all URLs.
  193. The format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
  194. *--private-key*=FILE::
  195. Use the private key in FILE.
  196. The private key must be decrypted and in PEM format.
  197. The behavior when encrypted one is given is undefined.
  198. See also *--certificate* option.
  199. *--referer*=REFERER::
  200. Set Referer. This affects all URLs.
  201. *--enable-http-keep-alive*[='true'|'false']::
  202. Enable HTTP/1.1 persistent connection.
  203. Default: 'true'
  204. *--enable-http-pipelining*[='true'|'false']::
  205. Enable HTTP/1.1 pipelining.
  206. Default: 'false'
  207. *--header*=HEADER::
  208. Append HEADER to HTTP request header.
  209. You can use this option repeatedly to specify more than one header:
  210. aria2c *--header*="X-A: b78" *--header*="X-B: 9J1" "http://host/file"
  211. *--load-cookies*=FILE::
  212. Load Cookies from FILE using the Firefox3 format (SQLite3) and the
  213. Mozilla/Firefox(1.x/2.x)/Netscape format.
  214. [NOTE]
  215. If aria2 is built without libsqlite3, then it doesn't support Firefox3 cookie format.
  216. *--save-cookies*=FILE::
  217. Save Cookies to FILE in Mozilla/Firefox(1.x/2.x)/ Netscape
  218. format. If FILE already exists, it is overwritten. Session Cookies
  219. are also saved and their expiry values are treated as 0. Possible
  220. Values: '/path/to/file'
  221. *--use-head*[='true'|'false']::
  222. Use HEAD method for the first request to the HTTP server.
  223. Default: 'false'
  224. *-U*, *--user-agent*=USER_AGENT::
  225. Set user agent for HTTP(S) downloads.
  226. Default: 'aria2/$VERSION', $VERSION is replaced by package version.
  227. FTP Specific Options
  228. ~~~~~~~~~~~~~~~~~~~~
  229. *--ftp-user*=USER::
  230. Set FTP user. This affects all URLs.
  231. Default: 'anonymous'
  232. *--ftp-passwd*=PASSWD::
  233. Set FTP password. This affects all URLs.
  234. Default: 'ARIA2USER@'
  235. *-p*, *--ftp-pasv*[='true'|'false']::
  236. Use the passive mode in FTP.
  237. If 'false' is given, the active mode will be used.
  238. Default: 'true'
  239. *--ftp-proxy*=PROXY::
  240. Use this proxy server for FTP. See also *--all-proxy* option.
  241. This affects all URLs.
  242. The format of PROXY is [\http://][USER:PASSWORD@]HOST[:PORT]
  243. *--ftp-type*=TYPE::
  244. Set FTP transfer type. TYPE is either 'binary' or 'ascii'.
  245. Default: 'binary'
  246. *--ftp-reuse-connection*[='true'|'false']::
  247. Reuse connection in FTP.
  248. Default: 'true'
  249. BitTorrent/Metalink Options
  250. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  251. *--select-file*=INDEX...::
  252. Set file to download by specifying its index.
  253. You can find the file index using the *--show-files* option.
  254. Multiple indexes can be specified by using ",", for example: '3,6'.
  255. You can also use "-" to specify a range: '1-5'.
  256. "," and "-" can be used together: '1-5,8,9'.
  257. When used with the -M option, index may vary depending on the query
  258. (see *--metalink-** options).
  259. [NOTE]
  260. In multi file torrent, the adjacent files specified by this option may
  261. also be downloaded. This is by design, not a bug.
  262. A single piece may include several files or part of files, and aria2
  263. writes the piece to the appropriate files.
  264. *-S*, *--show-files*::
  265. Print file listing of .torrent or .metalink file and exit.
  266. In case of .torrent file, additional information
  267. (infohash, piece length, etc) is also printed.
  268. BitTorrent Specific Options
  269. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  270. *--bt-external-ip*=IPADDRESS::
  271. Specify the external IP address to report to a BitTorrent
  272. tracker. Although this function is named "external", it can accept
  273. any kind of IP addresses. IPADDRESS must be a numeric IP address.
  274. *--bt-hash-check-seed*[='true'|'false']::
  275. If 'true' is given, after hash check using *--check-integrity* option and
  276. file is complete, continue to seed file. If you want to check file
  277. and download it only when it is damaged or incomplete, set this
  278. option to 'false'. This option has effect only on BitTorrent download.
  279. Default: 'true'
  280. *--bt-max-open-files*=NUM::
  281. Specify maximum number of files to open in each BitTorrent download.
  282. Default: '100'
  283. *--bt-max-peers*=NUM::
  284. Specify the maximum number of peers per torrent. '0' means
  285. unlimited. See also *--bt-request-peer-speed-limit* option.
  286. Default: '55'
  287. *--bt-min-crypto-level*='plain'|'arc4'::
  288. Set minimum level of encryption method.
  289. If several encryption methods are provided by a peer, aria2 chooses the lowest
  290. one which satisfies the given level.
  291. Default: 'plain'
  292. *--bt-require-crypto*='true'|'false'::
  293. If true is given, aria2 doesn't accept and establish connection with legacy
  294. BitTorrent handshake(\19BitTorrent protocol).
  295. Thus aria2 always uses Obfuscation handshake.
  296. Default: 'false'
  297. *--bt-request-peer-speed-limit*=SPEED::
  298. If the whole download speed of every torrent is lower than SPEED,
  299. aria2 temporarily increases the number of peers to try for more
  300. download speed. Configuring this option with your preferred download
  301. speed can increase your download speed in some cases.
  302. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  303. Default: '50K'
  304. *--bt-seed-unverified*[='true'|'false']::
  305. Seed previously downloaded files without verifying piece hashes.
  306. Default: 'false'
  307. *--bt-stop-timeout*=SEC::
  308. Stop BitTorrent download if download speed is 0 in consecutive SEC
  309. seconds. If '0' is given, this feature is disabled. Default: '0'
  310. *--bt-tracker-interval*=SEC::
  311. Set the interval in seconds between tracker requests. This
  312. completely overrides interval value and aria2 just uses this value
  313. and ignores the min interval and interval value in the response of
  314. tracker. If '0' is set, aria2 determines interval based on the
  315. response of tracker and the download progress. Default: '0'
  316. *--dht-entry-point*=HOST:PORT::
  317. Set host and port as an entry point to DHT network.
  318. *--dht-file-path*=PATH::
  319. Change the DHT routing table file to PATH.
  320. Default: '$HOME/.aria2/dht.dat'
  321. *--dht-listen-port*=PORT...::
  322. Set UDP listening port for DHT.
  323. Multiple ports can be specified by using ",", for example: '6881,6885'.
  324. You can also use "-" to specify a range: '6881-6999'. "," and "-" can be used
  325. together.
  326. Default: '6881-6999'
  327. [NOTE]
  328. Make sure that the specified ports are open for incoming UDP traffic.
  329. *--enable-dht*[='true'|'false']::
  330. Enable DHT functionality. If a private flag is set in a torrent, aria2
  331. doesn't use DHT for that download even if 'true' is given.
  332. Default: 'false'
  333. *--enable-peer-exchange*[='true'|'false']::
  334. Enable Peer Exchange extension. If a private flag is set in a torrent, this
  335. feature is disabled for that download even if 'true' is given.
  336. Default: 'true'
  337. *--follow-torrent*='true'|'false'|'mem'::
  338. If 'true' or 'mem' is specified, when a file whose suffix is ".torrent" or content
  339. type is "application/x-bittorrent" is downloaded, aria2 parses it as a torrent
  340. file and downloads files mentioned in it.
  341. If 'mem' is specified, a torrent file is not written to the disk, but is just
  342. kept in memory.
  343. If 'false' is specified, the action mentioned above is not taken.
  344. Default: 'true'
  345. *-O*, *--index-out*=INDEX=PATH::
  346. Set file path for file with index=INDEX. You can find the file index
  347. using the *--show-files* option. PATH is a relative path to the
  348. path specified in *--dir* option. You can use this option multiple
  349. times. Using this option, you can specify the output filenames of
  350. BitTorrent downloads.
  351. *--listen-port*=PORT...::
  352. Set TCP port number for BitTorrent downloads.
  353. Multiple ports can be specified by using ",", for example: '6881,6885'.
  354. You can also use "-" to specify a range: '6881-6999'.
  355. "," and "-" can be used together: '6881-6889,6999'.
  356. Default: '6881-6999'
  357. [NOTE]
  358. Make sure that the specified ports are open for incoming TCP traffic.
  359. *--max-overall-upload-limit*=SPEED::
  360. Set max overall upload speed in bytes/sec.
  361. '0' means unrestricted.
  362. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  363. To limit the upload speed per torrent, use *--max-upload-limit* option.
  364. Default: '0'
  365. *-u*, *--max-upload-limit*=SPEED::
  366. Set max upload speed per each torrent in bytes/sec.
  367. '0' means unrestricted.
  368. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  369. To limit the overall upload speed, use *--max-overall-upload-limit* option.
  370. Default: '0'
  371. *--peer-id-prefix*=PEER_ID_PREFIX::
  372. Specify the prefix of peer ID. The peer ID in
  373. BitTorrent is 20 byte length. If more than 20
  374. bytes are specified, only first 20 bytes are
  375. used. If less than 20 bytes are specified, random
  376. byte data are added to make its length 20 bytes.
  377. Default: 'aria2/$VERSION-', $VERSION is replaced by package version.
  378. *--seed-ratio*=RATIO::
  379. Specify share ratio. Seed completed torrents until share ratio reaches
  380. RATIO.
  381. You are strongly encouraged to specify equals or more than '1.0' here.
  382. Specify '0.0' if you intend to do seeding regardless of share ratio.
  383. If *--seed-time* option is specified along with this option, seeding ends when
  384. at least one of the conditions is satisfied.
  385. Default: '1.0'
  386. *--seed-time*=MINUTES::
  387. Specify seeding time in minutes. Also see the *--seed-ratio* option.
  388. *-T*, *--torrent-file*=TORRENT_FILE::
  389. The path to the .torrent file.
  390. You are not required to use this option because you can specify a torrent file without -T.
  391. Metalink Specific Options
  392. ~~~~~~~~~~~~~~~~~~~~~~~~~
  393. *--follow-metalink*='true'|'false'|'mem'::
  394. If 'true' or 'mem' is specified, when a file whose suffix is ".metaink" or content
  395. type of "application/metalink+xml" is downloaded, aria2 parses it as a metalink
  396. file and downloads files mentioned in it.
  397. If 'mem' is specified, a metalink file is not written to the disk, but is just
  398. kept in memory.
  399. If 'false' is specified, the action mentioned above is not taken.
  400. Default: 'true'
  401. *-M*, *--metalink-file*=METALINK_FILE::
  402. The file path to .metalink file. You are not required to use this option because you can
  403. specify a metalink file without -M.
  404. *-C*, *--metalink-servers*=NUM_SERVERS::
  405. The number of servers to connect to simultaneously.
  406. Some Metalinks regulate the number of servers to connect.
  407. aria2 strictly respects them.
  408. This means that if Metalink defines the maxconnections attribute lower
  409. than NUM_SERVERS, then aria2 uses the value of maxconnections attribute
  410. instead of NUM_SERVERS.
  411. See also *-s* and *-j* options.
  412. Default: '5'
  413. *--metalink-language*=LANGUAGE::
  414. The language of the file to download.
  415. *--metalink-location*=LOCATION[,...]::
  416. The location of the preferred server.
  417. A comma-delimited list of locations is acceptable, for example, 'JP,US'.
  418. *--metalink-os*=OS::
  419. The operating system of the file to download.
  420. *--metalink-version*=VERSION::
  421. The version of the file to download.
  422. *--metalink-preferred-protocol*=PROTO::
  423. Specify preferred protocol.
  424. The possible values are 'http', 'https', 'ftp' and 'none'.
  425. Specify 'none' to disable this feature.
  426. Default: 'none'
  427. *--metalink-enable-unique-protocol*='true'|'false'::
  428. If 'true' is given and several protocols are available for a mirror in a
  429. metalink file, aria2 uses one of them.
  430. Use *--metalink-preferred-protocol* option to specify the preference of
  431. protocol.
  432. Default: 'true'
  433. XML-RPC Options
  434. ~~~~~~~~~~~~~~~
  435. *--enable-xml-rpc*[='true'|'false']::
  436. Enable XML-RPC server. It is strongly recommended to set username
  437. and password using *--xml-rpc-user* and *--xml-rpc-passwd*
  438. option. See also *--xml-rpc-listen-port* option. Default: 'false'
  439. *--xml-rpc-listen-all*[='true'|'false']::
  440. Listen incoming XML-RPC requests on all network interfaces. If false
  441. is given, listen only on local loopback interface. Default: 'false'
  442. *--xml-rpc-listen-port*=PORT::
  443. Specify a port number for XML-RPC server to listen to. Possible
  444. Values: '1024'-'65535' Default: '6800'
  445. *--xml-rpc-max-request-size*=SIZE::
  446. Set max size of XML-RPC request. If aria2 detects the request is
  447. more than SIZE bytes, it drops connection. Default: '2M'
  448. *--xml-rpc-passwd*=PASSWD::
  449. Set XML-RPC password.
  450. *--xml-rpc-user*=USER::
  451. Set XML-RPC user.
  452. Advanced Options
  453. ~~~~~~~~~~~~~~~~
  454. *--allow-overwrite*='true'|'false'::
  455. If 'false' is given, and a file already exists but the corresponding
  456. control file (filename.aria2) doesn't exist, then aria2 will not
  457. re-download the file. See also *--auto-file-renaming* option.
  458. Default: 'false'
  459. *--allow-piece-length-change*='true'|'false'::
  460. If false is given, aria2 aborts download when a piece length is different
  461. from one in a control file.
  462. If true is given, you can proceed but some download progress will be lost.
  463. Default: 'false'
  464. *--async-dns*[='true'|'false']::
  465. Enable asynchronous DNS.
  466. Default: 'true'
  467. *--auto-file-renaming*[='true'|'false']::
  468. Rename file name if the same file already exists.
  469. This option works only in HTTP(S)/FTP download.
  470. The new file name has a dot and a number(1..9999) appended.
  471. Default: 'true'
  472. *--auto-save-interval*=SEC::
  473. Save a control file(*.aria2) every SEC seconds.
  474. If '0' is given, a control file is not saved during download. aria2 saves a
  475. control file when it stops regardless of the value.
  476. The possible values are between '0' to '600'.
  477. Default: '60'
  478. *--conf-path*=PATH::
  479. Change the configuration file path to PATH.
  480. Default: '$HOME/.aria2/aria2.conf'
  481. *-D*, *--daemon*::
  482. Run as daemon. The current working directory will be changed to '/'
  483. and standard input, standard output and standard error will be
  484. redirected to '/dev/null'. Default: 'false'
  485. *--enable-direct-io*[='true'|'false']::
  486. Enable directI/O, which lowers cpu usage while allocating/checking files.
  487. Turn off if you encounter any error.
  488. Default: 'true'
  489. *--event-poll*=POLL::
  490. Specify the method for polling events. The possible Values are
  491. 'epoll' and 'select'. If you use recent Linux that has epoll, then
  492. the default value is 'epoll'. Otherwise, the default value is
  493. 'select'.
  494. *--file-allocation*=METHOD::
  495. Specify file allocation method.
  496. 'none' doesn't pre-allocate file space. 'prealloc' pre-allocates file space
  497. before download begins. This may take some time depending on the size of the
  498. file.
  499. If you are using newer file systems such as ext4
  500. (with extents support), btrfs or xfs, 'falloc' is
  501. your best choice. It allocates large(few GiB)
  502. files almost instantly. Don't use 'falloc' with
  503. legacy file systems such as ext3 because it takes
  504. almost same time as 'prealloc' and it blocks aria2
  505. entirely until allocation finishes. 'falloc' may
  506. not be available if your system doesn't have
  507. *posix_fallocate*() function.
  508. Possible Values: 'none', 'prealloc', 'falloc'
  509. Default: 'prealloc'
  510. *--log-level*=LEVEL::
  511. Set log level to output.
  512. LEVEL is either 'debug', 'info', 'notice', 'warn' or 'error'.
  513. Default: 'debug'
  514. *--on-download-complete*=COMMAND::
  515. Set the command to be executed when download completes. See
  516. *--on-download-start* option for the requirement of COMMAND. See
  517. also *--on-download-stop* option. Possible Values:
  518. '/path/to/command'
  519. *--on-download-error*=COMMAND::
  520. Set the command to be executed when download aborts due to error.
  521. See *--on-download-start* option for the requirement of COMMAND.
  522. See also *--on-download-stop* option. Possible Values:
  523. '/path/to/command'
  524. *--on-download-start*=COMMAND::
  525. Set the command to be executed when download starts up. COMMAND must
  526. take just one argument and GID is passed to COMMAND as a first
  527. argument. Possible Values: '/path/to/command'
  528. *--on-download-stop*=COMMAND::
  529. Set the command to be executed when download stops. You can override
  530. the command to be executed for particular download result using
  531. *--on-download-complete* and *--on-download-error*. If they are
  532. specified, command specified in this option is not executed. See
  533. *--on-download-start* option for the requirement of COMMAND.
  534. Possible Values: '/path/to/command'
  535. *--summary-interval*=SEC::
  536. Set interval in seconds to output download progress summary.
  537. Setting '0' suppresses the output.
  538. Default: '60'
  539. [NOTE]
  540. In multi file torrent downloads, the files adjacent forward to the specified files
  541. are also allocated if they share the same piece.
  542. *-Z*, *--force-sequential*[='true'|'false']::
  543. Fetch URIs in the command-line sequentially and download each URI in a
  544. separate session, like the usual command-line download utilities.
  545. Default: 'false'
  546. *--max-overall-download-limit*=SPEED::
  547. Set max overall download speed in bytes/sec. '0' means
  548. unrestricted. You can append 'K' or 'M'(1K = 1024, 1M = 1024K). To
  549. limit the download speed per download, use *--max-download-limit*
  550. option. Default: '0'
  551. *--max-download-limit*=SPEED::
  552. Set max download speed per each download in bytes/sec. '0' means
  553. unrestricted. You can append 'K' or 'M'(1K = 1024, 1M = 1024K). To
  554. limit the overall download speed, use *--max-overall-download-limit*
  555. option. Default: '0'
  556. *--no-conf*::
  557. Disable loading aria2.conf file.
  558. *--no-file-allocation-limit*=SIZE::
  559. No file allocation is made for files whose size is smaller than SIZE.
  560. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  561. Default: '5M'
  562. *-P*, *--parameterized-uri*[='true'|'false']::
  563. Enable parameterized URI support.
  564. You can specify set of parts: 'http://{sv1,sv2,sv3}/foo.iso'.
  565. Also you can specify numeric sequences with step counter:
  566. '\http://host/image[000-100:2].img'.
  567. A step counter can be omitted.
  568. If all URIs do not point to the same file, such as the second example above,
  569. -Z option is required.
  570. Default: 'false'
  571. *-q*, *--quiet*[='true'|'false']::
  572. Make aria2 quiet (no console output).
  573. Default: 'false'
  574. *--realtime-chunk-checksum*='true'|'false'::
  575. Validate chunk of data by calculating checksum while downloading a file if
  576. chunk checksums are provided.
  577. Default: 'true'
  578. *--stop*=SEC::
  579. Stop application after SEC seconds has passed.
  580. If '0' is given, this feature is disabled.
  581. Default: '0'
  582. *-v*, *--version*::
  583. Print the version number, copyright and the configuration information and
  584. exit.
  585. Options That Take An Optional Argument
  586. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  587. The options that have its argument surrounded by square brackets([])
  588. take an optional argument. Usually omiting the argument is evaluated to 'true'.
  589. If you use short form of these options(such as '-V') and give
  590. an argument, then the option name and its argument should be concatenated(e.g.
  591. '-Vfalse'). If any spaces are inserted between the option name and the argument,
  592. the argument will be treated as URI and usually this is not what you expect.
  593. URL, TORRENT_FILE, METALINK_FILE
  594. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  595. You can specify multiple URLs in command-line.
  596. Unless you specify *-Z* option, all URLs must point to the same file or downloading will fail.
  597. You can also specify arbitrary number of torrent files and metalink files
  598. stored on a local drive. Please note that they are always treated as a
  599. separate download.
  600. You can specify both torrent file with -T option and URLs. By doing
  601. this, you can download a file from both torrent swarm and HTTP(S)/FTP
  602. server at the same time, while the data from HTTP(S)/FTP are uploaded
  603. to the torrent swarm. For single file torrents, URL can be a complete
  604. URL pointing to the resource or if URL ends with /, name in torrent
  605. file in torrent is added. For multi-file torrents, name and path are
  606. added to form a URL for each file.
  607. [NOTE]
  608. Make sure that URL is quoted with single(') or double(") quotation if it
  609. contains "&" or any characters that have special meaning in shell.
  610. Resuming Download
  611. ~~~~~~~~~~~~~~~~~
  612. Usually, you can resume transfer by just issuing same command(aria2c
  613. URL) if the previous transfer is made by aria2.
  614. If the previous transfer is made by a browser or wget like sequential
  615. download manager, then use -c option to continue the transfer(aria2c
  616. *-c* URL).
  617. EXIT STATUS
  618. -----------
  619. Because aria2 can handle multiple downloads at once, it encounters
  620. lots of errors in a session. aria2 returns the following exit status
  621. based on the last error encountered.
  622. *0*::
  623. If all downloads are successful.
  624. *1*::
  625. If an unknown error occurs.
  626. *2*::
  627. If time out occurs.
  628. *3*::
  629. If a resource is not found.
  630. *4*::
  631. If aria2 sees the specfied number of "resource not found" error.
  632. See *--max-file-not-found* option).
  633. *5*::
  634. If a download aborts because download speed is too slow.
  635. See *--lowest-speed-limit* option)
  636. *6*::
  637. If network problem occurs.
  638. *7*::
  639. If there are unfinished downloads. This error is only reported if
  640. all finished downloads are successful and there are unfinished
  641. downloads in a queue when aria2 exits by pressing Ctrl-C by an user
  642. or sending TERM or INT signal.
  643. [NOTE]
  644. An error occurred in a finished download will not be reported
  645. as exit status.
  646. ENVIRONMENT
  647. -----------
  648. aria2 recognizes the following environment variables.
  649. http_proxy [\http://][USER:PASSWORD@]HOST[:PORT]::
  650. Specify proxy server for use in HTTP.
  651. Overrides http-proxy value in configuration file.
  652. The command-line option *--http-proxy* overrides this value.
  653. https_proxy [\http://][USER:PASSWORD@]HOST[:PORT]::
  654. Specify proxy server for use in HTTPS.
  655. Overrides https-proxy value in configuration file.
  656. The command-line option *--https-proxy* overrides this value.
  657. ftp_proxy [\http://][USER:PASSWORD@]HOST[:PORT]::
  658. Specify proxy server for use in FTP.
  659. Overrides ftp-proxy value in configuration file.
  660. The command-line option *--ftp-proxy* overrides this value.
  661. all_proxy [\http://][USER:PASSWORD@]HOST[:PORT]::
  662. Specify proxy server for use if no protocol-specific proxy is specified.
  663. Overrides all-proxy value in configuration file.
  664. The command-line option *--all-proxy* overrides this value.
  665. no_proxy [DOMAIN,...]::
  666. Specify comma-separated hostname or domains to which proxy should not be used.
  667. Overrides no-proxy value in configuration file.
  668. The command-line option *--no-proxy* overrides this value.
  669. FILES
  670. -----
  671. aria2.conf
  672. ~~~~~~~~~~
  673. By default, aria2 parses '$HOME/.aria2/aria2.conf' as a configuraiton
  674. file. You can specify the path to configuration file using
  675. *--conf-path* option. If you don't want to use the configuraitonf
  676. file, use *--no-conf* option.
  677. The configuration file is a text file and has 1 option per each
  678. line. In each line, you can specify name-value pair in the format:
  679. NAME=VALUE, where name is the long command-line option name without
  680. "--" prefix. You can use same syntax for the command-line option. The
  681. lines beginning "#" are treated as comments.
  682. --------------------------------------
  683. # sample configuration file for aria2c
  684. listen-port=60000
  685. dht-listen-port=60000
  686. seed-ratio=1.0
  687. max-upload-limit=50K
  688. ftp-pasv=true
  689. --------------------------------------
  690. dht.dat
  691. ~~~~~~~~
  692. By default, the routing table of DHT is saved to the path $HOME/.aria2/dht.dat.
  693. Control File
  694. ~~~~~~~~~~~~
  695. aria2 uses a control file to track the progress of a download. A
  696. control file is placed in the same directory as the downloading file
  697. and its filename is the filename of downloading file with ".aria2"
  698. appended. For example, if you are downloading file.zip, then the
  699. control file should be file.zip.aria2. (There is a exception for this
  700. naming convention. If you are downloading a multi torrent, its
  701. control file is the "top directory" name of the torrent with ".aria2"
  702. appended. The "top directory" name is a value of "name" key in "info"
  703. directory in a torrent file.)
  704. Usually a control file is deleted once download completed. If aria2
  705. decides that download cannot be resumed(for example, when downloading
  706. a file from a HTTP server which doesn't support resume), a control
  707. file is not created.
  708. Normally if you lose a control file, you cannot resume download. But
  709. if you have a torrent or metalink with chunk checksums for the file,
  710. you can resume the download without a control file by giving -V option
  711. to aria2c in command-line.
  712. Input File
  713. ~~~~~~~~~~
  714. The input file can contain a list of URIs for aria2 to download. You
  715. can specify multiple URIs for a single entity: separate URIs on a
  716. single line using the TAB character.
  717. Each line is treated as if it is provided in command-line argument.
  718. Therefore they are affected by *-Z* and *-P* options.
  719. Additionally, the following options can be specified after each line
  720. of URIs. These optional lines must start with white space(s).
  721. * dir
  722. * check-integrity
  723. * continue
  724. * all-proxy
  725. * connect-timeout
  726. * dry-run
  727. * lowest-speed-limit
  728. * max-file-not-found
  729. * max-tries
  730. * no-proxy
  731. * out
  732. * proxy-method
  733. * remote-time
  734. * split
  735. * timeout
  736. * http-auth-challenge
  737. * http-user
  738. * http-passwd
  739. * http-proxy
  740. * https-proxy
  741. * referer
  742. * enable-http-keep-alive
  743. * enable-http-pipelining
  744. * header
  745. * use-head
  746. * user-agent
  747. * ftp-user
  748. * ftp-passwd
  749. * ftp-pasv
  750. * ftp-proxy
  751. * ftp-type
  752. * ftp-reuse-connection
  753. * no-netrc
  754. * select-file
  755. * bt-external-ip
  756. * bt-hash-check-seed
  757. * bt-max-open-files
  758. * bt-max-peers
  759. * bt-min-crypto-level
  760. * bt-require-crypto
  761. * bt-request-peer-speed-limit
  762. * bt-seed-unverified
  763. * bt-stop-timeout
  764. * bt-tracker-interval
  765. * enable-peer-exchange
  766. * follow-torrent
  767. * index-out
  768. * max-upload-limit
  769. * seed-ratio
  770. * seed-time
  771. * follow-metalink
  772. * metalink-servers
  773. * metalink-language
  774. * metalink-location
  775. * metalink-os
  776. * metalink-version
  777. * metalink-preferred-protocol
  778. * metalink-enable-unique-protocol
  779. * allow-overwrite
  780. * allow-piece-length-change
  781. * async-dns
  782. * auto-file-renaming
  783. * file-allocation
  784. * max-download-limit
  785. * no-file-allocation-limit
  786. * parameterized-uri
  787. * realtime-chunk-checksum
  788. These options have exactly same meaning of the ones in the
  789. command-line options, but it just applies to the URIs it belongs to.
  790. For example, the content of uri.txt is
  791. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  792. http://server/file.iso http://mirror/file.iso
  793. dir=/iso_images
  794. out=file.img
  795. http://foo/bar
  796. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  797. If aria2 is executed with *-i* uri.txt *-d* /tmp options, then
  798. 'file.iso' is saved as '/iso_images/file.img' and it is downloaded
  799. from \http://server/file.iso and \http://mirror/file.iso. The file
  800. 'bar' is downloaded from \http://foo/bar and saved as '/tmp/bar'.
  801. In some cases, *out* parameter has no effect. See note of *--out*
  802. option for the restrictions.
  803. Server Performance Profile
  804. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  805. This section describes the format of server performance profile. The
  806. file is plain text and each line has several NAME=VALUE pair,
  807. delimited by comma. Currently following NAMEs are recognized:
  808. host::
  809. Hostname of the server. Required.
  810. protocol::
  811. Protocol for this profile, such as ftp, http. Required.
  812. dl_speed::
  813. The average download speed observed in the previous download in
  814. bytes per sec. Required.
  815. sc_avg_speed::
  816. The average download speed observed in the previous download in
  817. bytes per sec. This value is only updated if the download is done in
  818. single connection environment and only used by
  819. AdaptiveURISelector. Optional.
  820. mc_avg_speed::
  821. The average download speed observed in the previous download in
  822. bytes per sec. This value is only updated if the download is done in
  823. multi connection environment and only used by
  824. AdaptiveURISelector. Optional.
  825. counter::
  826. How many times the server is used. Currently this value is only used
  827. by AdaptiveURISelector. Optional.
  828. last_updated::
  829. Last contact time in GMT with this server, specified in the seconds
  830. from the Epoch. Required.
  831. status::
  832. ERROR is set when server cannot be reached or out-of-service or
  833. timeout occurred. Otherwise, OK is set.
  834. Those fields must exist in one line. The order of the fields is not
  835. significant. You can put pairs other than the above; they are simply
  836. ignored.
  837. An example follows:
  838. --------------------------------------------------------------------------------
  839. host=localhost, protocol=http, dl_speed=32000, last_updated=1222491640, status=OK
  840. host=localhost, protocol=ftp, dl_speed=0, last_updated=1222491632, status=ERROR
  841. --------------------------------------------------------------------------------
  842. XML-RPC INTERFACE
  843. -----------------
  844. Terminology
  845. ~~~~~~~~~~~
  846. GID::
  847. GID(or gid) is the key to manage each download. Each download has an
  848. unique GID. Currently GID looks like an integer, but don't treat it
  849. as integer because it may be changed to another type in the future
  850. release.
  851. Methods
  852. ~~~~~~~
  853. *aria2.addUri* 'uris[, options[, position]]'
  854. This method adds new HTTP(S)/FTP download. 'uris' is of type array
  855. and its element is URI which is of type string. 'options' is of type
  856. struct and its members are a pair of option name and value. See
  857. *Options* below for more details. If 'position' is given as an
  858. integer starting from 0, the new download is inserted at 'position' in
  859. the waiting queue. If 'position' is not given or 'position' is larger
  860. than the size of the queue, it is appended at the end of the queue.
  861. This method returns GID of registered download.
  862. *aria2.addTorrent* 'torrent[, uris[, options[, position]]]'
  863. This method adds BitTorrent download by uploading .torrent file.
  864. 'torrent' is of type base64 which contains Base64-encoded .torrent
  865. file. 'uris' is of type array and its element is URI which is of type
  866. string. 'uris' is used for Web-seeding. For single file torrents, URI
  867. can be a complete URI pointing to the resource or if URI ends with /,
  868. name in torrent file is added. For multi-file torrents, name and path
  869. in torrent are added to form a URI for each file. 'options' is of
  870. type struct and its members are a pair of option name and value. See
  871. *Options* below for more details. If 'position' is given as an
  872. integer starting from 0, the new download is inserted at 'position' in
  873. the waiting queue. If 'position' is not given or 'position' is larger
  874. than the size of the queue, it is appended at the end of the queue.
  875. This method returns GID of registered download.
  876. *aria2.addMetalink* 'metalink[, options[, position]]'
  877. This method adds Metalink download by uploading .metalink file.
  878. 'metalink' is of type base64 which contains Base64-encoded .metalink
  879. file. 'options' is of type struct and its members are a pair of
  880. option name and value. See *Options* below for more details. If
  881. 'position' is given as an integer starting from 0, the new download is
  882. inserted at 'position' in the waiting queue. If 'position' is not
  883. given or 'position' is larger than the size of the queue, it is
  884. appended at the end of the queue. This method returns array of GID of
  885. registered download.
  886. *aria2.remove* 'gid'
  887. This method removes the download denoted by 'gid'. 'gid' is of type
  888. string. If specified download is in progress, it is stopped at
  889. first. The status of removed download becomes "removed". This method
  890. returns GID of removed download.
  891. *aria2.tellStatus* 'gid'
  892. This method returns download progress of the download denoted by
  893. 'gid'. 'gid' is of type string. The response is of type struct and it
  894. contains following keys. The value type is string.
  895. gid::
  896. GID of this download.
  897. status::
  898. "active" for currently downloading/seeding entry. "waiting" for the
  899. entry in the queue; download is not started. "error" for the stopped
  900. download because of error. "complete" for the stopped and completed
  901. download. "removed" for the download removed by user.
  902. totalLength::
  903. Total length of this download in bytes.
  904. completedLength::
  905. Completed length of this download in bytes.
  906. uploadLength::
  907. Uploaded length of this download in bytes.
  908. bitfield::
  909. Hexadecimal representation of the download progress. The highest bit
  910. corresponds to piece index 0. The set bits indicate the piece is
  911. available and unset bits indicate the piece is missing. The spare
  912. bits at the end are set to zero.
  913. downloadSpeed::
  914. Download speed of this download measured in bytes/sec.
  915. uploadSpeed::
  916. Upload speed of this download measured in bytes/sec.
  917. infoHash::
  918. InfoHash. BitTorrent only.
  919. numSeeders::
  920. The number of seeders the client has connected to. BitTorrent only.
  921. pieceLength::
  922. Piece length in bytes.
  923. numPieces::
  924. The number of pieces.
  925. connections::
  926. The number of peers/servers the client has connected to.
  927. errorCode::
  928. The last error code occurred in this download. The value is of type
  929. string. The error codes are defined in EXIT STATUS section. This
  930. value is only available for stopped/completed downloads.
  931. *aria2.getUris* 'gid'
  932. This method returns URIs used in the download denoted by 'gid'. 'gid'
  933. is of type string. The response is of type array and its element is of
  934. type struct and it contains following keys. The value type is string.
  935. uri::
  936. URI
  937. *aria2.getFiles* 'gid'
  938. This method returns file list of the download denoted by 'gid'. 'gid'
  939. is of type string. The response is of type array and its element is of
  940. type struct and it contains following keys. The value type is string.
  941. index::
  942. Index of file. Starting with 1. This is the same order with the
  943. files in multi-file torrent.
  944. path::
  945. File path.
  946. length::
  947. File size in bytes.
  948. selected::
  949. "true" if this file is selected by *--select-file* option. If
  950. *--select-file* is not specified or this is single torrent or no
  951. torrent download, this value is always "true". Otherwise "false".
  952. *aria2.getPeers* 'gid'
  953. This method returns peer list of the download denoted by 'gid'. 'gid'
  954. is of type string. This method is for BitTorrent only. The response
  955. is of type array and its element is of type struct and it contains
  956. following keys. The value type is string.
  957. peerId::
  958. Percent-encoded peer ID.
  959. ip::
  960. IP address of the peer.
  961. port::
  962. Port number of the peer.
  963. bitfield::
  964. Hexadecimal representation of the download progress of the peer. The
  965. highest bit corresponds to piece index 0. The set bits indicate the
  966. piece is available and unset bits indicate the piece is missing. The
  967. spare bits at the end are set to zero.
  968. amChoking::
  969. "true" if this client is choking the peer. Otherwise "false".
  970. peerChoking::
  971. "true" if the peer is choking this client. Otherwise "false".
  972. downloadSpeed::
  973. Download speed (byte/sec) that this client obtains from the peer.
  974. uploadSpeed::
  975. Upload speed(byte/sec) that this client uploads to the peer.
  976. seeder::
  977. "true" is this client is a seeder. Otherwise "false".
  978. *aria2.tellActive*
  979. This method returns the list of active downloads. The respose is of
  980. type array and its element is the same struct returned by
  981. *aria2.tellStatus* method.
  982. *aria2.tellWaiting* 'offset, num'
  983. This method returns the list of waiting download in the range of
  984. ['offset', 'offset'+'num'). 'offset' is of type integer and specifies
  985. the offset from the download waiting at the front. 'num' is of type
  986. integer and specifies the number of downloads to be returned. For
  987. example, imagine that three downloads "A","B" and "C" are waiting in
  988. this order. aria2.tellWaiting(0, 1) returns "A". aria2.tellWaiting(1,
  989. 2) returns "B" and "C". The respose is of type array and its element
  990. is the same struct returned by *aria2.tellStatus* method.
  991. *aria2.changeOption* 'gid, options'
  992. This method changes options of the download denoted by 'gid'
  993. dynamically. 'gid' is of type string. 'options' is of type struct
  994. and the available options are *max-download-limit* and *max-upload-limit*.
  995. This method returns "OK" for success.
  996. *aria2.changeGlobalOption* 'options'
  997. This method changes global options dynamically. 'options' is of type
  998. struct and the available options are *max-concurrent-downloads*,
  999. *max-overall-download-limit* and *max-overall-upload-limit*. This
  1000. method returns "OK" for success.
  1001. *aria2.purgeDownloadResult*
  1002. This method purges completed/error/removed downloads to free memory.
  1003. This method returns "OK".
  1004. *aria2.getVersion*
  1005. This method returns version of the program and the list of enabled
  1006. features. The response is of type struct and contains following keys.
  1007. version::
  1008. Version number of the program in string.
  1009. enabledFeatures::
  1010. List of enabled features. Each feature name is of type string.
  1011. Error Handling
  1012. ~~~~~~~~~~~~~~
  1013. In case of error, aria2 returns faultCode=1 and the error message in
  1014. faultString.
  1015. Options
  1016. ~~~~~~~
  1017. Same options for *-i* list are available. See *Input File* subsection
  1018. for complete list of options.
  1019. In the option struct, name element is option name(without preceeding
  1020. "--") and value element is argument as string.
  1021. -------------------------------------------------
  1022. <struct>
  1023. <member>
  1024. <name>split</name>
  1025. <value><string>1</string></value>
  1026. </member>
  1027. <member>
  1028. <name>http-proxy</name>
  1029. <value><string>http://proxy/</string></value>
  1030. </member>
  1031. </struct>
  1032. -------------------------------------------------
  1033. *header* and *index-out* option are allowed multiple times in
  1034. command-line. Since name should be unique in struct(many XML-RPC
  1035. library implementation uses hash or dict for struct), single string is
  1036. not enough. To overcome this situation, they can take array as value
  1037. as well as string.
  1038. ---------------------------------------------------------------
  1039. <struct>
  1040. <member>
  1041. <name>header</name>
  1042. <value>
  1043. <array>
  1044. <data>
  1045. <value><string>Accept-Language: ja</string></value>
  1046. <value><string>Accept-Charset: utf-8</string></value>
  1047. </data>
  1048. </array>
  1049. </value>
  1050. </member>
  1051. </struct>
  1052. ---------------------------------------------------------------
  1053. Sample XML-RPC Client Code
  1054. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  1055. The following Ruby script adds 'http://localhost/aria2.tar.bz2' to
  1056. aria2c operated on localhost with option *--dir*='/downloads' and
  1057. prints its reponse.
  1058. ----------------------------------------------
  1059. #!/usr/bin/env ruby
  1060. require 'xmlrpc/client'
  1061. require 'pp'
  1062. client=XMLRPC::Client.new2("http://localhost:6800/rpc")
  1063. options={ "dir" => "/downloads" }
  1064. result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options)
  1065. pp result
  1066. ----------------------------------------------
  1067. EXAMPLE
  1068. -------
  1069. HTTP/FTP Segmented Download
  1070. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1071. Download a file
  1072. ^^^^^^^^^^^^^^^
  1073. --------------------------------
  1074. aria2c "http://host/file.zip"
  1075. --------------------------------
  1076. [NOTE]
  1077. aria2 uses 5 connections to download 1 file by default.
  1078. Download a file using 1 connection
  1079. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1080. ----------------------------------
  1081. aria2c -s1 "http://host/file.zip"
  1082. ----------------------------------
  1083. [NOTE]
  1084. aria2 uses 5 connections to download 1 file by default.
  1085. -s1 limits the number of connections to just 1.
  1086. [NOTE]
  1087. To pause a download, press Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory. You can change URLs as long as they are pointing to the same file.
  1088. Download a file from 2 different HTTP servers
  1089. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1090. ------------------------------------------------------
  1091. aria2c "http://host/file.zip" "http://mirror/file.zip"
  1092. ------------------------------------------------------
  1093. Download a file from HTTP and FTP servers
  1094. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1095. -----------------------------------------------------
  1096. aria2c "http://host1/file.zip" "ftp://host2/file.zip"
  1097. -----------------------------------------------------
  1098. Download files listed in a text file concurrently
  1099. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1100. ------------------------
  1101. aria2c -ifiles.txt -j2
  1102. ------------------------
  1103. [NOTE]
  1104. -j option specifies the number of parallel downloads.
  1105. Using proxy
  1106. ^^^^^^^^^^^
  1107. For HTTP:
  1108. ----------------------------------------------------------
  1109. aria2c --http-proxy="http://proxy:8080" "http://host/file"
  1110. ----------------------------------------------------------
  1111. For FTP:
  1112. --------------------------------------------------------
  1113. aria2c --ftp-proxy="http://proxy:8080" "ftp://host/file"
  1114. --------------------------------------------------------
  1115. [NOTE]
  1116. See *--http-proxy*, *--https-proxy*, *--ftp-proxy* and *--all-proxy* for
  1117. details.
  1118. You can specify proxy in the environment variables. See *ENVIRONMENT* section.
  1119. Proxy with authorization
  1120. ^^^^^^^^^^^^^^^^^^^^^^^^
  1121. ----------------------------------------------------------------------------
  1122. aria2c --http-proxy="http://username:password@proxy:8080" "http://host/file"
  1123. ----------------------------------------------------------------------------
  1124. Metalink Download
  1125. ~~~~~~~~~~~~~~~~~
  1126. Download files with remote Metalink
  1127. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1128. --------------------------------------------------------
  1129. aria2c --follow-metalink=mem "http://host/file.metalink"
  1130. --------------------------------------------------------
  1131. Download using a local metalink file
  1132. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1133. ----------------------------------------------------------
  1134. aria2c -p --lowest-speed-limit=4000 file.metalink
  1135. ----------------------------------------------------------
  1136. [NOTE]
  1137. To pause a download, press Ctrl-C.
  1138. You can resume the transfer by running aria2c with the same argument in the same
  1139. directory.
  1140. Download several local metalink files
  1141. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1142. ----------------------------------------
  1143. aria2c -j2 file1.metalink file2.metalink
  1144. ----------------------------------------
  1145. Download only selected files using index
  1146. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1147. -------------------------------------------
  1148. aria2c --select-file=1-4,8 file.metalink
  1149. -------------------------------------------
  1150. [NOTE]
  1151. The index is printed to the console using -S option.
  1152. Download a file using a local .metalink file with user preference
  1153. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1154. ------------------------------------------------------------------------------
  1155. aria2c --metalink-location=JP,US --metalink-version=1.1 --metalink-language=en-US file.metalink
  1156. ------------------------------------------------------------------------------
  1157. BitTorrent Download
  1158. ~~~~~~~~~~~~~~~~~~~
  1159. Download files from remote BitTorrent file
  1160. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1161. ------------------------------------------------------
  1162. aria2c --follow-torrent=mem "http://host/file.torrent"
  1163. ------------------------------------------------------
  1164. Download using a local torrent file
  1165. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1166. ---------------------------------------------
  1167. aria2c --max-upload-limit=40K file.torrent
  1168. ---------------------------------------------
  1169. [NOTE]
  1170. --max-upload-limit specifies the max of upload rate.
  1171. [NOTE]
  1172. To pause a download, press Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory.
  1173. Download 2 torrents
  1174. ^^^^^^^^^^^^^^^^^^^
  1175. --------------------------------------
  1176. aria2c -j2 file1.torrent file2.torrent
  1177. --------------------------------------
  1178. Download a file using torrent and HTTP/FTP server
  1179. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1180. ------------------------------------------------------------
  1181. aria2c -Ttest.torrent "http://host1/file" "ftp://host2/file"
  1182. ------------------------------------------------------------
  1183. [NOTE]
  1184. Downloading multi file torrent with HTTP/FTP is not supported.
  1185. Download only selected files using index(usually called "selectable download")
  1186. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1187. ---------------------------------------
  1188. aria2c --select-file=1-4,8 file.torrent
  1189. ---------------------------------------
  1190. [NOTE]
  1191. The index is printed to the console using -S option.
  1192. Specify output filename
  1193. ^^^^^^^^^^^^^^^^^^^^^^^
  1194. To specify output filename for BitTorrent downloads, you need to know
  1195. the index of file in torrent file using *-S* option. For example, the
  1196. output looks like this:
  1197. --------------------------
  1198. idx|path/length
  1199. ===+======================
  1200. 1|dist/base-2.6.18.iso
  1201. |99.9MiB
  1202. ---+----------------------
  1203. 2|dist/driver-2.6.18.iso
  1204. |169.0MiB
  1205. ---+----------------------
  1206. --------------------------
  1207. To save 'dist/base-2.6.18.iso' in '/tmp/mydir/base.iso' and
  1208. 'dist/driver-2.6.18.iso' in '/tmp/dir/driver.iso', use the following
  1209. command:
  1210. -----------------------------------------------------------------------------------------
  1211. aria2c --dir=/tmp --index-out=1=mydir/base.iso --index-out=2=dir/driver.iso file.torrent
  1212. -----------------------------------------------------------------------------------------
  1213. Change the listening port for incoming peer
  1214. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1215. ---------------------------------------------------
  1216. aria2c --listen-port=7000-7001,8000 file.torrent
  1217. ---------------------------------------------------
  1218. [NOTE]
  1219. Since aria2 doesn't configure firewall or router for port forwarding, it's up
  1220. to you to do it manually.
  1221. Specify the condition to stop program after torrent download finished
  1222. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1223. -------------------------------------------------------
  1224. aria2c --seed-time=120 --seed-ratio=1.0 file.torrent
  1225. -------------------------------------------------------
  1226. [NOTE]
  1227. In the above example, the program exits when the 120 minutes has elapsed since download completed or seed ratio reaches 1.0.
  1228. Throttle upload speed
  1229. ^^^^^^^^^^^^^^^^^^^^^
  1230. ----------------------------------------------
  1231. aria2c --max-upload-limit=100K file.torrent
  1232. ----------------------------------------------
  1233. Enable DHT
  1234. ^^^^^^^^^^
  1235. ---------------------------------------------------------
  1236. aria2c --enable-dht --dht-listen-port=6881 file.torrent
  1237. ---------------------------------------------------------
  1238. [NOTE]
  1239. DHT uses udp port. Since aria2 doesn't configure firewall or router for port
  1240. forwarding, it's up to you to do it manually.
  1241. More advanced HTTP features
  1242. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1243. Load cookies
  1244. ^^^^^^^^^^^^
  1245. --------------------------------------------------------
  1246. aria2c --load-cookies=cookies.txt "http://host/file.zip"
  1247. --------------------------------------------------------
  1248. [NOTE]
  1249. You can use Firefox/Mozilla's cookie file without modification.
  1250. Resume download started by web browsers or another programs
  1251. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1252. -------------------------------------------------------
  1253. aria2c -c -s2 "http://host/partiallydownloadedfile.zip"
  1254. -------------------------------------------------------
  1255. Client certificate authorization for SSL/TLS
  1256. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1257. ------------------------------------------------------------------------------------------
  1258. aria2c --certificate=/path/to/mycert.pem --private-key=/path/to/mykey.pem https://host/file
  1259. ------------------------------------------------------------------------------------------
  1260. [NOTE]
  1261. The file specified in *--private-key* must be decrypted. The behavior when
  1262. encrypted one is given is undefined.
  1263. Verify peer in SSL/TLS using given CA certificates
  1264. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1265. ------------------------------------------------------------------------------------------
  1266. aria2c --ca-certificate=/path/to/ca-certificates.crt --check-certificate https://host/file
  1267. ------------------------------------------------------------------------------------------
  1268. And more advanced features
  1269. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  1270. Throttle download speed
  1271. ^^^^^^^^^^^^^^^^^^^^^^^
  1272. -------------------------------------------------
  1273. aria2c --max-download-limit=100K file.metalink
  1274. -------------------------------------------------
  1275. Repair a damaged download using -V option
  1276. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1277. -----------------------
  1278. aria2c -V file.metalink
  1279. -----------------------
  1280. [NOTE]
  1281. This option is only available used with BitTorrent or metalink with chunk
  1282. checksums.
  1283. Drop connection if download speed is lower than specified value
  1284. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1285. ------------------------------------------------
  1286. aria2c --lowest-speed-limit=10K file.metalink
  1287. ------------------------------------------------
  1288. Parameterized URI support
  1289. ^^^^^^^^^^^^^^^^^^^^^^^^^
  1290. You can specify set of parts:
  1291. -----------------------------------------------
  1292. aria2c -P "http://{host1,host2,host3}/file.iso"
  1293. -----------------------------------------------
  1294. You can specify numeric sequence:
  1295. ---------------------------------------------
  1296. aria2c -Z -P "http://host/image[000-100].png"
  1297. ---------------------------------------------
  1298. [NOTE]
  1299. -Z option is required if the all URIs don't point to the same file, such as the above example.
  1300. You can specify step counter:
  1301. -------------------------------------------
  1302. aria2c -Z -P "http://host/image[A-Z:2].png"
  1303. -------------------------------------------
  1304. Parallel downloads of arbitrary number of URL,metalink,torrent
  1305. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1306. --------------------------------------------------------------
  1307. aria2c -j3 -Z "http://host/file1" file2.torrent file3.metalink
  1308. --------------------------------------------------------------
  1309. BitTorrent Encryption
  1310. ^^^^^^^^^^^^^^^^^^^^^
  1311. Encrypt whole payload using ARC4:
  1312. -------------------------------------------------------------------------
  1313. aria2c --bt-min-crypto-level=arc4 --bt-require-crypto=true file.torrent
  1314. -------------------------------------------------------------------------
  1315. SEE ALSO
  1316. --------
  1317. Project Web Site: http://aria2.sourceforge.net/
  1318. aria2 Wiki: http://sourceforge.net/apps/trac/aria2/wiki
  1319. Metalink Homepage: http://www.metalinker.org/
  1320. COPYRIGHT
  1321. ---------
  1322. Copyright (C) 2006, 2009 Tatsuhiro Tsujikawa
  1323. This program is free software; you can redistribute it and/or modify
  1324. it under the terms of the GNU General Public License as published by
  1325. the Free Software Foundation; either version 2 of the License, or
  1326. (at your option) any later version.
  1327. This program is distributed in the hope that it will be useful,
  1328. but WITHOUT ANY WARRANTY; without even the implied warranty of
  1329. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1330. GNU General Public License for more details.
  1331. You should have received a copy of the GNU General Public License
  1332. along with this program; if not, write to the Free Software
  1333. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  1334. In addition, as a special exception, the copyright holders give
  1335. permission to link the code of portions of this program with the
  1336. OpenSSL library under certain conditions as described in each
  1337. individual source file, and distribute linked combinations
  1338. including the two.
  1339. You must obey the GNU General Public License in all respects
  1340. for all of the code used other than OpenSSL. If you modify
  1341. file(s) with this exception, you may extend this exception to your
  1342. version of the file(s), but you are not obligated to do so. If you
  1343. do not wish to do so, delete this exception statement from your
  1344. version. If you delete this exception statement from all source
  1345. files in the program, then also delete it here.