aria2c.1.asciidoc 137 KB

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