aria2c.1.asciidoc 143 KB

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