aria2c.1.asciidoc 136 KB

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