aria2c.1.asciidoc 138 KB

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