aria2c.1.txt 79 KB

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