aria2c.rst 142 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001
  1. .. _aria2c:
  2. aria2c(1)
  3. =========
  4. SINOPSE
  5. -------
  6. **aria2c** [<OPÇÕES>] [<URI>|<MAGNET>|<ARQUIVO_TORRENT>|<ARQUIVO_METALINK>] ...
  7. .. index:: double: Descrição; Sumário
  8. double: Resumo; Executivo
  9. triple: O que; Por que; Porque
  10. DESCRIÇÃO
  11. ---------
  12. Observação: Para executar o aria2 em um terminal ou no prompt da
  13. linha de comando do windows, utilize o comando aria2c.
  14. aria2 é um utilitário para download de arquivos. Os protocolos suportados são
  15. HTTP, HTTPS, FTP, BitTorrent e Metalink. aria2 pode efetuar download de arquivos
  16. a partir de múltiplas fontes e protocolos e tenta utilizar a máxima capacidade
  17. de banda. Há suporte para download de arquivos que tem origem em HTTP, HTTPS,
  18. FTP, BitTorrent e Metalink ao mesmo tempo, enquanto os dados baixados podem ser
  19. (uploaded) e compartilhados pelo BitTorrent. Usando conferência / aferição (checksum) nos
  20. Metalinks, aria2 automaticamente valida o conteúdo dos dados enquanto faz
  21. o download do arquivo como BitTorrent.
  22. .. index:: double: Opções; Básicas;
  23. Opções Básicas do aria2
  24. -----------------------
  25. Opções Comuns
  26. ~~~~~~~~~~~~~
  27. .. option:: -d, --dir=<DIR>
  28. O diretório onde será armazenado o arquivo baixado.
  29. .. option:: -i, --input-file=<ARQUIVO>
  30. Executa download da(s) URI encontradas no ARQUIVO. Podem ser especificados
  31. múltiplos URI para uma simples entidade: separe URI na mesma linha com
  32. um caracter TAB (tabulação).
  33. Quando desejar ler a entrada padrão (stdin) especificar ``-`` (hífen).
  34. Adicionalmente, diversas opções podem ser especificadas após cada linha de URI.
  35. Esta(s) linha(s) opcional(is) deve(m) começar(em) com um ou mais espaços em
  36. branco e possuir(em) apenas uma opção por linha.
  37. Ver subseção `Arquivo de Entrada`_ para mais detalhes.
  38. Ver também opção :option:`--deferred-input`.
  39. .. option:: -l, --log=<LOG>
  40. O nome do arquivo de log. Se ``-`` for especificado (entrada padrão), log é
  41. gravado em stdout (saída padrão). Se uma string vazia("") é especificada, log
  42. não será gravado em arquivo.
  43. .. option:: -j, --max-concurrent-downloads=<N>
  44. Configura o número máximo de downloads paralelos para cada URI (HTTP,
  45. HTTPS, FTP), Torrent e Metalink. Ver também opção :option:`--split <-s>`.
  46. Padrão: ``5``
  47. .. option:: -V, --check-integrity[=true|false]
  48. Verifica a integridade do arquivo validando pedaços hashes ou um hash do
  49. arquivo inteiro. Essa opção tem efeito só em downloads BitTorrent, Metalink
  50. com checksums ou HTTP, HTTPS e FTP com a opção :option:`--checksum`. Se pedaços
  51. de hashes são providos, essa opção pode detectar porções danificadas de um
  52. arquivo e efetuar novamente o download desses pedaços. Se especificar hash
  53. do arquivo inteiro, a verificação do hash ocorrerá só ao final do download,
  54. validação que leva em conta o tamanho do arquivo, e o download reinicirá a
  55. partir do início. Se houver especificação de ambos métodos de hash será
  56. utilizado o hash de pedações.
  57. Padrão:
  58. ``false``
  59. .. option:: -c, --continue[=true|false]
  60. Continua o download a partir de um download parcial, anteriormente
  61. interrompido. Use esta opção para retormar um download iniciado a partir
  62. de um browser (navegador) ou outro programa que faz baixa de arquivos
  63. sequencialmente desde o início.
  64. Atualmente esta opção só é aplicavel a download de HTTP, HTTPS e FTP.
  65. .. option:: -h, --help[=<TÓPICO>|<PALAVRA-CHAVE>]
  66. As mensagens de Ajuda são classificadas em temas. Um tema se inicia com
  67. ``#``. Por exemplo, digitar ``--help=#http`` para obter a explicação do uso das
  68. opções do tema ``#http``. Se digitar um termo que não é tema, haverá exibição
  69. das opções que incluem o termo informado.
  70. Valores disponíveis para temas podem ser: ``#basic``, ``#advanced``,
  71. ``#http``, ``#https``, ``#ftp``,
  72. ``#metalink``, ``#bittorrent``, ``#cookie``, ``#hook``, ``#file``, ``#rpc``,
  73. ``#checksum``, ``#experimental``, ``#deprecated``, ``#help``, ``#all``
  74. Padrão: ``#basic``
  75. Opções HTTP / FTP
  76. ~~~~~~~~~~~~~~~~~
  77. .. index:: double: proxy; servidor;
  78. triple: usuário; senha; proxy;
  79. .. option:: --all-proxy=<PROXY>
  80. Usar este servidor proxy para todos protocolos. Para limpar proxy
  81. previamente definido, use "". Esta configuração pode ser sobreposta através
  82. da especificação de um servidor proxy para um determinado protocolo usando
  83. opções :option:`--http-proxy`, :option:`--https-proxy` e :option:`--ftp-proxy`.
  84. Isto afeta todas as URIs.
  85. O formato da opção PROXY é ``[http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]``.
  86. Ver também seção `VARIÁVEIS DE AMBIENTE`_ section.
  87. .. note::
  88. Se usuário e senha são embutidos na URI do proxy eles também podem ser
  89. especificados através das opções
  90. *--{http,https,ftp,all}-proxy-{usuário,senha}*,
  91. aqueles que aparecerem por último assumem a precedência.
  92. Por exemplo, quando temos:
  93. ``http-proxy-user=meunome``, ``http-proxy-passwd=minhasenha``
  94. em aria2.conf e especificamos ``--http-proxy="http://svrproxy"`` na
  95. linha de comando, então obtemos como proxy HTTP ``http://svrproxy``
  96. com o usuário ``meunome`` e senha ``minhasenha``.
  97. Outro exemplo: quando especificamos na linha de comando:
  98. ``--http-proxy="http://usuário:senha@svrproxy" --http-proxy-user="meunome"
  99. --http-proxy-passwd="minhasenha"``, então obtemos proxy HTTP
  100. ``http://svrproxy`` com usuário ``meunome`` e senha ``minhasenha``.
  101. Mais um exemplo: se especificamos na linha de comando:
  102. ``--http-proxy-user="meunome" --http-proxy-passwd="minhasenha"
  103. --http-proxy="http://utilizador:acesso@svrproxy"``, então obtemos
  104. o proxy HTTP ``http://svrproxy`` com o usuário ``utilizador``
  105. e a senha ``acesso``.
  106. .. option:: --all-proxy-passwd=<SENHA>
  107. Define senha para a opção :option:`--all-proxy`.
  108. .. option:: --all-proxy-user=<USUÁRIO>
  109. Define usuário para opção :option:`--all-proxy`.
  110. .. option:: --checksum=<TIPO>=<ALGORITMO>
  111. Define verificação (checksum). TIPO é o tipo de algoritmo(hash). Os tipos de
  112. algoritmos estão listados em ``Algoritmos de Hash`` e podem ser obtidos
  113. através do do comando ``aria2c -v``. DIGEST é o código hexadecimal. Por
  114. examplo, definindo sha-1 o resultado parece com:
  115. ``sha-1=0192ba11326fe2298c8cb4de616f4d4140213838`` Essa opção aplica-se
  116. apenas para downloads HTTP, HTTPS e FTP.
  117. .. option:: --connect-timeout=<SEGUNDOS>
  118. Define o tempo de espera em segundos para estabelecer a conexão com o servidor
  119. proxy. Após o estabelecimento da conexão, esta opção não tem mais efeito, mas
  120. a opção :option:`--timeout <-t>` será utilizada.
  121. Padrão: ``60``
  122. .. option:: --dry-run[=true|false]
  123. Se ``true`` é informado, aria2 apenas verifica se o arquivo remoto está
  124. disponível para download dos dados. Esta opção tem efeito em downloads de
  125. servidores HTTP, HTTPS e FTP. Downloads de BitTorrent serão cancelados se for
  126. especificado ``true``.
  127. Padrão: ``false``
  128. .. option:: --lowest-speed-limit=<VELOCIDADE>
  129. Fecha a conexão se a velocidade de download é menor ou igual ao valor
  130. especificado, bytes por segundo.
  131. ``0`` significa que aria2 não levará em conta limite de velocidade mínima.
  132. Pode ser anexado ``K`` ou ``M`` (1K = 1024, 1M = 1024K).
  133. Esta opção não abrange downloads do tipo BitTorrent.
  134. Padrão: ``0``
  135. .. option:: -x, --max-connection-per-server=<NÚMERO>
  136. O número máximo de conexões para um servidor em cada download.
  137. Padrão: ``1``
  138. .. option:: --max-file-not-found=<NÚMERO>
  139. Se aria2 recebe çódigo de retorno "arquivo não encontrado" de um servidor
  140. remoto de HTTP / FTP um NÚMERO de vezes sem obter nenhum byte, então o
  141. download é forçado a falhar.
  142. Especificar ``0`` para desabilitar esta opção. Esta opção só é válida
  143. para servidores HTTP / FTP.
  144. Padrão: ``0``
  145. .. option:: -m, --max-tries=<NÚMERO>
  146. Define o número de tentativas. ``0`` significa ilimitadas.
  147. See also :option:`--retry-wait`.
  148. Padrão: ``5``
  149. .. option:: -k, --min-split-size=<TAMANHO>
  150. aria2 não divide menos que 2 * TAMANHO o intervalo de bytes. Por exemplo,
  151. considere download de um arquivo de 20MiB. Se o TAMANHO é 10M, aria2 pode
  152. dividir o arquivo em 2 intervalos de [0-10MiB) e [10MiB-20MiB) e executar o
  153. download usando 2 fontes (logicamente se a opção :option:`--split <-s>` >= 2).
  154. Se o TAMANHO é 15M, desde que 2 * 15M > 20Mib, aria2 não dividirá o arquivo e
  155. fará o download de 1 fonte. Pde ser anexado ``K`` ou ``M``
  156. (1K = 1024, 1M = 1024K).
  157. Valores Possíveis: ``1M`` -``1024M``
  158. Padrão: ``20M``
  159. .. option:: -n, --no-netrc[=true|false]
  160. Desabilita suporte netrc.
  161. Padrão: Suporte a netrc é habilitado por padrão.
  162. .. note::
  163. arquivo netrc é lido somente no início se a opção :option:`--no-netrc <-n>` é
  164. ``false``.
  165. Portanto se a opção :option:`--no-netrc <-n>` é ``true`` no início, não haverá
  166. netrc disponível durante toda a sessão, mesmo que seja utilizada a opção
  167. :func:`aria2.changeGlobalOption` para executar a opção :option:
  168. `--no-netrc=false <-n>`.
  169. .
  170. .. option:: --no-proxy=<DOMÍNIOS>
  171. Especifica nomes de servidores, domínios e endereços de redes com ou sem blocos
  172. CIDR para os quais não serão utilizados proxy.
  173. .. note::
  174. Para endereço de rede com blocos CIDR, ambos endereços IPv4 ou IPv6 funcionam.
  175. Implementação atual, não resolve nome host em URI para comparar com endereço
  176. especificado na opção :option:`--no-proxy`. Portanto só será efetiva se a URI
  177. possuir números de endereço IP.
  178. .. option:: -o, --out=<ARQUIVO>
  179. O nome do arquivo baixado. Quando a opção :option:`--force-sequential <-Z>` é
  180. utilizada esta opção será ignorada.
  181. .. note::
  182. Em um download Metalink ou BitTorrent não poderá ser especificado o nome
  183. do arquivo. O nome do arquivo especificado aqui é usado quando através
  184. da linha de comando é informada para o aria2 sem a utilização da opção
  185. :option:`--input-file <-i>`, :option:`--force-sequential <-Z>`.
  186. Por exemplo:
  187. .. code-block:: console
  188. $ aria2c -o meuarquivo.zip "http://server1/arquivo.zip" "http://server2/arquivo.zip"
  189. .. option:: --proxy-method=<MÉTODO>
  190. Define o método utilizado para requisições de proxy. MÉTODO é ``get`` ou
  191. ``tunnel``. Downloads HTTPS sempre utiliza ``tunnel``, independentemente
  192. desta opção.
  193. Padrão: ``get``
  194. .. option:: -R, --remote-time[=true|false]
  195. Recuperar timestamp do arquivo remoto a partir do servidor remoto HTTP / FTP
  196. e se disponível, aplicá-lo ao arquivo local.
  197. Padrão: ``false``
  198. .. option:: --reuse-uri[=true|false]
  199. Reutilizar uma URI já utilizada. Se não habilitada as URIs já utilizadas serão
  200. abandonadas.
  201. Padrão: ``true``
  202. .. option:: --retry-wait=<SEGUNDOS>
  203. Define quantos segundos haverá entre as tentativas. Com SEGUNDOS > 0, aria2 irá
  204. tentará fazer o download quando o servidor HTTP retornar código resposta 503.
  205. Padrão: ``0``
  206. .. option:: --server-stat-of=<ARQUIVO>
  207. Define o nome do arquivo no qual será salvo o perfil de performance de um
  208. ou mais servidores acessados.
  209. Para carregar dados já salvos utilizar opção :option:`--server-stat-if`.
  210. Ver subseção `Perfil Performance Servidor`_ abaixo,
  211. para o formato do arquivo.
  212. .. option:: --server-stat-if=<ARQUIVO>
  213. Specify the filename to load performance profile of the servers. The
  214. loaded data will be used in some URI selector such as ``feedback``.
  215. See also :option:`--uri-selector` option. See
  216. `Perfil Performance Servidor`_
  217. subsection below for file format.
  218. .. option:: --server-stat-timeout=<SEGUNDOS>
  219. Specifies timeout in seconds to invalidate performance profile of
  220. the servers since the last contact to them.
  221. Padrão: ``86400`` (24hours)
  222. .. option:: -s, --split=<N>
  223. Download a file using N connections. If more than N URIs are given,
  224. first N URIs are used and remaining URIs are used for backup. If
  225. less than N URIs are given, those URIs are used more than once so
  226. that N connections total are made simultaneously. The number of
  227. connections to the same host is restricted by
  228. :option:`--max-connection-per-server <-x>` option.
  229. See also :option:`--min-split-size <-k>` option.
  230. Padrão: ``5``
  231. .. note::
  232. Some Metalinks regulate the number of servers to connect. aria2
  233. strictly respects them. This means that if Metalink defines the
  234. maxconnections attribute lower than N, then aria2 uses the
  235. value of maxconnections attribute instead of N.
  236. .. option:: --stream-piece-selector=<SELECTOR>
  237. Specify piece selection algorithm used in HTTP e FTP download. Piece
  238. means fixed length segment which is downloaded in parallel in
  239. segmented download. If ``default`` is given, aria2 selects piece so
  240. that it reduces the number of establishing connection. This is
  241. reasonable default behaviour because establishing connection is an
  242. expensive operation. If ``inorder`` is given, aria2 selects piece
  243. which has minimum index. Index=0 means first of the file. This will
  244. be useful to view movie while downloading it.
  245. :option:`--enable-http-pipelining` option may
  246. be useful to reduce reconnection overhead. Please note that aria2
  247. honors
  248. :option:`--min-split-size <-k>` option,
  249. so it will be necessary to specify a reasonable value to
  250. :option:`--min-split-size <-k>` option.
  251. If ``geom`` is given, at the beginning aria2 selects piece which has
  252. minimum index like ``inorder``, but it exponentially increasingly
  253. keeps space from previously selected piece. This will reduce the
  254. number of establishing connection and at the same time it will
  255. download the beginning part of the file first. This will be useful
  256. to view movie while downloading it.
  257. Padrão: ``default``
  258. .. option:: -t, --timeout=<SEGUNDOS>
  259. Set timeout in seconds.
  260. Padrão: ``60``
  261. .. option:: --uri-selector=<SELECTOR>
  262. Specify URI selection algorithm. The possible values are ``inorder``,
  263. ``feedback`` and ``adaptive``. If ``inorder`` is given, URI is tried in
  264. the order appeared in the URI list. If ``feedback`` is given, aria2
  265. uses download speed observed in the previous downloads and choose
  266. fastest server in the URI list. This also effectively skips dead
  267. mirrors. The observed download speed is a part of performance
  268. profile of servers mentioned in :option:`--server-stat-of` and
  269. :option:`--server-stat-if` options. If ``adaptive`` is given, selects one of
  270. the best mirrors for the first and reserved connections. For
  271. supplementary ones, it returns mirrors which has not been tested
  272. yet, and if each of them has already been tested, returns mirrors
  273. which has to be tested again. Otherwise, it doesn't select anymore
  274. mirrors. Like ``feedback``, it uses a performance profile of servers.
  275. Padrão: ``feedback``
  276. Opções Específicas de HTTP e HTTPS
  277. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  278. .. index: triple: hhtp; http; opções
  279. .. option:: --ca-certificate=<ARQUIVO>
  280. Utilizar o certificado do ARQUIVO FILE para verificar os Servidores.
  281. O certificado precisa estar no formato PEM e pode conter múltiplos
  282. certificados CA.
  283. Utilizar a opção :option:`--check-certificate` para habilitar a verificação.
  284. .. note::
  285. Se aria2 foi compilado com OpenSSL ou versão mais recente de GnuTLS a qual
  286. tem a função ``gnutls_certificate_set_x509_system_trust()`` e a biblioteca
  287. foi adequadamente configurada para localizar o certificado CA existente,
  288. aria2 irá carregar automaticamente estes certificados no início.
  289. .. option:: --certificate=<ARQUIVO>
  290. Usar arquivo com certificado cliente.
  291. O certificado deve estar no formato PEM.
  292. Pode ser usada a opção :option:`--private-key` para especificar uma chave
  293. particular.
  294. .. option:: --check-certificate[=true|false]
  295. Verifica se o peer esta usando o certificado especificado na opção
  296. :option:`--ca-certificate`.
  297. Padrão: ``true``
  298. .. option:: --http-accept-gzip[=true|false]
  299. Envia cabeçalho requisição ``Accept: deflate, gzip`` e faz (inflate) se
  300. o servidor remoto responder com ``Content-Encoding: gzip`` ou
  301. ``Content-Encoding: deflate``. Padrão: ``false``
  302. .. note::
  303. Alguns servidores respondem com ``Content-Encoding: gzip`` para arquivos
  304. que são gzip. aria2 faz inflate destes por causa do cabeçalho de resposta.
  305. .. option:: --http-auth-challenge[=true|false]
  306. Envia cabeçalho de autorização HTTP só quando requisitado pelo servidor.
  307. Se ``false`` é habilitado, então o cabeçalho de autorização sempre será
  308. enviado ao servidor. Há uma exceção: se o nome do usuário de senha são
  309. embutidas na URI, o cabeçalho de autorização sempre será enviado ao servidor
  310. independente desta opção. Padrão: ``false``
  311. .. option:: --http-no-cache[=true|false]
  312. Envia Cache-Control: no-cache e Pragma: cabeçalho no-cache para evitar
  313. conteúdo do cache. Se ``false`` é fornecido, esses cabeçalhos não serão
  314. enviados e poderá ser adicionado o cabeçalho de Cache-Control com a diretiva
  315. desejada usando a opção :option:`--header`. Padrão: ``true``
  316. .. option:: --http-user=<USUÁRIO>
  317. Define usuário HTTP. Isto afeta todas as URIs.
  318. .. option:: --http-passwd=<PASSWD>
  319. Define senha HTTP. Isto afeta todas as URIs.
  320. .. option:: --http-proxy=<PROXY>
  321. Usar este servidor proxy para HTTP. Para limpar o proxy anteriormente
  322. definido use "". Ver também opção :option:`--all-proxy`. Isto afeta todas
  323. URIs. O formato de PROXY é ``[http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]``
  324. .. option:: --http-proxy-passwd=<SENHA>
  325. Define a senha para opção :option:`--http-proxy`.
  326. .. option:: --http-proxy-user=<USUÁRIO>
  327. Define o usuário para a opção :option:`--http-proxy`.
  328. .. option:: --https-proxy=<PROXY>
  329. Usar este servidor proxy para HTTPS. Para limpar o proxy anteriormente,
  330. use "". Ver também opção :option:`--all-proxy`. Isto afeta todas URIs. O
  331. formato de PROXY é ``[https://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]``
  332. .. option:: --https-proxy-passwd=<SENHA>
  333. Define senha para a opção :option:`--https-proxy`.
  334. .. option:: --https-proxy-user=<USUÁRIO>
  335. Define usuário para a opção :option:`--https-proxy`.
  336. .. option:: --private-key=<ARQUIVO>
  337. Define o arquivo de chave particular que será usado.
  338. A chave particular deve estar no formato PEM e não pode estar criptografada.
  339. O comportamento quando estiver criptografada é indefinido.
  340. Ver também a opção :option:`--certificate`.
  341. .. option:: --referer=<REFERER>
  342. Define a referência. Afeta todas URIs. Se ``*`` é usado, cada URI requisitada é usada
  343. como referência (referer). Pode ser útil quando usado em conjunto com a opção
  344. :option:`--parameterized-uri`.
  345. .. option:: --enable-http-keep-alive[=true|false]
  346. Enable HTTP/1.1 persistent connection.
  347. Padrão: ``true``
  348. .. option:: --enable-http-pipelining[=true|false]
  349. Habilita pipelining para HTTP/1.1.
  350. Padrão: ``false``
  351. .. note::
  352. Da perspectiva de performance, não há vantagem em habilitar esta opção.
  353. .. option:: --header=<HEADER>
  354. Anexa CABEÇALHOao ao cabeçalho HTTP requisitado.
  355. Pode usar esta opção várias vezes para especificar múltiplos cabeçalhos:
  356. .. code-block:: console
  357. $ aria2c --header="X-A: b78" --header="X-B: 9J1" "http://servidor/arquivo"
  358. .. index:: triple: cookies; load; save;
  359. .. option:: --load-cookies=<ARQUIVO>
  360. Carregar Cookies do ARQUIVO usando formato Firefox3 format (SQLite3),
  361. Chromium / Google Chrome (SQLite3) e formato
  362. Mozilla / Firefox(1.x/2.x) / Netscape.
  363. .. note::
  364. Se aria2 é compilado sem libsqlite3, então não havera suporte aos formatos
  365. de cookie Firefox3 e Chromium / Google Chrome.
  366. .. option:: --save-cookies=<ARQUIVO>
  367. Salva Cookies para o ARQUIVO no formato Mozilla / Firefox(1.x/2.x) /
  368. Netscape. Se ARQUIVO já existe, será sobreposto. Cookies da Sessão também
  369. serão salvos e seus valores de expiração serão tratados como 0.
  370. Valores Possíveis: ``/caminho/do/arquivo``
  371. .. option:: --use-head[=true|false]
  372. Usar método HEAD para a primeira requisição ao servidor HTTP.
  373. Padrão: ``false``
  374. .. option:: -U, --user-agent=<AGENTE_USUÁRIO>
  375. Define usuário agente para download HTTP, HTTPS.
  376. Padrão: ``aria2/$VERSION``, $VERSION é substituída pela versão do aria2.
  377. Opções Específicas de FTP
  378. ~~~~~~~~~~~~~~~~~~~~~~~~~
  379. .. option:: --ftp-user=<USUÁRIO>
  380. Definir o usuário FTP. Isto afeta todas as URIs.
  381. Padrão: ``anonymous``
  382. .. option:: --ftp-passwd=<SENHA_FTP>
  383. Definir senha FTP. Isto afeta todas as URIs.
  384. Se o nome existe, mas a senha esta ausente, para login em uma URI, aria2
  385. tenta obter a senha usando o arquivo .netrc, caso exista senha declarada
  386. no .netrc. Se não existir será utilizada a senha declarada nesta opção.
  387. Padrão: ``ARIA2USER@``
  388. .. option:: -p, --ftp-pasv[=true|false]
  389. Usar modo passivo no FTP.
  390. Se ``false`` é informado, o modo ativo será usado.
  391. Padrão: ``true``
  392. .. option:: --ftp-proxy=<PROXY>
  393. Usar este servidor proxy para FTP. Para limpar definição proxy previamente
  394. definido, use "". Ver também opção :option:`--all-proxy`.
  395. Isto afeta todas URIs. O formato do PROXY é
  396. ``[http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]``
  397. .. option:: --ftp-proxy-passwd=<PASSWD>
  398. Define senha para a opção :option:`--ftp-proxy`.
  399. .. option:: --ftp-proxy-user=<USUÁRIO>
  400. Define senha para opção :option:`--ftp-proxy`.
  401. .. option:: --ftp-type=<TYPE>
  402. Define tipo de transferência FTP. Que pode ser: ``binary`` ou ``ascii``.
  403. Padrão: ``binary``
  404. .. option:: --ftp-reuse-connection[=true|false]
  405. Reutilizar conexão FTP.
  406. Padrão: ``true``
  407. Opções Comuns de BitTorrent / Metalink
  408. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  409. .. option:: --select-file=<INDEX>...
  410. Define arquivo para download através da especificação de seu index.
  411. Para achar o index do arquivo use a opção :option:`--show-files <-S>`.
  412. Múltiplos indíces podem ser especificados usando-se ``,``, por exemplo:
  413. ``3,6``. Também pode ser usado ``-`` para especificar intervalos:
  414. ``1-5``. Ambos podem ser usados juntos ``,`` e ``-`` exemplo:
  415. ``1-5,8,9``. Quando usados com a opção -M, o índice pode variar dependendo
  416. das opções da query. Ver opções (*--metalink-\ **).
  417. .. note::
  418. Em torrent de múltiplos arquivos, os arquivos adjacentes especificados
  419. por essa opção também podem ser baixados. Esse é o comportamento esperado
  420. não é um bug/erro. Um simples pedaço pode incluir diversos arquivos ou
  421. partes de arquivos, e aria2 grava o pedaço(s) no(s) arquivo(s)
  422. apropriado(s).
  423. .. option:: -S, --show-files[=true|false]
  424. Imprimir a lista de arquivos do ".torrent", ".meta4" e ".metalink" e termina.
  425. No caso de arquivo ".torrent", informações adicionais são impressas.
  426. (infohash, tamanho pedaço, etc).
  427. Opções Específicas de BitTorrent
  428. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  429. .. option:: --bt-enable-lpd[=true|false]
  430. Habilita Descobrir Peer Local. Se indicador particular é configurado
  431. no torrent, aria2 não usa esta funcionalidade mesmo que ``true`` foi
  432. informato.
  433. Padrão: ``false``
  434. .. option:: --bt-exclude-tracker=<URI>[,...]
  435. Lista separada por vírgulas, de trackers de URI BitTorrent que devem ser
  436. removidas. Pode ser usado o valor especial ``*`` para especificar todas
  437. URIs; isso irá excluir todas URIs de "announce". Quando especificar ``*``
  438. em uma linha de comando do shell, lembre-se de forçar o escape or delimite
  439. com aspas, apóstrofo ou em linux com crase caracter `.
  440. Ver também opção :option: `--bt-tracker`.
  441. .. option:: --bt-external-ip=<ENDEREÇO-IP>
  442. Especificar o IP externo para reportar um track BitTorrent. Mesmo que esta
  443. função tenha o nome ``external``, ela pode aceitar qualquer tipo de endereço
  444. IP. ENDEREÇO-IP deve ser um endereço IP numérico.
  445. .. option:: --bt-hash-check-seed[=true|false]
  446. Se ``true`` é informado, após o check do hash usando a opção :option:
  447. `--check-integrity <-V>` e o arquivo esta completo, continue o arquivo seed.
  448. Se desejar verificar o arquivo e efetuar o download somente quando ele estiver
  449. imcompleto ou danificado, defina esta opção para ``false``. Esta opção
  450. só tem efeito para download de BitTorrent.
  451. Padrão: ``true``
  452. .. option:: --bt-lpd-interface=<INTERFACE>
  453. Use o interface de rede informado para Descobrir o Peer Local. Se esta opção
  454. não é especificada, o interface padrão é usado. Pode ser especificado o nome
  455. do interface e o endereço IP.
  456. Valores possíveis: interface, endereço IP
  457. .. option:: --bt-max-open-files=<NÚMERO>
  458. Especificar o número máximo de arquivos para abrir para cada download
  459. BitTorrent.
  460. Padrão: ``100``
  461. .. option:: --bt-max-peers=<NÚMERO>
  462. Especificar o número máximo de peers para cada torrent. ``0`` significa
  463. ilimitado. Ver também a opção :option: `--bt-request-peer-speed-limit`.
  464. Padrão: ``55``
  465. .. option:: --bt-metadata-only[=true|false]
  466. Download somente os metadados. O(s) arquivo(s) descrito(s) no(s) metadado(s)
  467. não será(ão) baixado(s). Esta opção só tem efeito para URI BitTorrent Magnet.
  468. Ver também a opção :option: `--bt-save-metadata`.
  469. Padrão: ``false``
  470. .. option:: --bt-min-crypto-level=plain|arc4
  471. Define o nível mínimo do método de critografia.
  472. Se existem diversos métodos são fornecidos por um peer, aria2 escolhe o que
  473. satisfaz o menor nível especificado.
  474. Padrão: ``plain``
  475. .. option:: --bt-prioritize-piece=head[=<TAMANHO>],tail[=<TAMANHO>]
  476. Tentar primeiramente o download do primeiro e último pedaço de cada arquivo
  477. Isto é útil para ver antecipadamente os arquivos. O argumento pode conter
  478. duas palavras chave:
  479. ``head`` e ``tail``. Para incluir ambos, devem estar separados por vírgula.
  480. Estas palavras chave possuem um parâmetro tamanho. Por examplo,
  481. se ``head=<TAMANHO>`` é especificado, pedaço no intervalo do número de bytes
  482. iniciais de cada arquivo terão prioridade. ``tail=<TAMANHO>`` significa
  483. que o intervalo final no TAMANHO informado de cada arquivo. TAMANHO pode
  484. incluir ``K`` ou ``M`` (1K = 1024, 1M = 1024K). Se TAMANHO é omitido,
  485. TAMNHA de 1M será usado.
  486. .. option:: --bt-remove-unselected-file[=true|false]
  487. Remove os arquivos não selecionados quando o download do BitTorrent estiver
  488. completo. Para selecionar arquivo(s) use a opção :option:`--select-file`.
  489. Se não for usada esta opção, é assumido que todos os arquivos serão
  490. selecionados. Use esta opção com critério pois ela realmente remove
  491. arquivo(s) do seu disco.
  492. Padrão: ``false``
  493. .. option:: --bt-require-crypto[=true|false]
  494. Se true é informado, aria2 não aceita nem estabelece conexão com handshake de
  495. BitTorrent (protocolo \19BitTorrent). Em vez disso aria2 usa
  496. (Obfuscation handshake.
  497. Padrão: ``false``
  498. .. option:: --bt-request-peer-speed-limit=<VELOCIDADE>
  499. Se a velocidade total de download do torrent é menor que a <VELOCIDADE>,
  500. aria2 temporariamente incrementa o número de peers para tentar maior
  501. velocidade de download. Configurando esta opção com sua velocidade
  502. preferida pode incrementar a velocidade de download em alguns casos. Pode
  503. ser anexado ``K`` ou ``M`` (1K = 1024, 1M = 1024K).
  504. Padrão: ``50K``
  505. .. option:: --bt-save-metadata[=true|false]
  506. Salvar metadados como arquivo ".torrent" file. Esta opção tem efeito somente
  507. se URI usada é de BitTorrent Magnet. O nome do arquivo é codificado em hash
  508. em hexadecimal com sufixo de ".torrent". O diretório onde será salvo o
  509. o metadado, é o mesmo onde aponta o download do arquivo. Se o arquivo já
  510. existe, o metadado não será salvo. Ver tambémn a opção :option:
  511. `--bt-metadata-only`.
  512. Padrão: ``false``
  513. .. option:: --bt-seed-unverified[=true|false]
  514. Faz Seed do arquivo previamente baixado sem verificar os hashes dos pedaços.
  515. Padrão: ``false``
  516. .. option:: --bt-stop-timeout=<SEGUNDOS>
  517. Interrompe o download do BitTorrent se a velocidade do for zero por
  518. consecutivos SEGUNDOS. Se ``0`` é informado, esta funcionalidade é
  519. desabilitada.
  520. Padrão: ``0``
  521. .. option:: --bt-tracker=<URI>[,...]
  522. Lista URI, separada por vírgulas, dos rastreadores BitTorrent. Estas URIs não
  523. são afetadas pela opção :option:`--bt-exclude-tracker`, porque elas são
  524. adicionadas após as URIs da opção :option:`--bt-exclude-tracker` serem
  525. removidas.
  526. .. option:: --bt-tracker-connect-timeout=<SEGUNDOS>
  527. Define o tempo de conexão em segundos para estabelecera conexão com o tracker.
  528. Após a conexão ser estabelecida, esta opção não tem mais efeito e a opção
  529. :option:`--bt-tracker-timeout` é usada.
  530. Padrão: ``60``
  531. .. option:: --bt-tracker-interval=<SEGUNDOS>
  532. Define o intervalo em segundos, entre as requisições ao tracker / rastreador.
  533. Isso sobrepõe o valor do intervalo e aria2 passa a usá-los e ignorar o
  534. valor mínimo de resposta do tracker / rastreador. Se ``0`` é definido, aria2
  535. assume que o intervalo será baseado no tracker / rastreador e o download
  536. irá prosseguir.
  537. Padrão: ``0``
  538. .. option:: --bt-tracker-timeout=<SEGUNDOS>
  539. Define em segundos o intervalo do timeout.
  540. Padrão: ``60``
  541. .. option:: --dht-entry-point=<SERVIDOR>:<PORTA>
  542. Define servidor e a porta da rede DHT IPv4.
  543. .. option:: --dht-entry-point6=<SERVIDOR>:<PORTA>
  544. Define servidor e a porta da rede DHT IPv6.
  545. .. option:: --dht-file-path=<CAMINHO>
  546. Modifica o caminho (CAMINHO) para o arquivo da tabela de roteamento DHT IPv4.
  547. Padrão: ``$HOME/.aria2/dht.dat``
  548. .. option:: --dht-file-path6=<PATH>
  549. Modifica o caminho (CAMINHO) para o arquivo da tabela de roteamento DHT IPv6.
  550. Padrão: ``$HOME/.aria2/dht6.dat``
  551. .. option:: --dht-listen-addr6=<ADDR>
  552. Define o endereço para o bind do socket para DHT IPv6. Deve ser endereço
  553. global IPv6 do servidor.
  554. .. option:: --dht-listen-port=<PORT>...
  555. Define portas UDP para ouvir para DHT (IPv4 e IPv6) e rastreador UDP.
  556. Múltiplas portas podem ser especificadas através do uso de ``,``,
  557. por exemplo: ``6881,6885``. Também pode ser usado ``-`` para especificar
  558. intervalo, exemplo: ``6881-6999``. Ambos ``,`` and ``-`` podem ser
  559. usados em conjunto.
  560. Padrão: ``6881-6999``
  561. .. note::
  562. Cerfifique-se que as portas especificadas estão disponíveis para tráfego UDP
  563. de entrada.
  564. .. option:: --dht-message-timeout=<SEGUNDOS>
  565. Define timeout em segundos.
  566. Padrão: ``10``
  567. .. option:: --enable-dht[=true|false]
  568. Habilita funcionalidade DHT IPv4. Tambem habilita suporte a rastreador UDP.
  569. Se um identificador particular é usado em um torrente, aria2 não usa DHT
  570. para aquele download, mesmo que ``true`` foi informado.
  571. Padrão: ``true``
  572. .. option:: --enable-dht6[=true|false]
  573. Habilita funcionalidade DHT IPv6. Se identificador particular é usado em um
  574. torrent, aria2 não usa DHT para aquele download mesmo que ``true`` foi
  575. informado. Usar opção :option:`--dht-listen-port` para especificar número(s)
  576. de porta(s) para ser(em) ouvida(s). Ver também opção :option:`
  577. --dht-listen-addr6`
  578. Padrão: ``true``
  579. .. option:: --enable-peer-exchange[=true|false]
  580. Habilita extensão Peer Exchange. Se um indicador particular é usado nesse
  581. torrent, essa funcionalidade será desabilitada para o download, mesmo que
  582. ``true`` foi informado.
  583. Padrão: ``true``
  584. .. option:: --follow-torrent=true|false|mem
  585. Se ``true`` ou ``mem`` é especificado, quando um arquivo cujo sufixo é
  586. ``.torrent`` ou o tipo de conteúdo é ``application/x-bittorrent`` é baixado,
  587. aria2 faz o parse como arquivo torrent e executa o download dos arquivos
  588. mencionados nele.
  589. Se ``mem`` é especificado, o arquivo torrent não será gravado em disco, apenas
  590. será mantido em memória.
  591. Se ``false`` é especificado, a ação acima descrita não será executada.
  592. Padrão: ``true``
  593. .. option:: -O, --index-out=<INDEX>=<PATH>
  594. Define o caminho do arquivo com índice=INDEX. O arquivo índice pode ser
  595. localizado usando-se a opção :option:`--show-files <-S>`. PATH é o caminho
  596. relativo ao caminho especificado na opção :option:`--dir <-d>`.
  597. Esta opção pode ser usada múltiplas vezes. Com esta opção pode-se especificar
  598. o nome dos arquivos que serão baixados pelo BitTorrent.
  599. .. option:: --listen-port=<PORT>...
  600. Define o número das portas TCP para download de BitTorrent.
  601. Multiplas portas são especificadas usando ``,``, por exemplo: ``6881,6885``.
  602. Também pode usar ``-`` para especificar intervalos: ``6881-6999``.
  603. Ambos ``,`` and ``-`` podem ser usados em conjunto: ``6881-6889,6999``.
  604. Padrão: ``6881-6999``
  605. .. note::
  606. Certifique-se que as portas estejam habilitadas para tráfego TCP de entrada.
  607. .. option:: --max-overall-upload-limit=<VELOCIDADE>
  608. Define a velocidade máxima geral de upload em bytes/seg. ``0`` significa
  609. irrestrito. Pode anexar ``K`` ou ``M`` (1K = 1024, 1M = 1024K). Para
  610. limitar a velocidade de upload por torrent, usar opção
  611. :option:`--max-upload-limit <-u>`.
  612. Padrão: ``0``
  613. .. option:: -u, --max-upload-limit=<VELOCIDADE>
  614. Define a velocidade máxima para cada torrent em bytes/seg. ``0`` significa
  615. irrestrito. Pode anexar ``K`` ou ``M`` (1K = 1024, 1M = 1024K). Para
  616. limitar a velocidade global de upload de torrent, usar opção
  617. :option:`--max-overall-upload-limit`.
  618. Padrão: ``0``
  619. .. option:: --peer-id-prefix=<PEER_ID_PREFIX>
  620. Especifica o prefixo para ID do peer. O ID do peer em um BitTorrent tem o
  621. tamanho de 20 bytes. Se mais de 20 bytes são especificados, somente os 20
  622. bytes iniciais serão usados. Se menos de 20 bytes são especificados, dados
  623. randomicos serão adicionados para completar o tamanho de 20 bytes.
  624. Padrão: ``aria2/$VERSÃO-``, $VERSÃO é a versão do pacote aria2.
  625. .. option:: --seed-ratio=<RATIO>
  626. Specify share ratio. Seed completed torrents until share ratio reaches
  627. RATIO.
  628. You are strongly encouraged to specify equals or more than ``1.0`` here.
  629. Specify ``0.0`` if you intend to do seeding regardless of share ratio.
  630. If :option:`--seed-time` option is specified along with this option,
  631. seeding ends when at least one of the conditions is satisfied.
  632. Padrão: ``1.0``
  633. .. option:: --seed-time=<MINUTES>
  634. Especificar o tempo de (seeding) em minutos. Ver também a opção
  635. :option:`--seed-ratio`.
  636. .. note::
  637. Especificando :option:`--seed-time=0 <--seed-time>` desabilita o (seeding)
  638. após o download ter sido completado.
  639. .. option:: -T, --torrent-file=<TORRENT_FILE>
  640. O caminho para o arquivo ".torrent". Não é obrigatório usar esta opção pois
  641. pode ser especificado arquivo ".torrent" sem a opção
  642. :option:`--torrent-file <-T>`.
  643. Opções Específicas de Metalink
  644. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  645. .. option:: --follow-metalink=true|false|mem
  646. If ``true`` or ``mem`` is specified, when a file whose suffix is ``.meta4``
  647. or ``.metalink`` or content type of ``application/metalink4+xml`` or
  648. ``application/metalink+xml`` is downloaded, aria2 parses it as a metalink
  649. file and downloads files mentioned in it.
  650. If ``mem`` is specified, a metalink file is not written to the disk,
  651. but is just kept in memory.
  652. If ``false`` is specified, the action mentioned above is not taken.
  653. Padrão: ``true``
  654. .. option:: --metalink-base-uri=<URI>
  655. Specify base URI to resolve relative URI in metalink:url and
  656. metalink:metaurl element in a metalink file stored in local disk. If
  657. URI points to a directory, URI must end with ``/``.
  658. .. option:: -M, --metalink-file=<METALINK_FILE>
  659. The file path to ".meta4" and ".metalink" file. Reads input from stdin when
  660. ``-`` is specified. You are not required to use this option because you can
  661. specify ".metalink" files without :option:`--metalink-file <-M>`.
  662. .. option:: --metalink-language=<LANGUAGE>
  663. The language of the file to download.
  664. .. option:: --metalink-location=<LOCATION>[,...]
  665. The location of the preferred server.
  666. A comma-delimited list of locations is acceptable, for example, ``jp,us``.
  667. .. option:: --metalink-os=<OS>
  668. The operating system of the file to download.
  669. .. option:: --metalink-version=<VERSION>
  670. The version of the file to download.
  671. .. option:: --metalink-preferred-protocol=<PROTO>
  672. Specify preferred protocol.
  673. The possible values are ``http``, ``https``, ``ftp`` and ``none``.
  674. Specify ``none`` to disable this feature.
  675. Padrão: ``none``
  676. .. option:: --metalink-enable-unique-protocol[=true|false]
  677. If ``true`` is given and several protocols are available for a mirror in a
  678. metalink file, aria2 uses one of them.
  679. Use :option:`--metalink-preferred-protocol` option to specify
  680. the preference of protocol.
  681. Padrão: ``true``
  682. Opções específicas de RPC
  683. ~~~~~~~~~~~~~~~~~~~~~~~~~
  684. .. option:: --enable-rpc[=true|false]
  685. Enable JSON-RPC/XML-RPC server. It is strongly recommended to set username
  686. and password using :option:`--rpc-user` and :option:`--rpc-passwd`
  687. option. See also :option:`--rpc-listen-port` option. Padrão: ``false``
  688. .. option:: --pause[=true|false]
  689. Pause o download após adicionado. Está opção só é efetiva quando
  690. a opção :option:`--enable-rpc=true <--enable-rpc>` é informada.
  691. Padrão: ``false``
  692. .. option:: --rpc-allow-origin-all[=true|false]
  693. Adiciona o campo de cabeçalho, ``Access-Control-Allow-Origin``,
  694. com o valor ``*`` á resposta RPC.
  695. Padrão: ``false``
  696. .. option:: --rpc-certificate=<ARQUIVO>
  697. Usar o certificado no ARQUIVO para servidor RPC. O certificado
  698. deve estar no formato PEM. Usar opção :option:`--rpc-private-key`
  699. para especificar chave particular. Usar a opção
  700. :option:`--rpc-secure` para habilitar criptografia.
  701. Usuários de *AppleTLS* precisam antes gerar o certificado próprio
  702. auto-assinado através do utilitário ``Keychain Access``, por ex:
  703. usando o assistente e tomando nota da identificação SHA-1 do
  704. certificado gerado.
  705. Para executar o aria2c com a opção :option:`--rpc-secure` usar
  706. `--rpc-certificate=<SHA-1>` e apenas omitir a opção
  707. :option:`--rpc-private-key`
  708. .. option:: --rpc-listen-all[=true|false]
  709. Listen incoming JSON-RPC/XML-RPC requests on all network interfaces. If false
  710. is given, listen only on local loopback interface. Padrão: ``false``
  711. .. option:: --rpc-listen-port=<PORT>
  712. Specify a port number for JSON-RPC/XML-RPC server to listen to. Possible
  713. Values: ``1024`` -``65535`` Padrão: ``6800``
  714. .. option:: --rpc-max-request-size=<TAMANHO>
  715. Set max size of JSON-RPC/XML-RPC request. If aria2 detects the request is
  716. more than SIZE bytes, it drops connection. Padrão: ``2M``
  717. .. option:: --rpc-passwd=<PASSWD>
  718. Set JSON-RPC/XML-RPC password.
  719. .. option:: --rpc-private-key=<FILE>
  720. Use the private key in FILE for RPC server. The private key must be
  721. decrypted and in PEM format. Use :option:`--rpc-secure` option to
  722. enable encryption. See also :option:`--rpc-certificate` option.
  723. .. option:: --rpc-save-upload-metadata[=true|false]
  724. Save the uploaded torrent or metalink metadata in the directory
  725. specified by :option:`--dir` option. The filename consists of SHA-1
  726. hash hex string of metadata plus extension. For torrent, the
  727. extension is '.torrent'. For metalink, it is '.meta4'. If false is
  728. given to this option, the downloads added by
  729. :func:`aria2.addTorrent` or :func:`aria2.addMetalink` will not be
  730. saved by :option:`--save-session` option. Default: ``false``
  731. .. option:: --rpc-secure[=true|false]
  732. RPC transport will be encrypted by SSL/TLS. The RPC clients must
  733. use https scheme to access the server. For WebSocket client, use wss
  734. scheme. Use :option:`--rpc-certificate` and
  735. :option:`--rpc-private-key` options to specify the server
  736. certificate and private key.
  737. .. option:: --rpc-user=<USUÁRIO>
  738. Set JSON-RPC/XML-RPC user.
  739. Opções Avançadas
  740. ~~~~~~~~~~~~~~~~
  741. .. option:: --allow-overwrite[=true|false]
  742. Reiniciar o download desde o início se o correspondente arquivo de controle
  743. não existir. Ver também a opção :option:`--auto-file-renaming`.
  744. Padrão: ``false``
  745. .. option:: --allow-piece-length-change[=true|false]
  746. Se ``false`` é informado, aria2 interrompe o download quando o tamanho de um
  747. pedaço for diferente do especificado no arquivo controle. Se ``true``
  748. é informado, o download prossegue mas o progresso será perdido.
  749. Padrão: ``false``
  750. .. option:: --always-resume[=true|false]
  751. Sempre continuar. Se If ``true`` é informado, aria2 sempre tentará
  752. retomar o download do ponto interrompido e se não for possivel o download
  753. será interrompido. Se ``false`` é informado, quando todas URIs fornecidas
  754. não suportarem a continuidade do download ou aria2 encontrar ``N`` URIs as
  755. quais não suportem retomar o download (``N`` é o valor especificado na
  756. opção :option:`--max-resume-failure-tries`), aria2 irá iniciar o download
  757. do início. Ver opção :option:`--max-resume-failure-tries`
  758. Padrão: ``true``
  759. .. option:: --async-dns[=true|false]
  760. Habilita DNS assíncrono.
  761. Padrão: ``true``
  762. .. option:: --async-dns-server=<ENDEREÇO-IP>[,...]
  763. Lista separada por vírgulas, dos endereços dos servidores DNS assíncronos
  764. usados pelo resolvedor. Normalmente o resolvedor de DNS assíncronos faz a
  765. leitura dos endereços a partir do arquivo ``/etc/resolv.conf``.
  766. Quando essa opção é usada é feito uso dos servidores DNS especificados na
  767. opção em detrimento do conteúdo do arquivo ``/etc/resolv.conf``.
  768. Podem ser usados ambos endereços IPv4 e IPv6. Essa opção é útil
  769. quando o sistema não possui ``/etc/resolv.conf`` e o usuário não tem
  770. permissão para criá-lo.
  771. .. option:: --auto-file-renaming[=true|false]
  772. Renomear o arquivo se o mesmo já existir.
  773. Essa opção só funciona em download HTTP, HTTPS e FTP.
  774. O novo nome do arquivo terá um ponto e uma sequência (1..9999) como sufixo.
  775. Padrão: ``true``
  776. .. option:: --auto-save-interval=<SEGUNDOS>
  777. Salvar o arquivo de controle (\*.aria2) a cada intervalo de SEGUNDOS.
  778. Se ``0`` é informado, o arquivo de controle não será salvo durante o
  779. download. aria2 salva o arquivo de controle quando parar, independentemente
  780. do valor. As possibilidades vão desde ``0`` até ``600``.
  781. Padrão: ``60``
  782. .. option:: --conditional-get[=true|false]
  783. Download file only when the local file is older than remote
  784. file. This function only works with HTTP, HTTPS, downloads only. It does
  785. not work if file size is specified in Metalink. It also ignores
  786. Content-Disposition header. If a control file exists, this option
  787. will be ignored. This function uses If-Modified-Since header to get
  788. only newer file conditionally. When getting modification time of
  789. local file, it uses user supplied filename(see :option:`--out <-o>` option) or
  790. filename part in URI if :option:`--out <-o>` is not specified.
  791. To overwrite existing file, :option:`--allow-overwrite` is required.
  792. Padrão: ``false``
  793. .. option:: --conf-path=<PATH>
  794. Change the configuration file path to PATH.
  795. Padrão: ``$HOME/.aria2/aria2.conf``
  796. .. option:: --console-log-level=<LEVEL>
  797. Set log level to output to console. LEVEL is either ``debug``,
  798. ``info``, ``notice``, ``warn`` or ``error``. Default: ``notice``
  799. .. option:: -D, --daemon[=true|false]
  800. Run as daemon. The current working directory will be changed to ``/``
  801. and standard input, standard output and standard error will be
  802. redirected to ``/dev/null``. Padrão: ``false``
  803. .. option:: --deferred-input[=true|false]
  804. If ``true`` is given, aria2 does not read all URIs and options from file
  805. specified by :option:`--input-file <-i>` option at startup,
  806. but it reads one by one when it
  807. needs later. This may reduce memory usage if input file contains a
  808. lot of URIs to download. If ``false`` is given, aria2 reads all URIs
  809. and options at startup.
  810. Padrão: ``false``
  811. .. option:: --disable-ipv6[=true|false]
  812. Disable IPv6. This is useful if you have to use broken DNS and want
  813. to avoid terribly slow AAAA record lookup. Padrão: ``false``
  814. .. option:: --disk-cache=<SIZE>
  815. Enable disk cache. If SIZE is ``0``, the disk cache is
  816. disabled. This feature caches the downloaded data in memory, which
  817. grows to at most SIZE bytes. The cache storage is created for aria2
  818. instance and shared by all downloads. The one advantage of the disk
  819. cache is reduce the disk I/O because the data are written in larger
  820. unit and it is reordered by the offset of the file. If hash
  821. checking is involved and the data are cached in memory, we don't
  822. need to read them from the disk. SIZE can include ``K`` or ``M``
  823. (1K = 1024, 1M = 1024K). Default: ``16M``
  824. .. option:: --download-result=<OPT>
  825. This option changes the way ``Download Results`` is formatted. If OPT
  826. is ``default``, print GID, status, average download speed and
  827. path/URI. If multiple files are involved, path/URI of first
  828. requested file is printed and remaining ones are omitted. If OPT is
  829. ``full``, print GID, status, average download speed, percentage of
  830. progress and path/URI. The percentage of progress and path/URI are
  831. printed for each requested file in each row.
  832. Padrão: ``default``
  833. .. option:: --enable-async-dns6[=true|false]
  834. Enable IPv6 name resolution in asynchronous DNS resolver. This
  835. option will be ignored when :option:`--async-dns=false. <--async-dns>`
  836. Padrão: ``false``
  837. .. option:: --enable-mmap[=true|false]
  838. Map files into memory. This option may not work if the file space
  839. is not pre-allocated. See :option:`--file-allocation`.
  840. Padrão: ``false``
  841. .. option:: --event-poll=<POLL>
  842. Specify the method for polling events. The possible values are
  843. ``epoll``, ``kqueue``, ``port``, ``poll`` and ``select``. For each ``epoll``,
  844. ``kqueue``, ``port`` and ``poll``, it is available if system supports it.
  845. ``epoll`` is available on recent Linux. ``kqueue`` is available on
  846. various \*BSD systems including Mac OS X. ``port`` is available on Open
  847. Solaris. The default value may vary depending on the system you use.
  848. .. option:: --file-allocation=<METHOD>
  849. Specify file allocation method.
  850. ``none`` doesn't pre-allocate file space. ``prealloc`` pre-allocates file space
  851. before download begins. This may take some time depending on the size of the
  852. file.
  853. If you are using newer file systems such as ext4
  854. (with extents support), btrfs, xfs or NTFS(MinGW build only), ``falloc`` is
  855. your best choice. It allocates large(few GiB)
  856. files almost instantly. Don't use ``falloc`` with
  857. legacy file systems such as ext3 and FAT32 because it takes
  858. almost same time as ``prealloc`` and it blocks aria2
  859. entirely until allocation finishes. ``falloc`` may
  860. not be available if your system doesn't have
  861. :manpage:`posix_fallocate(3)` function.
  862. ``trunc`` uses :manpage:`ftruncate(2)` system call or
  863. platform-specific counterpart to truncate a file to a specified
  864. length.
  865. Possible Values: ``none``, ``prealloc``, ``trunc``, ``falloc``
  866. Padrão: ``prealloc``
  867. .. option:: --force-save[=true|false]
  868. Save download with :option:`--save-session <--save-session>` option
  869. even if the download is completed or removed. This may be useful to
  870. save BitTorrent seeding which is recognized as completed state.
  871. Default: ``false``
  872. .. option:: --gid=<GID>
  873. Set GID manually. aria2 identifies each download by the ID called
  874. GID. The GID must be hex string of 16 characters, thus [0-9a-zA-Z]
  875. are allowed and leading zeros must not be stripped. The GID all 0 is
  876. reserved and must not be used. The GID must be unique, otherwise
  877. error is reported and the download is not added. This option is
  878. useful when restoring the sessions saved using
  879. :option:`--save-session <--save-session>` option. If this option is
  880. not used, new GID is generated by aria2.
  881. .. option:: --hash-check-only[=true|false]
  882. If ``true`` is given, after hash check using
  883. :option:`--check-integrity <-V>` option,
  884. abort download whether or not download is complete.
  885. Padrão: ``false``
  886. .. option:: --human-readable[=true|false]
  887. Print sizes and speed in human readable format (e.g., 1.2Ki, 3.4Mi)
  888. in the console readout. Padrão: ``true``
  889. .. option:: --interface=<INTERFACE>
  890. Bind sockets to given interface. You can specify interface name, IP
  891. address and hostname.
  892. Possible Values: interface, IP address, hostname
  893. .. note::
  894. If an interface has multiple addresses, it is highly recommended to
  895. specify IP address explicitly. See also :option:`--disable-ipv6`. If your
  896. system doesn't have :manpage:`getifaddrs(3)`, this option doesn't accept interface
  897. name.
  898. .. option:: --max-download-result=<NÚMERO>
  899. Set maximum number of download result kept in memory. The download
  900. results are completed/error/removed downloads. The download results
  901. are stored in FIFO queue and it can store at most NUM download
  902. results. When queue is full and new download result is created,
  903. oldest download result is removed from the front of the queue and
  904. new one is pushed to the back. Setting big number in this option may
  905. result high memory consumption after thousands of
  906. downloads. Specifying 0 means no download result is kept. Padrão:
  907. ``1000``
  908. .. option:: --max-resume-failure-tries=<N>
  909. When used with :option:`--always-resume=false, <--always-resume>` aria2 downloads file from
  910. scratch when aria2 detects N number of URIs that does not support
  911. resume. If N is ``0``, aria2 downloads file from scratch when all
  912. given URIs do not support resume. See :option:`--always-resume` option.
  913. Padrão: ``0``
  914. .. option:: --log-level=<LEVEL>
  915. Set log level to output.
  916. LEVEL is either ``debug``, ``info``, ``notice``, ``warn`` or ``error``.
  917. Padrão: ``debug``
  918. .. option:: --on-bt-download-complete=<COMMAND>
  919. For BitTorrent, a command specified in :option:`--on-download-complete` is
  920. called after download completed and seeding is over. On the other
  921. hand, this option set the command to be executed after download
  922. completed but before seeding.
  923. See `Interação com Eventos (Hook)`_ for more details about COMMAND.
  924. Possible Values: ``/path/to/command``
  925. .. option:: --on-download-complete=<COMMAND>
  926. Set the command to be executed after download completed. See
  927. See `Interação com Eventos (Hook)`_ for more details about COMMAND.
  928. See also :option:`--on-download-stop` option.
  929. Possible Values: ``/path/to/command``
  930. .. option:: --on-download-error=<COMMAND>
  931. Set the command to be executed after download aborted due to error.
  932. See `Interação com Eventos (Hook)`_ for more details about COMMAND.
  933. See also :option:`--on-download-stop` option. Possible Values:
  934. ``/path/to/command``
  935. .. option:: --on-download-pause=<COMMAND>
  936. Set the command to be executed after download was paused.
  937. See `Interação com Eventos (Hook)`_ for more details about COMMAND.
  938. Possible Values: ``/path/to/command``
  939. .. option:: --on-download-start=<COMMAND>
  940. Set the command to be executed after download got started.
  941. See `Interação com Eventos (Hook)`_ for more details about COMMAND.
  942. Possible Values: ``/path/to/command``
  943. .. option:: --on-download-stop=<COMMAND>
  944. Set the command to be executed after download stopped. You can override
  945. the command to be executed for particular download result using
  946. :option:`--on-download-complete` and :option:`--on-download-error`. If they are
  947. specified, command specified in this option is not executed.
  948. See `Interação com Eventos (Hook)`_ for more details about COMMAND.
  949. Possible Values: ``/path/to/command``
  950. .. option:: --piece-length=<LENGTH>
  951. Set a piece length for HTTP e FTP downloads. This is the boundary when
  952. aria2 splits a file. All splits occur at multiple of this
  953. length. This option will be ignored in BitTorrent downloads. It
  954. will be also ignored if Metalink file contains piece hashes.
  955. Padrão: ``1M``
  956. .. note::
  957. The possible usecase of :option:`--piece-length`
  958. option is change the request range in one HTTP pipelined request.
  959. To enable HTTP pipelining use
  960. :option:`--enable-http-pipelining`.
  961. .. option:: --show-console-readout[=true|false]
  962. Show console readout. Padrão: ``true``
  963. .. option:: --summary-interval=<SEGUNDOS>
  964. Set interval in seconds to output download progress summary.
  965. Setting ``0`` suppresses the output.
  966. Padrão: ``60``
  967. .. note::
  968. In multi file torrent downloads, the files adjacent forward to the specified files
  969. are also allocated if they share the same piece.
  970. .. option:: -Z, --force-sequential[=true|false]
  971. Fetch URIs in the command-line sequentially and download each URI in a
  972. separate session, like the usual command-line download utilities.
  973. Padrão: ``false``
  974. .. option:: --max-overall-download-limit=<VELOCIDADE>
  975. Set max overall download speed in bytes/sec. ``0`` means
  976. unrestricted. You can append ``K`` or ``M`` (1K = 1024, 1M = 1024K). To
  977. limit the download speed per download, use :option:`--max-download-limit`
  978. option. Padrão: ``0``
  979. .. option:: --max-download-limit=<VELOCIDADE>
  980. Set max download speed per each download in bytes/sec. ``0`` means
  981. unrestricted. You can append ``K`` or ``M`` (1K = 1024, 1M = 1024K). To
  982. limit the overall download speed, use :option:`--max-overall-download-limit`
  983. option. Padrão: ``0``
  984. .. option:: --no-conf[=true|false]
  985. Disable loading aria2.conf file.
  986. .. option:: --no-file-allocation-limit=<TAMANHO>
  987. No file allocation is made for files whose size is smaller than SIZE.
  988. You can append ``K`` or ``M`` (1K = 1024, 1M = 1024K).
  989. Padrão: ``5M``
  990. .. option:: -P, --parameterized-uri[=true|false]
  991. Enable parameterized URI support.
  992. You can specify set of parts: ``http://{sv1,sv2,sv3}/foo.iso``.
  993. Also you can specify numeric sequences with step counter:
  994. ``http://host/image[000-100:2].img``.
  995. A step counter can be omitted.
  996. If all URIs do not point to the same file, such as the second example above,
  997. -Z option is required.
  998. Padrão: ``false``
  999. .. option:: -q, --quiet[=true|false]
  1000. Make aria2 quiet (no console output).
  1001. Padrão: ``false``
  1002. .. option:: --realtime-chunk-checksum[=true|false]
  1003. Validate chunk of data by calculating checksum while downloading a file if
  1004. chunk checksums are provided.
  1005. Padrão: ``true``
  1006. .. option:: --remove-control-file[=true|false]
  1007. Remove control file before download. Using with
  1008. :option:`--allow-overwrite=true, <--allow-overwrite>` download always starts from
  1009. scratch. This will be useful for users behind proxy server which
  1010. disables resume.
  1011. .. option:: --save-session=<ARQUIVO>
  1012. Salvar downloads não concluídos ou com erro, para um ARQUIVO quando sair.
  1013. Pode ser informado o nome do arquivo para o aria2 com a opção
  1014. :option:`--input-file <-i>` no restart. Note que downloads adicionados
  1015. pela função :func:`aria2.addTorrent` e pela função
  1016. :func:`aria2.addMetalink` método RPC e seus respectivos metadados não podem
  1017. ser salvos. Downloads removidos usando a função :func:`aria2.remove` e
  1018. :func:`aria2.forceRemove` não serão salvos.
  1019. .. option:: --save-session-interval=<SEC>
  1020. Save error/unfinished downloads to a file specified by
  1021. :option:`--save-session` option every SEC seconds. If ``0`` is
  1022. given, file will be saved only when aria2 exits. Default: ``0``
  1023. .. option:: --stop=<SEGUNDOS>
  1024. Finaliza a aplicação após SEGUNDOS se passarem.
  1025. Se ``0`` é informado, essa funcionalidade é desabilitada.
  1026. Padrão: ``0``
  1027. .. option:: --stop-with-process=<PID>
  1028. Finaliza a aplicação quando o processo de número PID não estiver executando.
  1029. Isso é útil se o processo aria2 foi derivado de um processo precursor.
  1030. O processo precursor pode ter criado o processo aria2 com seu próprio pid
  1031. e quando o processo precursor terminar por alguma razão, aria2 pode
  1032. detectar por ele mesmo, essa situação e executar ele mesmo o shutdown.
  1033. Este recurso evita que um processo gere subprocessos que ficam no
  1034. limbo.
  1035. .. option:: --truncate-console-readout[=true|false]
  1036. Truncar a linha da console para ajustar-se a uma linha.
  1037. Padrão: ``true``
  1038. .. option:: -v, --version
  1039. Exibe o número da versão, copyright e informação da configuração e sai.
  1040. Argumento(s) Opcional(is)
  1041. ~~~~~~~~~~~~~~~~~~~~~~~~~
  1042. As opções que possuem seus argumentos delimitados por colchetes ([]), são
  1043. opcionais. Normalmente omitindo o argumento, ele será assumido como ``true``
  1044. (verdadeiro).
  1045. Se for usada a forma abreviada dessas opções (como em ``-V``) e informado
  1046. um argumento, estão o nome da opção e seu argumento devem ser concatenados,
  1047. por exemplo: (``-Vfalse``). Se houver espaços entre a opção e o argumento o
  1048. argumento será tratado como URI e normalmente não é isto o esperado.
  1049. Unidades (K and M)
  1050. ^^^^^^^^^^^^^^^^^^
  1051. Algumas opções usam ``K`` e ``M`` para convenientemente representar
  1052. 1.024 e 1.048.576 respectivamente. aria2 detecta estas caracteres de maneira
  1053. transparente (maiúsculas e minúsculas), portanto podem ser usados
  1054. `k`` ou ``K`` e ``m`` ou ``M``.
  1055. URI, MAGNET, TORRENT_FILE, METALINK_FILE
  1056. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1057. Podemos especificar múltiplas URIs em uma linha de comando. A menos que seja
  1058. especificada a opção :option:`--force-sequential <-Z>`, todas as URIs devem
  1059. apontar para o mesmo arquivo que será baixado ou o download falhará.
  1060. Pode-se especificar um número arbitrátio de URIs de BitTorrent Magnet URI.
  1061. Nove que eles sempre serão tratados como downloads separados.
  1062. São suportados Hash de Info de 40 characters e Hast de Info Base32 de 32
  1063. characters. Múltiplos parâmetros ``tr`` são suportados. Devido a URI
  1064. BitTorrent Magnet poder conter o caracter ``&``, é altamente recomendável
  1065. delimitar a URI com apóstrofo single(``'``) ou aspas double(``"``).
  1066. É altamente recomendável habilitar DHT especialmente quando ``tr`` o parâmetro
  1067. estiver ausente. Ver http://www.bittorrent.org/beps/bep_0009.html
  1068. para maiores detalhes sobre URI BitTorrent Magnet.
  1069. Pode-se também especificar um número arbitrário de arquivos torrent e
  1070. Documentos Metalink armazenados em um dispositivo local. Note que sempre serão
  1071. tratados como download distintos. Tanto Metalink4 quanto Metalink da versão 3
  1072. são suportados.
  1073. Pode-se especificar arquivo torrent usando a opção -T e URI. Fazendo isso
  1074. o download será baixado do servidor swarm e HTTP, HTTPS e FTP ao mesmo tempo,
  1075. enquanto os dados do HTTP, HTTPS e FTP serão uploaded para o swarm torrent.
  1076. Para torrent de um arquivo a URI deve ser completa e apontar inclusive o
  1077. recurso ou se a URI terminar com / o nome do torrent será adicionado. Para
  1078. múltiplos torrents, name e caminho serão adicionados para formar a URI, para
  1079. cada um dos arquivos.
  1080. .. note::
  1081. Certifique-se que a URI seja delimitada por apóstrofo single(``'``) ou
  1082. aspas double(``"``) se a URI contiver ``&`` ou qualquer outro caracter que
  1083. tenha significado especial para o shell.
  1084. Continuar Download Interrompido
  1085. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1086. Normalmente pode-se retomar uma transferência apenas executando-se o comando
  1087. aria2c URI, caso a transferência anterior estava sendo feita pelo aria2.
  1088. Caso a transferência anterior estava sendo feita por um navegador ou wget de
  1089. maneira sequencial, então utilize a opção :option:`--continue <-c>` para
  1090. retomar do ponto onde foi interrompida a transferência.
  1091. Interação com Eventos (Hook)
  1092. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1093. aria2 possui opções para especificar comando arbitrário após um evento
  1094. específico ocorrer. Atualmente as seguintes opções estão disponíveis:
  1095. :option:`--on-bt-download-complete`,
  1096. :option:`--on-download-pause`,
  1097. :option:`--on-download-complete`.
  1098. :option:`--on-download-start`,
  1099. :option:`--on-download-error`,
  1100. :option:`--on-download-stop`.
  1101. aria2 passa 3 argumentos para um comando especificado quando este comando for
  1102. executado. Estes argumentos são: GID, o número de arquivos e o caminho dos
  1103. arquivos. Para downloads HTTP, HTTPS e FTP normalmente o número de arquivos é 1.
  1104. BitTorrent podem conter múltiplos arquivos. Se o número de arquivos é maior
  1105. que 1, o caminho do arquivo é o primeiro. Em outras palavras, este é o valor
  1106. da chave path da primeira estrutura se aquela chave for verdadeira como
  1107. resposta do método da função :func:`aria2.getFiles` RPC.
  1108. Se for necessário todos os caminhos dos arquivos, considere usar o método
  1109. JSON-RPC/XML-RPC. Lembre-se que o caminho do arquivo pode ser modificado
  1110. durante o download no HTTP por causa do redirecionamento ou Disposição do
  1111. Conteúdo do Cabeçalho.
  1112. Observemos um exemplo de como são passados argumentos para um comando:
  1113. .. code-block:: console
  1114. $ cat hook.sh
  1115. #!/bin/sh
  1116. echo "chamado com [$1] [$2] [$3]"
  1117. $ aria2c --on-download-complete hook.sh http://dobrasil.org/arquivo.iso
  1118. chamado com [1] [1] [/caminho/para/arquivo.iso]
  1119. CÓDIGO DE RETORNO ou SAÍDA
  1120. --------------------------
  1121. Como aria2 pode manipular múltiplos downloads concomitantemente, podem ser
  1122. encontrados vários erros durante uma sessão. aria2 retorna os códigos de
  1123. retorno ou saída com base no último erro encontrado.
  1124. 0
  1125. Se todos os downloads terminam com sucesso.
  1126. 1
  1127. Erro desconhecido ocorreu.
  1128. 2
  1129. Tempo transcorrido (time out).
  1130. 3
  1131. Recurso não encontrado.
  1132. 4
  1133. Se aria2 tentou um número especificado de vezes e obteve "recurso não encontrado".
  1134. Ver opção :option:`--max-file-not-found`.
  1135. 5
  1136. Se download interrompido porque a velocidade de download é muito baixa.
  1137. Ver opção :option:`--lowest-speed-limit`
  1138. 6
  1139. Erro na rede (network).
  1140. 7
  1141. Se existem downloads não concluidos. Esse erro é reportado somente se
  1142. todos os downloads foram concluídos com sucesso mas existe uma fila quando
  1143. aria2 foi interrompido por quando foi pressionado :kbd:`Ctrl-C` pelo usuário
  1144. ou enviado o sinal TERM ou INT.
  1145. 8
  1146. Se o servidor remoto não suporta retomar um download que deve ser completado.
  1147. 9
  1148. Não há espaço em disco suficiente para os downloads.
  1149. 10
  1150. Se o tamanho do pedaço (piece) foi diferente do arquivo de controle .aria2.
  1151. Ver opção :option:`--allow-piece-length-change`.
  1152. 11
  1153. Se aria2 estava fazendo o download do mesmo arquivo no momento.
  1154. 12
  1155. If aria2 estava fazendo o download do mesmo, hash do torrent, no momento.
  1156. 13
  1157. Se o arquivo já existe. Ver opção :option:`--allow-overwrite`.
  1158. 14
  1159. Se renomer o arquivo falhou. Ver opção :option:`--auto-file-renaming`.
  1160. 15
  1161. Se aria2 não pode abrir o arquivo existente.
  1162. 16
  1163. Se aria2 não pode criar novo arquivo ou truncar um arquivo já existente.
  1164. 17
  1165. Se ocorreu erro de I/O no arquivo.
  1166. 18
  1167. Se aria2 não pode criar diretório.
  1168. 19
  1169. Se resolução de nomes falhou.
  1170. 20
  1171. Se aria2 não pode passar documento Metalink.
  1172. 21
  1173. Se comando FTP falhou.
  1174. 22
  1175. Se cabeçalho de resposta HTTP está errado ou inesperado.
  1176. 23
  1177. Se muitos redirecionamentos ocorreram.
  1178. 24
  1179. Se autorização HTTP falhou.
  1180. 25
  1181. Se aria2 não pode passar arquivo bencoded file (normalmente arq. ".torrent").
  1182. 26
  1183. Se arquivo ".torrent" estava corrompido ou inexistem informações que aria2
  1184. necessita.
  1185. 27
  1186. Se URI Magnet URI está errada.
  1187. 28
  1188. Se opção está errada ou não é reconhecida ou argumento inválido de uma opção
  1189. foi informado.
  1190. 29
  1191. Se o servidor remoto não pode manusear uma requisição devido a sobrecarga
  1192. temporária ou manutenção.
  1193. 30
  1194. Se aria2 não pode passar uma requisição JSON-RPC.
  1195. .. note::
  1196. Um erro ocorrido em um download completado não será reportado como um
  1197. status de saida nem como código de retorno (exit status).
  1198. .. index:: double: Variáveis; Ambiente
  1199. VARIÁVEIS DE AMBIENTE
  1200. ---------------------
  1201. aria2 reconhece as seguintes variáveis de ambiente.
  1202. ``http_proxy [http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]``
  1203. Especifica o servidor para uso do HTTP.
  1204. Sobrepõe o valor do http-proxy do arquivo de configuração.
  1205. A opção linha de comando :option:`--http-proxy` sobrepõe este valor.
  1206. ``https_proxy [http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]``
  1207. Especifica o servidor proxy para uso do HTTPS.
  1208. Sobrepõe o valor do https-proxy do arquivo de configuração.
  1209. A opção linha de comando :option:`--https-proxy` sobrepõe este valor.
  1210. ``ftp_proxy [http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]``
  1211. Especifica o servidor proxy para uso do FTP.
  1212. Sobrepõe o valor do http-proxy do arquivo de configuração.
  1213. A opção linha de comando :option:`--ftp-proxy` sobrepõe este valor.
  1214. ``all_proxy [http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]``
  1215. Especifica o servidor proxy para uso se nenhum protocolo-específico de proxy
  1216. é informado.
  1217. Sobrepõe o valor all-proxy do arquivo de configuração.
  1218. A opção linha de comando :option:`--all-proxy` sobrepõe este valor.
  1219. .. note::
  1220. Apesar de aria2 aceitar os esquemas ``ftp://`` e ``https://`` para proxy de
  1221. URI, aria2 assume que ``http://`` é especificado e não troca o comportamento
  1222. com base no esquema especificado.
  1223. ``no_proxy [DOMÍNIO,...]``
  1224. Especifica nome de servidores, separados por vírgula, domínios e endereços
  1225. de rede com ou sem blocos CIDR para os quais não será usado proxy.
  1226. Sobrepõe o valor no-proxy do arquivo de configuração.
  1227. A opção linha de comando :option:`--no-proxy` sobrepõe este valor.
  1228. Arquivos de configuração
  1229. ------------------------
  1230. .. index:: triple: aria2.conf; arquivo; configuração
  1231. aria2.conf
  1232. ~~~~~~~~~~
  1233. Por padrão, aria2 utiliza ``$HOME/.aria2/aria2.conf`` como arquivo de
  1234. configuração. Pode ser especificado o caminho do arquivo usando-se a opção
  1235. :option:`--conf-path`. Se não desejar usar a configuração de arquivo utilize
  1236. a opção :option:`--no-conf`.
  1237. O arquivo de configuração é um arquivo texto e possui uma opção por linha.
  1238. Em cada linha, deve haver um par (nome-valor), no formato:
  1239. ``NOME=VALOR``, onde nome é o nome longo da linha de comando sem o prefixo
  1240. ``--``. Pode ser usada a mesma sintaxe da opção da linha de comando.
  1241. Linhas que começam com ``#`` são tratados como comentários::
  1242. # arquivo de simples configuração para aria2c
  1243. listen-port=60000
  1244. dht-listen-port=60000
  1245. seed-ratio=1.0
  1246. max-upload-limit=50K
  1247. ftp-pasv=true
  1248. .. note::
  1249. Informações confidenciais como usuário/senha podem ser incluídas no arquivo
  1250. de configuração, mas recomenda-se trocar os bits de seu modo de acesso
  1251. (por exemplo: ``chmod 600 aria2.conf``), dessa maneira nenhum outro usuário
  1252. consegue ver o conteúdo desse arquivo de configuração.
  1253. .. index:: triple: dht.dat; arquivo; configuração
  1254. dht.dat
  1255. ~~~~~~~
  1256. Por padrão, a tabela de rota do IPv4 DHT está em ``$HOME/.aria2/dht.dat`` e a
  1257. tabela de rota do IPv6 DHT está em ``$HOME/.aria2/dht6.dat``.
  1258. .. index:: triple: netrc; arquivo; configuração
  1259. Netrc
  1260. ~~~~~
  1261. Por padrão, o suporte a Netrc está habilitado para HTTP, HTTPS e FTP. Para
  1262. desabilitar o suporte a netrc especificar :option:`--no-netrc <-n>`. Seu
  1263. arquivo .netrc precisa ter as permissões corretas (600).
  1264. Se o nome do servidor inicia com ``.``, aria2 executa pesquisa domínio ao
  1265. invés de pesquisa exata. Isto é uma extensão de aria2. Exemplo de pesquisa
  1266. de domínio, imagine as seguinte entrada no arquivo .netrc::
  1267. machine .dobrasil.org login meuid password minhasenha
  1268. ``aria2.dobrasil.org`` pesquisa domínio ``.dobrasil.org`` e usa ``meuid`` e
  1269. ``minhasenha``.
  1270. Mais exemplos de pesquisa domínio: ``nobrasil.net`` não executa pesquisa
  1271. domínio ``.nobrasil.net``. ``dobrasil.org`` não faz pesquisa domínio ``.dobrasil.org``
  1272. pois tem maior amplitude hierárquica por causa do ponto precedente ``.``. Se
  1273. desejar utilizar ``dobrasil.org``, especificar ``dobrasil.org``.
  1274. .. index:: triple: aria2; arquivo; controle
  1275. Arquivo de Controle
  1276. ~~~~~~~~~~~~~~~~~~~
  1277. aria2 utiliza um arquivo de controle para rastrear o progresso
  1278. de um download. Este arquivo é gravado no mesmo diretório do
  1279. arquivo que está sendo baixado e possui o sufixo ``.aria2``.
  1280. Por exemplo,se está baixando arquivo.zip, então o arquivo de controle
  1281. será arquivo.zip.aria2. (Existe apenas uma exceção para essa convenção
  1282. que é quando você está baixando um multi torrent, o arquivo de controle
  1283. estará no "diretório topo" do torrent com o sufixo ``.aria2``. O nome do
  1284. "diretório topo" é o valor da chave "name" no diretório "info" do arquivo
  1285. torrent).
  1286. Normalmente um arquivo controle é apagado quando o download se completa. Se
  1287. aria2 detecta que o download não pode ser retomado (por exemplo, quando faz
  1288. download de um servidor HTTP que não suporta retomar o processamento de um
  1289. ponto mas sempre do início), o arquivo de controle não será criado.
  1290. Se você perder o arquivo de controle, não será possivel retomar o download do
  1291. ponto onde estava. Mas se há um torrent ou metalink com checksum (verificação) do
  1292. arquivo, poderá ser retomado do último ponto especificando a opção -V na linha
  1293. de comando.
  1294. .. index:: triple: aria2; arquivo; entrada
  1295. Arquivo de Entrada
  1296. ~~~~~~~~~~~~~~~~~~
  1297. O arquivo de entrada pode conter uma lista de URIs para que o aria2 efetua
  1298. download. Podem ser especificados múltiplas URIs para cada simples entidade:
  1299. separar as entidades por um caracter TAB ou espaço.
  1300. Cada linha é tratada como se fosse especificada através de um argumento da linha
  1301. de comando. Entretando estas linhas são afetadas pela opção
  1302. :option:`--force-sequential <-Z>` e pela opção :option:`--parameterized-uri <-P>`
  1303. Quando as URIs do arquivo de entrada são diretamente lidas pelo aria2, as URIs
  1304. não precisam necessáriamente estarem delimitadas por apóstrofo (``'``) nem
  1305. aspas(``"``).
  1306. Linhas que começam com ``#`` são tratadas como comentário e desprezadas.
  1307. Adicionalmente, as seguintes opções podem ser especificadas após cada linha de
  1308. URI. Estas linhas opcionais precisam iniciar com um ou mais espaços.
  1309. .. hlist::
  1310. :columns: 3
  1311. * :option:`all-proxy <--all-proxy>`
  1312. * :option:`all-proxy-passwd <--all-proxy-passwd>`
  1313. * :option:`all-proxy-user <--all-proxy-user>`
  1314. * :option:`allow-overwrite <--allow-overwrite>`
  1315. * :option:`allow-piece-length-change <--allow-piece-length-change>`
  1316. * :option:`always-resume <--always-resume>`
  1317. * :option:`async-dns <--async-dns>`
  1318. * :option:`auto-file-renaming <--auto-file-renaming>`
  1319. * :option:`bt-enable-lpd <--bt-enable-lpd>`
  1320. * :option:`bt-exclude-tracker <--bt-exclude-tracker>`
  1321. * :option:`bt-external-ip <--bt-external-ip>`
  1322. * :option:`bt-hash-check-seed <--bt-hash-check-seed>`
  1323. * :option:`bt-max-open-files <--bt-max-open-files>`
  1324. * :option:`bt-max-peers <--bt-max-peers>`
  1325. * :option:`bt-metadata-only <--bt-metadata-only>`
  1326. * :option:`bt-min-crypto-level <--bt-min-crypto-level>`
  1327. * :option:`bt-prioritize-piece <--bt-prioritize-piece>`
  1328. * :option:`bt-remove-unselected-file <--bt-remove-unselected-file>`
  1329. * :option:`bt-request-peer-speed-limit <--bt-request-peer-speed-limit>`
  1330. * :option:`bt-require-crypto <--bt-require-crypto>`
  1331. * :option:`bt-save-metadata <--bt-save-metadata>`
  1332. * :option:`bt-seed-unverified <--bt-seed-unverified>`
  1333. * :option:`bt-stop-timeout <--bt-stop-timeout>`
  1334. * :option:`bt-tracker <--bt-tracker>`
  1335. * :option:`bt-tracker-connect-timeout <--bt-tracker-connect-timeout>`
  1336. * :option:`bt-tracker-interval <--bt-tracker-interval>`
  1337. * :option:`bt-tracker-timeout <--bt-tracker-timeout>`
  1338. * :option:`check-integrity <-V>`
  1339. * :option:`checksum <--checksum>`
  1340. * :option:`conditional-get <--conditional-get>`
  1341. * :option:`connect-timeout <--connect-timeout>`
  1342. * :option:`continue <-c>`
  1343. * :option:`dir <-d>`
  1344. * :option:`dry-run <--dry-run>`
  1345. * :option:`enable-async-dns6 <--enable-async-dns6>`
  1346. * :option:`enable-http-keep-alive <--enable-http-keep-alive>`
  1347. * :option:`enable-http-pipelining <--enable-http-pipelining>`
  1348. * :option:`enable-mmap <--enable-mmap>`
  1349. * :option:`enable-peer-exchange <--enable-peer-exchange>`
  1350. * :option:`file-allocation <--file-allocation>`
  1351. * :option:`follow-metalink <--follow-metalink>`
  1352. * :option:`follow-torrent <--follow-torrent>`
  1353. * :option:`force-save <--force-save>`
  1354. * :option:`ftp-passwd <--ftp-passwd>`
  1355. * :option:`ftp-pasv <-p>`
  1356. * :option:`ftp-proxy <--ftp-proxy>`
  1357. * :option:`ftp-proxy-passwd <--ftp-proxy-passwd>`
  1358. * :option:`ftp-proxy-user <--ftp-proxy-user>`
  1359. * :option:`ftp-reuse-connection <--ftp-reuse-connection>`
  1360. * :option:`ftp-type <--ftp-type>`
  1361. * :option:`ftp-user <--ftp-user>`
  1362. * :option:`hash-check-only <--hash-check-only>`
  1363. * :option:`header <--header>`
  1364. * :option:`http-accept-gzip <--http-accept-gzip>`
  1365. * :option:`http-auth-challenge <--http-auth-challenge>`
  1366. * :option:`http-no-cache <--http-no-cache>`
  1367. * :option:`http-passwd <--http-passwd>`
  1368. * :option:`http-proxy <--http-proxy>`
  1369. * :option:`http-proxy-passwd <--http-proxy-passwd>`
  1370. * :option:`http-proxy-user <--http-proxy-user>`
  1371. * :option:`http-user <--http-user>`
  1372. * :option:`https-proxy <--https-proxy>`
  1373. * :option:`https-proxy-passwd <--https-proxy-passwd>`
  1374. * :option:`https-proxy-user <--https-proxy-user>`
  1375. * :option:`index-out <-O>`
  1376. * :option:`lowest-speed-limit <--lowest-speed-limit>`
  1377. * :option:`max-connection-per-server <-x>`
  1378. * :option:`max-download-limit <--max-download-limit>`
  1379. * :option:`max-file-not-found <--max-file-not-found>`
  1380. * :option:`max-resume-failure-tries <--max-resume-failure-tries>`
  1381. * :option:`max-tries <-m>`
  1382. * :option:`max-upload-limit <-u>`
  1383. * :option:`metalink-base-uri <--metalink-base-uri>`
  1384. * :option:`metalink-enable-unique-protocol <--metalink-enable-unique-protocol>`
  1385. * :option:`metalink-language <--metalink-language>`
  1386. * :option:`metalink-location <--metalink-location>`
  1387. * :option:`metalink-os <--metalink-os>`
  1388. * :option:`metalink-preferred-protocol <--metalink-preferred-protocol>`
  1389. * :option:`metalink-version <--metalink-version>`
  1390. * :option:`min-split-size <-k>`
  1391. * :option:`no-file-allocation-limit <--no-file-allocation-limit>`
  1392. * :option:`no-netrc <-n>`
  1393. * :option:`no-proxy <--no-proxy>`
  1394. * :option:`out <-o>`
  1395. * :option:`parameterized-uri <-P>`
  1396. * :option:`pause <--pause>`
  1397. * :option:`piece-length <--piece-length>`
  1398. * :option:`proxy-method <--proxy-method>`
  1399. * :option:`realtime-chunk-checksum <--realtime-chunk-checksum>`
  1400. * :option:`referer <--referer>`
  1401. * :option:`remote-time <-R>`
  1402. * :option:`remove-control-file <--remove-control-file>`
  1403. * :option:`retry-wait <--retry-wait>`
  1404. * :option:`reuse-uri <--reuse-uri>`
  1405. * :option:`rpc-save-upload-metadata <--rpc-save-upload-metadata>`
  1406. * :option:`seed-ratio <--seed-ratio>`
  1407. * :option:`seed-time <--seed-time>`
  1408. * :option:`select-file <--select-file>`
  1409. * :option:`split <-s>`
  1410. * :option:`stream-piece-selector <--stream-piece-selector>`
  1411. * :option:`timeout <-t>`
  1412. * :option:`uri-selector <--uri-selector>`
  1413. * :option:`use-head <--use-head>`
  1414. * :option:`user-agent <-U>`
  1415. Estas opções possuem exatamente o mesmo significado das opções existentes na
  1416. linha de comando, mas aplicam-se apenas a URI a que pertencem.
  1417. Por favor perceba que dentro de um arquivo, elas não terão o prefixo ``--``.
  1418. Por exemplo, o conteúdo do arquivo de entrada uri.txt é::
  1419. http://servidor/arquivo.iso http://espelho/arquivo.iso
  1420. dir=/imagens_iso
  1421. out=arquivo.img
  1422. http://fu/ba
  1423. Se aria2 é executado com as opções ``-i uri.txt -d /tmp``, então o
  1424. ``arquivo.iso`` será salvo como ``/imagens_iso/arquivo.img`` e será baixado
  1425. dos servidores ``http://servidor/arquivo.iso`` e
  1426. ``http://espelho/arquivo.iso``.
  1427. O arquivo ``ba`` e baixado de ``http://fu/ba`` e salvo como ``/tmp/ba``.
  1428. Em alguns casos, o parâmetro :option:`out <-o>` não tem efeito.
  1429. Ver nota da opção :option:`--out <-o>` para entender as restrições.
  1430. .. index:: triple: Servidor; performance; Perfil;
  1431. Perfil Performance Servidor
  1432. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1433. Esta seção descreve o formato do perfil de performance do servidor, composto
  1434. por um arquivo de texto plano com cada linha contendo um par ``NOME=VALOR``,
  1435. delimitados por virgula. Atualmente esta é a lista de nomes reconhecidos:
  1436. ``host``
  1437. Nome do servidor. Requerido.
  1438. ``protocol``
  1439. Protocolo para este perfil, como ftp, http, https. http é requerido.
  1440. ``dl_speed``
  1441. Velocidade média de download observada no download prévio, em bytes por
  1442. segundo. Requerido.
  1443. ``sc_avg_speed``
  1444. The average download speed observed in the previous download in
  1445. bytes per sec. This value is only updated if the download is done in
  1446. single connection environment and only used by
  1447. AdaptiveURISelector. Optional.
  1448. ``mc_avg_speed``
  1449. The average download speed observed in the previous download in
  1450. bytes per sec. This value is only updated if the download is done in
  1451. multi connection environment and only used by
  1452. AdaptiveURISelector. Optional.
  1453. ``counter``
  1454. How many times the server is used. Currently this value is only used
  1455. by AdaptiveURISelector. Optional.
  1456. ``last_updated``
  1457. Last contact time in GMT with this server, specified in the seconds
  1458. since the Epoch(00:00:00 on January 1, 1970, UTC). Required.
  1459. ``status``
  1460. ERROR is set when server cannot be reached or out-of-service or
  1461. timeout occurred. Otherwise, OK is set.
  1462. Estes campos devem existir em uma linha. A ordem dos campos não importa.
  1463. Podem ser colocados pares; eles serão simplesmente ignorados.
  1464. Um exemplo abaixo::
  1465. host=localhost, protocol=http, dl_speed=32000, last_updated=1222491640,
  1466. status=OK
  1467. host=localhost, protocol=ftp, dl_speed=0, last_updated=1222491632,
  1468. status=ERROR
  1469. .. index:: double: interface; rpc;
  1470. INTERFACE RPC
  1471. -------------
  1472. aria2 provê o serviço JSON-RPC sobre HTTP e XML-RPC sobre HTTP e eles
  1473. basicamente possuem a mesma funcionalidade. aria2 também provê JSON-RPC
  1474. sobre WebSocket que utiliza o mesmo formato, do método e assinatura e
  1475. de resposta do formato JSON-RPC sobre HTTP, mas adicionalmente possui
  1476. notificações iniciadas pelo servidor.
  1477. Ver detalhes na seção `JSON-RPC sobre WebSocket`_ .
  1478. O caminho requisitado do interface JSON-RPC (sobre HTTP e sobre
  1479. WebSocket) é ``/jsonrpc``. O caminho requisitado do interface XML-RPC é
  1480. ``/rpc``.
  1481. A URI WebSocket para JSON-RPC sobre WebSocket é ``ws://HOST:PORT/jsonrpc``.
  1482. A implementação JSON-RPC é baseada na especificação
  1483. ``JSON-RPC 2.0 <http://jsonrpc.org/specification>`` e suporta
  1484. HTTP POST e GET (JSONP). Usando WebSocket como transporte, é uma extensão
  1485. original do aria2.
  1486. A interface JSON-RPC não suporta notificação em HTTP, mas o servidor RPC irá
  1487. enviar a notificação no WebSocket. Não é suportado número de ponto flutuante
  1488. O codificação de página deve ser UTF-8.
  1489. Quanto a seguinte documentação do JSON-RPC, entenda estrutura JSON como objeto.
  1490. .. index:: single: terminologia
  1491. Terminologia
  1492. ~~~~~~~~~~~~
  1493. GID
  1494. GID(or gid) é a chave para gerenciar cada download. Cada download tem um
  1495. único GID. Atualmente GID é armazenado em 64 bits como dado binário no
  1496. aria2. Para acesso RPG, isso é representado em uma string hexadecimal
  1497. de 16 caracteres (exemplo: ``2089b05ecca3d829``). Normalmente, aria2
  1498. gera esse GID para cada download, mas o usuário pode especificar
  1499. o GID manualmente usando a opção :option:`--gid <--gid>`. Quando
  1500. consultando um download por GID, pode ser especificado o prefixo
  1501. do GID como um prefixo único e exclusivo entre outros.
  1502. .. index:: double: exemplos; métodos
  1503. Métodos
  1504. ~~~~~~~
  1505. São descritos em torno de 35 exemplos, os quais serão numerados
  1506. utilizando código fonte com exemplos que usam a linguagem
  1507. Python versão 2.7.
  1508. .. index:: triple: exemplo; json-rpc; xml-rpc;
  1509. .. function:: aria2.addUri(uris[, options[, position]])
  1510. This method adds new HTTP(S)/FTP/BitTorrent Magnet URI. *uris* is of
  1511. type array and its element is URI which is of type string. For
  1512. BitTorrent Magnet URI, *uris* must have only one element and it should
  1513. be BitTorrent Magnet URI. URIs in *uris* must point to the same file.
  1514. If you mix other URIs which point to another file, aria2 does not
  1515. complain but download may fail. *options* is of type struct and its
  1516. members are a pair of option name and value. See :ref:`rpc_options` below for
  1517. more details. If *position* is given as an integer starting from 0,
  1518. the new download is inserted at *position* in the waiting queue. If
  1519. *position* is not given or *position* is larger than the size of the
  1520. queue, it is appended at the end of the queue. This method returns
  1521. GID of registered download.
  1522. **JSON-RPC EXEMPLO M010**
  1523. The following example adds ``http://example.org/file``::
  1524. >>> import urllib2, json
  1525. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1526. ... 'method':'aria2.addUri',
  1527. ... 'params':[['http://example.org/file']]})
  1528. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1529. >>> c.read()
  1530. '{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}'
  1531. **XML-RPC EXEMPLO M020**
  1532. The following example adds ``http://example.org/file``::
  1533. >>> import xmlrpclib
  1534. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1535. >>> s.aria2.addUri(['http://example.org/file'])
  1536. '2089b05ecca3d829'
  1537. The following example adds 2 sources and some options::
  1538. >>> s.aria2.addUri(['http://example.org/file', 'http://mirror/file'],
  1539. dict(dir="/tmp"))
  1540. 'd2703803b52216d1'
  1541. The following example adds a download and insert it to the front of
  1542. waiting downloads::
  1543. >>> s.aria2.addUri(['http://example.org/file'], {}, 0)
  1544. 'ca3d829cee549a4d'
  1545. .. function:: aria2.addTorrent(torrent[, uris[, options[, position]]])
  1546. This method adds BitTorrent download by uploading ".torrent" file.
  1547. If you want to add BitTorrent Magnet URI, use :func:`aria2.addUri`
  1548. method instead. *torrent* is of type base64 which contains
  1549. Base64-encoded ".torrent" file. *uris* is of type array and its
  1550. element is URI which is of type string. *uris* is used for
  1551. Web-seeding. For single file torrents, URI can be a complete URI
  1552. pointing to the resource or if URI ends with /, name in torrent file
  1553. is added. For multi-file torrents, name and path in torrent are
  1554. added to form a URI for each file. *options* is of type struct and
  1555. its members are a pair of option name and value. See
  1556. :ref:`rpc_options` below for more details. If *position* is given
  1557. as an integer starting from 0, the new download is inserted at
  1558. *position* in the waiting queue. If *position* is not given or
  1559. *position* is larger than the size of the queue, it is appended at
  1560. the end of the queue. This method returns GID of registered
  1561. download. If :option:`--rpc-save-upload-metadata` is ``true``, the
  1562. uploaded data is saved as a file named hex string of SHA-1 hash of
  1563. data plus ".torrent" in the directory specified by :option:`--dir
  1564. <-d>` option. The example of filename is
  1565. ``0a3893293e27ac0490424c06de4d09242215f0a6.torrent``. If same file
  1566. already exists, it is overwritten. If the file cannot be saved
  1567. successfully or :option:`--rpc-save-upload-metadata` is ``false``,
  1568. the downloads added by this method are not saved by
  1569. :option:`--save-session`.
  1570. The following examples add local file ``file.torrent``.
  1571. **JSON-RPC EXEMPLO M030**
  1572. ::
  1573. >>> import urllib2, json, base64
  1574. >>> torrent = base64.b64encode(open('file.torrent').read())
  1575. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'asdf',
  1576. ... 'method':'aria2.addTorrent', 'params':[torrent]})
  1577. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1578. >>> c.read()
  1579. '{"id":"asdf","jsonrpc":"2.0","result":"2089b05ecca3d829"}'
  1580. **XML-RPC EXEMPLO M040**
  1581. ::
  1582. >>> import xmlrpclib
  1583. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1584. >>> s.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent').read()))
  1585. '2089b05ecca3d829'
  1586. .. function:: aria2.addMetalink(metalink[, options[, position]])
  1587. This method adds Metalink download by uploading ".metalink" file.
  1588. *metalink* is of type base64 which contains Base64-encoded
  1589. ".metalink" file. *options* is of type struct and its members are a
  1590. pair of option name and value. See :ref:`rpc_options` below for more
  1591. details. If *position* is given as an integer starting from 0, the
  1592. new download is inserted at *position* in the waiting queue. If
  1593. *position* is not given or *position* is larger than the size of the
  1594. queue, it is appended at the end of the queue. This method returns
  1595. array of GID of registered download. If
  1596. :option:`--rpc-save-upload-metadata` is ``true``, the uploaded data
  1597. is saved as a file named hex string of SHA-1 hash of data plus
  1598. ".metalink" in the directory specified by :option:`--dir <-d>`
  1599. option. The example of filename is
  1600. ``0a3893293e27ac0490424c06de4d09242215f0a6.metalink``. If same file
  1601. already exists, it is overwritten. If the file cannot be saved
  1602. successfully or :option:`--rpc-save-upload-metadata` is ``false``,
  1603. the downloads added by this method are not saved by
  1604. :option:`--save-session`.
  1605. The following examples add local file file.meta4.
  1606. **JSON-RPC EXEMPLO M050**
  1607. ::
  1608. >>> import urllib2, json, base64
  1609. >>> metalink = base64.b64encode(open('file.meta4').read())
  1610. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1611. ... 'method':'aria2.addMetalink',
  1612. ... 'params':[metalink]})
  1613. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1614. >>> c.read()
  1615. '{"id":"qwer","jsonrpc":"2.0","result":["2089b05ecca3d829"]}'
  1616. **XML-RPC EXEMPLO M060**
  1617. ::
  1618. >>> import xmlrpclib
  1619. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1620. >>> s.aria2.addMetalink(xmlrpclib.Binary(open('file.meta4').read()))
  1621. ['2089b05ecca3d829']
  1622. .. function:: aria2.remove(gid)
  1623. This method removes the download denoted by *gid*. *gid* is of type
  1624. string. If specified download is in progress, it is stopped at
  1625. first. The status of removed download becomes ``removed``. This method
  1626. returns GID of removed download.
  1627. The following examples remove download GID#2089b05ecca3d829.
  1628. **JSON-RPC EXEMPLO M070**
  1629. ::
  1630. >>> import urllib2, json
  1631. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1632. ... 'method':'aria2.remove',
  1633. ... 'params':['2089b05ecca3d829']})
  1634. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1635. >>> c.read()
  1636. '{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}'
  1637. **XML-RPC EXEMPLO M080**
  1638. ::
  1639. >>> import xmlrpclib
  1640. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1641. >>> s.aria2.remove('2089b05ecca3d829')
  1642. '2089b05ecca3d829'
  1643. .. function:: aria2.forceRemove(gid)
  1644. This method removes the download denoted by *gid*. This method
  1645. behaves just like :func:`aria2.remove` except that this method removes
  1646. download without any action which takes time such as contacting
  1647. BitTorrent tracker.
  1648. .. function:: aria2.pause(gid)
  1649. This method pauses the download denoted by *gid*. *gid* is of type
  1650. string. The status of paused download becomes ``paused``. If the
  1651. download is active, the download is placed on the first position of
  1652. waiting queue. As long as the status is ``paused``, the download is not
  1653. started. To change status to ``waiting``, use :func:`aria2.unpause` method.
  1654. This method returns GID of paused download.
  1655. .. function:: aria2.pauseAll()
  1656. This method is equal to calling :func:`aria2.pause` for every active/waiting
  1657. download. This methods returns ``OK`` for success.
  1658. .. function:: aria2.forcePause(pid)
  1659. This method pauses the download denoted by *gid*. This method
  1660. behaves just like :func:`aria2.pause` except that this method pauses
  1661. download without any action which takes time such as contacting
  1662. BitTorrent tracker.
  1663. .. function:: aria2.forcePauseAll()
  1664. This method is equal to calling :func:`aria2.forcePause` for every
  1665. active/waiting download. This methods returns ``OK`` for success.
  1666. .. function:: aria2.unpause(gid)
  1667. This method changes the status of the download denoted by *gid* from
  1668. ``paused`` to ``waiting``. This makes the download eligible to restart.
  1669. *gid* is of type string. This method returns GID of unpaused
  1670. download.
  1671. .. function:: aria2.unpauseAll()
  1672. This method is equal to calling :func:`aria2.unpause` for every active/waiting
  1673. download. This methods returns ``OK`` for success.
  1674. .. function:: aria2.tellStatus(gid[, keys])
  1675. This method returns download progress of the download denoted by
  1676. *gid*. *gid* is of type string. *keys* is array of string. If it is
  1677. specified, the response contains only keys in *keys* array. If *keys*
  1678. is empty or not specified, the response contains all keys. This is
  1679. useful when you just want specific keys and avoid unnecessary
  1680. transfers. For example, ``aria2.tellStatus("2089b05ecca3d829", ["gid", "status"])``
  1681. returns *gid* and 'status' key. The response is of type struct and it
  1682. contains following keys. The value type is string.
  1683. ``gid``
  1684. GID of this download.
  1685. ``status``
  1686. ``active`` for currently downloading/seeding entry. ``waiting`` for the
  1687. entry in the queue; download is not started. ``paused`` for the
  1688. paused entry. ``error`` for the stopped download because of
  1689. error. ``complete`` for the stopped and completed download. ``removed``
  1690. for the download removed by user.
  1691. ``totalLength``
  1692. Total length of this download in bytes.
  1693. ``completedLength``
  1694. Completed length of this download in bytes.
  1695. ``uploadLength``
  1696. Uploaded length of this download in bytes.
  1697. ``bitfield``
  1698. Hexadecimal representation of the download progress. The highest bit
  1699. corresponds to piece index 0. The set bits indicate the piece is
  1700. available and unset bits indicate the piece is missing. The spare
  1701. bits at the end are set to zero. When download has not started yet,
  1702. this key will not be included in the response.
  1703. ``downloadSpeed``
  1704. Download speed of this download measured in bytes/sec.
  1705. ``uploadSpeed``
  1706. Upload speed of this download measured in bytes/sec.
  1707. ``infoHash``
  1708. InfoHash. BitTorrent only.
  1709. ``numSeeders``
  1710. The number of seeders the client has connected to. BitTorrent only.
  1711. ``pieceLength``
  1712. Piece length in bytes.
  1713. ``numPieces``
  1714. The number of pieces.
  1715. ``connections``
  1716. The number of peers/servers the client has connected to.
  1717. ``errorCode``
  1718. The last error code occurred in this download. The value is of type
  1719. string. The error codes are defined in `CÓDIGO DE RETORNO ou SAÍDA`_
  1720. section. This value is only available for stopped/completed downloads.
  1721. ``followedBy``
  1722. List of GIDs which are generated by the consequence of this
  1723. download. For example, when aria2 downloaded Metalink file, it
  1724. generates downloads described in it(see :option:`--follow-metalink`
  1725. option). This value is useful to track these auto generated
  1726. downloads. If there is no such downloads, this key will not
  1727. be included in the response.
  1728. ``belongsTo``
  1729. GID of a parent download. Some downloads are a part of another
  1730. download. For example, if a file in Metalink has BitTorrent
  1731. resource, the download of ".torrent" is a part of that file. If this
  1732. download has no parent, this key will not be included in the
  1733. response.
  1734. ``dir``
  1735. Directory to save files. This key is not available for stopped
  1736. downloads.
  1737. ``files``
  1738. Returns the list of files. The element of list is the same struct
  1739. used in :func:`aria2.getFiles` method.
  1740. ``bittorrent``
  1741. Struct which contains information retrieved from .torrent
  1742. file. BitTorrent only. It contains following keys.
  1743. ``announceList``
  1744. List of lists of announce URI. If ".torrent" file contains announce
  1745. and no announce-list, announce is converted to announce-list
  1746. format.
  1747. ``comment``
  1748. The comment for the torrent. ``comment.utf-8`` is used if available.
  1749. ``creationDate``
  1750. The creation time of the torrent. The value is an integer since
  1751. the Epoch, measured in seconds.
  1752. ``mode``
  1753. File mode of the torrent. The value is either ``single`` or ``multi``.
  1754. ``info``
  1755. Struct which contains data from Info dictionary. It contains
  1756. following keys.
  1757. ``name``
  1758. name in info dictionary. ``name.utf-8`` is used if available.
  1759. **JSON-RPC EXEMPLO M090**
  1760. The following example gets information about download GID#2089b05ecca3d829::
  1761. >>> import urllib2, json
  1762. >>> from pprint import pprint
  1763. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1764. ... 'method':'aria2.tellStatus',
  1765. ... 'params':['2089b05ecca3d829']})
  1766. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1767. >>> pprint(json.loads(c.read()))
  1768. {u'id': u'qwer',
  1769. u'jsonrpc': u'2.0',
  1770. u'result': {u'bitfield': u'0000000000',
  1771. u'completedLength': u'901120',
  1772. u'connections': u'1',
  1773. u'dir': u'/downloads',
  1774. u'downloadSpeed': u'15158',
  1775. u'files': [{u'index': u'1',
  1776. u'length': u'34896138',
  1777. u'completedLength': u'34896138',
  1778. u'path': u'/downloads/file',
  1779. u'selected': u'true',
  1780. u'uris': [{u'status': u'used',
  1781. u'uri': u'http://example.org/file'}]}],
  1782. u'gid': u'2089b05ecca3d829',
  1783. u'numPieces': u'34',
  1784. u'pieceLength': u'1048576',
  1785. u'status': u'active',
  1786. u'totalLength': u'34896138',
  1787. u'uploadLength': u'0',
  1788. u'uploadSpeed': u'0'}}
  1789. The following example gets information specifying keys you are
  1790. interested in::
  1791. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1792. ... 'method':'aria2.tellStatus',
  1793. ... 'params':['2089b05ecca3d829',
  1794. ... ['gid',
  1795. ... 'totalLength',
  1796. ... 'completedLength']]})
  1797. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1798. >>> pprint(json.loads(c.read()))
  1799. {u'id': u'qwer',
  1800. u'jsonrpc': u'2.0',
  1801. u'result': {u'completedLength': u'5701632',
  1802. u'gid': u'2089b05ecca3d829',
  1803. u'totalLength': u'34896138'}}
  1804. **XML-RPC EXEMPLO M100**
  1805. The following example gets information about download GID#2089b05ecca3d829::
  1806. >>> import xmlrpclib
  1807. >>> from pprint import pprint
  1808. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1809. >>> r = s.aria2.tellStatus('2089b05ecca3d829')
  1810. >>> pprint(r)
  1811. {'bitfield': 'ffff80',
  1812. 'completedLength': '34896138',
  1813. 'connections': '0',
  1814. 'dir': '/downloads',
  1815. 'downloadSpeed': '0',
  1816. 'errorCode': '0',
  1817. 'files': [{'index': '1',
  1818. 'length': '34896138',
  1819. 'completedLength': '34896138',
  1820. 'path': '/downloads/file',
  1821. 'selected': 'true',
  1822. 'uris': [{'status': 'used',
  1823. 'uri': 'http://example.org/file'}]}],
  1824. 'gid': '2089b05ecca3d829',
  1825. 'numPieces': '17',
  1826. 'pieceLength': '2097152',
  1827. 'status': 'complete',
  1828. 'totalLength': '34896138',
  1829. 'uploadLength': '0',
  1830. 'uploadSpeed': '0'}
  1831. The following example gets information specifying keys you are
  1832. interested in::
  1833. >>> r = s.aria2.tellStatus('2089b05ecca3d829', ['gid', 'totalLength', 'completedLength'])
  1834. >>> pprint(r)
  1835. {'completedLength': '34896138', 'gid': '2089b05ecca3d829', 'totalLength': '34896138'}
  1836. .. function:: aria2.getUris(gid)
  1837. This method returns URIs used in the download denoted by *gid*. *gid*
  1838. is of type string. The response is of type array and its element is of
  1839. type struct and it contains following keys. The value type is string.
  1840. ``uri``
  1841. URI
  1842. ``status``
  1843. 'used' if the URI is already used. 'waiting' if the URI is waiting
  1844. in the queue.
  1845. **JSON-RPC EXEMPLO M110**
  1846. ::
  1847. >>> import urllib2, json
  1848. >>> from pprint import pprint
  1849. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1850. ... 'method':'aria2.getUris',
  1851. ... 'params':['2089b05ecca3d829']})
  1852. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1853. >>> pprint(json.loads(c.read()))
  1854. {u'id': u'qwer',
  1855. u'jsonrpc': u'2.0',
  1856. u'result': [{u'status': u'used',
  1857. u'uri': u'http://example.org/file'}]}
  1858. **XML-RPC EXEMPLO M120**
  1859. ::
  1860. >>> import xmlrpclib
  1861. >>> from pprint import pprint
  1862. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1863. >>> r = s.aria2.getUris('2089b05ecca3d829')
  1864. >>> pprint(r)
  1865. [{'status': 'used', 'uri': 'http://example.org/file'}]
  1866. .. function:: aria2.getFiles(gid)
  1867. This method returns file list of the download denoted by *gid*. *gid*
  1868. is of type string. The response is of type array and its element is of
  1869. type struct and it contains following keys. The value type is string.
  1870. ``index``
  1871. Index of file. Starting with 1. This is the same order with the
  1872. files in multi-file torrent.
  1873. ``path``
  1874. File path.
  1875. ``length``
  1876. File size in bytes.
  1877. ``completedLength``
  1878. Completed length of this file in bytes. Please note that it is
  1879. possible that sum of completedLength is less than completedLength in
  1880. :func:`aria2.tellStatus` method.
  1881. This is because completedLength in
  1882. :func:`aria2.getFiles`
  1883. only calculates completed pieces. On the other hand, completedLength
  1884. in
  1885. :func:`aria2.tellStatus` takes into account
  1886. of partially completed piece.
  1887. ``selected``
  1888. ``true`` if this file is selected by :option:`--select-file` option. If
  1889. :option:`--select-file` is not specified or this is single torrent or no
  1890. torrent download, this value is always ``true``. Otherwise ``false``.
  1891. ``uris``
  1892. Returns the list of URI for this file. The element of list is the
  1893. same struct used in :func:`aria2.getUris` method.
  1894. **JSON-RPC EXEMPLO M130**
  1895. ::
  1896. >>> import urllib2, json
  1897. >>> from pprint import pprint
  1898. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1899. ... 'method':'aria2.getFiles',
  1900. ... 'params':['2089b05ecca3d829']})
  1901. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1902. >>> pprint(json.loads(c.read()))
  1903. {u'id': u'qwer',
  1904. u'jsonrpc': u'2.0',
  1905. u'result': [{u'index': u'1',
  1906. u'length': u'34896138',
  1907. u'completedLength': u'34896138',
  1908. u'path': u'/downloads/file',
  1909. u'selected': u'true',
  1910. u'uris': [{u'status': u'used',
  1911. u'uri': u'http://example.org/file'}]}]}
  1912. **XML-RPC EXEMPLO M140**
  1913. ::
  1914. >>> import xmlrpclib
  1915. >>> from pprint import pprint
  1916. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1917. >>> r = s.aria2.getFiles('2089b05ecca3d829')
  1918. >>> pprint(r)
  1919. [{'index': '1',
  1920. 'length': '34896138',
  1921. 'completedLength': '34896138',
  1922. 'path': '/downloads/file',
  1923. 'selected': 'true',
  1924. 'uris': [{'status': 'used',
  1925. 'uri': 'http://example.org/file'}]}]
  1926. .. function:: aria2.getPeers(gid)
  1927. This method returns peer list of the download denoted by *gid*. *gid*
  1928. is of type string. This method is for BitTorrent only. The response
  1929. is of type array and its element is of type struct and it contains
  1930. following keys. The value type is string.
  1931. ``peerId``
  1932. Percent-encoded peer ID.
  1933. ``ip``
  1934. IP address of the peer.
  1935. ``port``
  1936. Port number of the peer.
  1937. ``bitfield``
  1938. Hexadecimal representation of the download progress of the peer. The
  1939. highest bit corresponds to piece index 0. The set bits indicate the
  1940. piece is available and unset bits indicate the piece is missing. The
  1941. spare bits at the end are set to zero.
  1942. ``amChoking``
  1943. ``true`` if this client is choking the peer. Otherwise ``false``.
  1944. ``peerChoking``
  1945. ``true`` if the peer is choking this client. Otherwise ``false``.
  1946. ``downloadSpeed``
  1947. Download speed (byte/sec) that this client obtains from the peer.
  1948. ``uploadSpeed``
  1949. Upload speed(byte/sec) that this client uploads to the peer.
  1950. ``seeder``
  1951. ``true`` is this client is a seeder. Otherwise ``false``.
  1952. **JSON-RPC EXEMPLO M150**
  1953. ::
  1954. >>> import urllib2, json
  1955. >>> from pprint import pprint
  1956. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1957. ... 'method':'aria2.getPeers',
  1958. ... 'params':['2089b05ecca3d829']})
  1959. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1960. >>> pprint(json.loads(c.read()))
  1961. {u'id': u'qwer',
  1962. u'jsonrpc': u'2.0',
  1963. u'result': [{u'amChoking': u'true',
  1964. u'bitfield': u'ffffffffffffffffffffffffffffffffffffffff',
  1965. u'downloadSpeed': u'10602',
  1966. u'ip': u'10.0.0.9',
  1967. u'peerChoking': u'false',
  1968. u'peerId': u'aria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6',
  1969. u'port': u'6881',
  1970. u'seeder': u'true',
  1971. u'uploadSpeed': u'0'},
  1972. {u'amChoking': u'false',
  1973. u'bitfield': u'ffffeff0fffffffbfffffff9fffffcfff7f4ffff',
  1974. u'downloadSpeed': u'8654',
  1975. u'ip': u'10.0.0.30',
  1976. u'peerChoking': u'false',
  1977. u'peerId': u'bittorrent client758',
  1978. u'port': u'37842',
  1979. u'seeder': u'false',
  1980. u'uploadSpeed': u'6890'}]}
  1981. **XML-RPC EXEMPLO M160**
  1982. ::
  1983. >>> import xmlrpclib
  1984. >>> from pprint import pprint
  1985. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1986. >>> r = s.aria2.getPeers('2089b05ecca3d829')
  1987. >>> pprint(r)
  1988. [{'amChoking': 'true',
  1989. 'bitfield': 'ffffffffffffffffffffffffffffffffffffffff',
  1990. 'downloadSpeed': '10602',
  1991. 'ip': '10.0.0.9',
  1992. 'peerChoking': 'false',
  1993. 'peerId': 'aria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6',
  1994. 'port': '6881',
  1995. 'seeder': 'true',
  1996. 'uploadSpeed': '0'},
  1997. {'amChoking': 'false',
  1998. 'bitfield': 'ffffeff0fffffffbfffffff9fffffcfff7f4ffff',
  1999. 'downloadSpeed': '8654',
  2000. 'ip': '10.0.0.30',
  2001. 'peerChoking': 'false',
  2002. 'peerId': 'bittorrent client758',
  2003. 'port': '37842',
  2004. 'seeder': 'false,
  2005. 'uploadSpeed': '6890'}]
  2006. .. function:: aria2.getServers(gid)
  2007. This method returns currently connected HTTP, HTTPS, FTP servers of the
  2008. download denoted by *gid*. *gid* is of type string. The response
  2009. is of type array and its element is of type struct and it contains
  2010. following keys. The value type is string.
  2011. ``index``
  2012. Index of file. Starting with 1. This is the same order with the
  2013. files in multi-file torrent.
  2014. ``servers``
  2015. The list of struct which contains following keys.
  2016. ``uri``
  2017. URI originally added.
  2018. ``currentUri``
  2019. This is the URI currently used for downloading. If redirection is
  2020. involved, currentUri and uri may differ.
  2021. ``downloadSpeed``
  2022. Download speed (byte/sec)
  2023. **JSON-RPC EXEMPLO M170**
  2024. ::
  2025. >>> import urllib2, json
  2026. >>> from pprint import pprint
  2027. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2028. ... 'method':'aria2.getServers',
  2029. ... 'params':['2089b05ecca3d829']})
  2030. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2031. >>> pprint(json.loads(c.read()))
  2032. {u'id': u'qwer',
  2033. u'jsonrpc': u'2.0',
  2034. u'result': [{u'index': u'1',
  2035. u'servers': [{u'currentUri': u'http://example.org/file',
  2036. u'downloadSpeed': u'10467',
  2037. u'uri': u'http://example.org/file'}]}]}
  2038. **XML-RPC EXEMPLO M180**
  2039. ::
  2040. >>> import xmlrpclib
  2041. >>> from pprint import pprint
  2042. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2043. >>> r = s.aria2.getServers('2089b05ecca3d829')
  2044. >>> pprint(r)
  2045. [{'index': '1',
  2046. 'servers': [{'currentUri': 'http://example.org/dl/file',
  2047. 'downloadSpeed': '20285',
  2048. 'uri': 'http://example.org/file'}]}]
  2049. .. function:: aria2.tellActive([keys])
  2050. This method returns the list of active downloads. The response is of
  2051. type array and its element is the same struct returned by
  2052. :func:`aria2.tellStatus` method. For *keys* parameter, please refer to
  2053. :func:`aria2.tellStatus` method.
  2054. .. function:: aria2.tellWaiting(offset, num, [keys])
  2055. This method returns the list of waiting download, including paused
  2056. downloads. *offset* is of type integer and specifies the offset from
  2057. the download waiting at the front. *num* is of type integer and
  2058. specifies the number of downloads to be returned. For *keys*
  2059. parameter, please refer to :func:`aria2.tellStatus` method.
  2060. If *offset* is a positive integer, this method returns downloads in the
  2061. range of [*offset*, *offset* + *num*).
  2062. *offset* can be a negative integer. *offset* == -1 points last
  2063. download in the waiting queue and *offset* == -2 points the download
  2064. before the last download, and so on. The downloads in the response are
  2065. in reversed order.
  2066. For example, imagine that three downloads "A","B" and "C" are waiting
  2067. in this order. ``aria2.tellWaiting(0, 1)`` returns
  2068. ``["A"]``. ``aria2.tellWaiting(1, 2)`` returns ``["B", "C"]``.
  2069. ``aria2.tellWaiting(-1, 2)`` returns ``["C", "B"]``.
  2070. The response is of type array and its element is the same struct
  2071. returned by :func:`aria2.tellStatus` method.
  2072. .. function:: aria2.tellStopped(offset, num, [keys])
  2073. This method returns the list of stopped download. *offset* is of type
  2074. integer and specifies the offset from the oldest download. *num* is of
  2075. type integer and specifies the number of downloads to be returned.
  2076. For *keys* parameter, please refer to :func:`aria2.tellStatus` method.
  2077. *offset* and *num* have the same semantics as :func:`aria2.tellWaiting`
  2078. method.
  2079. The response is of type array and its element is the same struct
  2080. returned by :func:`aria2.tellStatus` method.
  2081. .. function:: aria2.changePosition(gid, pos, how)
  2082. This method changes the position of the download denoted by
  2083. *gid*. *pos* is of type integer. *how* is of type string. If *how* is
  2084. ``POS_SET``, it moves the download to a position relative to the
  2085. beginning of the queue. If *how* is ``POS_CUR``, it moves the download
  2086. to a position relative to the current position. If *how* is ``POS_END``,
  2087. it moves the download to a position relative to the end of the
  2088. queue. If the destination position is less than 0 or beyond the end of
  2089. the queue, it moves the download to the beginning or the end of the
  2090. queue respectively. The response is of type integer and it is the
  2091. destination position.
  2092. For example, if GID#2089b05ecca3d829 is placed in position 3,
  2093. ``aria2.changePosition('2089b05ecca3d829', -1, 'POS_CUR')`` will
  2094. change its position to 2. Additional
  2095. ``aria2.changePosition('2089b05ecca3d829', 0, 'POS_SET')`` will
  2096. change its position to 0(the beginning of the queue).
  2097. The following examples move the download GID#2089b05ecca3d829 to the
  2098. front of the waiting queue.
  2099. **JSON-RPC EXEMPLO M190**
  2100. ::
  2101. >>> import urllib2, json
  2102. >>> from pprint import pprint
  2103. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2104. ... 'method':'aria2.changePosition',
  2105. ... 'params':['2089b05ecca3d829', 0, 'POS_SET']})
  2106. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2107. >>> pprint(json.loads(c.read()))
  2108. {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': 0}
  2109. **XML-RPC EXEMPLO M200**
  2110. ::
  2111. >>> import xmlrpclib
  2112. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2113. >>> s.aria2.changePosition('2089b05ecca3d829', 0, 'POS_SET')
  2114. 0
  2115. .. index:: triple: exemplo; json-rpc; xml-rpc;
  2116. double: python; proxy-server;
  2117. .. function:: aria2.changeUri(gid, fileIndex, delUris, addUris[, position])
  2118. This method removes URIs in *delUris* from and appends URIs in
  2119. *addUris* to download denoted by *gid*. *delUris* and *addUris* are
  2120. list of string. A download can contain multiple files and URIs are
  2121. attached to each file. *fileIndex* is used to select which file to
  2122. remove/attach given URIs. *fileIndex* is 1-based. *position* is used
  2123. to specify where URIs are inserted in the existing waiting URI
  2124. list. *position* is 0-based. When *position* is omitted, URIs are
  2125. appended to the back of the list. This method first execute removal
  2126. and then addition. *position* is the position after URIs are removed,
  2127. not the position when this method is called. When removing URI, if
  2128. same URIs exist in download, only one of them is removed for each URI
  2129. in *delUris*. In other words, there are three URIs
  2130. ``http://example.org/aria2`` and you want remove them all, you have to
  2131. specify (at least) 3 ``http://example.org/aria2`` in *delUris*. This
  2132. method returns a list which contains 2 integers. The first integer is
  2133. the number of URIs deleted. The second integer is the number of URIs
  2134. added.
  2135. The following examples add 1 URI ``http://example.org/file`` to the
  2136. file whose index is ``1`` and belongs to the download
  2137. GID#2089b05ecca3d829.
  2138. **JSON-RPC EXEMPLO M210**
  2139. ::
  2140. >>> import urllib2, json
  2141. >>> from pprint import pprint
  2142. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2143. ... 'method':'aria2.changeUri',
  2144. ... 'params':['2089b05ecca3d829', 1, [],
  2145. ['http://example.org/file']]})
  2146. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2147. >>> pprint(json.loads(c.read()))
  2148. {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [0, 1]}
  2149. **XML-RPC EXEMPLO M220**
  2150. ::
  2151. >>> import xmlrpclib
  2152. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2153. >>> s.aria2.changeUri('2089b05ecca3d829', 1, [],
  2154. ['http://example.org/file'])
  2155. [0, 1]
  2156. .. function:: aria2.getOption(gid)
  2157. This method returns options of the download denoted by *gid*. The
  2158. response is of type struct. Its key is the name of option. The value
  2159. type is string. Note that this method does not return options which
  2160. have no default value and have not been set by the command-line
  2161. options, configuration files or RPC methods.
  2162. The following examples get options of the download
  2163. GID#2089b05ecca3d829.
  2164. **JSON-RPC EXEMPLO M230**
  2165. ::
  2166. >>> import urllib2, json
  2167. >>> from pprint import pprint
  2168. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2169. ... 'method':'aria2.getOption',
  2170. ... 'params':['2089b05ecca3d829']})
  2171. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2172. >>> pprint(json.loads(c.read()))
  2173. {u'id': u'qwer',
  2174. u'jsonrpc': u'2.0',
  2175. u'result': {u'allow-overwrite': u'false',
  2176. u'allow-piece-length-change': u'false',
  2177. u'always-resume': u'true',
  2178. u'async-dns': u'true',
  2179. ...
  2180. **XML-RPC EXEMPLO M240**
  2181. ::
  2182. >>> import xmlrpclib
  2183. >>> from pprint import pprint
  2184. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2185. >>> r = s.aria2.getOption('2089b05ecca3d829')
  2186. >>> pprint(r)
  2187. {'allow-overwrite': 'false',
  2188. 'allow-piece-length-change': 'false',
  2189. 'always-resume': 'true',
  2190. 'async-dns': 'true',
  2191. ....
  2192. .. function:: aria2.changeOption(gid, options)
  2193. This method changes options of the download denoted by *gid*
  2194. dynamically. *gid* is of type string. *options* is of type struct.
  2195. The following options are available for active downloads:
  2196. * :option:`bt-max-peers <--bt-max-peers>`
  2197. * :option:`bt-request-peer-speed-limit <--bt-request-peer-speed-limit>`
  2198. * :option:`bt-remove-unselected-file <--bt-remove-unselected-file>`
  2199. * :option:`force-save <--force-save>`
  2200. * :option:`max-download-limit <--max-download-limit>`
  2201. * :option:`max-upload-limit <-u>`
  2202. For waiting or paused downloads, in addition to the above options,
  2203. options listed in `Arquivo de Entrada`_ subsection are available,
  2204. except for following options:
  2205. :option:`dry-run <--dry-run>`,
  2206. :option:`metalink-base-uri <--metalink-base-uri>`,
  2207. :option:`parameterized-uri <-P>`,
  2208. :option:`pause <--pause>`,
  2209. :option:`piece-length <--piece-length>` and
  2210. :option:`rpc-save-upload-metadata <--rpc-save-upload-metadata>` option.
  2211. This method returns ``OK`` for success.
  2212. The following examples set :option:`max-download-limit
  2213. <--max-download-limit>` option to ``20K`` for the download
  2214. GID#2089b05ecca3d829.
  2215. **JSON-RPC EXEMPLO M250**
  2216. ::
  2217. >>> import urllib2, json
  2218. >>> from pprint import pprint
  2219. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2220. ... 'method':'aria2.changeOption',
  2221. ... 'params':['2089b05ecca3d829',
  2222. ... {'max-download-limit':'10K'}]})
  2223. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2224. >>> pprint(json.loads(c.read()))
  2225. {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'OK'}
  2226. **XML-RPC EXEMPLO M260**
  2227. ::
  2228. >>> import xmlrpclib
  2229. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2230. >>> s.aria2.changeOption('2089b05ecca3d829', {'max-download-limit':'20K'})
  2231. 'OK'
  2232. .. function:: aria2.getGlobalOption()
  2233. This method returns global options. The response is of type
  2234. struct. Its key is the name of option. The value type is string.
  2235. Note that this method does not return options which have no default
  2236. value and have not been set by the command-line options, configuration
  2237. files or RPC methods. Because global options are used as a template
  2238. for the options of newly added download, the response contains keys
  2239. returned by :func:`aria2.getOption` method.
  2240. .. function:: aria2.changeGlobalOption(options)
  2241. This method changes global options dynamically. *options* is of type
  2242. struct.
  2243. The following options are available:
  2244. * :option:`download-result <--download-result>`
  2245. * :option:`log <-l>`
  2246. * :option:`log-level <--log-level>`
  2247. * :option:`max-concurrent-downloads <-j>`
  2248. * :option:`max-download-result <--max-download-result>`
  2249. * :option:`max-overall-download-limit <--max-overall-download-limit>`
  2250. * :option:`max-overall-upload-limit <--max-overall-upload-limit>`
  2251. * :option:`save-cookies <--save-cookies>`
  2252. * :option:`save-session <--save-session>`
  2253. * :option:`server-stat-of <--server-stat-of>`
  2254. In addition to them, options listed in `Arquivo de Entrada`_ subsection
  2255. are available, except for following options:
  2256. :option:`checksum <--checksum>`,
  2257. :option:`index-out <-O>`,
  2258. :option:`out <-o>`,
  2259. :option:`pause <--pause>` and
  2260. :option:`select-file <--select-file>`.
  2261. Using :option:`log <-l>` option, you can dynamically start logging or
  2262. change log file. To stop logging, give empty string("") as a parameter
  2263. value. Note that log file is always opened in append mode. This method
  2264. returns ``OK`` for success.
  2265. .. function:: aria2.getGlobalStat()
  2266. This method returns global statistics such as overall download and
  2267. upload speed. The response is of type struct and contains following
  2268. keys. The value type is string.
  2269. ``downloadSpeed``
  2270. Overall download speed (byte/sec).
  2271. ``uploadSpeed``
  2272. Overall upload speed(byte/sec).
  2273. ``numActive``
  2274. The number of active downloads.
  2275. ``numWaiting``
  2276. The number of waiting downloads.
  2277. ``numStopped``
  2278. The number of stopped downloads.
  2279. **JSON-RPC EXEMPLO M270**
  2280. ::
  2281. >>> import urllib2, json
  2282. >>> from pprint import pprint
  2283. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2284. ... 'method':'aria2.getGlobalStat'})
  2285. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2286. >>> pprint(json.loads(c.read()))
  2287. {u'id': u'qwer',
  2288. u'jsonrpc': u'2.0',
  2289. u'result': {u'downloadSpeed': u'21846',
  2290. u'numActive': u'2',
  2291. u'numStopped': u'0',
  2292. u'numWaiting': u'0',
  2293. u'uploadSpeed': u'0'}}
  2294. **XML-RPC EXEMPLO M280**
  2295. ::
  2296. >>> import xmlrpclib
  2297. >>> from pprint import pprint
  2298. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2299. >>> r = s.aria2.getGlobalStat()
  2300. >>> pprint(r)
  2301. {'downloadSpeed': '23136',
  2302. 'numActive': '2',
  2303. 'numStopped': '0',
  2304. 'numWaiting': '0',
  2305. 'uploadSpeed': '0'}
  2306. .. function:: aria2.purgeDownloadResult()
  2307. This method purges completed/error/removed downloads to free memory.
  2308. This method returns ``OK``.
  2309. .. function:: aria2.removeDownloadResult(gid)
  2310. This method removes completed/error/removed download denoted by *gid*
  2311. from memory. This method returns ``OK`` for success.
  2312. The following examples remove the download result of the download
  2313. GID#2089b05ecca3d829.
  2314. **JSON-RPC EXEMPLO M290**
  2315. ::
  2316. >>> import urllib2, json
  2317. >>> from pprint import pprint
  2318. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2319. ... 'method':'aria2.removeDownloadResult',
  2320. ... 'params':['2089b05ecca3d829']})
  2321. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2322. >>> pprint(json.loads(c.read()))
  2323. {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'OK'}
  2324. **XML-RPC EXEMPLO M300**
  2325. ::
  2326. >>> import xmlrpclib
  2327. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2328. >>> s.aria2.removeDownloadResult('2089b05ecca3d829')
  2329. 'OK'
  2330. .. function:: aria2.getVersion()
  2331. This method returns version of the program and the list of enabled
  2332. features. The response is of type struct and contains following keys.
  2333. ``version``
  2334. Version number of the program in string.
  2335. ``enabledFeatures``
  2336. List of enabled features. Each feature name is of type string.
  2337. **JSON-RPC EXEMPLO M310**
  2338. ::
  2339. >>> import urllib2, json
  2340. >>> from pprint import pprint
  2341. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2342. ... 'method':'aria2.getVersion'})
  2343. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2344. >>> pprint(json.loads(c.read()))
  2345. {u'id': u'qwer',
  2346. u'jsonrpc': u'2.0',
  2347. u'result': {u'enabledFeatures': [u'Async DNS',
  2348. u'BitTorrent',
  2349. u'Firefox3 Cookie',
  2350. u'GZip',
  2351. u'HTTPS',
  2352. u'Message Digest',
  2353. u'Metalink',
  2354. u'XML-RPC'],
  2355. u'version': u'1.11.0'}}
  2356. **XML-RPC EXEMPLO M320**
  2357. ::
  2358. >>> import xmlrpclib
  2359. >>> from pprint import pprint
  2360. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2361. >>> r = s.aria2.getVersion()
  2362. >>> pprint(r)
  2363. {'enabledFeatures': ['Async DNS',
  2364. 'BitTorrent',
  2365. 'Firefox3 Cookie',
  2366. 'GZip',
  2367. 'HTTPS',
  2368. 'Message Digest',
  2369. 'Metalink',
  2370. 'XML-RPC'],
  2371. 'version': '1.11.0'}
  2372. .. function:: aria2.getSessionInfo()
  2373. This method returns session information.
  2374. The response is of type struct and contains following key.
  2375. ``sessionId``
  2376. Session ID, which is generated each time when aria2 is invoked.
  2377. **JSON-RPC EXEMPLO M330**
  2378. ::
  2379. >>> import urllib2, json
  2380. >>> from pprint import pprint
  2381. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2382. ... 'method':'aria2.getSessionInfo'})
  2383. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2384. >>> pprint(json.loads(c.read()))
  2385. {u'id': u'qwer',
  2386. u'jsonrpc': u'2.0',
  2387. u'result': {u'sessionId': u'cd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9'}}
  2388. **XML-RPC EXEMPLO M340**
  2389. ::
  2390. >>> import xmlrpclib
  2391. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2392. >>> s.aria2.getSessionInfo()
  2393. {'sessionId': 'cd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9'}
  2394. .. function:: aria2.shutdown()
  2395. This method shutdowns aria2. This method returns ``OK``.
  2396. .. function:: aria2.forceShutdown()
  2397. This method shutdowns :func:`aria2. This method behaves like aria2.shutdown`
  2398. except that any actions which takes time such as contacting BitTorrent
  2399. tracker are skipped. This method returns ``OK``.
  2400. .. function:: system.multicall(methods)
  2401. This methods encapsulates multiple method calls in a single request.
  2402. *methods* is of type array and its element is struct. The struct
  2403. contains two keys: ``methodName`` and ``params``. ``methodName`` is the
  2404. method name to call and ``params`` is array containing parameters to the
  2405. method. This method returns array of responses. The element of array
  2406. will either be a one-item array containing the return value of each
  2407. method call or struct of fault element if an encapsulated method call
  2408. fails.
  2409. In the following examples, we add 2 downloads. First one is
  2410. ``http://example.org/file`` and second one is ``file.torrent``.
  2411. **JSON-RPC EXEMPLO M350**
  2412. ::
  2413. >>> import urllib2, json, base64
  2414. >>> from pprint import pprint
  2415. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2416. ... 'method':'system.multicall',
  2417. ... 'params':[[{'methodName':'aria2.addUri',
  2418. ... 'params':[['http://example.org']]},
  2419. ... {'methodName':'aria2.addTorrent',
  2420. ... 'params':[base64.b64encode(open('file.torrent').read())]}]]})
  2421. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2422. >>> pprint(json.loads(c.read()))
  2423. {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [[u'2089b05ecca3d829'], [u'd2703803b52216d1']]}
  2424. JSON-RPC also supports Batch request described in JSON-RPC 2.0 Specification::
  2425. >>> jsonreq = json.dumps([{'jsonrpc':'2.0', 'id':'qwer',
  2426. ... 'method':'aria2.addUri',
  2427. ... 'params':[['http://example.org']]},
  2428. ... {'jsonrpc':'2.0', 'id':'asdf',
  2429. ... 'method':'aria2.addTorrent',
  2430. ... 'params':[base64.b64encode(open('file.torrent').read())]}])
  2431. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2432. >>> pprint(json.loads(c.read()))
  2433. [{u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'2089b05ecca3d829'},
  2434. {u'id': u'asdf', u'jsonrpc': u'2.0', u'result': u'd2703803b52216d1'}]
  2435. **XML-RPC EXEMPLO M360**
  2436. ::
  2437. >>> import xmlrpclib
  2438. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2439. >>> mc = xmlrpclib.MultiCall(s)
  2440. >>> mc.aria2.addUri(['http://example.org/file'])
  2441. >>> mc.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent').read()))
  2442. >>> r = mc()
  2443. >>> tuple(r)
  2444. ('2089b05ecca3d829', 'd2703803b52216d1')
  2445. Tratamento de Erros
  2446. ~~~~~~~~~~~~~~~~~~~
  2447. Usando JSON-RPC, aria2 retorna objeto JSON que contém código de erro
  2448. no código e a mensagem de erro na mensagem.
  2449. Usando XML-RPC, aria2 retorna código de falha (faultCode=1) e a mensagem
  2450. de erro em (faultString).
  2451. .. _rpc_options:
  2452. Opções
  2453. ~~~~~~
  2454. Same options for :option:`--input-file <-i>` list are available.
  2455. Ver subseção `Arquivo de Entrada`_ para lista completa de opções.
  2456. In the option struct, name element is option name(without preceding
  2457. ``--``) and value element is argument as string.
  2458. EXEMPLO JSON-RPC M370
  2459. ^^^^^^^^^^^^^^^^^^^^^
  2460. ::
  2461. {'split':'1', 'http-proxy':'http://proxy/'}
  2462. EXEMPLO XML-RPC M380
  2463. ^^^^^^^^^^^^^^^^^^^^
  2464. .. code-block:: xml
  2465. <struct>
  2466. <member>
  2467. <name>split</name>
  2468. <value><string>1</string></value>
  2469. </member>
  2470. <member>
  2471. <name>http-proxy</name>
  2472. <value><string>http://proxy/</string></value>
  2473. </member>
  2474. </struct>
  2475. :option:`header <--header>` and :option:`index-out <-O>`
  2476. option are allowed multiple times in
  2477. command-line. Since name should be unique in struct(many XML-RPC
  2478. library implementation uses hash or dict for struct), single string is
  2479. not enough. To overcome this situation, they can take array as value
  2480. as well as string.
  2481. EXEMPLO JSON-RPC M390
  2482. ^^^^^^^^^^^^^^^^^^^^^
  2483. ::
  2484. {'header':['Accept-Language: ja', 'Accept-Charset: utf-8']}
  2485. EXEMPLO XML-RPC M400
  2486. ^^^^^^^^^^^^^^^^^^^^
  2487. .. code-block:: xml
  2488. <struct>
  2489. <member>
  2490. <name>header</name>
  2491. <value>
  2492. <array>
  2493. <data>
  2494. <value><string>Accept-Language: ja</string></value>
  2495. <value><string>Accept-Charset: utf-8</string></value>
  2496. </data>
  2497. </array>
  2498. </value>
  2499. </member>
  2500. </struct>
  2501. Following example adds a download with 2 options: dir and header.
  2502. header option has 2 values, so it uses a list::
  2503. >>> import xmlrpclib
  2504. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2505. >>> opts = dict(dir='/tmp',
  2506. ... header=['Accept-Language: ja',
  2507. ... 'Accept-Charset: utf-8'])
  2508. >>> s.aria2.addUri(['http://example.org/file'], opts)
  2509. '1'
  2510. JSON-RPC usando HTTP GET
  2511. ~~~~~~~~~~~~~~~~~~~~~~~~
  2512. The JSON-RPC interface also supports request via HTTP GET.
  2513. The encoding scheme in GET parameters is based on JSON-RPC over HTTP
  2514. Specification [2008-1-15(RC1)]. The encoding of GET parameters are follows::
  2515. /jsonrpc?method=METHOD_NAME&id=ID&params=BASE64_ENCODED_PARAMS
  2516. The ``method`` and ``id`` are always treated as JSON string and their
  2517. encoding must be UTF-8.
  2518. For example, The encoded string of
  2519. ``aria2.tellStatus('2089b05ecca3d829')`` with ``id='foo'`` looks like
  2520. this::
  2521. /jsonrpc?method=aria2.tellStatus&id=foo&params=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D
  2522. The ``params`` parameter is Base64-encoded JSON array which usually
  2523. appears in ``params`` attribute in JSON-RPC request object. In the
  2524. above example, the params is ``["2089b05ecca3d829"]``, therefore::
  2525. ["2089b05ecca3d829"] --(Base64)--> WyIyMDg5YjA1ZWNjYTNkODI5Il0=
  2526. --(Percent Encode)--> WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D
  2527. The JSON-RPC interface supports JSONP. You can specify the callback
  2528. function in ``jsoncallback`` parameter::
  2529. /jsonrpc?method=aria2.tellStatus&id=foo&params=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D&jsoncallback=cb
  2530. For Batch request, ``method`` and ``id`` parameter must not be specified.
  2531. Whole request must be specified in ``params`` parameter. For example,
  2532. Batch request::
  2533. [{'jsonrpc':'2.0', 'id':'qwer', 'method':'aria2.getVersion'},
  2534. {'jsonrpc':'2.0', 'id':'asdf', 'method':'aria2.tellActive'}]
  2535. will be encoded like this::
  2536. /jsonrpc?params=W3sianNvbnJwYyI6ICIyLjAiLCAiaWQiOiAicXdlciIsICJtZXRob2QiOiAiYXJpYTIuZ2V0VmVyc2lvbiJ9LCB7Impzb25ycGMiOiAiMi4wIiwgImlkIjogImFzZGYiLCAibWV0aG9kIjogImFyaWEyLnRlbGxBY3RpdmUifV0%3D
  2537. .. index:: double: json; websocket;
  2538. JSON-RPC sobre WebSocket
  2539. ~~~~~~~~~~~~~~~~~~~~~~~~
  2540. JSON-RPC sobre WebSocket utiliza o mesmo método de assinatura e resposta
  2541. do formato JSON-RPC sobre HTTP. O WebSocket suportado é da versão 13
  2542. o qual é detalhado na :rfc:`6455`.
  2543. Para enviar uma requisição RPC para um servidor RPC, enviar strings serializadas
  2544. JSON num frame Text. A resposta do servidor RPC será entregue também em um frame
  2545. Text.
  2546. O servidor RPC ira enviar a notificação ao cliente. A notificação é
  2547. unidirecional, portanto o cliente que receber a notificação não pode
  2548. responde-la. Esse método de assinatura de notificação é muito usual mas
  2549. não provê uma identificação de chave. Os valores associados pelos parâmetros
  2550. chave são os dados que a notificação porta. O formato desses valores
  2551. variam dependendo do método de notificação. Os seguintes métodos de notificação
  2552. são definidos:
  2553. .. function:: aria2.onDownloadStart(event)
  2554. Essa notificação será enviada quando e se o download for iniciado.
  2555. *event* é o tipo de estrutura e pode conter as seguintes chaves:
  2556. O formato do valor é string.
  2557. ``gid``
  2558. GID do download.
  2559. .. function:: aria2.onDownloadPause(event)
  2560. Esta notificação será enviada se o download for pausado. *event*
  2561. tem a mesma estrutura do argumento *event* do método da função
  2562. :func:`aria2.onDownloadStart`.
  2563. .. function:: aria2.onDownloadStop(event)
  2564. Essa notificação será enviada se o download for interrompido pelo usuário.
  2565. *event* tem a mesma estrutura do argumento *event* do método da função
  2566. :func:`aria2.onDownloadStart`.
  2567. .. function:: aria2.onDownloadComplete(event)
  2568. Esta notificação será enviada quando o download for completado. Para
  2569. downloads BitTorrent, esta notificação será enviada quando for completado e
  2570. o (seed) terminar. O *event* tem a mesma estrutura do *event* do método da
  2571. função :func:`aria2.onDownloadStart`.
  2572. .. function:: aria2.onDownloadError(event)
  2573. Esta notificação será enviada se o download for interrompido por causa de
  2574. um erro.
  2575. O *event* tem a mesma estrutura do *event* do método da função
  2576. :func:`aria2.onDownloadStart`.
  2577. .. function:: aria2.onBtDownloadComplete(event)
  2578. Esta notificação será enviada se o download for completado para o
  2579. BitTorrent (mas o seeding pode não ter sido concluído). O *event* tem a
  2580. mesma estrutura do *event* do método da função :func:`aria2.onDownloadStart`.
  2581. Exemplo Cliente XML-RPC Ruby
  2582. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2583. O seguinte script Ruby script adiciona ``http://localhost/aria2.tar.bz2`` em
  2584. aria2c no servidor em localhost com a opção :option:`--dir=/downloads <-d>` e
  2585. imprime a resposta do processamento:
  2586. .. code-block:: ruby
  2587. #!/usr/bin/env ruby
  2588. require 'xmlrpc/client'
  2589. require 'pp'
  2590. client=XMLRPC::Client.new2("http://localhost:6800/rpc")
  2591. options={ "dir" => "/downloads" }
  2592. result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options)
  2593. pp result
  2594. Se você usa Python, pode usar xmlrpclib (em Python3.x, use xmlrpc.client) para
  2595. interagir com aria2::
  2596. import xmlrpclib
  2597. from pprint import pprint
  2598. s = xmlrpclib.ServerProxy("http://localhost:6800/rpc")
  2599. r = s.aria2.addUri(["http://localhost/aria2.tar.bz2"], {"dir":"/downloads"})
  2600. pprint(r)
  2601. .. index:: double: mensagens; console;
  2602. DIVERSOS
  2603. --------
  2604. Mensagens na Console
  2605. ~~~~~~~~~~~~~~~~~~~~
  2606. Enquanto executa o download de arquivos, aria2 imprime mensagens na console
  2607. para mostrar o progresso dos downloads. Um exemplo abaixo::
  2608. [#1 SIZE:400.0KiB/33.2MiB(1%) CN:1 SPD:115.7KiBs ETA:4m51s]
  2609. Entenda o que estes números e strings significam.
  2610. ``#N``
  2611. N significa GID, o qual é um ID único para cada download.
  2612. ``SIZE``
  2613. Tamanho Total e Tamanho em bytes. Se a :option:`--select-file` é usada,
  2614. será exibida a somatória do tamanho do arquivo.
  2615. ``SEEDING``
  2616. Taxa compartilhamento ratio. O cliente está funcionando. Após término do
  2617. download do BitTorrent, ``SIZE`` será substituído por ``SEEDING``.
  2618. ``CN``
  2619. Número de conexões que o cliente estabeleceu.
  2620. ``SEED``
  2621. O número de seeders ao qual o cliente está conectado.
  2622. ``SPD``
  2623. Velocidade do download.
  2624. ``UP``
  2625. Velocidade e número de bytes transmitidos upload.
  2626. ``ETA``
  2627. Tempo previsto para conclusão.
  2628. ``TOTAL SPD``
  2629. A soma das velocidades de download para todos downloads paralelos.
  2630. Quando aria2 está alocando o espaço para arquivo ou validando o checksum,
  2631. adicionalmente exibirá o progresso:
  2632. FileAlloc
  2633. GID, tamanho alocado e total em bytes.
  2634. Checksum
  2635. GID, tamanho validado e total em bytes.
  2636. EXEMPLOS DOWNLOAD HTTP / FTP
  2637. ----------------------------
  2638. Download Segmentado HTTP/FTP
  2639. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2640. Download de arquivo
  2641. ^^^^^^^^^^^^^^^^^^^
  2642. .. code-block:: console
  2643. $ aria2c "http://servidor/arquivo.zip"
  2644. .. note::
  2645. Para parar o download, pressione :kbd:`Ctrl-C`. Posteriormente pode ser
  2646. retomado o mesmo download no mesmo diretório. Podem ser modificadas as URIs
  2647. pois elas apontam para o mesmo arquivo.
  2648. Download de arquivo de 2 servidores HTTP diferentes
  2649. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2650. .. code-block:: console
  2651. $ aria2c "http://servidor/arquivo.zip" "http://espelhobrasil/arquivo.zip"
  2652. Download de arquivo do mesmo servidor HTTP usando 2 conexões
  2653. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2654. .. code-block:: console
  2655. $ aria2c -x2 -k1M "http://servidorbrasil/arquivo.zip"
  2656. Download de arquivo de servidor HTTP e FTP
  2657. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2658. .. code-block:: console
  2659. $ aria2c "http://svrbrasil/arquivo.zip" "ftp://servebr/arquivo.zip"
  2660. Download arquivos especificados num arquivo txt concomitantemente
  2661. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2662. .. code-block:: console
  2663. $ aria2c -i arquivo.txt -j2
  2664. .. note::
  2665. -j especifica número de downloads paralelos.
  2666. Usando proxy
  2667. ^^^^^^^^^^^^
  2668. Para HTTP:
  2669. .. code-block:: console
  2670. $ aria2c --http-proxy="http://svrproxy:8080" "http://servidor/arquivo"
  2671. .. code-block:: console
  2672. $ aria2c --http-proxy="http://svrproxy:8080"
  2673. --no-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://servidor/arquivo"
  2674. a máscara de rede /16 quer dizer que para toda a rede 192.168 também não
  2675. será usado o servidor proxy
  2676. Para FTP:
  2677. .. code-block:: console
  2678. $ aria2c --ftp-proxy="http://svrproxy:8080" "ftp://servidor/arquivo"
  2679. .. note::
  2680. Ver :option:`--http-proxy`, :option:`--https-proxy`, :option:`--ftp-proxy`,
  2681. :option:`--all-proxy` e :option:`--no-proxy` para detalhes. Proxy pode ser
  2682. especificado nas variáveis de ambiente. Ver seção `VARIÁVEIS DE AMBIENTE`_ .
  2683. Proxy com autenticação / autorização
  2684. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2685. .. code-block:: console
  2686. $ aria2c --http-proxy="http://usuário:senha@svrproxy:8080"
  2687. "http://servidor/arquivo"
  2688. .. code-block:: console
  2689. $ aria2c --http-proxy="http://svrproxy:8080"
  2690. --http-proxy-user="usuário" --http-proxy-passwd="senha"
  2691. "http://servidor/arquivo"
  2692. Download Metalink
  2693. ~~~~~~~~~~~~~~~~~
  2694. Download arquivos com Metalink remoto
  2695. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2696. .. code-block:: console
  2697. $ aria2c --follow-metalink=mem "http://servidor/arquivo.metalink"
  2698. Download arquivos com Metalink local
  2699. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2700. .. code-block:: console
  2701. $ aria2c -p --lowest-speed-limit=4000 arquivo.metalink
  2702. .. note::
  2703. Para parar o download, pressione :kbd:`Ctrl-C`.
  2704. A transferência pode ser retomada executando aria2c com o mesmo argumento
  2705. no mesmo diretório
  2706. Download diversos arquivos Metalink local
  2707. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2708. .. code-block:: console
  2709. $ aria2c -j2 arquivo1.metalink arquivo2.metalink
  2710. Download só arquivos selecionados usando index
  2711. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2712. .. code-block:: console
  2713. $ aria2c --select-file=1-4,8 arquivo.metalink
  2714. .. note::
  2715. O index é exibido na console usando opção -S.
  2716. Download um arquivo usando Metalink local com preferência do usuário
  2717. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2718. .. code-block:: console
  2719. $ aria2c --metalink-location=pt,us --metalink-version=1.1 --metalink-language=pt-BR arquivo.metalink
  2720. Download BitTorrent
  2721. ~~~~~~~~~~~~~~~~~~~
  2722. Download arquivos de BitTorrent remotos
  2723. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2724. .. code-block:: console
  2725. $ aria2c --follow-torrent=mem "http://servidortorrent/arquivo.torrent"
  2726. Download usando arquivo torrent local
  2727. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2728. .. code-block:: console
  2729. $ aria2c --max-upload-limit=40K arquivo.torrent
  2730. .. note::
  2731. --max-upload-limit especifica taxa máxima de transmissão (upload).
  2732. .. note::
  2733. Para parar o download, pressione :kbd:`Ctrl-C`. A transferência pode ser retomada
  2734. ao executar aria2c com os mesmos argumentos no mesmo diretório.
  2735. Download usando URI BitTorrent Magnet
  2736. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2737. .. code-block:: console
  2738. $ aria2c "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C&dn=aria2"
  2739. .. note::
  2740. Lembre-se inserir delimitadores na URI BitTorrent Magnet, pois ela inclui ``&``
  2741. que tem significado de parâmetro. Utilizar apóstrofo(``'``) ou aspas(``"``).
  2742. Download 2 torrents
  2743. ^^^^^^^^^^^^^^^^^^^
  2744. .. code-block:: console
  2745. $ aria2c -j2 arquivo1.torrent arquivo2.torrent
  2746. Download um arquivo usando torrent e servidor HTTP/FTP
  2747. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2748. .. code-block:: console
  2749. $ aria2c -T arqfile.torrent "http://serv1/arqfile" "ftp://svr2/arqfile"
  2750. .. note::
  2751. Download de arquivos múltiplos torrent com HTTP e FTP não é suportado.
  2752. Download arquivos selecionados usando index(chamado "download seletivo")
  2753. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2754. .. code-block:: console
  2755. $ aria2c --select-file=1-4,8 arquivo.torrent
  2756. .. note::
  2757. O index é exibido na console usando-se a opção -S.
  2758. Especificar arquivo saída
  2759. ^^^^^^^^^^^^^^^^^^^^^^^^^
  2760. Para especificar arquivo de saída em Downloads de BitTorrent, faz-se necessário
  2761. conhecer o index do arquivo no torrent usando a opção :option:`--show-files <-S>`.
  2762. Por exemplo, a saída exibirá algo como::
  2763. idx|path/length
  2764. ===+======================
  2765. 1|dist/base-2.6.18.iso
  2766. |99.9MiB
  2767. ---+----------------------
  2768. 2|dist/driver-2.6.18.iso
  2769. |169.0MiB
  2770. ---+----------------------
  2771. Para salvar 'dist/base-2.6.18.iso' em '/tmp/meudir/base.iso' e
  2772. 'dist/driver-2.6.18.iso' em '/tmp/dir/driver.iso', use o seguinte comando:
  2773. .. code-block:: console
  2774. $ aria2c --dir=/tmp --index-out=1=meudir/base.iso --index-out=2=dir/driver.iso arquivo.torrent
  2775. Modificar porta escuta para peer de entrada
  2776. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2777. .. code-block:: console
  2778. $ aria2c --listen-port=7000-7001,8000 arquivo.torrent
  2779. .. note::
  2780. Já que aria2 não configura o firewall ou porta de roteamento para portas
  2781. de encaminhamento, isto deve ser explicitado manualmente por você.
  2782. Especificar condição para para o programa torrent após término do download
  2783. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2784. .. code-block:: console
  2785. $ aria2c --seed-time=120 --seed-ratio=1.0 arquivo.torrent
  2786. .. note::
  2787. No exemplo acima, o programa termina após transcorrer 120 minutos após
  2788. término do download ou taxa chegar a 1.0.
  2789. Controlar velocidade upload Torrent
  2790. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2791. .. code-block:: console
  2792. $ aria2c --max-upload-limit=100K arquivo.torrent
  2793. Habilitar IPv4 DHT
  2794. ^^^^^^^^^^^^^^^^^^
  2795. .. code-block:: console
  2796. $ aria2c --enable-dht --dht-listen-port=6881 arquivo.torrent
  2797. .. note::
  2798. DHT utiliza a porta udp, como o aria2 não configura firewall nem porta de roteamento
  2799. ou forwarding, por favor executar estas configurações manualmente.
  2800. Habilitar IPv6 DHT
  2801. ^^^^^^^^^^^^^^^^^^
  2802. .. code-block:: console
  2803. $ aria2c --enable-dht6 --dht-listen-port=6881 --dht-listen-addr6=YOUR_GLOBAL_UNICAST_IPV6_ADDR --enable-async-dns6
  2804. .. note::
  2805. Se aria2c não foi compilado com c-ares, a opção :option:`--enable-async-dns6`
  2806. não é necessária. aria2 compartilha a mesma porta ente IPv4 e IPv6 DHT.
  2807. Adicionar e remover rastreador URI
  2808. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2809. Remover todos os rastreadores (tracker) das URIs descritas no arquivo.torrent
  2810. utilize ``http://tracker1/announce`` e ``http://tracker2/announce``
  2811. .. code-block:: console
  2812. $ aria2c --bt-exclude-tracker="*" --bt-tracker="http://tracker1/announce,http://tracker2/announce" file.torrent
  2813. Funcionalidades avançadas HTTP
  2814. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2815. Carregar cookies
  2816. ^^^^^^^^^^^^^^^^
  2817. .. code-block:: console
  2818. $ aria2c --load-cookies=cookies.txt "http://servidor/arquivo.zip"
  2819. .. note::
  2820. Podem ser utilizados sem nenhuma modificação coookies dos navegadores:
  2821. Firefox / Mozilla / Chromium.
  2822. Continuar download iniciado por navegadores ou outros programas
  2823. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2824. Quando desejar continuar ou retomar um download cujo processamento foi
  2825. interrompido, seja em navegador ou qualquer outro programa utilize
  2826. o aria2c para retomar este download do ponto onde parou.
  2827. .. code-block:: console
  2828. $ aria2c -c -s2 "http://servidor/arquivodedownloadparcial.zip"
  2829. Autenticação certificado para Cliente SSL/TLS
  2830. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2831. .. code-block:: console
  2832. $ aria2c --certificate=/path/para/mycert.pem --private-key=/path/para/mykey.pem https://servidor/arquivo
  2833. .. note::
  2834. O arquivo especificado na opção :option:`--private-key` não pode estar
  2835. criptografado. O comportamento do processo fica indefinido quando o
  2836. arquivo estiver criptografado.
  2837. Verificar peer em SSL/TLS usando certificados CA
  2838. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2839. .. code-block:: console
  2840. $ aria2c --ca-certificate=/path/para/ca-certificates.crt
  2841. --check-certificate https://servidor/arquivo
  2842. Funcionalidades avançadas adicionais
  2843. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2844. Controlar velocidade de download
  2845. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2846. Quando for necessário o controle da utilização da banda disponível, pode ser
  2847. utilizado a opção abaixo. Atenção o sufixo K ou M deve ser em letra maiúscula.
  2848. .. code-block:: console
  2849. $ aria2c --max-download-limit=100K arquivo.metalink
  2850. Reparar um download danificado
  2851. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2852. .. code-block:: console
  2853. $ aria2c -V arquivo.metalink
  2854. .. note::
  2855. Reparar downloads danificados pode ser mais eficiente usando
  2856. BitTorrent ou Metalink com a opção verificação (checksums).
  2857. Desconectar conexão se a velocidade download for menor que um valor
  2858. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2859. .. code-block:: console
  2860. $ aria2c --lowest-speed-limit=10K file.metalink
  2861. Suporte a URI parametrizada
  2862. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2863. A URI pode ser especificada como partes de um conjunto:
  2864. .. code-block:: console
  2865. $ aria2c -P "http://{svr1,svr2,svr3}/arquivo.iso"
  2866. Também podem ser especificados sequencias de intervalos:
  2867. .. code-block:: console
  2868. $ aria2c -Z -P "http://servidor/imagem[000-100].png"
  2869. .. note::
  2870. -Z opção requerida para que todas URIs não apontem para o mesmo arquivo,
  2871. como declarado no código acima.
  2872. Especificar incrementos para contador:
  2873. .. code-block:: console
  2874. $ aria2c -Z -P "http://servidor/imagem[A-Z:2].png"
  2875. Verificar validação checksum
  2876. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2877. .. code-block:: console
  2878. $ aria2c --checksum=sha-1=0192ba11326fe2298c8cb4de616f4d4140213837
  2879. http://dobrasil.org/arquivo
  2880. Download Paralelo de uma quantidade arbitrária de URI, Metalink ou Torrent
  2881. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2882. .. code-block:: console
  2883. $ aria2c -j3 -Z "http://servidor/arquivo1" arquivo2.torrent arq3.metalink
  2884. BitTorrent Criptografado
  2885. ^^^^^^^^^^^^^^^^^^^^^^^^
  2886. Criptografar todo conjunto usando ARC4:
  2887. .. code-block:: console
  2888. $ aria2c --bt-min-crypto-level=arc4 --bt-require-crypto=true arquivo.torrent
  2889. Ver Também
  2890. ----------
  2891. Site do Projeto aria2: http://aria2.sourceforge.net/
  2892. Wiki aria2: http://sourceforge.net/apps/trac/aria2/wiki
  2893. Site do Projeto Metalink: http://www.metalinker.org/
  2894. Descrição do Formato Download Metalink: :rfc:`5854`
  2895. COPYRIGHT
  2896. ---------
  2897. Copyright (C) 2006, 2013 Tatsuhiro Tsujikawa
  2898. Tradução para Português do Brasil 2013, Gilberto dos Santos Alves
  2899. utilizando editor kate e gedit no Debian squeeze 6.0.6 novembro de 2012
  2900. revisado em março de 2013 usando editor kate e gedit no ubuntu 12.04 LTS
  2901. Esse programa é software livre; pode ser redistribuido e/ou modificado
  2902. sob os termos da Licença GNU General Public License como publicada por
  2903. Free Software Foundation www.fsf.org; versão 2 da Licença, ou qualquer
  2904. versão mais recente, qualquer que seja sua escolha.
  2905. Este programa é distribuído na intenção de ser útil, mas SEM NENHUMA GARANTIA;
  2906. sem qualquer garantia implícita de ser COMERCIALIZÁVEL ou para PROPÓSITO
  2907. ESPECÍFICO. Consulte a Linceça GNU Genérica para mais detalhes.
  2908. Você precisa receber uma cópia da Licença Pública GNU Genérica junto com
  2909. este programa; caso não tenha, escrevá para Free Software Foundation, Inc.,
  2910. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  2911. Adicionalmente, como uma exceção especial, os detentores do direito autoral
  2912. autorizam a permissão para compilar programas que possuem ligação com
  2913. parte do código com a biblioteca OpenSSL sob certas condições como descritas
  2914. em cada arquivo fonte e autorizam a distribuição das das combinações das
  2915. ligações incluindo ambas.
  2916. Devem ser obedecidos todos os detalhes da Licença Pública GNU Genérica
  2917. em relação a OpenSSL. Caso haja modificação nos arquivos com esta exceção
  2918. deverá ser extendida esta exceção para as versões modificadas dos arquivos, mas
  2919. isto não é obrigatório. Se não houver esta intenção exclua esta declaração
  2920. de exceção da sua versão. Caso sejam excluídas as declarações de todos
  2921. os arquivos fontes, exclua também esta declaração daqui.
  2922. Anotação sobre divergência entre Manual e o aria2:
  2923. Esta página de manual pode não necessariamente conter a última informação.
  2924. Caso haja discrepância entre alguma informação do manual e o aria2, por
  2925. favor refira-se a versão em inglês resultante do comando man aria2c