aria2c.1.asciidoc 133 KB

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