aria2c.1.asciidoc 135 KB

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