aria2c.1.asciidoc 112 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030
  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.9
  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. [[aria2_optref_dir]]*-d*, *--dir*=DIR::
  28. The directory to store the downloaded file.
  29. [[aria2_optref_input_file]]*-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. Additionally, options can be specified after each line of
  34. URI. This optional line must start with one or more white spaces and have
  35. one option per single line.
  36. See *<<_input_file, Input File>>* subsection for details.
  37. [[aria2_optref_log]]*-l*, *--log*=LOG::
  38. The file name of the log file. If '-' is specified, log is written to
  39. stdout. If empty string("") is specified, log is not written to file.
  40. [[aria2_optref_max_concurrent_downloads]]*-j*, *--max-concurrent-downloads*=N::
  41. Set maximum number of parallel downloads for every static (HTTP/FTP) URI,
  42. torrent and metalink. See also *<<aria2_optref_split, -s>>* and *<<aria2_optref_metalink_servers, -C>>* option.
  43. Default: '5'
  44. [[aria2_optref_check_integrity]]*-V*, *--check-integrity*[='true'|'false']::
  45. Check file integrity by validating piece hashes or a hash of entire
  46. file. This option has effect only in BitTorrent and Metalink
  47. downloads with checksums. If piece hashes are provided, this option
  48. can detect damaged portions of a file and re-download them. If a
  49. hash of entire file is provided, hash check is only done when file
  50. has benn already download. This is determined by file length. If
  51. hash check fails, file is re-downloaded from scratch. If both piece
  52. hashes and a hash of entire file are provided, only piece hashes are
  53. used. Default: 'false'
  54. [[aria2_optref_continue]]*-c*, *--continue*[='true'|'false']::
  55. Continue downloading a partially downloaded file.
  56. Use this option to resume a download started by a web browser or another
  57. program which downloads files sequentially from the beginning.
  58. Currently this option is only applicable to HTTP(S)/FTP downloads.
  59. [[aria2_optref_help]]*-h*, *--help*[=TAG|KEYWORD]::
  60. The help messages are classified with tags. A tag starts with
  61. "#". For example, type "--help=#http" to get the usage for the
  62. options tagged with "#http". If non-tag word is given, print the
  63. usage for the options whose name includes that word.
  64. Available Values: '#basic', '#advanced', '#http', '#https', '#ftp',
  65. '#metalink', '#bittorrent', '#cookie', '#hook', '#file',
  66. '#xml-rpc', '#experimental', '#all'
  67. Default: '#basic'
  68. HTTP/FTP Options
  69. ~~~~~~~~~~~~~~~~
  70. [[aria2_optref_all_proxy]]*--all-proxy*=PROXY::
  71. Use this proxy server for all protocols. To erase previously
  72. defined proxy, use "". You can override this setting and specify a
  73. proxy server for a particular protocol using *<<aria2_optref_http_proxy, --http-proxy>>*,
  74. *<<aria2_optref_https_proxy, --https-proxy>>* and *<<aria2_optref_ftp_proxy, --ftp-proxy>>* options. This affects all URIs.
  75. The format of PROXY is [\\http://][USER:PASSWORD@]HOST[:PORT]
  76. [NOTE]
  77. If user and password are embedded in proxy URI and they are also
  78. specified by *--{http,https,ftp,all}-proxy-{user,passwd}* options,
  79. those appeared later have precedence. For example, you have
  80. http-proxy-user="myname", http-proxy-passwd="mypass" in aria2.conf and
  81. you specify --http-proxy="http://proxy" in command-line, then you get
  82. HTTP proxy "http://proxy" with user "myname" and password
  83. "mypass". Another example: if you specified in command-line
  84. --http-proxy="http://user:pass@proxy" --http-proxy-user="myname"
  85. --http-proxy-passwd="mypass", then you will get HTTP proxy
  86. "http://proxy" with user "myname" and password "mypass". One more
  87. example: if you specified in command-line --http-proxy-user="myname"
  88. --http-proxy-passwd="mypass" --http-proxy="http://user:pass@proxy",
  89. then you get HTTP proxy "http://proxy" with user "user" and password
  90. "pass".
  91. [[aria2_optref_all_proxy_passwd]]*--all-proxy-passwd*=PASSWD::
  92. Set password for *<<aria2_optref_all_proxy, --all-proxy>>* option.
  93. [[aria2_optref_all_proxy_user]]*--all-proxy-user*=USER::
  94. Set user for *<<aria2_optref_all_proxy, --all-proxy>>* option.
  95. [[aria2_optref_connect_timeout]]*--connect-timeout*=SEC::
  96. Set the connect timeout in seconds to establish connection to
  97. HTTP/FTP/proxy server. After the connection is established, this
  98. option makes no effect and *<<aria2_optref_timeout, --timeout>>* option is used instead.
  99. Default: '60'
  100. [[aria2_optref_dry_run]]*--dry-run*[='true'|'false']::
  101. If 'true' is given, aria2 just checks whether the remote file is
  102. available and doesn't download data. This option has effect on
  103. HTTP/FTP download. BitTorrent downloads are canceled if 'true' is
  104. specified. Default: 'false'
  105. [[aria2_optref_lowest_speed_limit]]*--lowest-speed-limit*=SPEED::
  106. Close connection if download speed is lower than or equal to this
  107. value(bytes per sec).
  108. '0' means aria2 does not have a lowest speed limit.
  109. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  110. This option does not affect BitTorrent downloads.
  111. Default: '0'
  112. [[aria2_optref_max_connection_per_server]]*-x*, *--max-connection-per-server*=NUM::
  113. The maximum number of connections to one server for each download.
  114. Default: '1'
  115. [[aria2_optref_max_file_not_found]]*--max-file-not-found*=NUM::
  116. If aria2 receives `file not found' status from the remote HTTP/FTP
  117. servers NUM times without getting a single byte, then force the
  118. download to fail. Specify '0' to disable this option. This options is
  119. effective only when using HTTP/FTP servers.
  120. Default: '0'
  121. [[aria2_optref_max_tries]]*-m*, *--max-tries*=N::
  122. Set number of tries. '0' means unlimited.
  123. See also *<<aria2_optref_retry_wait, --retry-wait>>*.
  124. Default: '5'
  125. [[aria2_optref_min_split_size]]*-k*, *--min-split-size*=SIZE::
  126. aria2 does not split less than 2*SIZE byte range. For example,
  127. let's consider downloading 20MiB file. If SIZE is 10M, aria2 can
  128. split file into 2 range [0-10MiB) and [10MiB-20MiB) and download it
  129. using 2 sources(if *<<aria2_optref_split, --split>>* >= 2, of course). If SIZE is 15M,
  130. since 2*15M > 20MiB, aria2 does not split file and download it using
  131. 1 source. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  132. Possible Values: '1M'-'1024M' Default: '20M'
  133. [[aria2_optref_no_netrc]]*-n*, *--no-netrc*[='true'|'false']::
  134. Disables netrc support. netrc support is enabled by default.
  135. [[aria2_optref_no_proxy]]*--no-proxy*=DOMAINS::
  136. Specify comma separated hostnames, domains and network address with
  137. or without CIDR block where proxy should not be used.
  138. [NOTE]
  139. For network address with CIDR block, only IPv4 address works. Current
  140. implementation does not resolve hostname in URI to compare network
  141. address specified in *<<aria2_optref_no_proxy, --no-proxy>>*. So it is only effecive if URI has
  142. numeric IP addresses.
  143. [[aria2_optref_out]]*-o*, *--out*=FILE::
  144. The file name of the downloaded file. When *<<aria2_optref_force_sequential, -Z>>* option is used, this
  145. option is ignored.
  146. [NOTE]
  147. In Metalink or BitTorrent download you cannot specify file name.
  148. The file name specified here is only used when the URIs fed to aria2
  149. are done by command line without *<<aria2_optref_input_file, -i>>*, *<<aria2_optref_force_sequential, -Z>>* option. For example:
  150. aria2c -o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip"
  151. [[aria2_optref_proxy_method]]*--proxy-method*=METHOD::
  152. Set the method to use in proxy request. 'METHOD' is either 'get' or
  153. 'tunnel'. HTTPS downloads always use 'tunnel' regardless of this
  154. option.
  155. Default: 'get'
  156. [[aria2_optref_remote_time]]*-R*, *--remote-time*[='true'|'false']::
  157. Retrieve timestamp of the remote file from the remote HTTP/FTP
  158. server and if it is available, apply it to the local file.
  159. Default: 'false'
  160. [[aria2_optref_reuse_uri]]*--reuse-uri*[='true'|'false']::
  161. Reuse already used URIs if no unused URIs are left.
  162. Default: 'true'
  163. [[aria2_optref_retry_wait]]*--retry-wait*=SEC::
  164. Set the seconds to wait between retries. With SEC > 0, aria2 will
  165. retry download when the HTTP server returns 503 response. Default:
  166. '0'
  167. [[aria2_optref_server_stat_of]]*--server-stat-of*=FILE::
  168. Specify the filename to which performance profile of the servers is
  169. saved. You can load saved data using *<<aria2_optref_server_stat_if, --server-stat-if>>* option. See
  170. *<<_server_performance_profile, Server Performance Profile>>*
  171. subsection below for file format.
  172. [[aria2_optref_server_stat_if]]*--server-stat-if*=FILE::
  173. Specify the filename to load performance profile of the servers. The
  174. loaded data will be used in some URI selector such as 'feedback'.
  175. See also *<<aria2_optref_uri_selector, --uri-selector>>* option. See
  176. *<<_server_performance_profile, Server Performance Profile>>*
  177. subsection below for file format.
  178. [[aria2_optref_server_stat_timeout]]*--server-stat-timeout*=SEC::
  179. Specifies timeout in seconds to invalidate performance profile of
  180. the servers since the last contact to them.
  181. Default: '86400' (24hours)
  182. [[aria2_optref_split]]*-s*, *--split*=N::
  183. Download a file using N connections. If more than N URIs are given,
  184. first N URIs are used and remaining URIs are used for backup. If
  185. less than N URIs are given, those URIs are used more than once so
  186. that N connections total are made simultaneously. The number of
  187. connections to the same host is restricted by
  188. *<<aria2_optref_max_connection_per_server, --max-connection-per-server>>* option. Please see *<<aria2_optref_max_concurrent_downloads, -j>>* and
  189. *<<aria2_optref_min_split_size, --min-split-size>>* option too. Please note that in Metalink
  190. download, this option has no effect and use *<<aria2_optref_metalink_servers, -C>>* option instead.
  191. Default: '5'
  192. [[aria2_optref_timeout]]*-t*, *--timeout*=SEC::
  193. Set timeout in seconds.
  194. Default: '60'
  195. [[aria2_optref_uri_selector]]*--uri-selector*=SELECTOR::
  196. Specify URI selection algorithm. The possible values are 'inorder',
  197. 'feedback' and 'adaptive'. If 'inorder' is given, URI is tried in
  198. the order appeared in the URI list. If 'feedback' is given, aria2
  199. uses download speed observed in the previous downloads and choose
  200. fastest server in the URI list. This also effectively skips dead
  201. mirrors. The observed download speed is a part of performance
  202. profile of servers mentioned in *<<aria2_optref_server_stat_of, --server-stat-of>>* and
  203. *<<aria2_optref_server_stat_if, --server-stat-if>>* options. If 'adaptive' is given, selects one of
  204. the best mirrors for the first and reserved connections. For
  205. supplementary ones, it returns mirrors which has not been tested
  206. yet, and if each of them has already been tested, returns mirrors
  207. which has to be tested again. Otherwise, it doesn't select anymore
  208. mirrors. Like 'feedback', it uses a performance profile of servers.
  209. Default: 'feedback'
  210. HTTP Specific Options
  211. ~~~~~~~~~~~~~~~~~~~~~
  212. [[aria2_optref_ca_certificate]]*--ca-certificate*=FILE::
  213. Use the certificate authorities in FILE to verify the peers.
  214. The certificate file must be in PEM format and can contain multiple CA
  215. certificates.
  216. Use *<<aria2_optref_check_certificate, --check-certificate>>* option to enable verification.
  217. [[aria2_optref_certificate]]*--certificate*=FILE::
  218. Use the client certificate in FILE.
  219. The certificate must be in PEM format.
  220. You may use *<<aria2_optref_private_key, --private-key>>* option to specify the private key.
  221. [[aria2_optref_check_certificate]]*--check-certificate*[='true'|'false']::
  222. Verify the peer using certificates specified in *<<aria2_optref_ca_certificate, --ca-certificate>>* option.
  223. Default: 'true'
  224. [[aria2_optref_http_accept_gzip]]*--http-accept-gzip*[='true'|'false']::
  225. Send "Accept: deflate, gzip" request header and inflate response if
  226. remote server responds with "Content-Encoding: gzip" or
  227. "Content-Encoding: deflate". Default: 'false'
  228. [NOTE]
  229. Some server responds with "Content-Encoding: gzip" for files which
  230. itself is gzipped file. aria2 inflates them anyway because of the
  231. response header.
  232. [[aria2_optref_http_auth_challenge]]*--http-auth-challenge*[='true'|'false']::
  233. Send HTTP authorization header only when it is requested by the
  234. server. If 'false' is set, then authorization header is always sent
  235. to the server. There is an exception: if username and password are
  236. embedded in URI, authorization header is always sent to the server
  237. regardless of this option. Default: 'false'
  238. [[aria2_optref_http_no_cache]]*--http-no-cache*[='true'|'false']::
  239. Send Cache-Control: no-cache and Pragma: no-cache header to avoid
  240. cached content. If 'false' is given, these headers are not sent
  241. and you can add Cache-Control header with a directive you like
  242. using *<<aria2_optref_header, --header>>* option. Default: 'true'
  243. [[aria2_optref_http_user]]*--http-user*=USER::
  244. Set HTTP user. This affects all URIs.
  245. [[aria2_optref_http_passwd]]*--http-passwd*=PASSWD::
  246. Set HTTP password. This affects all URIs.
  247. [[aria2_optref_http_proxy]]*--http-proxy*=PROXY::
  248. Use this proxy server for HTTP. To erase previously defined proxy,
  249. use "". See also *<<aria2_optref_all_proxy, --all-proxy>>* option. This affects all URIs. The
  250. format of PROXY is [\\http://][USER:PASSWORD@]HOST[:PORT]
  251. [[aria2_optref_http_proxy_passwd]]*--http-proxy-passwd*=PASSWD::
  252. Set password for *<<aria2_optref_http_proxy, --http-proxy>>* option.
  253. [[aria2_optref_http_proxy_user]]*--http-proxy-user*=USER::
  254. Set user for *<<aria2_optref_http_proxy, --http-proxy>>* option.
  255. [[aria2_optref_https_proxy]]*--https-proxy*=PROXY::
  256. Use this proxy server for HTTPS. To erase previously defined proxy,
  257. use "". See also *<<aria2_optref_all_proxy, --all-proxy>>* option. This affects all URIs. The
  258. format of PROXY is [\\http://][USER:PASSWORD@]HOST[:PORT]
  259. [[aria2_optref_https_proxy_passwd]]*--https-proxy-passwd*=PASSWD::
  260. Set password for *<<aria2_optref_https_proxy, --https-proxy>>* option.
  261. [[aria2_optref_https_proxy_user]]*--https-proxy-user*=USER::
  262. Set user for *<<aria2_optref_https_proxy, --https-proxy>>* option.
  263. [[aria2_optref_private_key]]*--private-key*=FILE::
  264. Use the private key in FILE.
  265. The private key must be decrypted and in PEM format.
  266. The behavior when encrypted one is given is undefined.
  267. See also *<<aria2_optref_certificate, --certificate>>* option.
  268. [[aria2_optref_referer]]*--referer*=REFERER::
  269. Set Referer. This affects all URIs.
  270. [[aria2_optref_enable_http_keep_alive]]*--enable-http-keep-alive*[='true'|'false']::
  271. Enable HTTP/1.1 persistent connection.
  272. Default: 'true'
  273. [[aria2_optref_enable_http_pipelining]]*--enable-http-pipelining*[='true'|'false']::
  274. Enable HTTP/1.1 pipelining.
  275. Default: 'false'
  276. [NOTE]
  277. In performance perspective, there is usually no advantage to enable
  278. this option.
  279. [[aria2_optref_header]]*--header*=HEADER::
  280. Append HEADER to HTTP request header.
  281. You can use this option repeatedly to specify more than one header:
  282. aria2c *<<aria2_optref_header, --header>>*="X-A: b78" *<<aria2_optref_header, --header>>*="X-B: 9J1" "http://host/file"
  283. [[aria2_optref_load_cookies]]*--load-cookies*=FILE::
  284. Load Cookies from FILE using the Firefox3 format (SQLite3),
  285. Chromium/Google Chrome (SQLite3) and the
  286. Mozilla/Firefox(1.x/2.x)/Netscape format.
  287. [NOTE]
  288. If aria2 is built without libsqlite3, then it doesn't support Firefox3
  289. and Chromium/Google Chrome cookie format.
  290. [[aria2_optref_save_cookies]]*--save-cookies*=FILE::
  291. Save Cookies to FILE in Mozilla/Firefox(1.x/2.x)/ Netscape
  292. format. If FILE already exists, it is overwritten. Session Cookies
  293. are also saved and their expiry values are treated as 0. Possible
  294. Values: '/path/to/file'
  295. [[aria2_optref_use_head]]*--use-head*[='true'|'false']::
  296. Use HEAD method for the first request to the HTTP server.
  297. Default: 'false'
  298. [[aria2_optref_user_agent]]*-U*, *--user-agent*=USER_AGENT::
  299. Set user agent for HTTP(S) downloads.
  300. Default: 'aria2/$VERSION', $VERSION is replaced by package version.
  301. FTP Specific Options
  302. ~~~~~~~~~~~~~~~~~~~~
  303. [[aria2_optref_ftp_user]]*--ftp-user*=USER::
  304. Set FTP user. This affects all URIs.
  305. Default: 'anonymous'
  306. [[aria2_optref_ftp_passwd]]*--ftp-passwd*=PASSWD::
  307. Set FTP password. This affects all URIs.
  308. If user name is embedded but password is missing in URI, aria2 tries
  309. to resolve password using .netrc. If password is found in .netrc,
  310. then use it as password. If not, use the password specified in this
  311. option.
  312. Default: 'ARIA2USER@'
  313. [[aria2_optref_ftp_pasv]]*-p*, *--ftp-pasv*[='true'|'false']::
  314. Use the passive mode in FTP.
  315. If 'false' is given, the active mode will be used.
  316. Default: 'true'
  317. [[aria2_optref_ftp_proxy]]*--ftp-proxy*=PROXY::
  318. Use this proxy server for FTP. To erase previously defined proxy,
  319. use "". See also *<<aria2_optref_all_proxy, --all-proxy>>* option. This affects all URIs. The
  320. format of PROXY is [\\http://][USER:PASSWORD@]HOST[:PORT]
  321. [[aria2_optref_ftp_proxy_passwd]]*--ftp-proxy-passwd*=PASSWD::
  322. Set password for *<<aria2_optref_ftp_proxy, --ftp-proxy>>* option.
  323. [[aria2_optref_ftp_proxy_user]]*--ftp-proxy-user*=USER::
  324. Set user for *<<aria2_optref_ftp_proxy, --ftp-proxy>>* option.
  325. [[aria2_optref_ftp_type]]*--ftp-type*=TYPE::
  326. Set FTP transfer type. TYPE is either 'binary' or 'ascii'.
  327. Default: 'binary'
  328. [[aria2_optref_ftp_reuse_connection]]*--ftp-reuse-connection*[='true'|'false']::
  329. Reuse connection in FTP.
  330. Default: 'true'
  331. BitTorrent/Metalink Options
  332. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  333. [[aria2_optref_select_file]]*--select-file*=INDEX...::
  334. Set file to download by specifying its index.
  335. You can find the file index using the *<<aria2_optref_show_files, --show-files>>* option.
  336. Multiple indexes can be specified by using ",", for example: '3,6'.
  337. You can also use "-" to specify a range: '1-5'.
  338. "," and "-" can be used together: '1-5,8,9'.
  339. When used with the -M option, index may vary depending on the query
  340. (see *--metalink-** options).
  341. [NOTE]
  342. In multi file torrent, the adjacent files specified by this option may
  343. also be downloaded. This is by design, not a bug.
  344. A single piece may include several files or part of files, and aria2
  345. writes the piece to the appropriate files.
  346. [[aria2_optref_show_files]]*-S*, *--show-files*[='true'|'false']::
  347. Print file listing of .torrent or .metalink file and exit.
  348. In case of .torrent file, additional information
  349. (infohash, piece length, etc) is also printed.
  350. BitTorrent Specific Options
  351. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  352. [[aria2_optref_bt_enable_lpd]]*--bt-enable-lpd*[='true'|'false']::
  353. Enable Local Peer Discovery. If a private flag is set in a torrent,
  354. aria2 doesn't use this feature for that download even if 'true' is
  355. given. Default: 'false'
  356. [[aria2_optref_bt_exclude_tracker]]*--bt-exclude-tracker*=URI[,...]::
  357. Comma separated list of BitTorrent tracker's announce URI to
  358. remove. You can use special value "\*" which matches all URIs, thus
  359. removes all announce URIs. When specifying "\*" in shell
  360. command-line, don't forget to escape or quote it. See also
  361. *<<aria2_optref_bt_tracker, --bt-tracker>>* option.
  362. [[aria2_optref_bt_external_ip]]*--bt-external-ip*=IPADDRESS::
  363. Specify the external IP address to report to a BitTorrent
  364. tracker. Although this function is named "external", it can accept
  365. any kind of IP addresses. IPADDRESS must be a numeric IP address.
  366. [[aria2_optref_bt_hash_check_seed]]*--bt-hash-check-seed*[='true'|'false']::
  367. If 'true' is given, after hash check using *<<aria2_optref_check_integrity, --check-integrity>>* option and
  368. file is complete, continue to seed file. If you want to check file
  369. and download it only when it is damaged or incomplete, set this
  370. option to 'false'. This option has effect only on BitTorrent download.
  371. Default: 'true'
  372. [[aria2_optref_bt_lpd_interface]]*--bt-lpd-interface*=INTERFACE::
  373. Use given interface for Local Peer Discovery. If this option is not
  374. specified, the default interface is chosen. You can specify
  375. interface name and IP address. Possible Values: interface, IP
  376. addres
  377. [[aria2_optref_bt_max_open_files]]*--bt-max-open-files*=NUM::
  378. Specify maximum number of files to open in each BitTorrent download.
  379. Default: '100'
  380. [[aria2_optref_bt_max_peers]]*--bt-max-peers*=NUM::
  381. Specify the maximum number of peers per torrent. '0' means
  382. unlimited. See also *<<aria2_optref_bt_request_peer_speed_limit, --bt-request-peer-speed-limit>>* option.
  383. Default: '55'
  384. [[aria2_optref_bt_metadata_only]]*--bt-metadata-only*[='true'|'false']::
  385. Download metadata only. The file(s) described in metadata will not
  386. be downloaded. This option has effect only when BitTorrent Magnet
  387. URI is used. See also *<<aria2_optref_bt_save_metadata, --bt-save-metadata>>* option. Default: 'false'
  388. [[aria2_optref_bt_min_crypto_level]]*--bt-min-crypto-level*='plain'|'arc4'::
  389. Set minimum level of encryption method.
  390. If several encryption methods are provided by a peer, aria2 chooses the lowest
  391. one which satisfies the given level.
  392. Default: 'plain'
  393. [[aria2_optref_bt_prioritize_piece]]*--bt-prioritize-piece*='head'[=SIZE],'tail'[=SIZE]::
  394. Try to download first and last pieces of each file first. This is
  395. useful for previewing files. The argument can contain 2 keywords:
  396. 'head' and 'tail'. To include both keywords, they must be separated
  397. by comma. These keywords can take one parameter, SIZE. For example,
  398. if 'head'=SIZE is specified, pieces in the range of first SIZE bytes
  399. of each file get higher priority. 'tail'=SIZE means the range of
  400. last SIZE bytes of each file. SIZE can include 'K' or 'M'(1K = 1024,
  401. 1M = 1024K). If SIZE is omitted, SIZE=1M is used.
  402. [[aria2_optref_bt_require_crypto]]*--bt-require-crypto*[='true'|'false']::
  403. If true is given, aria2 doesn't accept and establish connection with legacy
  404. BitTorrent handshake(\19BitTorrent protocol).
  405. Thus aria2 always uses Obfuscation handshake.
  406. Default: 'false'
  407. [[aria2_optref_bt_request_peer_speed_limit]]*--bt-request-peer-speed-limit*=SPEED::
  408. If the whole download speed of every torrent is lower than SPEED,
  409. aria2 temporarily increases the number of peers to try for more
  410. download speed. Configuring this option with your preferred download
  411. speed can increase your download speed in some cases.
  412. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  413. Default: '50K'
  414. [[aria2_optref_bt_save_metadata]]*--bt-save-metadata*[='true'|'false']::
  415. Save metadata as .torrent file. This option has effect only when
  416. BitTorrent Magnet URI is used. The filename is hex encoded info
  417. hash with suffix .torrent. The directory to be saved is the same
  418. directory where download file is saved. If the same file already
  419. exists, metadata is not saved. See also *<<aria2_optref_bt_metadata_only, --bt-metadata-only>>*
  420. option. Default: 'false'
  421. [[aria2_optref_bt_seed_unverified]]*--bt-seed-unverified*[='true'|'false']::
  422. Seed previously downloaded files without verifying piece hashes.
  423. Default: 'false'
  424. [[aria2_optref_bt_stop_timeout]]*--bt-stop-timeout*=SEC::
  425. Stop BitTorrent download if download speed is 0 in consecutive SEC
  426. seconds. If '0' is given, this feature is disabled. Default: '0'
  427. [[aria2_optref_bt_tracker]]*--bt-tracker*=URI[,...]::
  428. Comma separated list of additional BitTorrent tracker's announce
  429. URI. These URIs are not affected by *<<aria2_optref_bt_exclude_tracker, --bt-exclude-tracker>>* option
  430. because they are added after URIs in *<<aria2_optref_bt_exclude_tracker, --bt-exclude-tracker>>* option are
  431. removed.
  432. [[aria2_optref_bt_tracker_connect_timeout]]*--bt-tracker-connect-timeout*=SEC::
  433. Set the connect timeout in seconds to establish connection to
  434. tracker. After the connection is established, this option makes no
  435. effect and *<<aria2_optref_bt_tracker_timeout, --bt-tracker-timeout>>* option is used instead. Default:
  436. '60'
  437. [[aria2_optref_bt_tracker_interval]]*--bt-tracker-interval*=SEC::
  438. Set the interval in seconds between tracker requests. This
  439. completely overrides interval value and aria2 just uses this value
  440. and ignores the min interval and interval value in the response of
  441. tracker. If '0' is set, aria2 determines interval based on the
  442. response of tracker and the download progress. Default: '0'
  443. [[aria2_optref_bt_tracker_timeout]]*--bt-tracker-timeout*=SEC::
  444. Set timeout in seconds. Default: '60'
  445. [[aria2_optref_dht_entry_point]]*--dht-entry-point*=HOST:PORT::
  446. Set host and port as an entry point to IPv4 DHT network.
  447. [[aria2_optref_dht_entry_point6]]*--dht-entry-point6*=HOST:PORT::
  448. Set host and port as an entry point to IPv6 DHT network.
  449. [[aria2_optref_dht_file_path]]*--dht-file-path*=PATH::
  450. Change the IPv4 DHT routing table file to PATH.
  451. Default: '$HOME/.aria2/dht.dat'
  452. [[aria2_optref_dht_file_path6]]*--dht-file-path6*=PATH::
  453. Change the IPv6 DHT routing table file to PATH.
  454. Default: '$HOME/.aria2/dht6.dat'
  455. [[aria2_optref_dht_listen_addr6]]*--dht-listen-addr6*=ADDR::
  456. Specify address to bind socket for IPv6 DHT. It should be a global
  457. unicast IPv6 address of the host.
  458. [[aria2_optref_dht_listen_port]]*--dht-listen-port*=PORT...::
  459. Set UDP listening port for both IPv4 and IPv6 DHT.
  460. Multiple ports can be specified by using ",", for example: '6881,6885'.
  461. You can also use "-" to specify a range: '6881-6999'. "," and "-" can be used
  462. together.
  463. Default: '6881-6999'
  464. [NOTE]
  465. Make sure that the specified ports are open for incoming UDP traffic.
  466. [[aria2_optref_dht_message_timeout]]*--dht-message-timeout*=SEC::
  467. Set timeout in seconds. Default: '10'
  468. [[aria2_optref_enable_dht]]*--enable-dht*[='true'|'false']::
  469. Enable IPv4 DHT functionality. If a private flag is set in a
  470. torrent, aria2 doesn't use DHT for that download even if 'true' is
  471. given. Default: 'true'
  472. [[aria2_optref_enable_dht6]]*--enable-dht6*[='true'|'false']::
  473. Enable IPv6 DHT functionality. If a private flag is set in a
  474. torrent, aria2 doesn't use DHT for that download even if 'true' is
  475. given. Use *<<aria2_optref_dht_listen_port, --dht-listen-port>>* option to specify port number to
  476. listen on. See also *<<aria2_optref_dht_listen_addr6, --dht-listen-addr6>>* option.
  477. [[aria2_optref_enable_peer_exchange]]*--enable-peer-exchange*[='true'|'false']::
  478. Enable Peer Exchange extension. If a private flag is set in a torrent, this
  479. feature is disabled for that download even if 'true' is given.
  480. Default: 'true'
  481. [[aria2_optref_follow_torrent]]*--follow-torrent*='true'|'false'|'mem'::
  482. If 'true' or 'mem' is specified, when a file whose suffix is ".torrent" or content
  483. type is "application/x-bittorrent" is downloaded, aria2 parses it as a torrent
  484. file and downloads files mentioned in it.
  485. If 'mem' is specified, a torrent file is not written to the disk, but is just
  486. kept in memory.
  487. If 'false' is specified, the action mentioned above is not taken.
  488. Default: 'true'
  489. [[aria2_optref_index_out]]*-O*, *--index-out*=INDEX=PATH::
  490. Set file path for file with index=INDEX. You can find the file index
  491. using the *<<aria2_optref_show_files, --show-files>>* option. PATH is a relative path to the
  492. path specified in *<<aria2_optref_dir, --dir>>* option. You can use this option multiple
  493. times. Using this option, you can specify the output filenames of
  494. BitTorrent downloads.
  495. [[aria2_optref_listen_port]]*--listen-port*=PORT...::
  496. Set TCP port number for BitTorrent downloads.
  497. Multiple ports can be specified by using ",", for example: '6881,6885'.
  498. You can also use "-" to specify a range: '6881-6999'.
  499. "," and "-" can be used together: '6881-6889,6999'.
  500. Default: '6881-6999'
  501. [NOTE]
  502. Make sure that the specified ports are open for incoming TCP traffic.
  503. [[aria2_optref_max_overall_upload_limit]]*--max-overall-upload-limit*=SPEED::
  504. Set max overall upload speed in bytes/sec.
  505. '0' means unrestricted.
  506. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  507. To limit the upload speed per torrent, use *<<aria2_optref_max_upload_limit, --max-upload-limit>>* option.
  508. Default: '0'
  509. [[aria2_optref_max_upload_limit]]*-u*, *--max-upload-limit*=SPEED::
  510. Set max upload speed per each torrent in bytes/sec.
  511. '0' means unrestricted.
  512. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  513. To limit the overall upload speed, use *<<aria2_optref_max_overall_upload_limit, --max-overall-upload-limit>>* option.
  514. Default: '0'
  515. [[aria2_optref_peer_id_prefix]]*--peer-id-prefix*=PEER_ID_PREFIX::
  516. Specify the prefix of peer ID. The peer ID in
  517. BitTorrent is 20 byte length. If more than 20
  518. bytes are specified, only first 20 bytes are
  519. used. If less than 20 bytes are specified, random
  520. byte data are added to make its length 20 bytes.
  521. Default: 'aria2/$VERSION-', $VERSION is replaced by package version.
  522. [[aria2_optref_seed_ratio]]*--seed-ratio*=RATIO::
  523. Specify share ratio. Seed completed torrents until share ratio reaches
  524. RATIO.
  525. You are strongly encouraged to specify equals or more than '1.0' here.
  526. Specify '0.0' if you intend to do seeding regardless of share ratio.
  527. If *<<aria2_optref_seed_time, --seed-time>>* option is specified along with this option, seeding ends when
  528. at least one of the conditions is satisfied.
  529. Default: '1.0'
  530. [[aria2_optref_seed_time]]*--seed-time*=MINUTES::
  531. Specify seeding time in minutes. Also see the *<<aria2_optref_seed_ratio, --seed-ratio>>* option.
  532. [NOTE]
  533. Specifying *<<aria2_optref_seed_time, --seed-time>>*='0' disables seeding after download completed.
  534. [[aria2_optref_torrent_file]]*-T*, *--torrent-file*=TORRENT_FILE::
  535. The path to the .torrent file. You are not required to use this
  536. option because you can specify .torrent files without *<<aria2_optref_torrent_file, -T>>*.
  537. Metalink Specific Options
  538. ~~~~~~~~~~~~~~~~~~~~~~~~~
  539. [[aria2_optref_follow_metalink]]*--follow-metalink*='true'|'false'|'mem'::
  540. If 'true' or 'mem' is specified, when a file whose suffix is ".metalink" or content
  541. type of "application/metalink+xml" is downloaded, aria2 parses it as a metalink
  542. file and downloads files mentioned in it.
  543. If 'mem' is specified, a metalink file is not written to the disk, but is just
  544. kept in memory.
  545. If 'false' is specified, the action mentioned above is not taken.
  546. Default: 'true'
  547. [[aria2_optref_metalink_file]]*-M*, *--metalink-file*=METALINK_FILE::
  548. The file path to .metalink file. Reads input from stdin when '-' is
  549. specified. You are not required to use this option because you can
  550. specify .metalink files without *<<aria2_optref_metalink_file, -M>>*.
  551. [[aria2_optref_metalink_servers]]*-C*, *--metalink-servers*=NUM_SERVERS::
  552. The number of servers to connect to simultaneously.
  553. Some Metalinks regulate the number of servers to connect.
  554. aria2 strictly respects them.
  555. This means that if Metalink defines the maxconnections attribute lower
  556. than NUM_SERVERS, then aria2 uses the value of maxconnections attribute
  557. instead of NUM_SERVERS.
  558. See also *<<aria2_optref_split, -s>>* and *<<aria2_optref_max_concurrent_downloads, -j>>* options.
  559. Default: '5'
  560. [[aria2_optref_metalink_language]]*--metalink-language*=LANGUAGE::
  561. The language of the file to download.
  562. [[aria2_optref_metalink_location]]*--metalink-location*=LOCATION[,...]::
  563. The location of the preferred server.
  564. A comma-delimited list of locations is acceptable, for example, 'jp,us'.
  565. [[aria2_optref_metalink_os]]*--metalink-os*=OS::
  566. The operating system of the file to download.
  567. [[aria2_optref_metalink_version]]*--metalink-version*=VERSION::
  568. The version of the file to download.
  569. [[aria2_optref_metalink_preferred_protocol]]*--metalink-preferred-protocol*=PROTO::
  570. Specify preferred protocol.
  571. The possible values are 'http', 'https', 'ftp' and 'none'.
  572. Specify 'none' to disable this feature.
  573. Default: 'none'
  574. [[aria2_optref_metalink_enable_unique_protocol]]*--metalink-enable-unique-protocol*[='true'|'false']::
  575. If 'true' is given and several protocols are available for a mirror in a
  576. metalink file, aria2 uses one of them.
  577. Use *<<aria2_optref_metalink_preferred_protocol, --metalink-preferred-protocol>>* option to specify the preference of
  578. protocol.
  579. Default: 'true'
  580. XML-RPC Options
  581. ~~~~~~~~~~~~~~~
  582. [[aria2_optref_enable_xml_rpc]]*--enable-xml-rpc*[='true'|'false']::
  583. Enable XML-RPC server. It is strongly recommended to set username
  584. and password using *<<aria2_optref_xml_rpc_user, --xml-rpc-user>>* and *<<aria2_optref_xml_rpc_passwd, --xml-rpc-passwd>>*
  585. option. See also *<<aria2_optref_xml_rpc_listen_port, --xml-rpc-listen-port>>* option. Default: 'false'
  586. [[aria2_optref_xml_rpc_listen_all]]*--xml-rpc-listen-all*[='true'|'false']::
  587. Listen incoming XML-RPC requests on all network interfaces. If false
  588. is given, listen only on local loopback interface. Default: 'false'
  589. [[aria2_optref_xml_rpc_listen_port]]*--xml-rpc-listen-port*=PORT::
  590. Specify a port number for XML-RPC server to listen to. Possible
  591. Values: '1024'-'65535' Default: '6800'
  592. [[aria2_optref_xml_rpc_max_request_size]]*--xml-rpc-max-request-size*=SIZE::
  593. Set max size of XML-RPC request. If aria2 detects the request is
  594. more than SIZE bytes, it drops connection. Default: '2M'
  595. [[aria2_optref_xml_rpc_passwd]]*--xml-rpc-passwd*=PASSWD::
  596. Set XML-RPC password.
  597. [[aria2_optref_xml_rpc_user]]*--xml-rpc-user*=USER::
  598. Set XML-RPC user.
  599. Advanced Options
  600. ~~~~~~~~~~~~~~~~
  601. [[aria2_optref_allow_overwrite]]*--allow-overwrite*[='true'|'false']::
  602. Restart download from scratch if the corresponding control file
  603. doesn't exist. See also *<<aria2_optref_auto_file_renaming, --auto-file-renaming>>* option. Default:
  604. 'false'
  605. [[aria2_optref_allow_piece_length_change]]*--allow-piece-length-change*[='true'|'false']::
  606. If false is given, aria2 aborts download when a piece length is different
  607. from one in a control file.
  608. If true is given, you can proceed but some download progress will be lost.
  609. Default: 'false'
  610. [[aria2_optref_always_resume]]*--always-resume*[='true'|'false']::
  611. Always resume download. If 'true' is given, aria2 always tries to
  612. resume download and if resume is not possible, aborts download. If
  613. 'false' is given, when all given URIs do not support resume or aria2
  614. encounters 'N' URIs which does not support resume ('N' is the value
  615. specified using *<<aria2_optref_max_resume_failure_tries, --max-resume-failure-tries>>* option), aria2
  616. downloads file from scratch. See *<<aria2_optref_max_resume_failure_tries, --max-resume-failure-tries>>*
  617. option. Default: 'true'
  618. [[aria2_optref_async_dns]]*--async-dns*[='true'|'false']::
  619. Enable asynchronous DNS.
  620. Default: 'true'
  621. [[aria2_optref_auto_file_renaming]]*--auto-file-renaming*[='true'|'false']::
  622. Rename file name if the same file already exists.
  623. This option works only in HTTP(S)/FTP download.
  624. The new file name has a dot and a number(1..9999) appended.
  625. Default: 'true'
  626. [[aria2_optref_auto_save_interval]]*--auto-save-interval*=SEC::
  627. Save a control file(*.aria2) every SEC seconds.
  628. If '0' is given, a control file is not saved during download. aria2 saves a
  629. control file when it stops regardless of the value.
  630. The possible values are between '0' to '600'.
  631. Default: '60'
  632. [[aria2_optref_conditional_get]]*--conditional-get*[='true'|'false']::
  633. Download file only when the local file is older than remote
  634. file. This function only works with HTTP(S) downloads only. It does
  635. not work if file size is specified in Metalink. It also ignores
  636. Content-Disposition header. If a control file exists, this option
  637. will be ignored. This function uses If-Modified-Since header to get
  638. only newer file conditionally. When getting modification time of
  639. local file, it uses user supplied filename(see *<<aria2_optref_out, --out>>* option) or
  640. filename part in URI if *<<aria2_optref_out, --out>>* is not specified.
  641. To overwrite existing file, *<<aria2_optref_allow_overwrite, --allow-overwrite>>* is required.
  642. Default: 'false'
  643. [[aria2_optref_conf_path]]*--conf-path*=PATH::
  644. Change the configuration file path to PATH.
  645. Default: '$HOME/.aria2/aria2.conf'
  646. [[aria2_optref_daemon]]*-D*, *--daemon*[='true'|'false']::
  647. Run as daemon. The current working directory will be changed to '/'
  648. and standard input, standard output and standard error will be
  649. redirected to '/dev/null'. Default: 'false'
  650. [[aria2_optref_disable_ipv6]]*--disable-ipv6*[='true'|'false']::
  651. Disable IPv6. This is useful if you have to use broken DNS and want
  652. to avoid terribly slow AAAA record lookup. Default: 'false'
  653. [[aria2_optref_enable_async_dns6]]*--enable-async-dns6*[='true'|'false']::
  654. Enable IPv6 name resolution in asynchronous DNS resolver. This
  655. option will be ignored when *<<aria2_optref_async_dns, --async-dns>>*='false'.
  656. Default: 'false'
  657. [[aria2_optref_enable_direct_io]]*--enable-direct-io*[='true'|'false']::
  658. Enable directI/O, which lowers cpu usage while allocating/checking files.
  659. Turn off if you encounter any error.
  660. Default: 'true'
  661. [[aria2_optref_event_poll]]*--event-poll*=POLL::
  662. Specify the method for polling events. The possible values are
  663. 'epoll', 'kqueue', 'port', 'poll' and 'select'. For each 'epoll',
  664. 'kqueue', 'port' and 'poll', it is available if system supports it.
  665. 'epoll' is available on recent Linux. 'kqueue' is available on
  666. various *BSD systems including Mac OS X. 'port' is available on Open
  667. Solaris. The default value may vary depending on the system you use.
  668. [[aria2_optref_file_allocation]]*--file-allocation*=METHOD::
  669. Specify file allocation method.
  670. 'none' doesn't pre-allocate file space. 'prealloc' pre-allocates file space
  671. before download begins. This may take some time depending on the size of the
  672. file.
  673. If you are using newer file systems such as ext4
  674. (with extents support), btrfs or xfs, 'falloc' is
  675. your best choice. It allocates large(few GiB)
  676. files almost instantly. Don't use 'falloc' with
  677. legacy file systems such as ext3 because it takes
  678. almost same time as 'prealloc' and it blocks aria2
  679. entirely until allocation finishes. 'falloc' may
  680. not be available if your system doesn't have
  681. *posix_fallocate*() function.
  682. Possible Values: 'none', 'prealloc', 'falloc'
  683. Default: 'prealloc'
  684. [[aria2_optref_human_readable]]*--human-readable*[='true'|'false']::
  685. Print sizes and speed in human readable format (e.g., 1.2Ki, 3.4Mi)
  686. in the console readout. Default: 'true'
  687. [[aria2_optref_interface]]*--interface*=INTERFACE::
  688. Bind sockets to given interface. You can specify interface name, IP
  689. address and hostname.
  690. Possible Values: interface, IP address, hostname
  691. [NOTE]
  692. If an interface has multiple addresses, it is highly recommended to
  693. specify IP address explicitly. See also *<<aria2_optref_disable_ipv6, --disable-ipv6>>*. If your
  694. system doesn't have getifaddrs(), this option doesn't accept interface
  695. name.
  696. [[aria2_optref_max_download_result]]*--max-download-result*=NUM::
  697. Set maximum number of download result kept in memory. The download
  698. results are completed/error/removed downloads. The download results
  699. are stored in FIFO queue and it can store at most NUM download
  700. results. When queue is full and new download result is created,
  701. oldest download result is removed from the front of the queue and
  702. new one is pushed to the back. Setting big number in this option may
  703. result high memory consumption after thousands of
  704. downloads. Specifying 0 means no download result is kept. Default:
  705. '1000'
  706. [[aria2_optref_max_resume_failure_tries]]*--max-resume-failure-tries*=N::
  707. When used with *<<aria2_optref_always_resume, --always-resume>>*='false', aria2 downloads file from
  708. scratch when aria2 detects 'N' number of URIs that does not support
  709. resume. If 'N' is '0', aria2 downloads file from scratch when all
  710. given URIs do not support resume. See *<<aria2_optref_always_resume, --always-resume>>* option.
  711. Default: '0'
  712. [[aria2_optref_log_level]]*--log-level*=LEVEL::
  713. Set log level to output.
  714. LEVEL is either 'debug', 'info', 'notice', 'warn' or 'error'.
  715. Default: 'debug'
  716. [[aria2_optref_on_bt_download_complete]]*--on-bt-download-complete*=COMMAND::
  717. For BitTorrent, a command specified in *<<aria2_optref_on_download_complete, --on-download-complete>>* is
  718. called after download completed and seeding is over. On the other
  719. hand, this option set the command to be executed after download
  720. completed but before seeding.
  721. See *<<_event_hook, Event Hook>>* for more details about COMMAND.
  722. Possible Values: '/path/to/command'
  723. [[aria2_optref_on_download_complete]]*--on-download-complete*=COMMAND::
  724. Set the command to be executed after download completed. See
  725. See *<<_event_hook, Event Hook>>* for more details about COMMAND.
  726. See also *<<aria2_optref_on_download_stop, --on-download-stop>>* option.
  727. Possible Values: '/path/to/command'
  728. [[aria2_optref_on_download_error]]*--on-download-error*=COMMAND::
  729. Set the command to be executed after download aborted due to error.
  730. See *<<_event_hook, Event Hook>>* for more details about COMMAND.
  731. See also *<<aria2_optref_on_download_stop, --on-download-stop>>* option. Possible Values:
  732. '/path/to/command'
  733. [[aria2_optref_on_download_pause]]*--on-download-pause*=COMMAND::
  734. Set the command to be executed after download was paused.
  735. See *<<_event_hook, Event Hook>>* for more details about COMMAND.
  736. Possible Values: '/path/to/command'
  737. [[aria2_optref_on_download_start]]*--on-download-start*=COMMAND::
  738. Set the command to be executed after download got started.
  739. See *<<_event_hook, Event Hook>>* for more details about COMMAND.
  740. Possible Values: '/path/to/command'
  741. [[aria2_optref_on_download_stop]]*--on-download-stop*=COMMAND::
  742. Set the command to be executed after download stopped. You can override
  743. the command to be executed for particular download result using
  744. *<<aria2_optref_on_download_complete, --on-download-complete>>* and *<<aria2_optref_on_download_error, --on-download-error>>*. If they are
  745. specified, command specified in this option is not executed.
  746. See *<<_event_hook, Event Hook>>* for more details about COMMAND.
  747. Possible Values: '/path/to/command'
  748. [[aria2_optref_summary_interval]]*--summary-interval*=SEC::
  749. Set interval in seconds to output download progress summary.
  750. Setting '0' suppresses the output.
  751. Default: '60'
  752. [NOTE]
  753. In multi file torrent downloads, the files adjacent forward to the specified files
  754. are also allocated if they share the same piece.
  755. [[aria2_optref_force_sequential]]*-Z*, *--force-sequential*[='true'|'false']::
  756. Fetch URIs in the command-line sequentially and download each URI in a
  757. separate session, like the usual command-line download utilities.
  758. Default: 'false'
  759. [[aria2_optref_max_overall_download_limit]]*--max-overall-download-limit*=SPEED::
  760. Set max overall download speed in bytes/sec. '0' means
  761. unrestricted. You can append 'K' or 'M'(1K = 1024, 1M = 1024K). To
  762. limit the download speed per download, use *<<aria2_optref_max_download_limit, --max-download-limit>>*
  763. option. Default: '0'
  764. [[aria2_optref_max_download_limit]]*--max-download-limit*=SPEED::
  765. Set max download speed per each download in bytes/sec. '0' means
  766. unrestricted. You can append 'K' or 'M'(1K = 1024, 1M = 1024K). To
  767. limit the overall download speed, use *<<aria2_optref_max_overall_download_limit, --max-overall-download-limit>>*
  768. option. Default: '0'
  769. [[aria2_optref_no_conf]]*--no-conf*[='true'|'false']::
  770. Disable loading aria2.conf file.
  771. [[aria2_optref_no_file_allocation_limit]]*--no-file-allocation-limit*=SIZE::
  772. No file allocation is made for files whose size is smaller than SIZE.
  773. You can append 'K' or 'M'(1K = 1024, 1M = 1024K).
  774. Default: '5M'
  775. [[aria2_optref_parameterized_uri]]*-P*, *--parameterized-uri*[='true'|'false']::
  776. Enable parameterized URI support.
  777. You can specify set of parts: 'http://{sv1,sv2,sv3}/foo.iso'.
  778. Also you can specify numeric sequences with step counter:
  779. '\http://host/image[000-100:2].img'.
  780. A step counter can be omitted.
  781. If all URIs do not point to the same file, such as the second example above,
  782. -Z option is required.
  783. Default: 'false'
  784. [[aria2_optref_quiet]]*-q*, *--quiet*[='true'|'false']::
  785. Make aria2 quiet (no console output).
  786. Default: 'false'
  787. [[aria2_optref_realtime_chunk_checksum]]*--realtime-chunk-checksum*[='true'|'false']::
  788. Validate chunk of data by calculating checksum while downloading a file if
  789. chunk checksums are provided.
  790. Default: 'true'
  791. [[aria2_optref_remove_control_file]]*--remove-control-file*[='true'|'false']::
  792. Remove control file before download. Using with
  793. *<<aria2_optref_allow_overwrite, --allow-overwrite>>*='true', download always starts from
  794. scratch. This will be useful for users behind proxy server which
  795. disables resume.
  796. [NOTE]
  797. For Metalink downloads, -C1 is recommended for proxy server which
  798. disables resume, in order to avoid establishing unnecessary
  799. connections.
  800. [[aria2_optref_save_session]]*--save-session*=FILE::
  801. Save error/unfinished downloads to FILE on exit. You can pass this
  802. output file to aria2c with *<<aria2_optref_input_file, -i>>* option on restart. Please note that
  803. downloads added by *<<aria2_xmlrpc_aria2_addTorrent, aria2.addTorrent>>* and
  804. *<<aria2_xmlrpc_aria2_addMetalink, aria2.addMetalink>>*
  805. XML-RPC method are not saved.
  806. [[aria2_optref_stop]]*--stop*=SEC::
  807. Stop application after SEC seconds has passed.
  808. If '0' is given, this feature is disabled.
  809. Default: '0'
  810. [[aria2_optref_version]]*-v*, *--version*::
  811. Print the version number, copyright and the configuration information and
  812. exit.
  813. Options That Take An Optional Argument
  814. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  815. The options that have its argument surrounded by square brackets([])
  816. take an optional argument. Usually omiting the argument is evaluated to 'true'.
  817. If you use short form of these options(such as '-V') and give
  818. an argument, then the option name and its argument should be concatenated(e.g.
  819. '-Vfalse'). If any spaces are inserted between the option name and the argument,
  820. the argument will be treated as URI and usually this is not what you expect.
  821. URI, MAGNET, TORRENT_FILE, METALINK_FILE
  822. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  823. You can specify multiple URIs in command-line. Unless you specify
  824. *<<aria2_optref_force_sequential, -Z>>* option, all URIs must point to the same file or downloading will
  825. fail.
  826. You can specify arbitrary number of BitTorrent Magnet URI. Please note
  827. that they are always treated as a separate download. Both hex encoded
  828. 40 characters Info Hash and Base32 encoded 32 characters Info Hash are
  829. supported. The multiple "tr" parameters are supported. Because
  830. BitTorrent Magnet URI is likely to contain "&" character, it is highly
  831. recommended to always quote URI with single(') or double(") quotation.
  832. It is strongly recommended to enable DHT especially when "tr"
  833. parameter is missing. See http://www.bittorrent.org/beps/bep_0009.html
  834. for more details about BitTorrent Magnet URI.
  835. You can also specify arbitrary number of torrent files and Metalink
  836. documents stored on a local drive. Please note that they are always
  837. treated as a separate download. Both Metalink4 and Metalink version
  838. 3.0 are supported.
  839. You can specify both torrent file with -T option and URIs. By doing
  840. this, you can download a file from both torrent swarm and HTTP(S)/FTP
  841. server at the same time, while the data from HTTP(S)/FTP are uploaded
  842. to the torrent swarm. For single file torrents, URI can be a complete
  843. URI pointing to the resource or if URI ends with /, name in torrent
  844. file in torrent is added. For multi-file torrents, name and path are
  845. added to form a URI for each file.
  846. [NOTE]
  847. Make sure that URI is quoted with single(') or double(") quotation if it
  848. contains "&" or any characters that have special meaning in shell.
  849. Resuming Download
  850. ~~~~~~~~~~~~~~~~~
  851. Usually, you can resume transfer by just issuing same command(aria2c
  852. URI) if the previous transfer is made by aria2.
  853. If the previous transfer is made by a browser or wget like sequential
  854. download manager, then use -c option to continue the transfer(aria2c
  855. *<<aria2_optref_continue, -c>>* URI).
  856. Event Hook
  857. ~~~~~~~~~~
  858. aria2 provides options to specify arbitrary command after specific event
  859. occurred. Currently following options are available:
  860. *<<aria2_optref_on_bt_download_complete, --on-bt-download-complete>>*,
  861. *<<aria2_optref_on_download_pause, --on-download-pause>>*,
  862. *<<aria2_optref_on_download_complete, --on-download-complete>>*.
  863. *<<aria2_optref_on_download_start, --on-download-start>>*,
  864. *<<aria2_optref_on_download_error, --on-download-error>>*,
  865. *<<aria2_optref_on_download_stop, --on-download-stop>>*.
  866. aria2 passes 3 arguments to specified command when it is executed.
  867. These arguments are: GID, the number of files and file path. For
  868. HTTP, FTP downloads, usually the number of files is 1. BitTorrent
  869. download can contain multiple files.
  870. If number of files is more than one, file path is first one. In
  871. other words, this is the value of path key of first struct whose
  872. selected key is true in the response of
  873. *<<aria2_xmlrpc_aria2_getFiles, aria2.getFiles>>*
  874. XML-RPC method.
  875. If you want to get all file paths, consider to use XML-RPC. Please
  876. note that file path may change during download in HTTP because of
  877. redirection or Content-Disposition header.
  878. Let's see an example of how arguments are passed to command.
  879. --------------------------------------------------------------------------------
  880. $ cat hook.sh
  881. #!/bin/sh
  882. echo "Called with [$1] [$2] [$3]"
  883. $ aria2c --on-download-complete hook.sh http://example.org/file.iso
  884. Called with [1] [1] [/path/to/file.iso]
  885. --------------------------------------------------------------------------------
  886. EXIT STATUS
  887. -----------
  888. Because aria2 can handle multiple downloads at once, it encounters
  889. lots of errors in a session. aria2 returns the following exit status
  890. based on the last error encountered.
  891. *0*::
  892. If all downloads were successful.
  893. *1*::
  894. If an unknown error occurred.
  895. *2*::
  896. If time out occurred.
  897. *3*::
  898. If a resource was not found.
  899. *4*::
  900. If aria2 saw the specfied number of "resource not found" error.
  901. See *<<aria2_optref_max_file_not_found, --max-file-not-found>>* option).
  902. *5*::
  903. If a download aborted because download speed was too slow.
  904. See *<<aria2_optref_lowest_speed_limit, --lowest-speed-limit>>* option)
  905. *6*::
  906. If network problem occurred.
  907. *7*::
  908. If there were unfinished downloads. This error is only reported if
  909. all finished downloads were successful and there were unfinished
  910. downloads in a queue when aria2 exited by pressing Ctrl-C by an user
  911. or sending TERM or INT signal.
  912. *8*::
  913. If remote server did not support resume when resume was required to
  914. complete download.
  915. *9*::
  916. If there was not enough disk space available.
  917. *10*::
  918. If piece length was different from one in .aria2 control file. See
  919. *<<aria2_optref_allow_piece_length_change, --allow-piece-length-change>>* option.
  920. *11*::
  921. If aria2 was downloading same file at that moment.
  922. *12*::
  923. If aria2 was downloading same info hash torrent at that moment.
  924. *13*::
  925. If file already existed. See *<<aria2_optref_allow_overwrite, --allow-overwrite>>* option.
  926. *14*::
  927. If renaming file failed. See *<<aria2_optref_auto_file_renaming, --auto-file-renaming>>* option.
  928. *15*::
  929. If aria2 could not open existing file.
  930. *16*::
  931. If aria2 could not create new file or truncate existing file.
  932. *17*::
  933. If file I/O error occurred.
  934. *18*::
  935. If aria2 could not create directory.
  936. *19*::
  937. If name resolution failed.
  938. *20*::
  939. If aria2 could not parse Metalink document.
  940. *21*::
  941. If FTP command failed.
  942. *22*::
  943. If HTTP response header was bad or unexpected.
  944. *23*::
  945. If too many redirections occurred.
  946. *24*::
  947. If HTTP authorization failed.
  948. *25*::
  949. If aria2 could not parse bencoded file(usually .torrent file).
  950. *26*::
  951. If .torrent file was corrupted or missing information that aria2 needed.
  952. *27*::
  953. If Magnet URI was bad.
  954. *28*::
  955. If bad/unrecognized option was given or unexpected option argument
  956. was given.
  957. *29*::
  958. If the remote server was unable to handle the request due to a
  959. temporary overloading or maintenance.
  960. [NOTE]
  961. An error occurred in a finished download will not be reported
  962. as exit status.
  963. ENVIRONMENT
  964. -----------
  965. aria2 recognizes the following environment variables.
  966. http_proxy [\\http://][USER:PASSWORD@]HOST[:PORT]::
  967. Specify proxy server for use in HTTP.
  968. Overrides http-proxy value in configuration file.
  969. The command-line option *<<aria2_optref_http_proxy, --http-proxy>>* overrides this value.
  970. https_proxy [\\http://][USER:PASSWORD@]HOST[:PORT]::
  971. Specify proxy server for use in HTTPS.
  972. Overrides https-proxy value in configuration file.
  973. The command-line option *<<aria2_optref_https_proxy, --https-proxy>>* overrides this value.
  974. ftp_proxy [\\http://][USER:PASSWORD@]HOST[:PORT]::
  975. Specify proxy server for use in FTP.
  976. Overrides ftp-proxy value in configuration file.
  977. The command-line option *<<aria2_optref_ftp_proxy, --ftp-proxy>>* overrides this value.
  978. all_proxy [\\http://][USER:PASSWORD@]HOST[:PORT]::
  979. Specify proxy server for use if no protocol-specific proxy is specified.
  980. Overrides all-proxy value in configuration file.
  981. The command-line option *<<aria2_optref_all_proxy, --all-proxy>>* overrides this value.
  982. no_proxy [DOMAIN,...]::
  983. Specify comma-separated hostname, domains and network address with
  984. or without CIDR block to which proxy should not be used. Overrides
  985. no-proxy value in configuration file. The command-line option
  986. *<<aria2_optref_no_proxy, --no-proxy>>* overrides this value.
  987. FILES
  988. -----
  989. aria2.conf
  990. ~~~~~~~~~~
  991. By default, aria2 parses '$HOME/.aria2/aria2.conf' as a configuraiton
  992. file. You can specify the path to configuration file using
  993. *<<aria2_optref_conf_path, --conf-path>>* option. If you don't want to use the configuraitonf
  994. file, use *<<aria2_optref_no_conf, --no-conf>>* option.
  995. The configuration file is a text file and has 1 option per each
  996. line. In each line, you can specify name-value pair in the format:
  997. NAME=VALUE, where name is the long command-line option name without
  998. "--" prefix. You can use same syntax for the command-line option. The
  999. lines beginning "#" are treated as comments.
  1000. --------------------------------------
  1001. # sample configuration file for aria2c
  1002. listen-port=60000
  1003. dht-listen-port=60000
  1004. seed-ratio=1.0
  1005. max-upload-limit=50K
  1006. ftp-pasv=true
  1007. --------------------------------------
  1008. dht.dat
  1009. ~~~~~~~~
  1010. By default, the routing table of IPv4 DHT is saved to the path
  1011. '$HOME/.aria2/dht.dat' and the routing table of IPv6 DHT is saved to
  1012. the path '$HOME/.aria2/dht6.dat'.
  1013. Netrc
  1014. ~~~~~
  1015. Netrc support is enabled by default for HTTP(S)/FTP. To disable netrc
  1016. support, specify *<<aria2_optref_no_netrc, -n>>* option. Your .netrc file should have correct
  1017. permissions(600).
  1018. If machine name starts ".", aria2 performs domain match instead of
  1019. exact match. This is an extension of aria2. For example of domain
  1020. match, imagine the following .netrc entry:
  1021. -------------------------------------------------
  1022. machine .example.org login myid password mypasswd
  1023. -------------------------------------------------
  1024. In domain match, aria2.example.org matches .example.org and uses myid
  1025. and mypasswd. example.org also matches .example.org. But example.net
  1026. does not match .example.org.
  1027. Control File
  1028. ~~~~~~~~~~~~
  1029. aria2 uses a control file to track the progress of a download. A
  1030. control file is placed in the same directory as the downloading file
  1031. and its filename is the filename of downloading file with ".aria2"
  1032. appended. For example, if you are downloading file.zip, then the
  1033. control file should be file.zip.aria2. (There is a exception for this
  1034. naming convention. If you are downloading a multi torrent, its
  1035. control file is the "top directory" name of the torrent with ".aria2"
  1036. appended. The "top directory" name is a value of "name" key in "info"
  1037. directory in a torrent file.)
  1038. Usually a control file is deleted once download completed. If aria2
  1039. decides that download cannot be resumed(for example, when downloading
  1040. a file from a HTTP server which doesn't support resume), a control
  1041. file is not created.
  1042. Normally if you lose a control file, you cannot resume download. But
  1043. if you have a torrent or metalink with chunk checksums for the file,
  1044. you can resume the download without a control file by giving -V option
  1045. to aria2c in command-line.
  1046. Input File
  1047. ~~~~~~~~~~
  1048. The input file can contain a list of URIs for aria2 to download. You
  1049. can specify multiple URIs for a single entity: separate URIs on a
  1050. single line using the TAB character.
  1051. Each line is treated as if it is provided in command-line argument.
  1052. Therefore they are affected by *<<aria2_optref_force_sequential, -Z>>* and *<<aria2_optref_parameterized_uri, -P>>* options.
  1053. Lines starting with "#" are treated as comments and skipped.
  1054. Additionally, the following options can be specified after each line
  1055. of URIs. These optional lines must start with white space(s).
  1056. * *<<aria2_optref_all_proxy, all-proxy>>*
  1057. * *<<aria2_optref_all_proxy_passwd, all-proxy-passwd>>*
  1058. * *<<aria2_optref_all_proxy_user, all-proxy-user>>*
  1059. * *<<aria2_optref_allow_overwrite, allow-overwrite>>*
  1060. * *<<aria2_optref_allow_piece_length_change, allow-piece-length-change>>*
  1061. * *<<aria2_optref_always_resume, always-resume>>*
  1062. * *<<aria2_optref_async_dns, async-dns>>*
  1063. * *<<aria2_optref_auto_file_renaming, auto-file-renaming>>*
  1064. * *<<aria2_optref_bt_enable_lpd, bt-enable-lpd>>*
  1065. * *<<aria2_optref_bt_exclude_tracker, bt-exclude-tracker>>*
  1066. * *<<aria2_optref_bt_external_ip, bt-external-ip>>*
  1067. * *<<aria2_optref_bt_hash_check_seed, bt-hash-check-seed>>*
  1068. * *<<aria2_optref_bt_max_open_files, bt-max-open-files>>*
  1069. * *<<aria2_optref_bt_max_peers, bt-max-peers>>*
  1070. * *<<aria2_optref_bt_metadata_only, bt-metadata-only>>*
  1071. * *<<aria2_optref_bt_min_crypto_level, bt-min-crypto-level>>*
  1072. * *<<aria2_optref_bt_prioritize_piece, bt-prioritize-piece>>*
  1073. * *<<aria2_optref_bt_request_peer_speed_limit, bt-request-peer-speed-limit>>*
  1074. * *<<aria2_optref_bt_require_crypto, bt-require-crypto>>*
  1075. * *<<aria2_optref_bt_save_metadata, bt-save-metadata>>*
  1076. * *<<aria2_optref_bt_seed_unverified, bt-seed-unverified>>*
  1077. * *<<aria2_optref_bt_stop_timeout, bt-stop-timeout>>*
  1078. * *<<aria2_optref_bt_tracker, bt-tracker>>*
  1079. * *<<aria2_optref_bt_tracker_connect_timeout, bt-tracker-connect-timeout>>*
  1080. * *<<aria2_optref_bt_tracker_interval, bt-tracker-interval>>*
  1081. * *<<aria2_optref_bt_tracker_timeout, bt-tracker-timeout>>*
  1082. * *<<aria2_optref_check_integrity, check-integrity>>*
  1083. * *<<aria2_optref_conditional_get, conditional-get>>*
  1084. * *<<aria2_optref_connect_timeout, connect-timeout>>*
  1085. * *<<aria2_optref_continue, continue>>*
  1086. * *<<aria2_optref_dir, dir>>*
  1087. * *<<aria2_optref_dry_run, dry-run>>*
  1088. * *<<aria2_optref_enable_async_dns6, enable-async-dns6>>*
  1089. * *<<aria2_optref_enable_http_keep_alive, enable-http-keep-alive>>*
  1090. * *<<aria2_optref_enable_http_pipelining, enable-http-pipelining>>*
  1091. * *<<aria2_optref_enable_peer_exchange, enable-peer-exchange>>*
  1092. * *<<aria2_optref_file_allocation, file-allocation>>*
  1093. * *<<aria2_optref_follow_metalink, follow-metalink>>*
  1094. * *<<aria2_optref_follow_torrent, follow-torrent>>*
  1095. * *<<aria2_optref_ftp_passwd, ftp-passwd>>*
  1096. * *<<aria2_optref_ftp_pasv, ftp-pasv>>*
  1097. * *<<aria2_optref_ftp_proxy, ftp-proxy>>*
  1098. * *<<aria2_optref_ftp_proxy_passwd, ftp-proxy-passwd>>*
  1099. * *<<aria2_optref_ftp_proxy_user, ftp-proxy-user>>*
  1100. * *<<aria2_optref_ftp_reuse_connection, ftp-reuse-connection>>*
  1101. * *<<aria2_optref_ftp_type, ftp-type>>*
  1102. * *<<aria2_optref_ftp_user, ftp-user>>*
  1103. * *<<aria2_optref_header, header>>*
  1104. * *<<aria2_optref_http_accept_gzip, http-accept-gzip>>*
  1105. * *<<aria2_optref_http_auth_challenge, http-auth-challenge>>*
  1106. * *<<aria2_optref_http_no_cache, http-no-cache>>*
  1107. * *<<aria2_optref_http_passwd, http-passwd>>*
  1108. * *<<aria2_optref_http_proxy, http-proxy>>*
  1109. * *<<aria2_optref_http_proxy_passwd, http-proxy-passwd>>*
  1110. * *<<aria2_optref_http_proxy_user, http-proxy-user>>*
  1111. * *<<aria2_optref_http_user, http-user>>*
  1112. * *<<aria2_optref_https_proxy, https-proxy>>*
  1113. * *<<aria2_optref_https_proxy_passwd, https-proxy-passwd>>*
  1114. * *<<aria2_optref_https_proxy_user, https-proxy-user>>*
  1115. * *<<aria2_optref_index_out, index-out>>*
  1116. * *<<aria2_optref_lowest_speed_limit, lowest-speed-limit>>*
  1117. * *<<aria2_optref_max_connection_per_server, max-connection-per-server>>*
  1118. * *<<aria2_optref_max_download_limit, max-download-limit>>*
  1119. * *<<aria2_optref_max_file_not_found, max-file-not-found>>*
  1120. * *<<aria2_optref_max_resume_failure_tries, max-resume-failure-tries>>*
  1121. * *<<aria2_optref_max_tries, max-tries>>*
  1122. * *<<aria2_optref_max_upload_limit, max-upload-limit>>*
  1123. * *<<aria2_optref_metalink_enable_unique_protocol, metalink-enable-unique-protocol>>*
  1124. * *<<aria2_optref_metalink_language, metalink-language>>*
  1125. * *<<aria2_optref_metalink_location, metalink-location>>*
  1126. * *<<aria2_optref_metalink_os, metalink-os>>*
  1127. * *<<aria2_optref_metalink_preferred_protocol, metalink-preferred-protocol>>*
  1128. * *<<aria2_optref_metalink_servers, metalink-servers>>*
  1129. * *<<aria2_optref_metalink_version, metalink-version>>*
  1130. * *<<aria2_optref_min_split_size, min-split-size>>*
  1131. * *<<aria2_optref_no_file_allocation_limit, no-file-allocation-limit>>*
  1132. * *<<aria2_optref_no_netrc, no-netrc>>*
  1133. * *<<aria2_optref_no_proxy, no-proxy>>*
  1134. * *<<aria2_optref_out, out>>*
  1135. * *<<aria2_optref_parameterized_uri, parameterized-uri>>*
  1136. * *<<aria2_optref_proxy_method, proxy-method>>*
  1137. * *<<aria2_optref_realtime_chunk_checksum, realtime-chunk-checksum>>*
  1138. * *<<aria2_optref_referer, referer>>*
  1139. * *<<aria2_optref_remote_time, remote-time>>*
  1140. * *<<aria2_optref_remove_control_file, remove-control-file>>*
  1141. * *<<aria2_optref_reuse_uri, reuse-uri>>*
  1142. * *<<aria2_optref_seed_ratio, seed-ratio>>*
  1143. * *<<aria2_optref_seed_time, seed-time>>*
  1144. * *<<aria2_optref_select_file, select-file>>*
  1145. * *<<aria2_optref_split, split>>*
  1146. * *<<aria2_optref_timeout, timeout>>*
  1147. * *<<aria2_optref_use_head, use-head>>*
  1148. * *<<aria2_optref_user_agent, user-agent>>*
  1149. * *<<aria2_optref_retry_wait, retry-wait>>*
  1150. These options have exactly same meaning of the ones in the
  1151. command-line options, but it just applies to the URIs it belongs to.
  1152. Please note that for options in input file "--" prefix must be
  1153. stripped.
  1154. For example, the content of uri.txt is
  1155. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1156. http://server/file.iso http://mirror/file.iso
  1157. dir=/iso_images
  1158. out=file.img
  1159. http://foo/bar
  1160. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1161. If aria2 is executed with *<<aria2_optref_input_file, -i>>* uri.txt *<<aria2_optref_dir, -d>>* /tmp options, then
  1162. 'file.iso' is saved as '/iso_images/file.img' and it is downloaded
  1163. from \http://server/file.iso and \http://mirror/file.iso. The file
  1164. 'bar' is downloaded from \http://foo/bar and saved as '/tmp/bar'.
  1165. In some cases, *<<aria2_optref_out, out>>* parameter has no effect.
  1166. See note of *<<aria2_optref_out, --out>>*
  1167. option for the restrictions.
  1168. Server Performance Profile
  1169. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  1170. This section describes the format of server performance profile. The
  1171. file is plain text and each line has several NAME=VALUE pair,
  1172. delimited by comma. Currently following NAMEs are recognized:
  1173. host::
  1174. Hostname of the server. Required.
  1175. protocol::
  1176. Protocol for this profile, such as ftp, http. Required.
  1177. dl_speed::
  1178. The average download speed observed in the previous download in
  1179. bytes per sec. Required.
  1180. sc_avg_speed::
  1181. The average download speed observed in the previous download in
  1182. bytes per sec. This value is only updated if the download is done in
  1183. single connection environment and only used by
  1184. AdaptiveURISelector. Optional.
  1185. mc_avg_speed::
  1186. The average download speed observed in the previous download in
  1187. bytes per sec. This value is only updated if the download is done in
  1188. multi connection environment and only used by
  1189. AdaptiveURISelector. Optional.
  1190. counter::
  1191. How many times the server is used. Currently this value is only used
  1192. by AdaptiveURISelector. Optional.
  1193. last_updated::
  1194. Last contact time in GMT with this server, specified in the seconds
  1195. since the Epoch(00:00:00 on January 1, 1970, UTC). Required.
  1196. status::
  1197. ERROR is set when server cannot be reached or out-of-service or
  1198. timeout occurred. Otherwise, OK is set.
  1199. Those fields must exist in one line. The order of the fields is not
  1200. significant. You can put pairs other than the above; they are simply
  1201. ignored.
  1202. An example follows:
  1203. --------------------------------------------------------------------------------
  1204. host=localhost, protocol=http, dl_speed=32000, last_updated=1222491640, status=OK
  1205. host=localhost, protocol=ftp, dl_speed=0, last_updated=1222491632, status=ERROR
  1206. --------------------------------------------------------------------------------
  1207. XML-RPC INTERFACE
  1208. -----------------
  1209. Terminology
  1210. ~~~~~~~~~~~
  1211. GID::
  1212. GID(or gid) is the key to manage each download. Each download has an
  1213. unique GID. Currently GID looks like an integer, but don't treat it
  1214. as integer because it may be changed to another type in the future
  1215. release. Please note that GID is session local and not persisted
  1216. when aria2 exits.
  1217. Methods
  1218. ~~~~~~~
  1219. All code examples come from Python2.7 interpreter.
  1220. [[aria2_xmlrpc_aria2_addUri]]
  1221. *aria2.addUri* ('uris[, options[, position]]')
  1222. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1223. Description
  1224. +++++++++++
  1225. This method adds new HTTP(S)/FTP/BitTorrent Magnet URI. 'uris' is of
  1226. type array and its element is URI which is of type string. For
  1227. BitTorrent Magnet URI, 'uris' must have only one element and it should
  1228. be BitTorrent Magnet URI. URIs in 'uris' must point to the same file.
  1229. If you mix other URIs which point to another file, aria2 does not
  1230. complain but download may fail. 'options' is of type struct and its
  1231. members are a pair of option name and value. See *<<aria2_xmlrpc_options, Options>>* below for
  1232. more details. If 'position' is given as an integer starting from 0,
  1233. the new download is inserted at 'position' in the waiting queue. If
  1234. 'position' is not given or 'position' is larger than the size of the
  1235. queue, it is appended at the end of the queue. This method returns
  1236. GID of registered download.
  1237. Example
  1238. +++++++
  1239. The following example adds \http://example.org/file to aria2:
  1240. ----------------------------------------------------------
  1241. >>> import xmlrpclib
  1242. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1243. >>> s.aria2.addUri(['http://example.org/file'])
  1244. '1'
  1245. ----------------------------------------------------------
  1246. The following example adds 2 sources and some options:
  1247. --------------------------------------------------------------------------
  1248. >>> s.aria2.addUri(['http://example.org/file'], dict(dir="/tmp"))
  1249. '2'
  1250. --------------------------------------------------------------------------
  1251. The following example adds a download and insert it to the front of
  1252. waiting downloads:
  1253. ---------------------------------------------------------------
  1254. >>> s.aria2.addUri(['http://example.org/file'], {}, 0)
  1255. '3'
  1256. ---------------------------------------------------------------
  1257. [[aria2_xmlrpc_aria2_addTorrent]]
  1258. *aria2.addTorrent* ('torrent[, uris[, options[, position]]]')
  1259. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1260. Description
  1261. +++++++++++
  1262. This method adds BitTorrent download by uploading .torrent file. If
  1263. you want to add BitTorrent Magnet URI, use *<<aria2_xmlrpc_aria2_addUri, aria2.addUri>>* method
  1264. instead. 'torrent' is of type base64 which contains Base64-encoded
  1265. .torrent file. 'uris' is of type array and its element is URI which
  1266. is of type string. 'uris' is used for Web-seeding. For single file
  1267. torrents, URI can be a complete URI pointing to the resource or if URI
  1268. ends with /, name in torrent file is added. For multi-file torrents,
  1269. name and path in torrent are added to form a URI for each file.
  1270. 'options' is of type struct and its members are a pair of option name
  1271. and value. See *<<aria2_xmlrpc_options, Options>>* below for more details. If 'position' is
  1272. given as an integer starting from 0, the new download is inserted at
  1273. 'position' in the waiting queue. If 'position' is not given or
  1274. 'position' is larger than the size of the queue, it is appended at the
  1275. end of the queue. This method returns GID of registered download.
  1276. Please note that the downloads added by this method are not saved by
  1277. *<<aria2_optref_save_session, --save-session>>*.
  1278. Example
  1279. +++++++
  1280. The following example adds local file file.torrent to aria2:
  1281. ---------------------------------------------------------------------
  1282. >>> import xmlrpclib
  1283. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1284. >>> s.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent').read()))
  1285. '6'
  1286. ---------------------------------------------------------------------
  1287. [[aria2_xmlrpc_aria2_addMetalink]]
  1288. *aria2.addMetalink* ('metalink[, options[, position]]')
  1289. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1290. Description
  1291. +++++++++++
  1292. This method adds Metalink download by uploading .metalink file.
  1293. 'metalink' is of type base64 which contains Base64-encoded .metalink
  1294. file. 'options' is of type struct and its members are a pair of
  1295. option name and value. See *<<aria2_xmlrpc_options, Options>>* below for more details. If
  1296. 'position' is given as an integer starting from 0, the new download is
  1297. inserted at 'position' in the waiting queue. If 'position' is not
  1298. given or 'position' is larger than the size of the queue, it is
  1299. appended at the end of the queue. This method returns array of GID of
  1300. registered download. Please note that the downloads added by this
  1301. method are not saved by *<<aria2_optref_save_session, --save-session>>*.
  1302. Example
  1303. +++++++
  1304. The following example adds local file file.meta4 to aria2:
  1305. --------------------------------------------------------------------
  1306. >>> import xmlrpclib
  1307. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1308. >>> s.aria2.addMetalink(xmlrpclib.Binary(open('file.meta4').read()))
  1309. ['8']
  1310. --------------------------------------------------------------------
  1311. [[aria2_xmlrpc_aria2_remove]]
  1312. *aria2.remove* ('gid')
  1313. ^^^^^^^^^^^^^^^^^^^^^^
  1314. Description
  1315. +++++++++++
  1316. This method removes the download denoted by 'gid'. 'gid' is of type
  1317. string. If specified download is in progress, it is stopped at
  1318. first. The status of removed download becomes "removed". This method
  1319. returns GID of removed download.
  1320. Example
  1321. +++++++
  1322. The following example removes download whose GID is "3":
  1323. --------------------------------------------------------------------
  1324. >>> import xmlrpclib
  1325. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1326. >>> s.aria2.remove('3')
  1327. '3'
  1328. --------------------------------------------------------------------
  1329. [[aria2_xmlrpc_aria2_forceRemove]]
  1330. *aria2.forceRemove* ('gid')
  1331. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1332. Description
  1333. +++++++++++
  1334. This method removes the download denoted by 'gid'. This method
  1335. behaves just like *<<aria2_xmlrpc_aria2_remove, aria2.remove>>* except that this method removes
  1336. download without any action which takes time such as contacting
  1337. BitTorrent tracker.
  1338. [[aria2_xmlrpc_aria2_pause]]
  1339. *aria2.pause* ('gid')
  1340. ^^^^^^^^^^^^^^^^^^^^^
  1341. Description
  1342. +++++++++++
  1343. This method pauses the download denoted by 'gid'. 'gid' is of type
  1344. string. The status of paused download becomes "paused". If the
  1345. download is active, the download is placed on the first position of
  1346. waiting queue. As long as the status is "paused", the download is not
  1347. started. To change status to "waiting", use *<<aria2_xmlrpc_aria2_unpause, aria2.unpause>>* method.
  1348. This method returns GID of paused download.
  1349. [[aria2_xmlrpc_aria2_pauseAll]]
  1350. *aria2.pauseAll* ()
  1351. ^^^^^^^^^^^^^^^^^^^
  1352. Description
  1353. +++++++++++
  1354. This method is equal to calling *<<aria2_xmlrpc_aria2_pause, aria2.pause>>* for every active/waiting
  1355. download. This methods returns "OK" for success.
  1356. [[aria2_xmlrpc_aria2_forcePause]]
  1357. *aria2.forcePause* ('pid')
  1358. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  1359. Description
  1360. +++++++++++
  1361. This method pauses the download denoted by 'gid'. This method
  1362. behaves just like *<<aria2_xmlrpc_aria2_pause, aria2.pause>>* except that this method pauses
  1363. download without any action which takes time such as contacting
  1364. BitTorrent tracker.
  1365. [[aria2_xmlrpc_aria2_forcePauseAll]]
  1366. *aria2.forcePauseAll* ()
  1367. ^^^^^^^^^^^^^^^^^^^^^^^^
  1368. Description
  1369. +++++++++++
  1370. This method is equal to calling *<<aria2_xmlrpc_aria2_forcePause, aria2.forcePause>>* for every
  1371. active/waiting download. This methods returns "OK" for success.
  1372. [[aria2_xmlrpc_aria2_unpause]]
  1373. *aria2.unpause* ('gid')
  1374. ^^^^^^^^^^^^^^^^^^^^^^^
  1375. Description
  1376. +++++++++++
  1377. This method changes the status of the download denoted by 'gid' from
  1378. "paused" to "waiting". This makes the download eligible to restart.
  1379. 'gid' is of type string. This method returns GID of unpaused
  1380. download.
  1381. [[aria2_xmlrpc_aria2_unpauseAll]]
  1382. *aria2.unpauseAll* ()
  1383. ^^^^^^^^^^^^^^^^^^^^^
  1384. Description
  1385. +++++++++++
  1386. This method is equal to calling *<<aria2_xmlrpc_aria2_unpause, aria2.unpause>>* for every active/waiting
  1387. download. This methods returns "OK" for success.
  1388. [[aria2_xmlrpc_aria2_tellStatus]]
  1389. *aria2.tellStatus* ('gid[, keys]')
  1390. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1391. Description
  1392. +++++++++++
  1393. This method returns download progress of the download denoted by
  1394. 'gid'. 'gid' is of type string. 'keys' is array of string. If it is
  1395. specified, the response contains only keys in 'keys' array. If 'keys'
  1396. is empty or not specified, the response contains all keys. This is
  1397. useful when you just want specific keys and avoid unnecessary
  1398. transfers. For example, *<<aria2_xmlrpc_aria2_tellStatus, aria2.tellStatus>>*("1", ["gid", "status"])
  1399. returns 'gid' and 'status' key. The response is of type struct and it
  1400. contains following keys. The value type is string.
  1401. gid::
  1402. GID of this download.
  1403. status::
  1404. "active" for currently downloading/seeding entry. "waiting" for the
  1405. entry in the queue; download is not started. "paused" for the
  1406. paused entry. "error" for the stopped download because of
  1407. error. "complete" for the stopped and completed download. "removed"
  1408. for the download removed by user.
  1409. totalLength::
  1410. Total length of this download in bytes.
  1411. completedLength::
  1412. Completed length of this download in bytes.
  1413. uploadLength::
  1414. Uploaded length of this download in bytes.
  1415. bitfield::
  1416. Hexadecimal representation of the download progress. The highest bit
  1417. corresponds to piece index 0. The set bits indicate the piece is
  1418. available and unset bits indicate the piece is missing. The spare
  1419. bits at the end are set to zero. When download has not started yet,
  1420. this key will not be included in the response.
  1421. downloadSpeed::
  1422. Download speed of this download measured in bytes/sec.
  1423. uploadSpeed::
  1424. Upload speed of this download measured in bytes/sec.
  1425. infoHash::
  1426. InfoHash. BitTorrent only.
  1427. numSeeders::
  1428. The number of seeders the client has connected to. BitTorrent only.
  1429. pieceLength::
  1430. Piece length in bytes.
  1431. numPieces::
  1432. The number of pieces.
  1433. connections::
  1434. The number of peers/servers the client has connected to.
  1435. errorCode::
  1436. The last error code occurred in this download. The value is of type
  1437. string. The error codes are defined in *<<_exit_status, EXIT
  1438. STATUS>>* section. This value is only available for
  1439. stopped/completed downloads.
  1440. followedBy::
  1441. List of GIDs which are generated by the consequence of this
  1442. download. For example, when aria2 downloaded Metalink file, it
  1443. generates downloads described in it(see *<<aria2_optref_follow_metalink, --follow-metalink>>*
  1444. option). This value is useful to track these auto generated
  1445. downloads. If there is no such downloads, this key will not
  1446. be included in the response.
  1447. belongsTo::
  1448. GID of a parent download. Some downloads are a part of another
  1449. download. For example, if a file in Metalink has BitTorrent
  1450. resource, the download of .torrent is a part of that file. If this
  1451. download has no parent, this key will not be included in the
  1452. response.
  1453. dir::
  1454. Directory to save files. This key is not available for stopped
  1455. downloads.
  1456. files::
  1457. Returns the list of files. The element of list is the same struct
  1458. used in *<<aria2_xmlrpc_aria2_getFiles, aria2.getFiles>>* method.
  1459. bittorrent::
  1460. Struct which contains information retrieved from .torrent
  1461. file. BitTorrent only. It contains following keys.
  1462. announceList;;
  1463. List of lists of announce URI. If .torrent file contains announce
  1464. and no announce-list, announce is converted to announce-list
  1465. format.
  1466. comment;;
  1467. The comment for the torrent. comment.utf-8 is used if available.
  1468. creationDate;;
  1469. The creation time of the torrent. The value is an integer since
  1470. the Epoch, measured in seconds.
  1471. mode;;
  1472. File mode of the torrent. The value is either 'single' or 'multi'.
  1473. info;;
  1474. Struct which contains data from Info dictionary. It contains
  1475. following keys.
  1476. name:::
  1477. name in info dictionary. name.utf-8 is used if available.
  1478. Example
  1479. +++++++
  1480. The following example gets information about download whose GID is
  1481. "1":
  1482. --------------------------------------------------------------------
  1483. >>> import xmlrpclib
  1484. >>> from pprint import pprint
  1485. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1486. >>> r = s.aria2.tellStatus('1')
  1487. >>> pprint(r)
  1488. {'bitfield': 'ffff80',
  1489. 'completedLength': '34896138',
  1490. 'connections': '0',
  1491. 'dir': '/downloads',
  1492. 'downloadSpeed': '0',
  1493. 'errorCode': '0',
  1494. 'files': [{'index': '1',
  1495. 'length': '34896138',
  1496. 'path': '/downloads/file',
  1497. 'selected': 'true',
  1498. 'uris': [{'status': 'used',
  1499. 'uri': 'http://example.org/file'}]}],
  1500. 'gid': '1',
  1501. 'numPieces': '17',
  1502. 'pieceLength': '2097152',
  1503. 'status': 'complete',
  1504. 'totalLength': '34896138',
  1505. 'uploadLength': '0',
  1506. 'uploadSpeed': '0'}
  1507. --------------------------------------------------------------------
  1508. The following example gets information specifying keys you are
  1509. interested in:
  1510. --------------------------------------------------------------------------
  1511. >>> r = s.aria2.tellStatus('1', ['gid', 'totalLength', 'completedLength'])
  1512. >>> pprint(r)
  1513. {'completedLength': '34896138', 'gid': '1', 'totalLength': '34896138'}
  1514. --------------------------------------------------------------------------
  1515. [[aria2_xmlrpc_aria2_getUris]]
  1516. *aria2.getUris* ('gid')
  1517. ^^^^^^^^^^^^^^^^^^^^^^^
  1518. Description
  1519. +++++++++++
  1520. This method returns URIs used in the download denoted by 'gid'. 'gid'
  1521. is of type string. The response is of type array and its element is of
  1522. type struct and it contains following keys. The value type is string.
  1523. uri::
  1524. URI
  1525. status::
  1526. 'used' if the URI is already used. 'waiting' if the URI is waiting
  1527. in the queue.
  1528. Example
  1529. +++++++
  1530. --------------------------------------------------------------------
  1531. >>> import xmlrpclib
  1532. >>> from pprint import pprint
  1533. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1534. >>> r = s.aria2.getUris('1')
  1535. >>> pprint(r)
  1536. [{'status': 'used', 'uri': 'http://example.org/file'}]
  1537. --------------------------------------------------------------------
  1538. [[aria2_xmlrpc_aria2_getFiles]]
  1539. *aria2.getFiles* ('gid')
  1540. ^^^^^^^^^^^^^^^^^^^^^^^^
  1541. Description
  1542. +++++++++++
  1543. This method returns file list of the download denoted by 'gid'. 'gid'
  1544. is of type string. The response is of type array and its element is of
  1545. type struct and it contains following keys. The value type is string.
  1546. index::
  1547. Index of file. Starting with 1. This is the same order with the
  1548. files in multi-file torrent.
  1549. path::
  1550. File path.
  1551. length::
  1552. File size in bytes.
  1553. selected::
  1554. "true" if this file is selected by *<<aria2_optref_select_file, --select-file>>* option. If
  1555. *<<aria2_optref_select_file, --select-file>>* is not specified or this is single torrent or no
  1556. torrent download, this value is always "true". Otherwise "false".
  1557. uris::
  1558. Returns the list of URI for this file. The element of list is the
  1559. same struct used in *<<aria2_xmlrpc_aria2_getUris, aria2.getUris>>* method.
  1560. Example
  1561. +++++++
  1562. --------------------------------------------------------------------------
  1563. >>> import xmlrpclib
  1564. >>> from pprint import pprint
  1565. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1566. >>> r = s.aria2.getFiles('1')
  1567. >>> pprint(r)
  1568. [{'index': '1',
  1569. 'length': '34896138',
  1570. 'path': '/downloads/file',
  1571. 'selected': 'true',
  1572. 'uris': [{'status': 'used',
  1573. 'uri': 'http://example.org/file'}]}]
  1574. --------------------------------------------------------------------------
  1575. [[aria2_xmlrpc_aria2_getPeers]]
  1576. *aria2.getPeers* ('gid')
  1577. ^^^^^^^^^^^^^^^^^^^^^^^^
  1578. Description
  1579. +++++++++++
  1580. This method returns peer list of the download denoted by 'gid'. 'gid'
  1581. is of type string. This method is for BitTorrent only. The response
  1582. is of type array and its element is of type struct and it contains
  1583. following keys. The value type is string.
  1584. peerId::
  1585. Percent-encoded peer ID.
  1586. ip::
  1587. IP address of the peer.
  1588. port::
  1589. Port number of the peer.
  1590. bitfield::
  1591. Hexadecimal representation of the download progress of the peer. The
  1592. highest bit corresponds to piece index 0. The set bits indicate the
  1593. piece is available and unset bits indicate the piece is missing. The
  1594. spare bits at the end are set to zero.
  1595. amChoking::
  1596. "true" if this client is choking the peer. Otherwise "false".
  1597. peerChoking::
  1598. "true" if the peer is choking this client. Otherwise "false".
  1599. downloadSpeed::
  1600. Download speed (byte/sec) that this client obtains from the peer.
  1601. uploadSpeed::
  1602. Upload speed(byte/sec) that this client uploads to the peer.
  1603. seeder::
  1604. "true" is this client is a seeder. Otherwise "false".
  1605. Example
  1606. +++++++
  1607. --------------------------------------------------------------------------
  1608. >>> import xmlrpclib
  1609. >>> from pprint import pprint
  1610. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1611. >>> r = s.aria2.getPeers('1')
  1612. >>> pprint(r)
  1613. [{'amChoking': 'true',
  1614. 'bitfield': 'ffffffffffffffffffffffffffffffffffffffff',
  1615. 'downloadSpeed': '10602',
  1616. 'ip': '10.0.0.9',
  1617. 'peerChoking': 'false',
  1618. 'peerId': 'aria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6',
  1619. 'port': '6881',
  1620. 'seeder': 'true',
  1621. 'uploadSpeed': '0'},
  1622. {'amChoking': 'false',
  1623. 'bitfield': 'ffffeff0fffffffbfffffff9fffffcfff7f4ffff',
  1624. 'downloadSpeed': '8654',
  1625. 'ip': '10.0.0.30',
  1626. 'peerChoking': 'false',
  1627. 'peerId': 'bittorrent client758',
  1628. 'port': '37842',
  1629. 'seeder': 'false,
  1630. 'uploadSpeed': '6890'}]
  1631. --------------------------------------------------------------------------
  1632. [[aria2_xmlrpc_aria2_getServers]]
  1633. *aria2.getServers* ('gid')
  1634. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  1635. Description
  1636. +++++++++++
  1637. This method returns currently connected HTTP(S)/FTP servers of the download denoted by 'gid'. 'gid' is of type string. The response
  1638. is of type array and its element is of type struct and it contains
  1639. following keys. The value type is string.
  1640. index::
  1641. Index of file. Starting with 1. This is the same order with the
  1642. files in multi-file torrent.
  1643. servers::
  1644. The list of struct which contains following keys.
  1645. uri;;
  1646. URI originally added.
  1647. currentUri;;
  1648. This is the URI currently used for downloading. If redirection is
  1649. involved, currentUri and uri may differ.
  1650. downloadSpeed;;
  1651. Download speed (byte/sec)
  1652. Example
  1653. +++++++
  1654. --------------------------------------------------------------------
  1655. >>> import xmlrpclib
  1656. >>> from pprint import pprint
  1657. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1658. >>> r = s.aria2.getServers('1')
  1659. >>> pprint(r)
  1660. [{'index': '1',
  1661. 'servers': [{'currentUri': 'http://example.org/dl/file',
  1662. 'downloadSpeed': '20285',
  1663. 'uri': 'http://example.org/file'}]}]
  1664. --------------------------------------------------------------------
  1665. [[aria2_xmlrpc_aria2_tellActive]]
  1666. *aria2.tellActive* ('[keys]')
  1667. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1668. Description
  1669. +++++++++++
  1670. This method returns the list of active downloads. The response is of
  1671. type array and its element is the same struct returned by
  1672. *<<aria2_xmlrpc_aria2_tellStatus, aria2.tellStatus>>* method. For 'keys' parameter, please refer to
  1673. *<<aria2_xmlrpc_aria2_tellStatus, aria2.tellStatus>>* method.
  1674. [[aria2_xmlrpc_aria2_tellWaiting]]
  1675. *aria2.tellWaiting* ('offset, num, [keys]')
  1676. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1677. Description
  1678. +++++++++++
  1679. This method returns the list of waiting download, including paused
  1680. downloads. 'offset' is of type integer and specifies the offset from
  1681. the download waiting at the front. 'num' is of type integer and
  1682. specifies the number of downloads to be returned. For 'keys'
  1683. parameter, please refer to *<<aria2_xmlrpc_aria2_tellStatus, aria2.tellStatus>>* method.
  1684. If offset is a positive integer, this method returns downloads in the
  1685. range of ['offset', 'offset'+'num').
  1686. 'offset' can be a negative integer. 'offset' == -1 points last
  1687. download in the waiting queue and 'offset' == -2 points the download
  1688. before the last download, and so on. The downloads in the response are
  1689. in reversed order.
  1690. For example, imagine that three downloads "A","B" and "C" are waiting
  1691. in this order. aria2.tellWaiting(0, 1) returns
  1692. ["A"]. aria2.tellWaiting(1, 2) returns ["B", "C"].
  1693. aria2.tellWaiting(-1, 2) returns ["C", "B"].
  1694. The response is of type array and its element is the same struct
  1695. returned by *<<aria2_xmlrpc_aria2_tellStatus, aria2.tellStatus>>* method.
  1696. [[aria2_xmlrpc_aria2_tellStopped]]
  1697. *aria2.tellStopped* ('offset, num, [keys]')
  1698. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1699. Description
  1700. +++++++++++
  1701. This method returns the list of stopped download. 'offset' is of type
  1702. integer and specifies the offset from the oldest download. 'num' is of
  1703. type integer and specifies the number of downloads to be returned.
  1704. For 'keys' parameter, please refer to *<<aria2_xmlrpc_aria2_tellStatus, aria2.tellStatus>>* method.
  1705. 'offset' and 'num' have the same semantics as *<<aria2_xmlrpc_aria2_tellWaiting, aria2.tellWaiting>>*
  1706. method.
  1707. The response is of type array and its element is the same struct
  1708. returned by *<<aria2_xmlrpc_aria2_tellStatus, aria2.tellStatus>>* method.
  1709. [[aria2_xmlrpc_aria2_changePosition]]
  1710. *aria2.changePosition* ('gid, pos, how')
  1711. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1712. Description
  1713. +++++++++++
  1714. This method changes the position of the download denoted by
  1715. 'gid'. 'pos' is of type integer. 'how' is of type string. If 'how' is
  1716. "POS_SET", it moves the download to a position relative to the
  1717. beginning of the queue. If 'how' is "POS_CUR", it moves the download
  1718. to a position relative to the current position. If 'how' is "POS_END",
  1719. it moves the download to a position relative to the end of the
  1720. queue. If the destination position is less than 0 or beyond the end of
  1721. the queue, it moves the download to the beginning or the end of the
  1722. queue respectively. The response is of type integer and it is the
  1723. destination position.
  1724. For example, if GID#1 is placed in position 3, aria2.changePosition(1,
  1725. -1, POS_CUR) will change its position to 2. Additional
  1726. aria2.changePosition(1, 0, POS_SET) will change its position to 0(the
  1727. beginning of the queue).
  1728. Example
  1729. +++++++
  1730. The following example moves the download whose GID is "3" to the
  1731. front of the waiting queue:
  1732. --------------------------------------------------------------------
  1733. >>> import xmlrpclib
  1734. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1735. >>> s.aria2.changePosition('3', 0, 'POS_SET')
  1736. 0
  1737. --------------------------------------------------------------------
  1738. [[aria2_xmlrpc_aria2_changeUri]]
  1739. *aria2.changeUri* ('gid, fileIndex, delUris, addUris[, position]')
  1740. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1741. Description
  1742. +++++++++++
  1743. This method removes URIs in 'delUris' from and appends URIs in
  1744. 'addUris' to download denoted by 'gid'. 'delUris' and 'addUris' are
  1745. list of string. A download can contain multiple files and URIs are
  1746. attached to each file. 'fileIndex' is used to select which file to
  1747. remove/attach given URIs. 'fileIndex' is 1-based. 'position' is used
  1748. to specify where URIs are inserted in the existing waiting URI
  1749. list. 'position' is 0-based. When 'position' is omitted, URIs are
  1750. appended to the back of the list. This method first execute removal
  1751. and then addition. 'position' is the position after URIs are removed,
  1752. not the position when this method is called. When removing URI, if
  1753. same URIs exist in download, only one of them is removed for each URI
  1754. in 'delUris'. In other words, there are three URIs
  1755. "http://example.org/aria2" and you want remove them all, you have to
  1756. specify (at least) 3 "http://example.org/aria2" in 'delUris'. This
  1757. method returns a list which contains 2 integers. The first integer is
  1758. the number of URIs deleted. The second integer is the number of URIs
  1759. added.
  1760. Example
  1761. +++++++
  1762. The following example adds 1 URI \http://example.org/file to the file
  1763. whose index is "1" and belongs to the download whose GID is "2":
  1764. --------------------------------------------------------------------
  1765. >>> import xmlrpclib
  1766. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1767. >>> s.aria2.changeUri('2', 1, [], ['http://example.org/file'])
  1768. [0, 1]
  1769. --------------------------------------------------------------------
  1770. [[aria2_xmlrpc_aria2_getOption]]
  1771. *aria2.getOption* ('gid')
  1772. ^^^^^^^^^^^^^^^^^^^^^^^^^
  1773. Description
  1774. +++++++++++
  1775. This method returns options of the download denoted by 'gid'. The
  1776. response is of type struct. Its key is the name of option. The value type
  1777. is string.
  1778. Example
  1779. +++++++
  1780. The following example gets options of the download whose GID is "1":
  1781. --------------------------------------------------------------------
  1782. >>> import xmlrpclib
  1783. >>> from pprint import pprint
  1784. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1785. >>> r = s.aria2.getOption('1')
  1786. >>> pprint(r)
  1787. {'allow-overwrite': 'false',
  1788. 'allow-piece-length-change': 'false',
  1789. 'always-resume': 'true',
  1790. 'async-dns': 'true',
  1791. ....
  1792. --------------------------------------------------------------------
  1793. [[aria2_xmlrpc_aria2_changeOption]]
  1794. *aria2.changeOption* ('gid, options')
  1795. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1796. Description
  1797. +++++++++++
  1798. This method changes options of the download denoted by 'gid'
  1799. dynamically. 'gid' is of type string. 'options' is of type struct
  1800. and the available options are: *<<aria2_optref_bt_max_peers, bt-max-peers>>*,
  1801. *<<aria2_optref_bt_request_peer_speed_limit, bt-request-peer-speed-limit>>*, *<<aria2_optref_max_download_limit, max-download-limit>>* and
  1802. *<<aria2_optref_max_upload_limit, max-upload-limit>>*. This method returns "OK" for success.
  1803. Example
  1804. +++++++
  1805. The following example sets
  1806. *<<aria2_optref_max_download_limit, max-download-limit>>* option to "20K" for
  1807. the download whose GID is "1".
  1808. --------------------------------------------------------------------
  1809. >>> import xmlrpclib
  1810. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1811. >>> s.aria2.changeOption('1', {'max-download-limit':'20K'})
  1812. 'OK'
  1813. --------------------------------------------------------------------
  1814. [[aria2_xmlrpc_aria2_getGlobalOption]]
  1815. *aria2.getGlobalOption* ()
  1816. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  1817. Description
  1818. +++++++++++
  1819. This method returns global options. The response is of type
  1820. struct. Its key is the name of option. The value type is string.
  1821. Because global options are used as a template for the options of newly
  1822. added download, the response contains keys returned by
  1823. *<<aria2_xmlrpc_aria2_getOption, aria2.getOption>>* method.
  1824. [[aria2_xmlrpc_aria2_changeGlobalOption]]
  1825. *aria2.changeGlobalOption* ('options')
  1826. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1827. Description
  1828. +++++++++++
  1829. This method changes global options dynamically. 'options' is of type
  1830. struct and the available options are *<<aria2_optref_max_concurrent_downloads, max-concurrent-downloads>>*,
  1831. *<<aria2_optref_max_overall_download_limit, max-overall-download-limit>>*, *<<aria2_optref_max_overall_upload_limit, max-overall-upload-limit>>*, *<<aria2_optref_log_level, log-level>>*
  1832. and *<<aria2_optref_log, log>>*. Using *<<aria2_optref_log, log>>* option, you can dynamically start logging or
  1833. change log file. To stop logging, give empty string("") as a parameter
  1834. value. Note that log file is always opened in append mode. This method
  1835. returns "OK" for success.
  1836. [[aria2_xmlrpc_aria2_purgeDownloadResult]]
  1837. *aria2.purgeDownloadResult* ()
  1838. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1839. Description
  1840. +++++++++++
  1841. This method purges completed/error/removed downloads to free memory.
  1842. This method returns "OK".
  1843. [[aria2_xmlrpc_aria2_removeDownloadResult]]
  1844. *aria2.removeDownloadResult* ('gid')
  1845. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1846. Description
  1847. +++++++++++
  1848. This method removes completed/error/removed download denoted by 'gid'
  1849. from memory. This method returns "OK" for success.
  1850. Example
  1851. +++++++
  1852. The following example removes the download result of the download
  1853. whose GID is "1".
  1854. --------------------------------------------------------------------
  1855. >>> import xmlrpclib
  1856. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1857. >>> s.aria2.removeDownloadResult('1')
  1858. 'OK'
  1859. --------------------------------------------------------------------
  1860. [[aria2_xmlrpc_aria2_getVersion]]
  1861. *aria2.getVersion* ()
  1862. ^^^^^^^^^^^^^^^^^^^^^
  1863. Description
  1864. +++++++++++
  1865. This method returns version of the program and the list of enabled
  1866. features. The response is of type struct and contains following keys.
  1867. version::
  1868. Version number of the program in string.
  1869. enabledFeatures::
  1870. List of enabled features. Each feature name is of type string.
  1871. Example
  1872. +++++++
  1873. --------------------------------------------------------------------
  1874. >>> import xmlrpclib
  1875. >>> from pprint import pprint
  1876. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1877. >>> r = s.aria2.getVersion()
  1878. >>> pprint(r)
  1879. {'enabledFeatures': ['Async DNS',
  1880. 'BitTorrent',
  1881. 'Firefox3 Cookie',
  1882. 'GZip',
  1883. 'HTTPS',
  1884. 'Message Digest',
  1885. 'Metalink',
  1886. 'XML-RPC'],
  1887. 'version': '1.10.5'}
  1888. --------------------------------------------------------------------
  1889. [[aria2_xmlrpc_aria2_getSessionInfo]]
  1890. *aria2.getSessionInfo* ()
  1891. ^^^^^^^^^^^^^^^^^^^^^^^^^
  1892. Description
  1893. +++++++++++
  1894. This method returns session information.
  1895. The response is of type struct and contains following key.
  1896. sessionId::
  1897. Session ID, which is generated each time when aria2 is invoked.
  1898. Example
  1899. +++++++
  1900. --------------------------------------------------------------------
  1901. >>> import xmlrpclib
  1902. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1903. >>> s.aria2.getSessionInfo()
  1904. {'sessionId': 'cd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9'}
  1905. --------------------------------------------------------------------
  1906. [[aria2_xmlrpc_aria2_shutdown]]
  1907. *aria2.shutdown* ()
  1908. ^^^^^^^^^^^^^^^^^^^
  1909. Description
  1910. +++++++++++
  1911. This method shutdowns aria2. This method returns "OK".
  1912. [[aria2_xmlrpc_aria2_forceShutdown]]
  1913. *aria2.forceShutdown* ()
  1914. ^^^^^^^^^^^^^^^^^^^^^^^^
  1915. Description
  1916. +++++++++++
  1917. This method shutdowns aria2. This method behaves like *<<aria2_xmlrpc_aria2_shutdown, aria2.shutdown>>*
  1918. except that any actions which takes time such as contacting BitTorrent
  1919. tracker are skipped. This method returns "OK".
  1920. [[aria2_xmlrpc_system_multicall]]
  1921. *system.multicall* ('methods')
  1922. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1923. Description
  1924. +++++++++++
  1925. This methods encapsulates multiple method calls in a single request.
  1926. 'methods' is of type array and its element is struct. The struct
  1927. contains two keys: "methodName" and "params". "methodName" is the
  1928. method name to call and "params" is array containing parameters to the
  1929. method. This method returns array of responses. The element of array
  1930. will either be a one-item array containing the return value of each
  1931. method call or struct of fault element if an encapsulated method call
  1932. fails.
  1933. Example
  1934. +++++++
  1935. In the following example, we add 2 downloads. First one is
  1936. \http://example.org/file and second one is file.torrent:
  1937. ----------------------------------------------------------------------
  1938. >>> import xmlrpclib
  1939. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1940. >>> mc = xmlrpclib.MultiCall(s)
  1941. >>> mc.aria2.addUri(['http://example.org/file'])
  1942. >>> mc.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent').read()))
  1943. >>> r = mc()
  1944. >>> tuple(r)
  1945. ('2', '3')
  1946. ----------------------------------------------------------------------
  1947. Error Handling
  1948. ~~~~~~~~~~~~~~
  1949. In case of error, aria2 returns faultCode=1 and the error message in
  1950. faultString.
  1951. [[aria2_xmlrpc_options]]
  1952. Options
  1953. ~~~~~~~
  1954. Same options for *<<aria2_optref_input_file, -i>>* list are available. See *<<_input_file, Input
  1955. File>>* subsection for complete list of options.
  1956. In the option struct, name element is option name(without preceding
  1957. "--") and value element is argument as string.
  1958. -------------------------------------------------
  1959. <struct>
  1960. <member>
  1961. <name>split</name>
  1962. <value><string>1</string></value>
  1963. </member>
  1964. <member>
  1965. <name>http-proxy</name>
  1966. <value><string>http://proxy/</string></value>
  1967. </member>
  1968. </struct>
  1969. -------------------------------------------------
  1970. *<<aria2_optref_header, header>>* and *<<aria2_optref_index_out, index-out>>*
  1971. option are allowed multiple times in
  1972. command-line. Since name should be unique in struct(many XML-RPC
  1973. library implementation uses hash or dict for struct), single string is
  1974. not enough. To overcome this situation, they can take array as value
  1975. as well as string.
  1976. ---------------------------------------------------------------
  1977. <struct>
  1978. <member>
  1979. <name>header</name>
  1980. <value>
  1981. <array>
  1982. <data>
  1983. <value><string>Accept-Language: ja</string></value>
  1984. <value><string>Accept-Charset: utf-8</string></value>
  1985. </data>
  1986. </array>
  1987. </value>
  1988. </member>
  1989. </struct>
  1990. ---------------------------------------------------------------
  1991. Following example adds a download with 2 options: dir and header.
  1992. header option has 2 values, so it uses a list:
  1993. -------------------------------------------------------------------------
  1994. >>> import xmlrpclib
  1995. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1996. >>> opts = dict(dir='/tmp',
  1997. ... header=['Accept-Language: ja',
  1998. ... 'Accept-Charset: utf-8'])
  1999. >>> s.aria2.addUri(['http://example.org/file'], opts)
  2000. '1'
  2001. --------------------------------------------------------------------------
  2002. Sample XML-RPC Client Code
  2003. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  2004. The following Ruby script adds 'http://localhost/aria2.tar.bz2' to
  2005. aria2c operated on localhost with option *<<aria2_optref_dir, --dir>>*='/downloads' and
  2006. prints its reponse.
  2007. ----------------------------------------------
  2008. #!/usr/bin/env ruby
  2009. require 'xmlrpc/client'
  2010. require 'pp'
  2011. client=XMLRPC::Client.new2("http://localhost:6800/rpc")
  2012. options={ "dir" => "/downloads" }
  2013. result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options)
  2014. pp result
  2015. ----------------------------------------------
  2016. If you are a Python lover, you can use xmlrpclib(for Python3.x, use
  2017. xmlrpc.client instead) to interact with aria2.
  2018. ----------------------------------------------
  2019. import xmlrpclib
  2020. from pprint import pprint
  2021. s = xmlrpclib.ServerProxy("http://localhost:6800/rpc")
  2022. r = s.aria2.addUri(["http://localhost/aria2.tar.bz2"], {"dir":"/downloads"})
  2023. pprint(r)
  2024. ----------------------------------------------
  2025. EXAMPLE
  2026. -------
  2027. HTTP/FTP Segmented Download
  2028. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2029. Download a file
  2030. ^^^^^^^^^^^^^^^
  2031. --------------------------------
  2032. aria2c "http://host/file.zip"
  2033. --------------------------------
  2034. [NOTE]
  2035. 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.
  2036. Download a file from 2 different HTTP servers
  2037. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2038. ------------------------------------------------------
  2039. aria2c "http://host/file.zip" "http://mirror/file.zip"
  2040. ------------------------------------------------------
  2041. Download a file from 1 host using 2 connections
  2042. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2043. ------------------------------------------------------
  2044. aria2c -x2 -k1M "http://host/file.zip"
  2045. ------------------------------------------------------
  2046. Download a file from HTTP and FTP servers
  2047. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2048. -----------------------------------------------------
  2049. aria2c "http://host1/file.zip" "ftp://host2/file.zip"
  2050. -----------------------------------------------------
  2051. Download files listed in a text file concurrently
  2052. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2053. ------------------------
  2054. aria2c -ifiles.txt -j2
  2055. ------------------------
  2056. [NOTE]
  2057. -j option specifies the number of parallel downloads.
  2058. Using proxy
  2059. ^^^^^^^^^^^
  2060. For HTTP:
  2061. ----------------------------------------------------------
  2062. aria2c --http-proxy="http://proxy:8080" "http://host/file"
  2063. ----------------------------------------------------------
  2064. ----------------------------------------------------------
  2065. aria2c --http-proxy="http://proxy:8080" --no-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://host/file"
  2066. ----------------------------------------------------------
  2067. For FTP:
  2068. --------------------------------------------------------
  2069. aria2c --ftp-proxy="http://proxy:8080" "ftp://host/file"
  2070. --------------------------------------------------------
  2071. [NOTE]
  2072. See *<<aria2_optref_http_proxy, --http-proxy>>*, *<<aria2_optref_https_proxy, --https-proxy>>*, *<<aria2_optref_ftp_proxy, --ftp-proxy>>*, *<<aria2_optref_all_proxy, --all-proxy>>* and
  2073. *<<aria2_optref_no_proxy, --no-proxy>>* for details. You can specify proxy in the environment
  2074. variables. See *<<_environment, ENVIRONMENT>>* section.
  2075. Proxy with authorization
  2076. ^^^^^^^^^^^^^^^^^^^^^^^^
  2077. ----------------------------------------------------------------------------
  2078. aria2c --http-proxy="http://username:password@proxy:8080" "http://host/file"
  2079. ----------------------------------------------------------------------------
  2080. ----------------------------------------------------------------------------
  2081. aria2c --http-proxy="http://proxy:8080" --http-proxy-user="username" --http-proxy-passwd="password" "http://host/file"
  2082. ----------------------------------------------------------------------------
  2083. Metalink Download
  2084. ~~~~~~~~~~~~~~~~~
  2085. Download files with remote Metalink
  2086. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2087. --------------------------------------------------------
  2088. aria2c --follow-metalink=mem "http://host/file.metalink"
  2089. --------------------------------------------------------
  2090. Download using a local metalink file
  2091. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2092. ----------------------------------------------------------
  2093. aria2c -p --lowest-speed-limit=4000 file.metalink
  2094. ----------------------------------------------------------
  2095. [NOTE]
  2096. To stop a download, press Ctrl-C.
  2097. You can resume the transfer by running aria2c with the same argument in the same
  2098. directory.
  2099. Download several local metalink files
  2100. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2101. ----------------------------------------
  2102. aria2c -j2 file1.metalink file2.metalink
  2103. ----------------------------------------
  2104. Download only selected files using index
  2105. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2106. -------------------------------------------
  2107. aria2c --select-file=1-4,8 file.metalink
  2108. -------------------------------------------
  2109. [NOTE]
  2110. The index is printed to the console using -S option.
  2111. Download a file using a local .metalink file with user preference
  2112. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2113. ------------------------------------------------------------------------------
  2114. aria2c --metalink-location=jp,us --metalink-version=1.1 --metalink-language=en-US file.metalink
  2115. ------------------------------------------------------------------------------
  2116. BitTorrent Download
  2117. ~~~~~~~~~~~~~~~~~~~
  2118. Download files from remote BitTorrent file
  2119. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2120. ------------------------------------------------------
  2121. aria2c --follow-torrent=mem "http://host/file.torrent"
  2122. ------------------------------------------------------
  2123. Download using a local torrent file
  2124. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2125. ---------------------------------------------
  2126. aria2c --max-upload-limit=40K file.torrent
  2127. ---------------------------------------------
  2128. [NOTE]
  2129. --max-upload-limit specifies the max of upload rate.
  2130. [NOTE]
  2131. To stop a download, press Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory.
  2132. Download using BitTorrent Magnet URI
  2133. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2134. ------------------------------------------------------------------------------
  2135. aria2c "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C&dn=aria2"
  2136. ------------------------------------------------------------------------------
  2137. [NOTE]
  2138. Don't forget to quote BitTorrent Magnet URI which includes "&"
  2139. character with single(') or double(") quotation.
  2140. Download 2 torrents
  2141. ^^^^^^^^^^^^^^^^^^^
  2142. --------------------------------------
  2143. aria2c -j2 file1.torrent file2.torrent
  2144. --------------------------------------
  2145. Download a file using torrent and HTTP/FTP server
  2146. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2147. ------------------------------------------------------------
  2148. aria2c -Ttest.torrent "http://host1/file" "ftp://host2/file"
  2149. ------------------------------------------------------------
  2150. [NOTE]
  2151. Downloading multi file torrent with HTTP/FTP is not supported.
  2152. Download only selected files using index(usually called "selectable download")
  2153. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2154. ---------------------------------------
  2155. aria2c --select-file=1-4,8 file.torrent
  2156. ---------------------------------------
  2157. [NOTE]
  2158. The index is printed to the console using -S option.
  2159. Specify output filename
  2160. ^^^^^^^^^^^^^^^^^^^^^^^
  2161. To specify output filename for BitTorrent downloads, you need to know
  2162. the index of file in torrent file using *<<aria2_optref_show_files, -S>>* option. For example, the
  2163. output looks like this:
  2164. --------------------------
  2165. idx|path/length
  2166. ===+======================
  2167. 1|dist/base-2.6.18.iso
  2168. |99.9MiB
  2169. ---+----------------------
  2170. 2|dist/driver-2.6.18.iso
  2171. |169.0MiB
  2172. ---+----------------------
  2173. --------------------------
  2174. To save 'dist/base-2.6.18.iso' in '/tmp/mydir/base.iso' and
  2175. 'dist/driver-2.6.18.iso' in '/tmp/dir/driver.iso', use the following
  2176. command:
  2177. -----------------------------------------------------------------------------------------
  2178. aria2c --dir=/tmp --index-out=1=mydir/base.iso --index-out=2=dir/driver.iso file.torrent
  2179. -----------------------------------------------------------------------------------------
  2180. Change the listening port for incoming peer
  2181. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2182. ---------------------------------------------------
  2183. aria2c --listen-port=7000-7001,8000 file.torrent
  2184. ---------------------------------------------------
  2185. [NOTE]
  2186. Since aria2 doesn't configure firewall or router for port forwarding, it's up
  2187. to you to do it manually.
  2188. Specify the condition to stop program after torrent download finished
  2189. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2190. -------------------------------------------------------
  2191. aria2c --seed-time=120 --seed-ratio=1.0 file.torrent
  2192. -------------------------------------------------------
  2193. [NOTE]
  2194. In the above example, the program exits when the 120 minutes has elapsed since download completed or seed ratio reaches 1.0.
  2195. Throttle upload speed
  2196. ^^^^^^^^^^^^^^^^^^^^^
  2197. ----------------------------------------------
  2198. aria2c --max-upload-limit=100K file.torrent
  2199. ----------------------------------------------
  2200. Enable IPv4 DHT
  2201. ^^^^^^^^^^^^^^^
  2202. ---------------------------------------------------------
  2203. aria2c --enable-dht --dht-listen-port=6881 file.torrent
  2204. ---------------------------------------------------------
  2205. [NOTE]
  2206. DHT uses udp port. Since aria2 doesn't configure firewall or router for port
  2207. forwarding, it's up to you to do it manually.
  2208. Enable IPv6 DHT
  2209. ^^^^^^^^^^^^^^^
  2210. -----------------------------------------------------------------------------------------------------------
  2211. aria2c --enable-dht6 --dht-listen-port=6881 --dht-listen-addr6=YOUR_GLOBAL_UNICAST_IPV6_ADDR --enable-async-dns6
  2212. -----------------------------------------------------------------------------------------------------------
  2213. [NOTE]
  2214. If aria2c is not built with c-ares, *<<aria2_optref_enable_async_dns6, --enable-async-dns6>>* is
  2215. unnecessary. aria2 shares same port between IPv4 and IPv6 DHT.
  2216. Add and remove tracker URI
  2217. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  2218. Removes all tracker announce URIs described in file.torrent and use
  2219. "http://tracker1/announce" and "http://tracker2/announce" instead.
  2220. ---------------------------------------------------------------------------------------------------------
  2221. aria2c --bt-exclude-tracker="*" --bt-tracker="http://tracker1/announce,http://tracker2/announce" file.torrent
  2222. ---------------------------------------------------------------------------------------------------------
  2223. More advanced HTTP features
  2224. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2225. Load cookies
  2226. ^^^^^^^^^^^^
  2227. --------------------------------------------------------
  2228. aria2c --load-cookies=cookies.txt "http://host/file.zip"
  2229. --------------------------------------------------------
  2230. [NOTE]
  2231. You can use Firefox/Mozilla/Chromium's cookie file without modification.
  2232. Resume download started by web browsers or another programs
  2233. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2234. -------------------------------------------------------
  2235. aria2c -c -s2 "http://host/partiallydownloadedfile.zip"
  2236. -------------------------------------------------------
  2237. Client certificate authorization for SSL/TLS
  2238. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2239. ------------------------------------------------------------------------------------------
  2240. aria2c --certificate=/path/to/mycert.pem --private-key=/path/to/mykey.pem https://host/file
  2241. ------------------------------------------------------------------------------------------
  2242. [NOTE]
  2243. The file specified in *<<aria2_optref_private_key, --private-key>>* must be decrypted. The behavior when
  2244. encrypted one is given is undefined.
  2245. Verify peer in SSL/TLS using given CA certificates
  2246. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2247. ------------------------------------------------------------------------------------------
  2248. aria2c --ca-certificate=/path/to/ca-certificates.crt --check-certificate https://host/file
  2249. ------------------------------------------------------------------------------------------
  2250. And more advanced features
  2251. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  2252. Throttle download speed
  2253. ^^^^^^^^^^^^^^^^^^^^^^^
  2254. -------------------------------------------------
  2255. aria2c --max-download-limit=100K file.metalink
  2256. -------------------------------------------------
  2257. Repair a damaged download
  2258. ^^^^^^^^^^^^^^^^^^^^^^^^^
  2259. -----------------------
  2260. aria2c -V file.metalink
  2261. -----------------------
  2262. [NOTE]
  2263. This option is only available used with BitTorrent or metalink with chunk
  2264. checksums.
  2265. Drop connection if download speed is lower than specified value
  2266. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2267. ------------------------------------------------
  2268. aria2c --lowest-speed-limit=10K file.metalink
  2269. ------------------------------------------------
  2270. Parameterized URI support
  2271. ^^^^^^^^^^^^^^^^^^^^^^^^^
  2272. You can specify set of parts:
  2273. -----------------------------------------------
  2274. aria2c -P "http://{host1,host2,host3}/file.iso"
  2275. -----------------------------------------------
  2276. You can specify numeric sequence:
  2277. ---------------------------------------------
  2278. aria2c -Z -P "http://host/image[000-100].png"
  2279. ---------------------------------------------
  2280. [NOTE]
  2281. -Z option is required if the all URIs don't point to the same file, such as the above example.
  2282. You can specify step counter:
  2283. -------------------------------------------
  2284. aria2c -Z -P "http://host/image[A-Z:2].png"
  2285. -------------------------------------------
  2286. Parallel downloads of arbitrary number of URI,metalink,torrent
  2287. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2288. --------------------------------------------------------------
  2289. aria2c -j3 -Z "http://host/file1" file2.torrent file3.metalink
  2290. --------------------------------------------------------------
  2291. BitTorrent Encryption
  2292. ^^^^^^^^^^^^^^^^^^^^^
  2293. Encrypt whole payload using ARC4:
  2294. -------------------------------------------------------------------------
  2295. aria2c --bt-min-crypto-level=arc4 --bt-require-crypto=true file.torrent
  2296. -------------------------------------------------------------------------
  2297. SEE ALSO
  2298. --------
  2299. Project Web Site: http://aria2.sourceforge.net/
  2300. aria2 Wiki: http://sourceforge.net/apps/trac/aria2/wiki
  2301. Metalink Homepage: http://www.metalinker.org/
  2302. The Metalink Download Description Format: http://tools.ietf.org/html/rfc5854
  2303. COPYRIGHT
  2304. ---------
  2305. Copyright (C) 2006, 2011 Tatsuhiro Tsujikawa
  2306. This program is free software; you can redistribute it and/or modify
  2307. it under the terms of the GNU General Public License as published by
  2308. the Free Software Foundation; either version 2 of the License, or
  2309. (at your option) any later version.
  2310. This program is distributed in the hope that it will be useful,
  2311. but WITHOUT ANY WARRANTY; without even the implied warranty of
  2312. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2313. GNU General Public License for more details.
  2314. You should have received a copy of the GNU General Public License
  2315. along with this program; if not, write to the Free Software
  2316. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  2317. In addition, as a special exception, the copyright holders give
  2318. permission to link the code of portions of this program with the
  2319. OpenSSL library under certain conditions as described in each
  2320. individual source file, and distribute linked combinations
  2321. including the two.
  2322. You must obey the GNU General Public License in all respects
  2323. for all of the code used other than OpenSSL. If you modify
  2324. file(s) with this exception, you may extend this exception to your
  2325. version of the file(s), but you are not obligated to do so. If you
  2326. do not wish to do so, delete this exception statement from your
  2327. version. If you delete this exception statement from all source
  2328. files in the program, then also delete it here.