aria2c.rst 141 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993
  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 no
  386. .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 download after added. This option is effective only when
  690. :option:`--enable-rpc=true <--enable-rpc>` is given.
  691. Padrão: ``false``
  692. .. option:: --rpc-allow-origin-all[=true|false]
  693. Add Access-Control-Allow-Origin header field with value ``*`` to the
  694. RPC response.
  695. Padrão: ``false``
  696. .. option:: --rpc-certificate=<FILE>
  697. Use the certificate in FILE for RPC server. The certificate must be
  698. in PEM format. Use :option:`--rpc-private-key` option to specify the
  699. private key. Use :option:`--rpc-secure` option to enable encryption.
  700. .. option:: --rpc-listen-all[=true|false]
  701. Listen incoming JSON-RPC/XML-RPC requests on all network interfaces. If false
  702. is given, listen only on local loopback interface. Padrão: ``false``
  703. .. option:: --rpc-listen-port=<PORT>
  704. Specify a port number for JSON-RPC/XML-RPC server to listen to. Possible
  705. Values: ``1024`` -``65535`` Padrão: ``6800``
  706. .. option:: --rpc-max-request-size=<TAMANHO>
  707. Set max size of JSON-RPC/XML-RPC request. If aria2 detects the request is
  708. more than SIZE bytes, it drops connection. Padrão: ``2M``
  709. .. option:: --rpc-passwd=<PASSWD>
  710. Set JSON-RPC/XML-RPC password.
  711. .. option:: --rpc-private-key=<FILE>
  712. Use the private key in FILE for RPC server. The private key must be
  713. decrypted and in PEM format. Use :option:`--rpc-secure` option to
  714. enable encryption. See also :option:`--rpc-certificate` option.
  715. .. option:: --rpc-save-upload-metadata[=true|false]
  716. Save the uploaded torrent or metalink metadata in the directory
  717. specified by :option:`--dir` option. The filename consists of SHA-1
  718. hash hex string of metadata plus extension. For torrent, the
  719. extension is '.torrent'. For metalink, it is '.meta4'. If false is
  720. given to this option, the downloads added by
  721. :func:`aria2.addTorrent` or :func:`aria2.addMetalink` will not be
  722. saved by :option:`--save-session` option. Default: ``false``
  723. .. option:: --rpc-secure[=true|false]
  724. RPC transport will be encrypted by SSL/TLS. The RPC clients must
  725. use https scheme to access the server. For WebSocket client, use wss
  726. scheme. Use :option:`--rpc-certificate` and
  727. :option:`--rpc-private-key` options to specify the server
  728. certificate and private key.
  729. .. option:: --rpc-user=<USUÁRIO>
  730. Set JSON-RPC/XML-RPC user.
  731. Opções Avançadas
  732. ~~~~~~~~~~~~~~~~
  733. .. option:: --allow-overwrite[=true|false]
  734. Reiniciar o download desde o início se o correspondente arquivo de controle
  735. não existir. Ver também a opção :option:`--auto-file-renaming`.
  736. Padrão: ``false``
  737. .. option:: --allow-piece-length-change[=true|false]
  738. Se ``false`` é informado, aria2 interrompe o download quando o tamanho de um
  739. pedaço for diferente do especificado no arquivo controle. Se ``true``
  740. é informado, o download prossegue mas o progresso será perdido.
  741. Padrão: ``false``
  742. .. option:: --always-resume[=true|false]
  743. Sempre continuar. Se If ``true`` é informado, aria2 sempre tentará
  744. retomar o download do ponto interrompido e se não for possivel o download
  745. será interrompido. Se ``false`` é informado, quando todas URIs fornecidas
  746. não suportarem a continuidade do download ou aria2 encontrar ``N`` URIs as
  747. quais não suportem retomar o download (``N`` é o valor especificado na
  748. opção :option:`--max-resume-failure-tries`), aria2 irá iniciar o download
  749. do início. Ver opção :option:`--max-resume-failure-tries`
  750. Padrão: ``true``
  751. .. option:: --async-dns[=true|false]
  752. Habilita DNS assíncrono.
  753. Padrão: ``true``
  754. .. option:: --async-dns-server=<ENDEREÇO-IP>[,...]
  755. Lista separada por vírgulas, dos endereços dos servidores DNS assíncronos
  756. usados pelo resolvedor. Normalmente o resolvedor de DNS assíncronos faz a
  757. leitura dos endereços a partir do arquivo ``/etc/resolv.conf``.
  758. Quando essa opção é usada é feito uso dos servidores DNS especificados na
  759. opção em detrimento do conteúdo do arquivo ``/etc/resolv.conf``.
  760. Podem ser usados ambos endereços IPv4 e IPv6. Essa opção é útil
  761. quando o sistema não possui ``/etc/resolv.conf`` e o usuário não tem
  762. permissão para criá-lo.
  763. .. option:: --auto-file-renaming[=true|false]
  764. Renomear o arquivo se o mesmo já existir.
  765. Essa opção só funciona em download HTTP, HTTPS e FTP.
  766. O novo nome do arquivo terá um ponto e uma sequência (1..9999) como sufixo.
  767. Padrão: ``true``
  768. .. option:: --auto-save-interval=<SEGUNDOS>
  769. Salvar o arquivo de controle (\*.aria2) a cada intervalo de SEGUNDOS.
  770. Se ``0`` é informado, o arquivo de controle não será salvo durante o
  771. download. aria2 salva o arquivo de controle quando parar, independentemente
  772. do valor. As possibilidades vão desde ``0`` até ``600``.
  773. Padrão: ``60``
  774. .. option:: --conditional-get[=true|false]
  775. Download file only when the local file is older than remote
  776. file. This function only works with HTTP, HTTPS, downloads only. It does
  777. not work if file size is specified in Metalink. It also ignores
  778. Content-Disposition header. If a control file exists, this option
  779. will be ignored. This function uses If-Modified-Since header to get
  780. only newer file conditionally. When getting modification time of
  781. local file, it uses user supplied filename(see :option:`--out <-o>` option) or
  782. filename part in URI if :option:`--out <-o>` is not specified.
  783. To overwrite existing file, :option:`--allow-overwrite` is required.
  784. Padrão: ``false``
  785. .. option:: --conf-path=<PATH>
  786. Change the configuration file path to PATH.
  787. Padrão: ``$HOME/.aria2/aria2.conf``
  788. .. option:: --console-log-level=<LEVEL>
  789. Set log level to output to console. LEVEL is either ``debug``,
  790. ``info``, ``notice``, ``warn`` or ``error``. Default: ``notice``
  791. .. option:: -D, --daemon[=true|false]
  792. Run as daemon. The current working directory will be changed to ``/``
  793. and standard input, standard output and standard error will be
  794. redirected to ``/dev/null``. Padrão: ``false``
  795. .. option:: --deferred-input[=true|false]
  796. If ``true`` is given, aria2 does not read all URIs and options from file
  797. specified by :option:`--input-file <-i>` option at startup,
  798. but it reads one by one when it
  799. needs later. This may reduce memory usage if input file contains a
  800. lot of URIs to download. If ``false`` is given, aria2 reads all URIs
  801. and options at startup.
  802. Padrão: ``false``
  803. .. option:: --disable-ipv6[=true|false]
  804. Disable IPv6. This is useful if you have to use broken DNS and want
  805. to avoid terribly slow AAAA record lookup. Padrão: ``false``
  806. .. option:: --disk-cache=<SIZE>
  807. Enable disk cache. If SIZE is ``0``, the disk cache is
  808. disabled. This feature caches the downloaded data in memory, which
  809. grows to at most SIZE bytes. The cache storage is created for aria2
  810. instance and shared by all downloads. The one advantage of the disk
  811. cache is reduce the disk I/O because the data are written in larger
  812. unit and it is reordered by the offset of the file. If hash
  813. checking is involved and the data are cached in memory, we don't
  814. need to read them from the disk. SIZE can include ``K`` or ``M``
  815. (1K = 1024, 1M = 1024K). Default: ``0``
  816. .. option:: --download-result=<OPT>
  817. This option changes the way ``Download Results`` is formatted. If OPT
  818. is ``default``, print GID, status, average download speed and
  819. path/URI. If multiple files are involved, path/URI of first
  820. requested file is printed and remaining ones are omitted. If OPT is
  821. ``full``, print GID, status, average download speed, percentage of
  822. progress and path/URI. The percentage of progress and path/URI are
  823. printed for each requested file in each row.
  824. Padrão: ``default``
  825. .. option:: --enable-async-dns6[=true|false]
  826. Enable IPv6 name resolution in asynchronous DNS resolver. This
  827. option will be ignored when :option:`--async-dns=false. <--async-dns>`
  828. Padrão: ``false``
  829. .. option:: --enable-mmap[=true|false]
  830. Map files into memory. This option may not work if the file space
  831. is not pre-allocated. See :option:`--file-allocation`.
  832. Padrão: ``false``
  833. .. option:: --event-poll=<POLL>
  834. Specify the method for polling events. The possible values are
  835. ``epoll``, ``kqueue``, ``port``, ``poll`` and ``select``. For each ``epoll``,
  836. ``kqueue``, ``port`` and ``poll``, it is available if system supports it.
  837. ``epoll`` is available on recent Linux. ``kqueue`` is available on
  838. various \*BSD systems including Mac OS X. ``port`` is available on Open
  839. Solaris. The default value may vary depending on the system you use.
  840. .. option:: --file-allocation=<METHOD>
  841. Specify file allocation method.
  842. ``none`` doesn't pre-allocate file space. ``prealloc`` pre-allocates file space
  843. before download begins. This may take some time depending on the size of the
  844. file.
  845. If you are using newer file systems such as ext4
  846. (with extents support), btrfs, xfs or NTFS(MinGW build only), ``falloc`` is
  847. your best choice. It allocates large(few GiB)
  848. files almost instantly. Don't use ``falloc`` with
  849. legacy file systems such as ext3 and FAT32 because it takes
  850. almost same time as ``prealloc`` and it blocks aria2
  851. entirely until allocation finishes. ``falloc`` may
  852. not be available if your system doesn't have
  853. :manpage:`posix_fallocate(3)` function.
  854. ``trunc`` uses :manpage:`ftruncate(2)` system call or
  855. platform-specific counterpart to truncate a file to a specified
  856. length.
  857. Possible Values: ``none``, ``prealloc``, ``trunc``, ``falloc``
  858. Padrão: ``prealloc``
  859. .. option:: --force-save[=true|false]
  860. Save download with :option:`--save-session <--save-session>` option
  861. even if the download is completed or removed. This may be useful to
  862. save BitTorrent seeding which is recognized as completed state.
  863. Default: ``false``
  864. .. option:: --gid=<GID>
  865. Set GID manually. aria2 identifies each download by the ID called
  866. GID. The GID must be hex string of 16 characters, thus [0-9a-zA-Z]
  867. are allowed and leading zeros must not be stripped. The GID all 0 is
  868. reserved and must not be used. The GID must be unique, otherwise
  869. error is reported and the download is not added. This option is
  870. useful when restoring the sessions saved using
  871. :option:`--save-session <--save-session>` option. If this option is
  872. not used, new GID is generated by aria2.
  873. .. option:: --hash-check-only[=true|false]
  874. If ``true`` is given, after hash check using
  875. :option:`--check-integrity <-V>` option,
  876. abort download whether or not download is complete.
  877. Padrão: ``false``
  878. .. option:: --human-readable[=true|false]
  879. Print sizes and speed in human readable format (e.g., 1.2Ki, 3.4Mi)
  880. in the console readout. Padrão: ``true``
  881. .. option:: --interface=<INTERFACE>
  882. Bind sockets to given interface. You can specify interface name, IP
  883. address and hostname.
  884. Possible Values: interface, IP address, hostname
  885. .. note::
  886. If an interface has multiple addresses, it is highly recommended to
  887. specify IP address explicitly. See also :option:`--disable-ipv6`. If your
  888. system doesn't have :manpage:`getifaddrs(3)`, this option doesn't accept interface
  889. name.
  890. .. option:: --max-download-result=<NÚMERO>
  891. Set maximum number of download result kept in memory. The download
  892. results are completed/error/removed downloads. The download results
  893. are stored in FIFO queue and it can store at most NUM download
  894. results. When queue is full and new download result is created,
  895. oldest download result is removed from the front of the queue and
  896. new one is pushed to the back. Setting big number in this option may
  897. result high memory consumption after thousands of
  898. downloads. Specifying 0 means no download result is kept. Padrão:
  899. ``1000``
  900. .. option:: --max-resume-failure-tries=<N>
  901. When used with :option:`--always-resume=false, <--always-resume>` aria2 downloads file from
  902. scratch when aria2 detects N number of URIs that does not support
  903. resume. If N is ``0``, aria2 downloads file from scratch when all
  904. given URIs do not support resume. See :option:`--always-resume` option.
  905. Padrão: ``0``
  906. .. option:: --log-level=<LEVEL>
  907. Set log level to output.
  908. LEVEL is either ``debug``, ``info``, ``notice``, ``warn`` or ``error``.
  909. Padrão: ``debug``
  910. .. option:: --on-bt-download-complete=<COMMAND>
  911. For BitTorrent, a command specified in :option:`--on-download-complete` is
  912. called after download completed and seeding is over. On the other
  913. hand, this option set the command to be executed after download
  914. completed but before seeding.
  915. See `Interação com Eventos (Hook)`_ for more details about COMMAND.
  916. Possible Values: ``/path/to/command``
  917. .. option:: --on-download-complete=<COMMAND>
  918. Set the command to be executed after download completed. See
  919. See `Interação com Eventos (Hook)`_ for more details about COMMAND.
  920. See also :option:`--on-download-stop` option.
  921. Possible Values: ``/path/to/command``
  922. .. option:: --on-download-error=<COMMAND>
  923. Set the command to be executed after download aborted due to error.
  924. See `Interação com Eventos (Hook)`_ for more details about COMMAND.
  925. See also :option:`--on-download-stop` option. Possible Values:
  926. ``/path/to/command``
  927. .. option:: --on-download-pause=<COMMAND>
  928. Set the command to be executed after download was paused.
  929. See `Interação com Eventos (Hook)`_ for more details about COMMAND.
  930. Possible Values: ``/path/to/command``
  931. .. option:: --on-download-start=<COMMAND>
  932. Set the command to be executed after download got started.
  933. See `Interação com Eventos (Hook)`_ for more details about COMMAND.
  934. Possible Values: ``/path/to/command``
  935. .. option:: --on-download-stop=<COMMAND>
  936. Set the command to be executed after download stopped. You can override
  937. the command to be executed for particular download result using
  938. :option:`--on-download-complete` and :option:`--on-download-error`. If they are
  939. specified, command specified in this option is not executed.
  940. See `Interação com Eventos (Hook)`_ for more details about COMMAND.
  941. Possible Values: ``/path/to/command``
  942. .. option:: --piece-length=<LENGTH>
  943. Set a piece length for HTTP e FTP downloads. This is the boundary when
  944. aria2 splits a file. All splits occur at multiple of this
  945. length. This option will be ignored in BitTorrent downloads. It
  946. will be also ignored if Metalink file contains piece hashes.
  947. Padrão: ``1M``
  948. .. note::
  949. The possible usecase of :option:`--piece-length`
  950. option is change the request range in one HTTP pipelined request.
  951. To enable HTTP pipelining use
  952. :option:`--enable-http-pipelining`.
  953. .. option:: --show-console-readout[=true|false]
  954. Show console readout. Padrão: ``true``
  955. .. option:: --summary-interval=<SEGUNDOS>
  956. Set interval in seconds to output download progress summary.
  957. Setting ``0`` suppresses the output.
  958. Padrão: ``60``
  959. .. note::
  960. In multi file torrent downloads, the files adjacent forward to the specified files
  961. are also allocated if they share the same piece.
  962. .. option:: -Z, --force-sequential[=true|false]
  963. Fetch URIs in the command-line sequentially and download each URI in a
  964. separate session, like the usual command-line download utilities.
  965. Padrão: ``false``
  966. .. option:: --max-overall-download-limit=<VELOCIDADE>
  967. Set max overall download speed in bytes/sec. ``0`` means
  968. unrestricted. You can append ``K`` or ``M`` (1K = 1024, 1M = 1024K). To
  969. limit the download speed per download, use :option:`--max-download-limit`
  970. option. Padrão: ``0``
  971. .. option:: --max-download-limit=<VELOCIDADE>
  972. Set max download speed per each download in bytes/sec. ``0`` means
  973. unrestricted. You can append ``K`` or ``M`` (1K = 1024, 1M = 1024K). To
  974. limit the overall download speed, use :option:`--max-overall-download-limit`
  975. option. Padrão: ``0``
  976. .. option:: --no-conf[=true|false]
  977. Disable loading aria2.conf file.
  978. .. option:: --no-file-allocation-limit=<TAMANHO>
  979. No file allocation is made for files whose size is smaller than SIZE.
  980. You can append ``K`` or ``M`` (1K = 1024, 1M = 1024K).
  981. Padrão: ``5M``
  982. .. option:: -P, --parameterized-uri[=true|false]
  983. Enable parameterized URI support.
  984. You can specify set of parts: ``http://{sv1,sv2,sv3}/foo.iso``.
  985. Also you can specify numeric sequences with step counter:
  986. ``http://host/image[000-100:2].img``.
  987. A step counter can be omitted.
  988. If all URIs do not point to the same file, such as the second example above,
  989. -Z option is required.
  990. Padrão: ``false``
  991. .. option:: -q, --quiet[=true|false]
  992. Make aria2 quiet (no console output).
  993. Padrão: ``false``
  994. .. option:: --realtime-chunk-checksum[=true|false]
  995. Validate chunk of data by calculating checksum while downloading a file if
  996. chunk checksums are provided.
  997. Padrão: ``true``
  998. .. option:: --remove-control-file[=true|false]
  999. Remove control file before download. Using with
  1000. :option:`--allow-overwrite=true, <--allow-overwrite>` download always starts from
  1001. scratch. This will be useful for users behind proxy server which
  1002. disables resume.
  1003. .. option:: --save-session=<ARQUIVO>
  1004. Salvar downloads não concluídos ou com erro, para um ARQUIVO quando sair.
  1005. Pode ser informado o nome do arquivo para o aria2 com a opção
  1006. :option:`--input-file <-i>` no restart. Note que downloads adicionados
  1007. pela função :func:`aria2.addTorrent` e pela função
  1008. :func:`aria2.addMetalink` método RPC e seus respectivos metadados não podem
  1009. ser salvos. Downloads removidos usando a função :func:`aria2.remove` e
  1010. :func:`aria2.forceRemove` não serão salvos.
  1011. .. option:: --save-session-interval=<SEC>
  1012. Save error/unfinished downloads to a file specified by
  1013. :option:`--save-session` option every SEC seconds. If ``0`` is
  1014. given, file will be saved only when aria2 exits. Default: ``0``
  1015. .. option:: --stop=<SEGUNDOS>
  1016. Finaliza a aplicação após SEGUNDOS se passarem.
  1017. Se ``0`` é informado, essa funcionalidade é desabilitada.
  1018. Padrão: ``0``
  1019. .. option:: --stop-with-process=<PID>
  1020. Finaliza a aplicação quando o processo de número PID não estiver executando.
  1021. Isso é útil se o processo aria2 foi derivado de um processo precursor.
  1022. O processo precursor pode ter criado o processo aria2 com seu próprio pid
  1023. e quando o processo precursor terminar por alguma razão, aria2 pode
  1024. detectar por ele mesmo, essa situação e executar ele mesmo o shutdown.
  1025. Este recurso evita que um processo gere subprocessos que ficam no
  1026. limbo.
  1027. .. option:: --truncate-console-readout[=true|false]
  1028. Truncar a linha da console para ajustar-se a uma linha.
  1029. Padrão: ``true``
  1030. .. option:: -v, --version
  1031. Exibe o número da versão, copyright e informação da configuração e sai.
  1032. Argumento(s) Opcional(is)
  1033. ~~~~~~~~~~~~~~~~~~~~~~~~~
  1034. As opções que possuem seus argumentos delimitados por colchetes ([]), são
  1035. opcionais. Normalmente omitindo o argumento, ele será assumido como ``true``
  1036. (verdadeiro).
  1037. Se for usada a forma abreviada dessas opções (como em ``-V``) e informado
  1038. um argumento, estão o nome da opção e seu argumento devem ser concatenados,
  1039. por exemplo: (``-Vfalse``). Se houver espaços entre a opção e o argumento o
  1040. argumento será tratado como URI e normalmente não é isto o esperado.
  1041. Unidades (K and M)
  1042. ^^^^^^^^^^^^^^^^^^
  1043. Algumas opções usam ``K`` e ``M`` para convenientemente representar
  1044. 1.024 e 1.048.576 respectivamente. aria2 detecta estas caracteres de maneira
  1045. transparente (maiúsculas e minúsculas), portanto podem ser usados
  1046. `k`` ou ``K`` e ``m`` ou ``M``.
  1047. URI, MAGNET, TORRENT_FILE, METALINK_FILE
  1048. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1049. Podemos especificar múltiplas URIs em uma linha de comando. A menos que seja
  1050. especificada a opção :option:`--force-sequential <-Z>`, todas as URIs devem
  1051. apontar para o mesmo arquivo que será baixado ou o download falhará.
  1052. Pode-se especificar um número arbitrátio de URIs de BitTorrent Magnet URI.
  1053. Nove que eles sempre serão tratados como downloads separados.
  1054. São suportados Hash de Info de 40 characters e Hast de Info Base32 de 32
  1055. characters. Múltiplos parâmetros ``tr`` são suportados. Devido a URI
  1056. BitTorrent Magnet poder conter o caracter ``&``, é altamente recomendável
  1057. delimitar a URI com apóstrofo single(``'``) ou aspas double(``"``).
  1058. É altamente recomendável habilitar DHT especialmente quando ``tr`` o parâmetro
  1059. estiver ausente. Ver http://www.bittorrent.org/beps/bep_0009.html
  1060. para maiores detalhes sobre URI BitTorrent Magnet.
  1061. Pode-se também especificar um número arbitrário de arquivos torrent e
  1062. Documentos Metalink armazenados em um dispositivo local. Note que sempre serão
  1063. tratados como download distintos. Tanto Metalink4 quanto Metalink da versão 3
  1064. são suportados.
  1065. Pode-se especificar arquivo torrent usando a opção -T e URI. Fazendo isso
  1066. o download será baixado do servidor swarm e HTTP, HTTPS e FTP ao mesmo tempo,
  1067. enquanto os dados do HTTP, HTTPS e FTP serão uploaded para o swarm torrent.
  1068. Para torrent de um arquivo a URI deve ser completa e apontar inclusive o
  1069. recurso ou se a URI terminar com / o nome do torrent será adicionado. Para
  1070. múltiplos torrents, name e caminho serão adicionados para formar a URI, para
  1071. cada um dos arquivos.
  1072. .. note::
  1073. Certifique-se que a URI seja delimitada por apóstrofo single(``'``) ou
  1074. aspas double(``"``) se a URI contiver ``&`` ou qualquer outro caracter que
  1075. tenha significado especial para o shell.
  1076. Continuar Download Interrompido
  1077. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1078. Normalmente pode-se retomar uma transferência apenas executando-se o comando
  1079. aria2c URI, caso a transferência anterior estava sendo feita pelo aria2.
  1080. Caso a transferência anterior estava sendo feita por um navegador ou wget de
  1081. maneira sequencial, então utilize a opção :option:`--continue <-c>` para
  1082. retomar do ponto onde foi interrompida a transferência.
  1083. Interação com Eventos (Hook)
  1084. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1085. aria2 possui opções para especificar comando arbitrário após um evento
  1086. específico ocorrer. Atualmente as seguintes opções estão disponíveis:
  1087. :option:`--on-bt-download-complete`,
  1088. :option:`--on-download-pause`,
  1089. :option:`--on-download-complete`.
  1090. :option:`--on-download-start`,
  1091. :option:`--on-download-error`,
  1092. :option:`--on-download-stop`.
  1093. aria2 passa 3 argumentos para um comando especificado quando este comando for
  1094. executado. Estes argumentos são: GID, o número de arquivos e o caminho dos
  1095. arquivos. Para downloads HTTP, HTTPS e FTP normalmente o número de arquivos é 1.
  1096. BitTorrent podem conter múltiplos arquivos. Se o número de arquivos é maior
  1097. que 1, o caminho do arquivo é o primeiro. Em outras palavras, este é o valor
  1098. da chave path da primeira estrutura se aquela chave for verdadeira como
  1099. resposta do método da função :func:`aria2.getFiles` RPC.
  1100. Se for necessário todos os caminhos dos arquivos, considere usar o método
  1101. JSON-RPC/XML-RPC. Lembre-se que o caminho do arquivo pode ser modificado
  1102. durante o download no HTTP por causa do redirecionamento ou Disposição do
  1103. Conteúdo do Cabeçalho.
  1104. Observemos um exemplo de como são passados argumentos para um comando:
  1105. .. code-block:: console
  1106. $ cat hook.sh
  1107. #!/bin/sh
  1108. echo "chamado com [$1] [$2] [$3]"
  1109. $ aria2c --on-download-complete hook.sh http://dobrasil.org/arquivo.iso
  1110. chamado com [1] [1] [/caminho/para/arquivo.iso]
  1111. CÓDIGO DE RETORNO ou SAÍDA
  1112. --------------------------
  1113. Como aria2 pode manipular múltiplos downloads concomitantemente, podem ser
  1114. encontrados vários erros durante uma sessão. aria2 retorna os códigos de
  1115. retorno ou saída com base no último erro encontrado.
  1116. 0
  1117. Se todos os downloads terminam com sucesso.
  1118. 1
  1119. Erro desconhecido ocorreu.
  1120. 2
  1121. Tempo transcorrido (time out).
  1122. 3
  1123. Recurso não encontrado.
  1124. 4
  1125. Se aria2 tentou um número especificado de vezes e obteve "recurso não encontrado".
  1126. Ver opção :option:`--max-file-not-found`.
  1127. 5
  1128. Se download interrompido porque a velocidade de download é muito baixa.
  1129. Ver opção :option:`--lowest-speed-limit`
  1130. 6
  1131. Erro na rede (network).
  1132. 7
  1133. Se existem downloads não concluidos. Esse erro é reportado somente se
  1134. todos os downloads foram concluídos com sucesso mas existe uma fila quando
  1135. aria2 foi interrompido por quando foi pressionado :kbd:`Ctrl-C` pelo usuário
  1136. ou enviado o sinal TERM ou INT.
  1137. 8
  1138. Se o servidor remoto não suporta retomar um download que deve ser completado.
  1139. 9
  1140. Não há espaço em disco suficiente para os downloads.
  1141. 10
  1142. Se o tamanho do pedaço (piece) foi diferente do arquivo de controle .aria2.
  1143. Ver opção :option:`--allow-piece-length-change`.
  1144. 11
  1145. Se aria2 estava fazendo o download do mesmo arquivo no momento.
  1146. 12
  1147. If aria2 estava fazendo o download do mesmo, hash do torrent, no momento.
  1148. 13
  1149. Se o arquivo já existe. Ver opção :option:`--allow-overwrite`.
  1150. 14
  1151. Se renomer o arquivo falhou. Ver opção :option:`--auto-file-renaming`.
  1152. 15
  1153. Se aria2 não pode abrir o arquivo existente.
  1154. 16
  1155. Se aria2 não pode criar novo arquivo ou truncar um arquivo já existente.
  1156. 17
  1157. Se ocorreu erro de I/O no arquivo.
  1158. 18
  1159. Se aria2 não pode criar diretório.
  1160. 19
  1161. Se resolução de nomes falhou.
  1162. 20
  1163. Se aria2 não pode passar documento Metalink.
  1164. 21
  1165. Se comando FTP falhou.
  1166. 22
  1167. Se cabeçalho de resposta HTTP está errado ou inesperado.
  1168. 23
  1169. Se muitos redirecionamentos ocorreram.
  1170. 24
  1171. Se autorização HTTP falhou.
  1172. 25
  1173. Se aria2 não pode passar arquivo bencoded file (normalmente arq. ".torrent").
  1174. 26
  1175. Se arquivo ".torrent" estava corrompido ou inexistem informações que aria2
  1176. necessita.
  1177. 27
  1178. Se URI Magnet URI está errada.
  1179. 28
  1180. Se opção está errada ou não é reconhecida ou argumento inválido de uma opção
  1181. foi informado.
  1182. 29
  1183. Se o servidor remoto não pode manusear uma requisição devido a sobrecarga
  1184. temporária ou manutenção.
  1185. 30
  1186. Se aria2 não pode passar uma requisição JSON-RPC.
  1187. .. note::
  1188. Um erro ocorrido em um download completado não será reportado como um
  1189. status de saida nem como código de retorno (exit status).
  1190. .. index:: double: Variáveis; Ambiente
  1191. VARIÁVEIS DE AMBIENTE
  1192. ---------------------
  1193. aria2 reconhece as seguintes variáveis de ambiente.
  1194. ``http_proxy [http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]``
  1195. Especifica o servidor para uso do HTTP.
  1196. Sobrepõe o valor do http-proxy do arquivo de configuração.
  1197. A opção linha de comando :option:`--http-proxy` sobrepõe este valor.
  1198. ``https_proxy [http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]``
  1199. Especifica o servidor proxy para uso do HTTPS.
  1200. Sobrepõe o valor do https-proxy do arquivo de configuração.
  1201. A opção linha de comando :option:`--https-proxy` sobrepõe este valor.
  1202. ``ftp_proxy [http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]``
  1203. Especifica o servidor proxy para uso do FTP.
  1204. Sobrepõe o valor do http-proxy do arquivo de configuração.
  1205. A opção linha de comando :option:`--ftp-proxy` sobrepõe este valor.
  1206. ``all_proxy [http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]``
  1207. Especifica o servidor proxy para uso se nenhum protocolo-específico de proxy
  1208. é informado.
  1209. Sobrepõe o valor all-proxy do arquivo de configuração.
  1210. A opção linha de comando :option:`--all-proxy` sobrepõe este valor.
  1211. .. note::
  1212. Apesar de aria2 aceitar os esquemas ``ftp://`` e ``https://`` para proxy de
  1213. URI, aria2 assume que ``http://`` é especificado e não troca o comportamento
  1214. com base no esquema especificado.
  1215. ``no_proxy [DOMÍNIO,...]``
  1216. Especifica nome de servidores, separados por vírgula, domínios e endereços
  1217. de rede com ou sem blocos CIDR para os quais não será usado proxy.
  1218. Sobrepõe o valor no-proxy do arquivo de configuração.
  1219. A opção linha de comando :option:`--no-proxy` sobrepõe este valor.
  1220. Arquivos de configuração
  1221. ------------------------
  1222. .. index:: triple: aria2.conf; arquivo; configuração
  1223. aria2.conf
  1224. ~~~~~~~~~~
  1225. Por padrão, aria2 utiliza ``$HOME/.aria2/aria2.conf`` como arquivo de
  1226. configuração. Pode ser especificado o caminho do arquivo usando-se a opção
  1227. :option:`--conf-path`. Se não desejar usar a configuração de arquivo utilize
  1228. a opção :option:`--no-conf`.
  1229. O arquivo de configuração é um arquivo texto e possui uma opção por linha.
  1230. Em cada linha, deve haver um par (nome-valor), no formato:
  1231. ``NOME=VALOR``, onde nome é o nome longo da linha de comando sem o prefixo
  1232. ``--``. Pode ser usada a mesma sintaxe da opção da linha de comando.
  1233. Linhas que começam com ``#`` são tratados como comentários::
  1234. # arquivo de simples configuração para aria2c
  1235. listen-port=60000
  1236. dht-listen-port=60000
  1237. seed-ratio=1.0
  1238. max-upload-limit=50K
  1239. ftp-pasv=true
  1240. .. note::
  1241. Informações confidenciais como usuário/senha podem ser incluídas no arquivo
  1242. de configuração, mas recomenda-se trocar os bits de seu modo de acesso
  1243. (por exemplo: ``chmod 600 aria2.conf``), dessa maneira nenhum outro usuário
  1244. consegue ver o conteúdo desse arquivo de configuração.
  1245. .. index:: triple: dht.dat; arquivo; configuração
  1246. dht.dat
  1247. ~~~~~~~
  1248. Por padrão, a tabela de rota do IPv4 DHT está em ``$HOME/.aria2/dht.dat`` e a
  1249. tabela de rota do IPv6 DHT está em ``$HOME/.aria2/dht6.dat``.
  1250. .. index:: triple: netrc; arquivo; configuração
  1251. Netrc
  1252. ~~~~~
  1253. Por padrão, o suporte a Netrc está habilitado para HTTP, HTTPS e FTP. Para
  1254. desabilitar o suporte a netrc especificar :option:`--no-netrc <-n>`. Seu
  1255. arquivo .netrc precisa ter as permissões corretas (600).
  1256. Se o nome do servidor inicia com ``.``, aria2 executa pesquisa domínio ao
  1257. invés de pesquisa exata. Isto é uma extensão de aria2. Exemplo de pesquisa
  1258. de domínio, imagine as seguinte entrada no arquivo .netrc::
  1259. machine .dobrasil.org login meuid password minhasenha
  1260. ``aria2.dobrasil.org`` pesquisa domínio ``.dobrasil.org`` e usa ``meuid`` e
  1261. ``minhasenha``.
  1262. Mais exemplos de pesquisa domínio: ``nobrasil.net`` não executa pesquisa
  1263. domínio ``.nobrasil.net``. ``dobrasil.org`` não faz pesquisa domínio ``.dobrasil.org``
  1264. pois tem maior amplitude hierárquica por causa do ponto precedente ``.``. Se
  1265. desejar utilizar ``dobrasil.org``, especificar ``dobrasil.org``.
  1266. .. index:: triple: aria2; arquivo; controle
  1267. Arquivo de Controle
  1268. ~~~~~~~~~~~~~~~~~~~
  1269. aria2 utiliza um arquivo de controle para rastrear o progresso
  1270. de um download. Este arquivo é gravado no mesmo diretório do
  1271. arquivo que está sendo baixado e possui o sufixo ``.aria2``.
  1272. Por exemplo,se está baixando arquivo.zip, então o arquivo de controle
  1273. será arquivo.zip.aria2. (Existe apenas uma exceção para essa convenção
  1274. que é quando você está baixando um multi torrent, o arquivo de controle
  1275. estará no "diretório topo" do torrent com o sufixo ``.aria2``. O nome do
  1276. "diretório topo" é o valor da chave "name" no diretório "info" do arquivo
  1277. torrent).
  1278. Normalmente um arquivo controle é apagado quando o download se completa. Se
  1279. aria2 detecta que o download não pode ser retomado (por exemplo, quando faz
  1280. download de um servidor HTTP que não suporta retomar o processamento de um
  1281. ponto mas sempre do início), o arquivo de controle não será criado.
  1282. Se você perder o arquivo de controle, não será possivel retomar o download do
  1283. ponto onde estava. Mas se há um torrent ou metalink com checksum (verificação) do
  1284. arquivo, poderá ser retomado do último ponto especificando a opção -V na linha
  1285. de comando.
  1286. .. index:: triple: aria2; arquivo; entrada
  1287. Arquivo de Entrada
  1288. ~~~~~~~~~~~~~~~~~~
  1289. O arquivo de entrada pode conter uma lista de URIs para que o aria2 efetua
  1290. download. Podem ser especificados múltiplas URIs para cada simples entidade:
  1291. separar as entidades por um caracter TAB ou espaço.
  1292. Cada linha é tratada como se fosse especificada através de um argumento da linha
  1293. de comando. Entretando estas linhas são afetadas pela opção
  1294. :option:`--force-sequential <-Z>` e pela opção :option:`--parameterized-uri <-P>`
  1295. Quando as URIs do arquivo de entrada são diretamente lidas pelo aria2, as URIs
  1296. não precisam necessáriamente estarem delimitadas por apóstrofo (``'``) nem
  1297. aspas(``"``).
  1298. Linhas que começam com ``#`` são tratadas como comentário e desprezadas.
  1299. Adicionalmente, as seguintes opções podem ser especificadas após cada linha de
  1300. URI. Estas linhas opcionais precisam iniciar com um ou mais espaços.
  1301. .. hlist::
  1302. :columns: 3
  1303. * :option:`all-proxy <--all-proxy>`
  1304. * :option:`all-proxy-passwd <--all-proxy-passwd>`
  1305. * :option:`all-proxy-user <--all-proxy-user>`
  1306. * :option:`allow-overwrite <--allow-overwrite>`
  1307. * :option:`allow-piece-length-change <--allow-piece-length-change>`
  1308. * :option:`always-resume <--always-resume>`
  1309. * :option:`async-dns <--async-dns>`
  1310. * :option:`auto-file-renaming <--auto-file-renaming>`
  1311. * :option:`bt-enable-lpd <--bt-enable-lpd>`
  1312. * :option:`bt-exclude-tracker <--bt-exclude-tracker>`
  1313. * :option:`bt-external-ip <--bt-external-ip>`
  1314. * :option:`bt-hash-check-seed <--bt-hash-check-seed>`
  1315. * :option:`bt-max-open-files <--bt-max-open-files>`
  1316. * :option:`bt-max-peers <--bt-max-peers>`
  1317. * :option:`bt-metadata-only <--bt-metadata-only>`
  1318. * :option:`bt-min-crypto-level <--bt-min-crypto-level>`
  1319. * :option:`bt-prioritize-piece <--bt-prioritize-piece>`
  1320. * :option:`bt-remove-unselected-file <--bt-remove-unselected-file>`
  1321. * :option:`bt-request-peer-speed-limit <--bt-request-peer-speed-limit>`
  1322. * :option:`bt-require-crypto <--bt-require-crypto>`
  1323. * :option:`bt-save-metadata <--bt-save-metadata>`
  1324. * :option:`bt-seed-unverified <--bt-seed-unverified>`
  1325. * :option:`bt-stop-timeout <--bt-stop-timeout>`
  1326. * :option:`bt-tracker <--bt-tracker>`
  1327. * :option:`bt-tracker-connect-timeout <--bt-tracker-connect-timeout>`
  1328. * :option:`bt-tracker-interval <--bt-tracker-interval>`
  1329. * :option:`bt-tracker-timeout <--bt-tracker-timeout>`
  1330. * :option:`check-integrity <-V>`
  1331. * :option:`checksum <--checksum>`
  1332. * :option:`conditional-get <--conditional-get>`
  1333. * :option:`connect-timeout <--connect-timeout>`
  1334. * :option:`continue <-c>`
  1335. * :option:`dir <-d>`
  1336. * :option:`dry-run <--dry-run>`
  1337. * :option:`enable-async-dns6 <--enable-async-dns6>`
  1338. * :option:`enable-http-keep-alive <--enable-http-keep-alive>`
  1339. * :option:`enable-http-pipelining <--enable-http-pipelining>`
  1340. * :option:`enable-mmap <--enable-mmap>`
  1341. * :option:`enable-peer-exchange <--enable-peer-exchange>`
  1342. * :option:`file-allocation <--file-allocation>`
  1343. * :option:`follow-metalink <--follow-metalink>`
  1344. * :option:`follow-torrent <--follow-torrent>`
  1345. * :option:`force-save <--force-save>`
  1346. * :option:`ftp-passwd <--ftp-passwd>`
  1347. * :option:`ftp-pasv <-p>`
  1348. * :option:`ftp-proxy <--ftp-proxy>`
  1349. * :option:`ftp-proxy-passwd <--ftp-proxy-passwd>`
  1350. * :option:`ftp-proxy-user <--ftp-proxy-user>`
  1351. * :option:`ftp-reuse-connection <--ftp-reuse-connection>`
  1352. * :option:`ftp-type <--ftp-type>`
  1353. * :option:`ftp-user <--ftp-user>`
  1354. * :option:`hash-check-only <--hash-check-only>`
  1355. * :option:`header <--header>`
  1356. * :option:`http-accept-gzip <--http-accept-gzip>`
  1357. * :option:`http-auth-challenge <--http-auth-challenge>`
  1358. * :option:`http-no-cache <--http-no-cache>`
  1359. * :option:`http-passwd <--http-passwd>`
  1360. * :option:`http-proxy <--http-proxy>`
  1361. * :option:`http-proxy-passwd <--http-proxy-passwd>`
  1362. * :option:`http-proxy-user <--http-proxy-user>`
  1363. * :option:`http-user <--http-user>`
  1364. * :option:`https-proxy <--https-proxy>`
  1365. * :option:`https-proxy-passwd <--https-proxy-passwd>`
  1366. * :option:`https-proxy-user <--https-proxy-user>`
  1367. * :option:`index-out <-O>`
  1368. * :option:`lowest-speed-limit <--lowest-speed-limit>`
  1369. * :option:`max-connection-per-server <-x>`
  1370. * :option:`max-download-limit <--max-download-limit>`
  1371. * :option:`max-file-not-found <--max-file-not-found>`
  1372. * :option:`max-resume-failure-tries <--max-resume-failure-tries>`
  1373. * :option:`max-tries <-m>`
  1374. * :option:`max-upload-limit <-u>`
  1375. * :option:`metalink-base-uri <--metalink-base-uri>`
  1376. * :option:`metalink-enable-unique-protocol <--metalink-enable-unique-protocol>`
  1377. * :option:`metalink-language <--metalink-language>`
  1378. * :option:`metalink-location <--metalink-location>`
  1379. * :option:`metalink-os <--metalink-os>`
  1380. * :option:`metalink-preferred-protocol <--metalink-preferred-protocol>`
  1381. * :option:`metalink-version <--metalink-version>`
  1382. * :option:`min-split-size <-k>`
  1383. * :option:`no-file-allocation-limit <--no-file-allocation-limit>`
  1384. * :option:`no-netrc <-n>`
  1385. * :option:`no-proxy <--no-proxy>`
  1386. * :option:`out <-o>`
  1387. * :option:`parameterized-uri <-P>`
  1388. * :option:`pause <--pause>`
  1389. * :option:`piece-length <--piece-length>`
  1390. * :option:`proxy-method <--proxy-method>`
  1391. * :option:`realtime-chunk-checksum <--realtime-chunk-checksum>`
  1392. * :option:`referer <--referer>`
  1393. * :option:`remote-time <-R>`
  1394. * :option:`remove-control-file <--remove-control-file>`
  1395. * :option:`retry-wait <--retry-wait>`
  1396. * :option:`reuse-uri <--reuse-uri>`
  1397. * :option:`rpc-save-upload-metadata <--rpc-save-upload-metadata>`
  1398. * :option:`seed-ratio <--seed-ratio>`
  1399. * :option:`seed-time <--seed-time>`
  1400. * :option:`select-file <--select-file>`
  1401. * :option:`split <-s>`
  1402. * :option:`stream-piece-selector <--stream-piece-selector>`
  1403. * :option:`timeout <-t>`
  1404. * :option:`uri-selector <--uri-selector>`
  1405. * :option:`use-head <--use-head>`
  1406. * :option:`user-agent <-U>`
  1407. Estas opções possuem exatamente o mesmo significado das opções existentes na
  1408. linha de comando, mas aplicam-se apenas a URI a que pertencem.
  1409. Por favor perceba que dentro de um arquivo, elas não terão o prefixo ``--``.
  1410. Por exemplo, o conteúdo do arquivo de entrada uri.txt é::
  1411. http://servidor/arquivo.iso http://espelho/arquivo.iso
  1412. dir=/imagens_iso
  1413. out=arquivo.img
  1414. http://fu/ba
  1415. Se aria2 é executado com as opções ``-i uri.txt -d /tmp``, então o
  1416. ``arquivo.iso`` será salvo como ``/imagens_iso/arquivo.img`` e será baixado
  1417. dos servidores ``http://servidor/arquivo.iso`` e
  1418. ``http://espelho/arquivo.iso``.
  1419. O arquivo ``ba`` e baixado de ``http://fu/ba`` e salvo como ``/tmp/ba``.
  1420. Em alguns casos, o parâmetro :option:`out <-o>` não tem efeito.
  1421. Ver nota da opção :option:`--out <-o>` para entender as restrições.
  1422. .. index:: triple: Servidor; performance; Perfil;
  1423. Perfil Performance Servidor
  1424. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1425. Esta seção descreve o formato do perfil de performance do servidor, composto
  1426. por um arquivo de texto plano com cada linha contendo um par ``NOME=VALOR``,
  1427. delimitados por virgula. Atualmente esta é a lista de nomes reconhecidos:
  1428. ``host``
  1429. Nome do servidor. Requerido.
  1430. ``protocol``
  1431. Protocolo para este perfil, como ftp, http, https. http é requerido.
  1432. ``dl_speed``
  1433. Velocidade média de download observada no download prévio, em bytes por
  1434. segundo. Requerido.
  1435. ``sc_avg_speed``
  1436. The average download speed observed in the previous download in
  1437. bytes per sec. This value is only updated if the download is done in
  1438. single connection environment and only used by
  1439. AdaptiveURISelector. Optional.
  1440. ``mc_avg_speed``
  1441. The average download speed observed in the previous download in
  1442. bytes per sec. This value is only updated if the download is done in
  1443. multi connection environment and only used by
  1444. AdaptiveURISelector. Optional.
  1445. ``counter``
  1446. How many times the server is used. Currently this value is only used
  1447. by AdaptiveURISelector. Optional.
  1448. ``last_updated``
  1449. Last contact time in GMT with this server, specified in the seconds
  1450. since the Epoch(00:00:00 on January 1, 1970, UTC). Required.
  1451. ``status``
  1452. ERROR is set when server cannot be reached or out-of-service or
  1453. timeout occurred. Otherwise, OK is set.
  1454. Estes campos devem existir em uma linha. A ordem dos campos não importa.
  1455. Podem ser colocados pares; eles serão simplesmente ignorados.
  1456. Um exemplo abaixo::
  1457. host=localhost, protocol=http, dl_speed=32000, last_updated=1222491640,
  1458. status=OK
  1459. host=localhost, protocol=ftp, dl_speed=0, last_updated=1222491632,
  1460. status=ERROR
  1461. .. index:: double: interface; rpc;
  1462. INTERFACE RPC
  1463. -------------
  1464. aria2 provê o serviço JSON-RPC sobre HTTP e XML-RPC sobre HTTP e eles
  1465. basicamente possuem a mesma funcionalidade. aria2 também provê JSON-RPC
  1466. sobre WebSocket que utiliza o mesmo formato, do método e assinatura e
  1467. de resposta do formato JSON-RPC sobre HTTP, mas adicionalmente possui
  1468. notificações iniciadas pelo servidor.
  1469. Ver detalhes na seção `JSON-RPC sobre WebSocket`_ .
  1470. O caminho requisitado do interface JSON-RPC (sobre HTTP e sobre
  1471. WebSocket) é ``/jsonrpc``. O caminho requisitado do interface XML-RPC é
  1472. ``/rpc``.
  1473. A URI WebSocket para JSON-RPC sobre WebSocket é ``ws://HOST:PORT/jsonrpc``.
  1474. A implementação JSON-RPC é baseada na especificação
  1475. ``JSON-RPC 2.0 <http://jsonrpc.org/specification>`` e suporta
  1476. HTTP POST e GET (JSONP). Usando WebSocket como transporte, é uma extensão
  1477. original do aria2.
  1478. A interface JSON-RPC não suporta notificação em HTTP, mas o servidor RPC irá
  1479. enviar a notificação no WebSocket. Não é suportado número de ponto flutuante
  1480. O codificação de página deve ser UTF-8.
  1481. Quanto a seguinte documentação do JSON-RPC, entenda estrutura JSON como objeto.
  1482. .. index:: single: terminologia
  1483. Terminologia
  1484. ~~~~~~~~~~~~
  1485. GID
  1486. GID(or gid) é a chave para gerenciar cada download. Cada download tem um
  1487. único GID. Atualmente GID é armazenado em 64 bits como dado binário no
  1488. aria2. Para acesso RPG, isso é representado em uma string hexadecimal
  1489. de 16 caracteres (exemplo: ``2089b05ecca3d829``). Normalmente, aria2
  1490. gera esse GID para cada download, mas o usuário pode especificar
  1491. o GID manualmente usando a opção :option:`--gid <--gid>`. Quando
  1492. consultando um download por GID, pode ser especificado o prefixo
  1493. do GID como um prefixo único e exclusivo entre outros.
  1494. .. index:: double: exemplos; métodos
  1495. Métodos
  1496. ~~~~~~~
  1497. São descritos em torno de 35 exemplos, os quais serão numerados
  1498. utilizando código fonte com exemplos que usam a linguagem
  1499. Python versão 2.7.
  1500. .. index:: triple: exemplo; json-rpc; xml-rpc;
  1501. .. function:: aria2.addUri(uris[, options[, position]])
  1502. This method adds new HTTP(S)/FTP/BitTorrent Magnet URI. *uris* is of
  1503. type array and its element is URI which is of type string. For
  1504. BitTorrent Magnet URI, *uris* must have only one element and it should
  1505. be BitTorrent Magnet URI. URIs in *uris* must point to the same file.
  1506. If you mix other URIs which point to another file, aria2 does not
  1507. complain but download may fail. *options* is of type struct and its
  1508. members are a pair of option name and value. See :ref:`rpc_options` below for
  1509. more details. If *position* is given as an integer starting from 0,
  1510. the new download is inserted at *position* in the waiting queue. If
  1511. *position* is not given or *position* is larger than the size of the
  1512. queue, it is appended at the end of the queue. This method returns
  1513. GID of registered download.
  1514. **JSON-RPC EXEMPLO M010**
  1515. The following example adds ``http://example.org/file``::
  1516. >>> import urllib2, json
  1517. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1518. ... 'method':'aria2.addUri',
  1519. ... 'params':[['http://example.org/file']]})
  1520. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1521. >>> c.read()
  1522. '{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}'
  1523. **XML-RPC EXEMPLO M020**
  1524. The following example adds ``http://example.org/file``::
  1525. >>> import xmlrpclib
  1526. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1527. >>> s.aria2.addUri(['http://example.org/file'])
  1528. '2089b05ecca3d829'
  1529. The following example adds 2 sources and some options::
  1530. >>> s.aria2.addUri(['http://example.org/file', 'http://mirror/file'],
  1531. dict(dir="/tmp"))
  1532. 'd2703803b52216d1'
  1533. The following example adds a download and insert it to the front of
  1534. waiting downloads::
  1535. >>> s.aria2.addUri(['http://example.org/file'], {}, 0)
  1536. 'ca3d829cee549a4d'
  1537. .. function:: aria2.addTorrent(torrent[, uris[, options[, position]]])
  1538. This method adds BitTorrent download by uploading ".torrent" file.
  1539. If you want to add BitTorrent Magnet URI, use :func:`aria2.addUri`
  1540. method instead. *torrent* is of type base64 which contains
  1541. Base64-encoded ".torrent" file. *uris* is of type array and its
  1542. element is URI which is of type string. *uris* is used for
  1543. Web-seeding. For single file torrents, URI can be a complete URI
  1544. pointing to the resource or if URI ends with /, name in torrent file
  1545. is added. For multi-file torrents, name and path in torrent are
  1546. added to form a URI for each file. *options* is of type struct and
  1547. its members are a pair of option name and value. See
  1548. :ref:`rpc_options` below for more details. If *position* is given
  1549. as an integer starting from 0, the new download is inserted at
  1550. *position* in the waiting queue. If *position* is not given or
  1551. *position* is larger than the size of the queue, it is appended at
  1552. the end of the queue. This method returns GID of registered
  1553. download. If :option:`--rpc-save-upload-metadata` is ``true``, the
  1554. uploaded data is saved as a file named hex string of SHA-1 hash of
  1555. data plus ".torrent" in the directory specified by :option:`--dir
  1556. <-d>` option. The example of filename is
  1557. ``0a3893293e27ac0490424c06de4d09242215f0a6.torrent``. If same file
  1558. already exists, it is overwritten. If the file cannot be saved
  1559. successfully or :option:`--rpc-save-upload-metadata` is ``false``,
  1560. the downloads added by this method are not saved by
  1561. :option:`--save-session`.
  1562. The following examples add local file ``file.torrent``.
  1563. **JSON-RPC EXEMPLO M030**
  1564. ::
  1565. >>> import urllib2, json, base64
  1566. >>> torrent = base64.b64encode(open('file.torrent').read())
  1567. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'asdf',
  1568. ... 'method':'aria2.addTorrent', 'params':[torrent]})
  1569. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1570. >>> c.read()
  1571. '{"id":"asdf","jsonrpc":"2.0","result":"2089b05ecca3d829"}'
  1572. **XML-RPC EXEMPLO M040**
  1573. ::
  1574. >>> import xmlrpclib
  1575. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1576. >>> s.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent').read()))
  1577. '2089b05ecca3d829'
  1578. .. function:: aria2.addMetalink(metalink[, options[, position]])
  1579. This method adds Metalink download by uploading ".metalink" file.
  1580. *metalink* is of type base64 which contains Base64-encoded
  1581. ".metalink" file. *options* is of type struct and its members are a
  1582. pair of option name and value. See :ref:`rpc_options` below for more
  1583. details. If *position* is given as an integer starting from 0, the
  1584. new download is inserted at *position* in the waiting queue. If
  1585. *position* is not given or *position* is larger than the size of the
  1586. queue, it is appended at the end of the queue. This method returns
  1587. array of GID of registered download. If
  1588. :option:`--rpc-save-upload-metadata` is ``true``, the uploaded data
  1589. is saved as a file named hex string of SHA-1 hash of data plus
  1590. ".metalink" in the directory specified by :option:`--dir <-d>`
  1591. option. The example of filename is
  1592. ``0a3893293e27ac0490424c06de4d09242215f0a6.metalink``. If same file
  1593. already exists, it is overwritten. If the file cannot be saved
  1594. successfully or :option:`--rpc-save-upload-metadata` is ``false``,
  1595. the downloads added by this method are not saved by
  1596. :option:`--save-session`.
  1597. The following examples add local file file.meta4.
  1598. **JSON-RPC EXEMPLO M050**
  1599. ::
  1600. >>> import urllib2, json, base64
  1601. >>> metalink = base64.b64encode(open('file.meta4').read())
  1602. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1603. ... 'method':'aria2.addMetalink',
  1604. ... 'params':[metalink]})
  1605. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1606. >>> c.read()
  1607. '{"id":"qwer","jsonrpc":"2.0","result":["2089b05ecca3d829"]}'
  1608. **XML-RPC EXEMPLO M060**
  1609. ::
  1610. >>> import xmlrpclib
  1611. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1612. >>> s.aria2.addMetalink(xmlrpclib.Binary(open('file.meta4').read()))
  1613. ['2089b05ecca3d829']
  1614. .. function:: aria2.remove(gid)
  1615. This method removes the download denoted by *gid*. *gid* is of type
  1616. string. If specified download is in progress, it is stopped at
  1617. first. The status of removed download becomes ``removed``. This method
  1618. returns GID of removed download.
  1619. The following examples remove download GID#2089b05ecca3d829.
  1620. **JSON-RPC EXEMPLO M070**
  1621. ::
  1622. >>> import urllib2, json
  1623. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1624. ... 'method':'aria2.remove',
  1625. ... 'params':['2089b05ecca3d829']})
  1626. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1627. >>> c.read()
  1628. '{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}'
  1629. **XML-RPC EXEMPLO M080**
  1630. ::
  1631. >>> import xmlrpclib
  1632. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1633. >>> s.aria2.remove('2089b05ecca3d829')
  1634. '2089b05ecca3d829'
  1635. .. function:: aria2.forceRemove(gid)
  1636. This method removes the download denoted by *gid*. This method
  1637. behaves just like :func:`aria2.remove` except that this method removes
  1638. download without any action which takes time such as contacting
  1639. BitTorrent tracker.
  1640. .. function:: aria2.pause(gid)
  1641. This method pauses the download denoted by *gid*. *gid* is of type
  1642. string. The status of paused download becomes ``paused``. If the
  1643. download is active, the download is placed on the first position of
  1644. waiting queue. As long as the status is ``paused``, the download is not
  1645. started. To change status to ``waiting``, use :func:`aria2.unpause` method.
  1646. This method returns GID of paused download.
  1647. .. function:: aria2.pauseAll()
  1648. This method is equal to calling :func:`aria2.pause` for every active/waiting
  1649. download. This methods returns ``OK`` for success.
  1650. .. function:: aria2.forcePause(pid)
  1651. This method pauses the download denoted by *gid*. This method
  1652. behaves just like :func:`aria2.pause` except that this method pauses
  1653. download without any action which takes time such as contacting
  1654. BitTorrent tracker.
  1655. .. function:: aria2.forcePauseAll()
  1656. This method is equal to calling :func:`aria2.forcePause` for every
  1657. active/waiting download. This methods returns ``OK`` for success.
  1658. .. function:: aria2.unpause(gid)
  1659. This method changes the status of the download denoted by *gid* from
  1660. ``paused`` to ``waiting``. This makes the download eligible to restart.
  1661. *gid* is of type string. This method returns GID of unpaused
  1662. download.
  1663. .. function:: aria2.unpauseAll()
  1664. This method is equal to calling :func:`aria2.unpause` for every active/waiting
  1665. download. This methods returns ``OK`` for success.
  1666. .. function:: aria2.tellStatus(gid[, keys])
  1667. This method returns download progress of the download denoted by
  1668. *gid*. *gid* is of type string. *keys* is array of string. If it is
  1669. specified, the response contains only keys in *keys* array. If *keys*
  1670. is empty or not specified, the response contains all keys. This is
  1671. useful when you just want specific keys and avoid unnecessary
  1672. transfers. For example, ``aria2.tellStatus("2089b05ecca3d829", ["gid", "status"])``
  1673. returns *gid* and 'status' key. The response is of type struct and it
  1674. contains following keys. The value type is string.
  1675. ``gid``
  1676. GID of this download.
  1677. ``status``
  1678. ``active`` for currently downloading/seeding entry. ``waiting`` for the
  1679. entry in the queue; download is not started. ``paused`` for the
  1680. paused entry. ``error`` for the stopped download because of
  1681. error. ``complete`` for the stopped and completed download. ``removed``
  1682. for the download removed by user.
  1683. ``totalLength``
  1684. Total length of this download in bytes.
  1685. ``completedLength``
  1686. Completed length of this download in bytes.
  1687. ``uploadLength``
  1688. Uploaded length of this download in bytes.
  1689. ``bitfield``
  1690. Hexadecimal representation of the download progress. The highest bit
  1691. corresponds to piece index 0. The set bits indicate the piece is
  1692. available and unset bits indicate the piece is missing. The spare
  1693. bits at the end are set to zero. When download has not started yet,
  1694. this key will not be included in the response.
  1695. ``downloadSpeed``
  1696. Download speed of this download measured in bytes/sec.
  1697. ``uploadSpeed``
  1698. Upload speed of this download measured in bytes/sec.
  1699. ``infoHash``
  1700. InfoHash. BitTorrent only.
  1701. ``numSeeders``
  1702. The number of seeders the client has connected to. BitTorrent only.
  1703. ``pieceLength``
  1704. Piece length in bytes.
  1705. ``numPieces``
  1706. The number of pieces.
  1707. ``connections``
  1708. The number of peers/servers the client has connected to.
  1709. ``errorCode``
  1710. The last error code occurred in this download. The value is of type
  1711. string. The error codes are defined in `CÓDIGO DE RETORNO ou SAÍDA`_
  1712. section. This value is only available for stopped/completed downloads.
  1713. ``followedBy``
  1714. List of GIDs which are generated by the consequence of this
  1715. download. For example, when aria2 downloaded Metalink file, it
  1716. generates downloads described in it(see :option:`--follow-metalink`
  1717. option). This value is useful to track these auto generated
  1718. downloads. If there is no such downloads, this key will not
  1719. be included in the response.
  1720. ``belongsTo``
  1721. GID of a parent download. Some downloads are a part of another
  1722. download. For example, if a file in Metalink has BitTorrent
  1723. resource, the download of ".torrent" is a part of that file. If this
  1724. download has no parent, this key will not be included in the
  1725. response.
  1726. ``dir``
  1727. Directory to save files. This key is not available for stopped
  1728. downloads.
  1729. ``files``
  1730. Returns the list of files. The element of list is the same struct
  1731. used in :func:`aria2.getFiles` method.
  1732. ``bittorrent``
  1733. Struct which contains information retrieved from .torrent
  1734. file. BitTorrent only. It contains following keys.
  1735. ``announceList``
  1736. List of lists of announce URI. If ".torrent" file contains announce
  1737. and no announce-list, announce is converted to announce-list
  1738. format.
  1739. ``comment``
  1740. The comment for the torrent. ``comment.utf-8`` is used if available.
  1741. ``creationDate``
  1742. The creation time of the torrent. The value is an integer since
  1743. the Epoch, measured in seconds.
  1744. ``mode``
  1745. File mode of the torrent. The value is either ``single`` or ``multi``.
  1746. ``info``
  1747. Struct which contains data from Info dictionary. It contains
  1748. following keys.
  1749. ``name``
  1750. name in info dictionary. ``name.utf-8`` is used if available.
  1751. **JSON-RPC EXEMPLO M090**
  1752. The following example gets information about download GID#2089b05ecca3d829::
  1753. >>> import urllib2, json
  1754. >>> from pprint import pprint
  1755. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1756. ... 'method':'aria2.tellStatus',
  1757. ... 'params':['2089b05ecca3d829']})
  1758. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1759. >>> pprint(json.loads(c.read()))
  1760. {u'id': u'qwer',
  1761. u'jsonrpc': u'2.0',
  1762. u'result': {u'bitfield': u'0000000000',
  1763. u'completedLength': u'901120',
  1764. u'connections': u'1',
  1765. u'dir': u'/downloads',
  1766. u'downloadSpeed': u'15158',
  1767. u'files': [{u'index': u'1',
  1768. u'length': u'34896138',
  1769. u'completedLength': u'34896138',
  1770. u'path': u'/downloads/file',
  1771. u'selected': u'true',
  1772. u'uris': [{u'status': u'used',
  1773. u'uri': u'http://example.org/file'}]}],
  1774. u'gid': u'2089b05ecca3d829',
  1775. u'numPieces': u'34',
  1776. u'pieceLength': u'1048576',
  1777. u'status': u'active',
  1778. u'totalLength': u'34896138',
  1779. u'uploadLength': u'0',
  1780. u'uploadSpeed': u'0'}}
  1781. The following example gets information specifying keys you are
  1782. interested in::
  1783. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1784. ... 'method':'aria2.tellStatus',
  1785. ... 'params':['2089b05ecca3d829',
  1786. ... ['gid',
  1787. ... 'totalLength',
  1788. ... 'completedLength']]})
  1789. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1790. >>> pprint(json.loads(c.read()))
  1791. {u'id': u'qwer',
  1792. u'jsonrpc': u'2.0',
  1793. u'result': {u'completedLength': u'5701632',
  1794. u'gid': u'2089b05ecca3d829',
  1795. u'totalLength': u'34896138'}}
  1796. **XML-RPC EXEMPLO M100**
  1797. The following example gets information about download GID#2089b05ecca3d829::
  1798. >>> import xmlrpclib
  1799. >>> from pprint import pprint
  1800. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1801. >>> r = s.aria2.tellStatus('2089b05ecca3d829')
  1802. >>> pprint(r)
  1803. {'bitfield': 'ffff80',
  1804. 'completedLength': '34896138',
  1805. 'connections': '0',
  1806. 'dir': '/downloads',
  1807. 'downloadSpeed': '0',
  1808. 'errorCode': '0',
  1809. 'files': [{'index': '1',
  1810. 'length': '34896138',
  1811. 'completedLength': '34896138',
  1812. 'path': '/downloads/file',
  1813. 'selected': 'true',
  1814. 'uris': [{'status': 'used',
  1815. 'uri': 'http://example.org/file'}]}],
  1816. 'gid': '2089b05ecca3d829',
  1817. 'numPieces': '17',
  1818. 'pieceLength': '2097152',
  1819. 'status': 'complete',
  1820. 'totalLength': '34896138',
  1821. 'uploadLength': '0',
  1822. 'uploadSpeed': '0'}
  1823. The following example gets information specifying keys you are
  1824. interested in::
  1825. >>> r = s.aria2.tellStatus('2089b05ecca3d829', ['gid', 'totalLength', 'completedLength'])
  1826. >>> pprint(r)
  1827. {'completedLength': '34896138', 'gid': '2089b05ecca3d829', 'totalLength': '34896138'}
  1828. .. function:: aria2.getUris(gid)
  1829. This method returns URIs used in the download denoted by *gid*. *gid*
  1830. is of type string. The response is of type array and its element is of
  1831. type struct and it contains following keys. The value type is string.
  1832. ``uri``
  1833. URI
  1834. ``status``
  1835. 'used' if the URI is already used. 'waiting' if the URI is waiting
  1836. in the queue.
  1837. **JSON-RPC EXEMPLO M110**
  1838. ::
  1839. >>> import urllib2, json
  1840. >>> from pprint import pprint
  1841. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1842. ... 'method':'aria2.getUris',
  1843. ... 'params':['2089b05ecca3d829']})
  1844. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1845. >>> pprint(json.loads(c.read()))
  1846. {u'id': u'qwer',
  1847. u'jsonrpc': u'2.0',
  1848. u'result': [{u'status': u'used',
  1849. u'uri': u'http://example.org/file'}]}
  1850. **XML-RPC EXEMPLO M120**
  1851. ::
  1852. >>> import xmlrpclib
  1853. >>> from pprint import pprint
  1854. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1855. >>> r = s.aria2.getUris('2089b05ecca3d829')
  1856. >>> pprint(r)
  1857. [{'status': 'used', 'uri': 'http://example.org/file'}]
  1858. .. function:: aria2.getFiles(gid)
  1859. This method returns file list of the download denoted by *gid*. *gid*
  1860. is of type string. The response is of type array and its element is of
  1861. type struct and it contains following keys. The value type is string.
  1862. ``index``
  1863. Index of file. Starting with 1. This is the same order with the
  1864. files in multi-file torrent.
  1865. ``path``
  1866. File path.
  1867. ``length``
  1868. File size in bytes.
  1869. ``completedLength``
  1870. Completed length of this file in bytes. Please note that it is
  1871. possible that sum of completedLength is less than completedLength in
  1872. :func:`aria2.tellStatus` method.
  1873. This is because completedLength in
  1874. :func:`aria2.getFiles`
  1875. only calculates completed pieces. On the other hand, completedLength
  1876. in
  1877. :func:`aria2.tellStatus` takes into account
  1878. of partially completed piece.
  1879. ``selected``
  1880. ``true`` if this file is selected by :option:`--select-file` option. If
  1881. :option:`--select-file` is not specified or this is single torrent or no
  1882. torrent download, this value is always ``true``. Otherwise ``false``.
  1883. ``uris``
  1884. Returns the list of URI for this file. The element of list is the
  1885. same struct used in :func:`aria2.getUris` method.
  1886. **JSON-RPC EXEMPLO M130**
  1887. ::
  1888. >>> import urllib2, json
  1889. >>> from pprint import pprint
  1890. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1891. ... 'method':'aria2.getFiles',
  1892. ... 'params':['2089b05ecca3d829']})
  1893. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1894. >>> pprint(json.loads(c.read()))
  1895. {u'id': u'qwer',
  1896. u'jsonrpc': u'2.0',
  1897. u'result': [{u'index': u'1',
  1898. u'length': u'34896138',
  1899. u'completedLength': u'34896138',
  1900. u'path': u'/downloads/file',
  1901. u'selected': u'true',
  1902. u'uris': [{u'status': u'used',
  1903. u'uri': u'http://example.org/file'}]}]}
  1904. **XML-RPC EXEMPLO M140**
  1905. ::
  1906. >>> import xmlrpclib
  1907. >>> from pprint import pprint
  1908. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1909. >>> r = s.aria2.getFiles('2089b05ecca3d829')
  1910. >>> pprint(r)
  1911. [{'index': '1',
  1912. 'length': '34896138',
  1913. 'completedLength': '34896138',
  1914. 'path': '/downloads/file',
  1915. 'selected': 'true',
  1916. 'uris': [{'status': 'used',
  1917. 'uri': 'http://example.org/file'}]}]
  1918. .. function:: aria2.getPeers(gid)
  1919. This method returns peer list of the download denoted by *gid*. *gid*
  1920. is of type string. This method is for BitTorrent only. The response
  1921. is of type array and its element is of type struct and it contains
  1922. following keys. The value type is string.
  1923. ``peerId``
  1924. Percent-encoded peer ID.
  1925. ``ip``
  1926. IP address of the peer.
  1927. ``port``
  1928. Port number of the peer.
  1929. ``bitfield``
  1930. Hexadecimal representation of the download progress of the peer. The
  1931. highest bit corresponds to piece index 0. The set bits indicate the
  1932. piece is available and unset bits indicate the piece is missing. The
  1933. spare bits at the end are set to zero.
  1934. ``amChoking``
  1935. ``true`` if this client is choking the peer. Otherwise ``false``.
  1936. ``peerChoking``
  1937. ``true`` if the peer is choking this client. Otherwise ``false``.
  1938. ``downloadSpeed``
  1939. Download speed (byte/sec) that this client obtains from the peer.
  1940. ``uploadSpeed``
  1941. Upload speed(byte/sec) that this client uploads to the peer.
  1942. ``seeder``
  1943. ``true`` is this client is a seeder. Otherwise ``false``.
  1944. **JSON-RPC EXEMPLO M150**
  1945. ::
  1946. >>> import urllib2, json
  1947. >>> from pprint import pprint
  1948. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  1949. ... 'method':'aria2.getPeers',
  1950. ... 'params':['2089b05ecca3d829']})
  1951. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  1952. >>> pprint(json.loads(c.read()))
  1953. {u'id': u'qwer',
  1954. u'jsonrpc': u'2.0',
  1955. u'result': [{u'amChoking': u'true',
  1956. u'bitfield': u'ffffffffffffffffffffffffffffffffffffffff',
  1957. u'downloadSpeed': u'10602',
  1958. u'ip': u'10.0.0.9',
  1959. u'peerChoking': u'false',
  1960. u'peerId': u'aria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6',
  1961. u'port': u'6881',
  1962. u'seeder': u'true',
  1963. u'uploadSpeed': u'0'},
  1964. {u'amChoking': u'false',
  1965. u'bitfield': u'ffffeff0fffffffbfffffff9fffffcfff7f4ffff',
  1966. u'downloadSpeed': u'8654',
  1967. u'ip': u'10.0.0.30',
  1968. u'peerChoking': u'false',
  1969. u'peerId': u'bittorrent client758',
  1970. u'port': u'37842',
  1971. u'seeder': u'false',
  1972. u'uploadSpeed': u'6890'}]}
  1973. **XML-RPC EXEMPLO M160**
  1974. ::
  1975. >>> import xmlrpclib
  1976. >>> from pprint import pprint
  1977. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  1978. >>> r = s.aria2.getPeers('2089b05ecca3d829')
  1979. >>> pprint(r)
  1980. [{'amChoking': 'true',
  1981. 'bitfield': 'ffffffffffffffffffffffffffffffffffffffff',
  1982. 'downloadSpeed': '10602',
  1983. 'ip': '10.0.0.9',
  1984. 'peerChoking': 'false',
  1985. 'peerId': 'aria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6',
  1986. 'port': '6881',
  1987. 'seeder': 'true',
  1988. 'uploadSpeed': '0'},
  1989. {'amChoking': 'false',
  1990. 'bitfield': 'ffffeff0fffffffbfffffff9fffffcfff7f4ffff',
  1991. 'downloadSpeed': '8654',
  1992. 'ip': '10.0.0.30',
  1993. 'peerChoking': 'false',
  1994. 'peerId': 'bittorrent client758',
  1995. 'port': '37842',
  1996. 'seeder': 'false,
  1997. 'uploadSpeed': '6890'}]
  1998. .. function:: aria2.getServers(gid)
  1999. This method returns currently connected HTTP, HTTPS, FTP servers of the
  2000. download denoted by *gid*. *gid* is of type string. The response
  2001. is of type array and its element is of type struct and it contains
  2002. following keys. The value type is string.
  2003. ``index``
  2004. Index of file. Starting with 1. This is the same order with the
  2005. files in multi-file torrent.
  2006. ``servers``
  2007. The list of struct which contains following keys.
  2008. ``uri``
  2009. URI originally added.
  2010. ``currentUri``
  2011. This is the URI currently used for downloading. If redirection is
  2012. involved, currentUri and uri may differ.
  2013. ``downloadSpeed``
  2014. Download speed (byte/sec)
  2015. **JSON-RPC EXEMPLO M170**
  2016. ::
  2017. >>> import urllib2, json
  2018. >>> from pprint import pprint
  2019. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2020. ... 'method':'aria2.getServers',
  2021. ... 'params':['2089b05ecca3d829']})
  2022. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2023. >>> pprint(json.loads(c.read()))
  2024. {u'id': u'qwer',
  2025. u'jsonrpc': u'2.0',
  2026. u'result': [{u'index': u'1',
  2027. u'servers': [{u'currentUri': u'http://example.org/file',
  2028. u'downloadSpeed': u'10467',
  2029. u'uri': u'http://example.org/file'}]}]}
  2030. **XML-RPC EXEMPLO M180**
  2031. ::
  2032. >>> import xmlrpclib
  2033. >>> from pprint import pprint
  2034. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2035. >>> r = s.aria2.getServers('2089b05ecca3d829')
  2036. >>> pprint(r)
  2037. [{'index': '1',
  2038. 'servers': [{'currentUri': 'http://example.org/dl/file',
  2039. 'downloadSpeed': '20285',
  2040. 'uri': 'http://example.org/file'}]}]
  2041. .. function:: aria2.tellActive([keys])
  2042. This method returns the list of active downloads. The response is of
  2043. type array and its element is the same struct returned by
  2044. :func:`aria2.tellStatus` method. For *keys* parameter, please refer to
  2045. :func:`aria2.tellStatus` method.
  2046. .. function:: aria2.tellWaiting(offset, num, [keys])
  2047. This method returns the list of waiting download, including paused
  2048. downloads. *offset* is of type integer and specifies the offset from
  2049. the download waiting at the front. *num* is of type integer and
  2050. specifies the number of downloads to be returned. For *keys*
  2051. parameter, please refer to :func:`aria2.tellStatus` method.
  2052. If *offset* is a positive integer, this method returns downloads in the
  2053. range of [*offset*, *offset* + *num*).
  2054. *offset* can be a negative integer. *offset* == -1 points last
  2055. download in the waiting queue and *offset* == -2 points the download
  2056. before the last download, and so on. The downloads in the response are
  2057. in reversed order.
  2058. For example, imagine that three downloads "A","B" and "C" are waiting
  2059. in this order. ``aria2.tellWaiting(0, 1)`` returns
  2060. ``["A"]``. ``aria2.tellWaiting(1, 2)`` returns ``["B", "C"]``.
  2061. ``aria2.tellWaiting(-1, 2)`` returns ``["C", "B"]``.
  2062. The response is of type array and its element is the same struct
  2063. returned by :func:`aria2.tellStatus` method.
  2064. .. function:: aria2.tellStopped(offset, num, [keys])
  2065. This method returns the list of stopped download. *offset* is of type
  2066. integer and specifies the offset from the oldest download. *num* is of
  2067. type integer and specifies the number of downloads to be returned.
  2068. For *keys* parameter, please refer to :func:`aria2.tellStatus` method.
  2069. *offset* and *num* have the same semantics as :func:`aria2.tellWaiting`
  2070. method.
  2071. The response is of type array and its element is the same struct
  2072. returned by :func:`aria2.tellStatus` method.
  2073. .. function:: aria2.changePosition(gid, pos, how)
  2074. This method changes the position of the download denoted by
  2075. *gid*. *pos* is of type integer. *how* is of type string. If *how* is
  2076. ``POS_SET``, it moves the download to a position relative to the
  2077. beginning of the queue. If *how* is ``POS_CUR``, it moves the download
  2078. to a position relative to the current position. If *how* is ``POS_END``,
  2079. it moves the download to a position relative to the end of the
  2080. queue. If the destination position is less than 0 or beyond the end of
  2081. the queue, it moves the download to the beginning or the end of the
  2082. queue respectively. The response is of type integer and it is the
  2083. destination position.
  2084. For example, if GID#2089b05ecca3d829 is placed in position 3,
  2085. ``aria2.changePosition('2089b05ecca3d829', -1, 'POS_CUR')`` will
  2086. change its position to 2. Additional
  2087. ``aria2.changePosition('2089b05ecca3d829', 0, 'POS_SET')`` will
  2088. change its position to 0(the beginning of the queue).
  2089. The following examples move the download GID#2089b05ecca3d829 to the
  2090. front of the waiting queue.
  2091. **JSON-RPC EXEMPLO M190**
  2092. ::
  2093. >>> import urllib2, json
  2094. >>> from pprint import pprint
  2095. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2096. ... 'method':'aria2.changePosition',
  2097. ... 'params':['2089b05ecca3d829', 0, 'POS_SET']})
  2098. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2099. >>> pprint(json.loads(c.read()))
  2100. {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': 0}
  2101. **XML-RPC EXEMPLO M200**
  2102. ::
  2103. >>> import xmlrpclib
  2104. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2105. >>> s.aria2.changePosition('2089b05ecca3d829', 0, 'POS_SET')
  2106. 0
  2107. .. index:: triple: exemplo; json-rpc; xml-rpc;
  2108. double: python; proxy-server;
  2109. .. function:: aria2.changeUri(gid, fileIndex, delUris, addUris[, position])
  2110. This method removes URIs in *delUris* from and appends URIs in
  2111. *addUris* to download denoted by *gid*. *delUris* and *addUris* are
  2112. list of string. A download can contain multiple files and URIs are
  2113. attached to each file. *fileIndex* is used to select which file to
  2114. remove/attach given URIs. *fileIndex* is 1-based. *position* is used
  2115. to specify where URIs are inserted in the existing waiting URI
  2116. list. *position* is 0-based. When *position* is omitted, URIs are
  2117. appended to the back of the list. This method first execute removal
  2118. and then addition. *position* is the position after URIs are removed,
  2119. not the position when this method is called. When removing URI, if
  2120. same URIs exist in download, only one of them is removed for each URI
  2121. in *delUris*. In other words, there are three URIs
  2122. ``http://example.org/aria2`` and you want remove them all, you have to
  2123. specify (at least) 3 ``http://example.org/aria2`` in *delUris*. This
  2124. method returns a list which contains 2 integers. The first integer is
  2125. the number of URIs deleted. The second integer is the number of URIs
  2126. added.
  2127. The following examples add 1 URI ``http://example.org/file`` to the
  2128. file whose index is ``1`` and belongs to the download
  2129. GID#2089b05ecca3d829.
  2130. **JSON-RPC EXEMPLO M210**
  2131. ::
  2132. >>> import urllib2, json
  2133. >>> from pprint import pprint
  2134. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2135. ... 'method':'aria2.changeUri',
  2136. ... 'params':['2089b05ecca3d829', 1, [],
  2137. ['http://example.org/file']]})
  2138. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2139. >>> pprint(json.loads(c.read()))
  2140. {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [0, 1]}
  2141. **XML-RPC EXEMPLO M220**
  2142. ::
  2143. >>> import xmlrpclib
  2144. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2145. >>> s.aria2.changeUri('2089b05ecca3d829', 1, [],
  2146. ['http://example.org/file'])
  2147. [0, 1]
  2148. .. function:: aria2.getOption(gid)
  2149. This method returns options of the download denoted by *gid*. The
  2150. response is of type struct. Its key is the name of option. The value
  2151. type is string. Note that this method does not return options which
  2152. have no default value and have not been set by the command-line
  2153. options, configuration files or RPC methods.
  2154. The following examples get options of the download
  2155. GID#2089b05ecca3d829.
  2156. **JSON-RPC EXEMPLO M230**
  2157. ::
  2158. >>> import urllib2, json
  2159. >>> from pprint import pprint
  2160. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2161. ... 'method':'aria2.getOption',
  2162. ... 'params':['2089b05ecca3d829']})
  2163. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2164. >>> pprint(json.loads(c.read()))
  2165. {u'id': u'qwer',
  2166. u'jsonrpc': u'2.0',
  2167. u'result': {u'allow-overwrite': u'false',
  2168. u'allow-piece-length-change': u'false',
  2169. u'always-resume': u'true',
  2170. u'async-dns': u'true',
  2171. ...
  2172. **XML-RPC EXEMPLO M240**
  2173. ::
  2174. >>> import xmlrpclib
  2175. >>> from pprint import pprint
  2176. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2177. >>> r = s.aria2.getOption('2089b05ecca3d829')
  2178. >>> pprint(r)
  2179. {'allow-overwrite': 'false',
  2180. 'allow-piece-length-change': 'false',
  2181. 'always-resume': 'true',
  2182. 'async-dns': 'true',
  2183. ....
  2184. .. function:: aria2.changeOption(gid, options)
  2185. This method changes options of the download denoted by *gid*
  2186. dynamically. *gid* is of type string. *options* is of type struct.
  2187. The following options are available for active downloads:
  2188. * :option:`bt-max-peers <--bt-max-peers>`
  2189. * :option:`bt-request-peer-speed-limit <--bt-request-peer-speed-limit>`
  2190. * :option:`bt-remove-unselected-file <--bt-remove-unselected-file>`
  2191. * :option:`force-save <--force-save>`
  2192. * :option:`max-download-limit <--max-download-limit>`
  2193. * :option:`max-upload-limit <-u>`
  2194. For waiting or paused downloads, in addition to the above options,
  2195. options listed in `Arquivo de Entrada`_ subsection are available,
  2196. except for following options:
  2197. :option:`dry-run <--dry-run>`,
  2198. :option:`metalink-base-uri <--metalink-base-uri>`,
  2199. :option:`parameterized-uri <-P>`,
  2200. :option:`pause <--pause>`,
  2201. :option:`piece-length <--piece-length>` and
  2202. :option:`rpc-save-upload-metadata <--rpc-save-upload-metadata>` option.
  2203. This method returns ``OK`` for success.
  2204. The following examples set :option:`max-download-limit
  2205. <--max-download-limit>` option to ``20K`` for the download
  2206. GID#2089b05ecca3d829.
  2207. **JSON-RPC EXEMPLO M250**
  2208. ::
  2209. >>> import urllib2, json
  2210. >>> from pprint import pprint
  2211. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2212. ... 'method':'aria2.changeOption',
  2213. ... 'params':['2089b05ecca3d829',
  2214. ... {'max-download-limit':'10K'}]})
  2215. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2216. >>> pprint(json.loads(c.read()))
  2217. {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'OK'}
  2218. **XML-RPC EXEMPLO M260**
  2219. ::
  2220. >>> import xmlrpclib
  2221. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2222. >>> s.aria2.changeOption('2089b05ecca3d829', {'max-download-limit':'20K'})
  2223. 'OK'
  2224. .. function:: aria2.getGlobalOption()
  2225. This method returns global options. The response is of type
  2226. struct. Its key is the name of option. The value type is string.
  2227. Note that this method does not return options which have no default
  2228. value and have not been set by the command-line options, configuration
  2229. files or RPC methods. Because global options are used as a template
  2230. for the options of newly added download, the response contains keys
  2231. returned by :func:`aria2.getOption` method.
  2232. .. function:: aria2.changeGlobalOption(options)
  2233. This method changes global options dynamically. *options* is of type
  2234. struct.
  2235. The following options are available:
  2236. * :option:`download-result <--download-result>`
  2237. * :option:`log <-l>`
  2238. * :option:`log-level <--log-level>`
  2239. * :option:`max-concurrent-downloads <-j>`
  2240. * :option:`max-download-result <--max-download-result>`
  2241. * :option:`max-overall-download-limit <--max-overall-download-limit>`
  2242. * :option:`max-overall-upload-limit <--max-overall-upload-limit>`
  2243. * :option:`save-cookies <--save-cookies>`
  2244. * :option:`save-session <--save-session>`
  2245. * :option:`server-stat-of <--server-stat-of>`
  2246. In addition to them, options listed in `Arquivo de Entrada`_ subsection
  2247. are available, except for following options:
  2248. :option:`checksum <--checksum>`,
  2249. :option:`index-out <-O>`,
  2250. :option:`out <-o>`,
  2251. :option:`pause <--pause>` and
  2252. :option:`select-file <--select-file>`.
  2253. Using :option:`log <-l>` option, you can dynamically start logging or
  2254. change log file. To stop logging, give empty string("") as a parameter
  2255. value. Note that log file is always opened in append mode. This method
  2256. returns ``OK`` for success.
  2257. .. function:: aria2.getGlobalStat()
  2258. This method returns global statistics such as overall download and
  2259. upload speed. The response is of type struct and contains following
  2260. keys. The value type is string.
  2261. ``downloadSpeed``
  2262. Overall download speed (byte/sec).
  2263. ``uploadSpeed``
  2264. Overall upload speed(byte/sec).
  2265. ``numActive``
  2266. The number of active downloads.
  2267. ``numWaiting``
  2268. The number of waiting downloads.
  2269. ``numStopped``
  2270. The number of stopped downloads.
  2271. **JSON-RPC EXEMPLO M270**
  2272. ::
  2273. >>> import urllib2, json
  2274. >>> from pprint import pprint
  2275. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2276. ... 'method':'aria2.getGlobalStat'})
  2277. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2278. >>> pprint(json.loads(c.read()))
  2279. {u'id': u'qwer',
  2280. u'jsonrpc': u'2.0',
  2281. u'result': {u'downloadSpeed': u'21846',
  2282. u'numActive': u'2',
  2283. u'numStopped': u'0',
  2284. u'numWaiting': u'0',
  2285. u'uploadSpeed': u'0'}}
  2286. **XML-RPC EXEMPLO M280**
  2287. ::
  2288. >>> import xmlrpclib
  2289. >>> from pprint import pprint
  2290. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2291. >>> r = s.aria2.getGlobalStat()
  2292. >>> pprint(r)
  2293. {'downloadSpeed': '23136',
  2294. 'numActive': '2',
  2295. 'numStopped': '0',
  2296. 'numWaiting': '0',
  2297. 'uploadSpeed': '0'}
  2298. .. function:: aria2.purgeDownloadResult()
  2299. This method purges completed/error/removed downloads to free memory.
  2300. This method returns ``OK``.
  2301. .. function:: aria2.removeDownloadResult(gid)
  2302. This method removes completed/error/removed download denoted by *gid*
  2303. from memory. This method returns ``OK`` for success.
  2304. The following examples remove the download result of the download
  2305. GID#2089b05ecca3d829.
  2306. **JSON-RPC EXEMPLO M290**
  2307. ::
  2308. >>> import urllib2, json
  2309. >>> from pprint import pprint
  2310. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2311. ... 'method':'aria2.removeDownloadResult',
  2312. ... 'params':['2089b05ecca3d829']})
  2313. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2314. >>> pprint(json.loads(c.read()))
  2315. {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'OK'}
  2316. **XML-RPC EXEMPLO M300**
  2317. ::
  2318. >>> import xmlrpclib
  2319. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2320. >>> s.aria2.removeDownloadResult('2089b05ecca3d829')
  2321. 'OK'
  2322. .. function:: aria2.getVersion()
  2323. This method returns version of the program and the list of enabled
  2324. features. The response is of type struct and contains following keys.
  2325. ``version``
  2326. Version number of the program in string.
  2327. ``enabledFeatures``
  2328. List of enabled features. Each feature name is of type string.
  2329. **JSON-RPC EXEMPLO M310**
  2330. ::
  2331. >>> import urllib2, json
  2332. >>> from pprint import pprint
  2333. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2334. ... 'method':'aria2.getVersion'})
  2335. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2336. >>> pprint(json.loads(c.read()))
  2337. {u'id': u'qwer',
  2338. u'jsonrpc': u'2.0',
  2339. u'result': {u'enabledFeatures': [u'Async DNS',
  2340. u'BitTorrent',
  2341. u'Firefox3 Cookie',
  2342. u'GZip',
  2343. u'HTTPS',
  2344. u'Message Digest',
  2345. u'Metalink',
  2346. u'XML-RPC'],
  2347. u'version': u'1.11.0'}}
  2348. **XML-RPC EXEMPLO M320**
  2349. ::
  2350. >>> import xmlrpclib
  2351. >>> from pprint import pprint
  2352. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2353. >>> r = s.aria2.getVersion()
  2354. >>> pprint(r)
  2355. {'enabledFeatures': ['Async DNS',
  2356. 'BitTorrent',
  2357. 'Firefox3 Cookie',
  2358. 'GZip',
  2359. 'HTTPS',
  2360. 'Message Digest',
  2361. 'Metalink',
  2362. 'XML-RPC'],
  2363. 'version': '1.11.0'}
  2364. .. function:: aria2.getSessionInfo()
  2365. This method returns session information.
  2366. The response is of type struct and contains following key.
  2367. ``sessionId``
  2368. Session ID, which is generated each time when aria2 is invoked.
  2369. **JSON-RPC EXEMPLO M330**
  2370. ::
  2371. >>> import urllib2, json
  2372. >>> from pprint import pprint
  2373. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2374. ... 'method':'aria2.getSessionInfo'})
  2375. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2376. >>> pprint(json.loads(c.read()))
  2377. {u'id': u'qwer',
  2378. u'jsonrpc': u'2.0',
  2379. u'result': {u'sessionId': u'cd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9'}}
  2380. **XML-RPC EXEMPLO M340**
  2381. ::
  2382. >>> import xmlrpclib
  2383. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2384. >>> s.aria2.getSessionInfo()
  2385. {'sessionId': 'cd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9'}
  2386. .. function:: aria2.shutdown()
  2387. This method shutdowns aria2. This method returns ``OK``.
  2388. .. function:: aria2.forceShutdown()
  2389. This method shutdowns :func:`aria2. This method behaves like aria2.shutdown`
  2390. except that any actions which takes time such as contacting BitTorrent
  2391. tracker are skipped. This method returns ``OK``.
  2392. .. function:: system.multicall(methods)
  2393. This methods encapsulates multiple method calls in a single request.
  2394. *methods* is of type array and its element is struct. The struct
  2395. contains two keys: ``methodName`` and ``params``. ``methodName`` is the
  2396. method name to call and ``params`` is array containing parameters to the
  2397. method. This method returns array of responses. The element of array
  2398. will either be a one-item array containing the return value of each
  2399. method call or struct of fault element if an encapsulated method call
  2400. fails.
  2401. In the following examples, we add 2 downloads. First one is
  2402. ``http://example.org/file`` and second one is ``file.torrent``.
  2403. **JSON-RPC EXEMPLO M350**
  2404. ::
  2405. >>> import urllib2, json, base64
  2406. >>> from pprint import pprint
  2407. >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
  2408. ... 'method':'system.multicall',
  2409. ... 'params':[[{'methodName':'aria2.addUri',
  2410. ... 'params':[['http://example.org']]},
  2411. ... {'methodName':'aria2.addTorrent',
  2412. ... 'params':[base64.b64encode(open('file.torrent').read())]}]]})
  2413. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2414. >>> pprint(json.loads(c.read()))
  2415. {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [[u'2089b05ecca3d829'], [u'd2703803b52216d1']]}
  2416. JSON-RPC also supports Batch request described in JSON-RPC 2.0 Specification::
  2417. >>> jsonreq = json.dumps([{'jsonrpc':'2.0', 'id':'qwer',
  2418. ... 'method':'aria2.addUri',
  2419. ... 'params':[['http://example.org']]},
  2420. ... {'jsonrpc':'2.0', 'id':'asdf',
  2421. ... 'method':'aria2.addTorrent',
  2422. ... 'params':[base64.b64encode(open('file.torrent').read())]}])
  2423. >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
  2424. >>> pprint(json.loads(c.read()))
  2425. [{u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'2089b05ecca3d829'},
  2426. {u'id': u'asdf', u'jsonrpc': u'2.0', u'result': u'd2703803b52216d1'}]
  2427. **XML-RPC EXEMPLO M360**
  2428. ::
  2429. >>> import xmlrpclib
  2430. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2431. >>> mc = xmlrpclib.MultiCall(s)
  2432. >>> mc.aria2.addUri(['http://example.org/file'])
  2433. >>> mc.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent').read()))
  2434. >>> r = mc()
  2435. >>> tuple(r)
  2436. ('2089b05ecca3d829', 'd2703803b52216d1')
  2437. Tratamento de Erros
  2438. ~~~~~~~~~~~~~~~~~~~
  2439. Usando JSON-RPC, aria2 retorna objeto JSON que contém código de erro
  2440. no código e a mensagem de erro na mensagem.
  2441. Usando XML-RPC, aria2 retorna código de falha (faultCode=1) e a mensagem
  2442. de erro em (faultString).
  2443. .. _rpc_options:
  2444. Opções
  2445. ~~~~~~
  2446. Same options for :option:`--input-file <-i>` list are available.
  2447. Ver subseção `Arquivo de Entrada`_ para lista completa de opções.
  2448. In the option struct, name element is option name(without preceding
  2449. ``--``) and value element is argument as string.
  2450. EXEMPLO JSON-RPC M370
  2451. ^^^^^^^^^^^^^^^^^^^^^
  2452. ::
  2453. {'split':'1', 'http-proxy':'http://proxy/'}
  2454. EXEMPLO XML-RPC M380
  2455. ^^^^^^^^^^^^^^^^^^^^
  2456. .. code-block:: xml
  2457. <struct>
  2458. <member>
  2459. <name>split</name>
  2460. <value><string>1</string></value>
  2461. </member>
  2462. <member>
  2463. <name>http-proxy</name>
  2464. <value><string>http://proxy/</string></value>
  2465. </member>
  2466. </struct>
  2467. :option:`header <--header>` and :option:`index-out <-O>`
  2468. option are allowed multiple times in
  2469. command-line. Since name should be unique in struct(many XML-RPC
  2470. library implementation uses hash or dict for struct), single string is
  2471. not enough. To overcome this situation, they can take array as value
  2472. as well as string.
  2473. EXEMPLO JSON-RPC M390
  2474. ^^^^^^^^^^^^^^^^^^^^^
  2475. ::
  2476. {'header':['Accept-Language: ja', 'Accept-Charset: utf-8']}
  2477. EXEMPLO XML-RPC M400
  2478. ^^^^^^^^^^^^^^^^^^^^
  2479. .. code-block:: xml
  2480. <struct>
  2481. <member>
  2482. <name>header</name>
  2483. <value>
  2484. <array>
  2485. <data>
  2486. <value><string>Accept-Language: ja</string></value>
  2487. <value><string>Accept-Charset: utf-8</string></value>
  2488. </data>
  2489. </array>
  2490. </value>
  2491. </member>
  2492. </struct>
  2493. Following example adds a download with 2 options: dir and header.
  2494. header option has 2 values, so it uses a list::
  2495. >>> import xmlrpclib
  2496. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
  2497. >>> opts = dict(dir='/tmp',
  2498. ... header=['Accept-Language: ja',
  2499. ... 'Accept-Charset: utf-8'])
  2500. >>> s.aria2.addUri(['http://example.org/file'], opts)
  2501. '1'
  2502. JSON-RPC usando HTTP GET
  2503. ~~~~~~~~~~~~~~~~~~~~~~~~
  2504. The JSON-RPC interface also supports request via HTTP GET.
  2505. The encoding scheme in GET parameters is based on JSON-RPC over HTTP
  2506. Specification [2008-1-15(RC1)]. The encoding of GET parameters are follows::
  2507. /jsonrpc?method=METHOD_NAME&id=ID&params=BASE64_ENCODED_PARAMS
  2508. The ``method`` and ``id`` are always treated as JSON string and their
  2509. encoding must be UTF-8.
  2510. For example, The encoded string of
  2511. ``aria2.tellStatus('2089b05ecca3d829')`` with ``id='foo'`` looks like
  2512. this::
  2513. /jsonrpc?method=aria2.tellStatus&id=foo&params=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D
  2514. The ``params`` parameter is Base64-encoded JSON array which usually
  2515. appears in ``params`` attribute in JSON-RPC request object. In the
  2516. above example, the params is ``["2089b05ecca3d829"]``, therefore::
  2517. ["2089b05ecca3d829"] --(Base64)--> WyIyMDg5YjA1ZWNjYTNkODI5Il0=
  2518. --(Percent Encode)--> WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D
  2519. The JSON-RPC interface supports JSONP. You can specify the callback
  2520. function in ``jsoncallback`` parameter::
  2521. /jsonrpc?method=aria2.tellStatus&id=foo&params=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D&jsoncallback=cb
  2522. For Batch request, ``method`` and ``id`` parameter must not be specified.
  2523. Whole request must be specified in ``params`` parameter. For example,
  2524. Batch request::
  2525. [{'jsonrpc':'2.0', 'id':'qwer', 'method':'aria2.getVersion'},
  2526. {'jsonrpc':'2.0', 'id':'asdf', 'method':'aria2.tellActive'}]
  2527. will be encoded like this::
  2528. /jsonrpc?params=W3sianNvbnJwYyI6ICIyLjAiLCAiaWQiOiAicXdlciIsICJtZXRob2QiOiAiYXJpYTIuZ2V0VmVyc2lvbiJ9LCB7Impzb25ycGMiOiAiMi4wIiwgImlkIjogImFzZGYiLCAibWV0aG9kIjogImFyaWEyLnRlbGxBY3RpdmUifV0%3D
  2529. .. index:: double: json; websocket;
  2530. JSON-RPC sobre WebSocket
  2531. ~~~~~~~~~~~~~~~~~~~~~~~~
  2532. JSON-RPC sobre WebSocket utiliza o mesmo método de assinatura e resposta
  2533. do formato JSON-RPC sobre HTTP. O WebSocket suportado é da versão 13
  2534. o qual é detalhado na :rfc:`6455`.
  2535. Para enviar uma requisição RPC para um servidor RPC, enviar strings serializadas
  2536. JSON num frame Text. A resposta do servidor RPC será entregue também em um frame
  2537. Text.
  2538. O servidor RPC ira enviar a notificação ao cliente. A notificação é
  2539. unidirecional, portanto o cliente que receber a notificação não pode
  2540. responde-la. Esse método de assinatura de notificação é muito usual mas
  2541. não provê uma identificação de chave. Os valores associados pelos parâmetros
  2542. chave são os dados que a notificação porta. O formato desses valores
  2543. variam dependendo do método de notificação. Os seguintes métodos de notificação
  2544. são definidos:
  2545. .. function:: aria2.onDownloadStart(event)
  2546. Essa notificação será enviada quando e se o download for iniciado.
  2547. *event* é o tipo de estrutura e pode conter as seguintes chaves:
  2548. O formato do valor é string.
  2549. ``gid``
  2550. GID do download.
  2551. .. function:: aria2.onDownloadPause(event)
  2552. Esta notificação será enviada se o download for pausado. *event*
  2553. tem a mesma estrutura do argumento *event* do método da função
  2554. :func:`aria2.onDownloadStart`.
  2555. .. function:: aria2.onDownloadStop(event)
  2556. Essa notificação será enviada se o download for interrompido pelo usuário.
  2557. *event* tem a mesma estrutura do argumento *event* do método da função
  2558. :func:`aria2.onDownloadStart`.
  2559. .. function:: aria2.onDownloadComplete(event)
  2560. Esta notificação será enviada quando o download for completado. Para
  2561. downloads BitTorrent, esta notificação será enviada quando for completado e
  2562. o (seed) terminar. O *event* tem a mesma estrutura do *event* do método da
  2563. função :func:`aria2.onDownloadStart`.
  2564. .. function:: aria2.onDownloadError(event)
  2565. Esta notificação será enviada se o download for interrompido por causa de
  2566. um erro.
  2567. O *event* tem a mesma estrutura do *event* do método da função
  2568. :func:`aria2.onDownloadStart`.
  2569. .. function:: aria2.onBtDownloadComplete(event)
  2570. Esta notificação será enviada se o download for completado para o
  2571. BitTorrent (mas o seeding pode não ter sido concluído). O *event* tem a
  2572. mesma estrutura do *event* do método da função :func:`aria2.onDownloadStart`.
  2573. Exemplo Cliente XML-RPC Ruby
  2574. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2575. O seguinte script Ruby script adiciona ``http://localhost/aria2.tar.bz2`` em
  2576. aria2c no servidor em localhost com a opção :option:`--dir=/downloads <-d>` e
  2577. imprime a resposta do processamento:
  2578. .. code-block:: ruby
  2579. #!/usr/bin/env ruby
  2580. require 'xmlrpc/client'
  2581. require 'pp'
  2582. client=XMLRPC::Client.new2("http://localhost:6800/rpc")
  2583. options={ "dir" => "/downloads" }
  2584. result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options)
  2585. pp result
  2586. Se você usa Python, pode usar xmlrpclib (em Python3.x, use xmlrpc.client) para
  2587. interagir com aria2::
  2588. import xmlrpclib
  2589. from pprint import pprint
  2590. s = xmlrpclib.ServerProxy("http://localhost:6800/rpc")
  2591. r = s.aria2.addUri(["http://localhost/aria2.tar.bz2"], {"dir":"/downloads"})
  2592. pprint(r)
  2593. .. index:: double: mensagens; console;
  2594. DIVERSOS
  2595. --------
  2596. Mensagens na Console
  2597. ~~~~~~~~~~~~~~~~~~~~
  2598. Enquanto executa o download de arquivos, aria2 imprime mensagens na console
  2599. para mostrar o progresso dos downloads. Um exemplo abaixo::
  2600. [#1 SIZE:400.0KiB/33.2MiB(1%) CN:1 SPD:115.7KiBs ETA:4m51s]
  2601. Entenda o que estes números e strings significam.
  2602. ``#N``
  2603. N significa GID, o qual é um ID único para cada download.
  2604. ``SIZE``
  2605. Tamanho Total e Tamanho em bytes. Se a :option:`--select-file` é usada,
  2606. será exibida a somatória do tamanho do arquivo.
  2607. ``SEEDING``
  2608. Taxa compartilhamento ratio. O cliente está funcionando. Após término do
  2609. download do BitTorrent, ``SIZE`` será substituído por ``SEEDING``.
  2610. ``CN``
  2611. Número de conexões que o cliente estabeleceu.
  2612. ``SEED``
  2613. O número de seeders ao qual o cliente está conectado.
  2614. ``SPD``
  2615. Velocidade do download.
  2616. ``UP``
  2617. Velocidade e número de bytes transmitidos upload.
  2618. ``ETA``
  2619. Tempo previsto para conclusão.
  2620. ``TOTAL SPD``
  2621. A soma das velocidades de download para todos downloads paralelos.
  2622. Quando aria2 está alocando o espaço para arquivo ou validando o checksum,
  2623. adicionalmente exibirá o progresso:
  2624. FileAlloc
  2625. GID, tamanho alocado e total em bytes.
  2626. Checksum
  2627. GID, tamanho validado e total em bytes.
  2628. EXEMPLOS DOWNLOAD HTTP / FTP
  2629. ----------------------------
  2630. Download Segmentado HTTP/FTP
  2631. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2632. Download de arquivo
  2633. ^^^^^^^^^^^^^^^^^^^
  2634. .. code-block:: console
  2635. $ aria2c "http://servidor/arquivo.zip"
  2636. .. note::
  2637. Para parar o download, pressione :kbd:`Ctrl-C`. Posteriormente pode ser
  2638. retomado o mesmo download no mesmo diretório. Podem ser modificadas as URIs
  2639. pois elas apontam para o mesmo arquivo.
  2640. Download de arquivo de 2 servidores HTTP diferentes
  2641. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2642. .. code-block:: console
  2643. $ aria2c "http://servidor/arquivo.zip" "http://espelhobrasil/arquivo.zip"
  2644. Download de arquivo do mesmo servidor HTTP usando 2 conexões
  2645. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2646. .. code-block:: console
  2647. $ aria2c -x2 -k1M "http://servidorbrasil/arquivo.zip"
  2648. Download de arquivo de servidor HTTP e FTP
  2649. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2650. .. code-block:: console
  2651. $ aria2c "http://svrbrasil/arquivo.zip" "ftp://servebr/arquivo.zip"
  2652. Download arquivos especificados num arquivo txt concomitantemente
  2653. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2654. .. code-block:: console
  2655. $ aria2c -i arquivo.txt -j2
  2656. .. note::
  2657. -j especifica número de downloads paralelos.
  2658. Usando proxy
  2659. ^^^^^^^^^^^^
  2660. Para HTTP:
  2661. .. code-block:: console
  2662. $ aria2c --http-proxy="http://svrproxy:8080" "http://servidor/arquivo"
  2663. .. code-block:: console
  2664. $ aria2c --http-proxy="http://svrproxy:8080"
  2665. --no-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://servidor/arquivo"
  2666. a máscara de rede /16 quer dizer que para toda a rede 192.168 também não
  2667. será usado o servidor proxy
  2668. Para FTP:
  2669. .. code-block:: console
  2670. $ aria2c --ftp-proxy="http://svrproxy:8080" "ftp://servidor/arquivo"
  2671. .. note::
  2672. Ver :option:`--http-proxy`, :option:`--https-proxy`, :option:`--ftp-proxy`,
  2673. :option:`--all-proxy` e :option:`--no-proxy` para detalhes. Proxy pode ser
  2674. especificado nas variáveis de ambiente. Ver seção `VARIÁVEIS DE AMBIENTE`_ .
  2675. Proxy com autenticação / autorização
  2676. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2677. .. code-block:: console
  2678. $ aria2c --http-proxy="http://usuário:senha@svrproxy:8080"
  2679. "http://servidor/arquivo"
  2680. .. code-block:: console
  2681. $ aria2c --http-proxy="http://svrproxy:8080"
  2682. --http-proxy-user="usuário" --http-proxy-passwd="senha"
  2683. "http://servidor/arquivo"
  2684. Download Metalink
  2685. ~~~~~~~~~~~~~~~~~
  2686. Download arquivos com Metalink remoto
  2687. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2688. .. code-block:: console
  2689. $ aria2c --follow-metalink=mem "http://servidor/arquivo.metalink"
  2690. Download arquivos com Metalink local
  2691. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2692. .. code-block:: console
  2693. $ aria2c -p --lowest-speed-limit=4000 arquivo.metalink
  2694. .. note::
  2695. Para parar o download, pressione :kbd:`Ctrl-C`.
  2696. A transferência pode ser retomada executando aria2c com o mesmo argumento
  2697. no mesmo diretório
  2698. Download diversos arquivos Metalink local
  2699. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2700. .. code-block:: console
  2701. $ aria2c -j2 arquivo1.metalink arquivo2.metalink
  2702. Download só arquivos selecionados usando index
  2703. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2704. .. code-block:: console
  2705. $ aria2c --select-file=1-4,8 arquivo.metalink
  2706. .. note::
  2707. O index é exibido na console usando opção -S.
  2708. Download um arquivo usando Metalink local com preferência do usuário
  2709. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2710. .. code-block:: console
  2711. $ aria2c --metalink-location=pt,us --metalink-version=1.1 --metalink-language=pt-BR arquivo.metalink
  2712. Download BitTorrent
  2713. ~~~~~~~~~~~~~~~~~~~
  2714. Download arquivos de BitTorrent remotos
  2715. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2716. .. code-block:: console
  2717. $ aria2c --follow-torrent=mem "http://servidortorrent/arquivo.torrent"
  2718. Download usando arquivo torrent local
  2719. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2720. .. code-block:: console
  2721. $ aria2c --max-upload-limit=40K arquivo.torrent
  2722. .. note::
  2723. --max-upload-limit especifica taxa máxima de transmissão (upload).
  2724. .. note::
  2725. Para parar o download, pressione :kbd:`Ctrl-C`. A transferência pode ser retomada
  2726. ao executar aria2c com os mesmos argumentos no mesmo diretório.
  2727. Download usando URI BitTorrent Magnet
  2728. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2729. .. code-block:: console
  2730. $ aria2c "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C&dn=aria2"
  2731. .. note::
  2732. Lembre-se inserir delimitadores na URI BitTorrent Magnet, pois ela inclui ``&``
  2733. que tem significado de parâmetro. Utilizar apóstrofo(``'``) ou aspas(``"``).
  2734. Download 2 torrents
  2735. ^^^^^^^^^^^^^^^^^^^
  2736. .. code-block:: console
  2737. $ aria2c -j2 arquivo1.torrent arquivo2.torrent
  2738. Download um arquivo usando torrent e servidor HTTP/FTP
  2739. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2740. .. code-block:: console
  2741. $ aria2c -T arqfile.torrent "http://serv1/arqfile" "ftp://svr2/arqfile"
  2742. .. note::
  2743. Download de arquivos múltiplos torrent com HTTP e FTP não é suportado.
  2744. Download arquivos selecionados usando index(chamado "download seletivo")
  2745. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2746. .. code-block:: console
  2747. $ aria2c --select-file=1-4,8 arquivo.torrent
  2748. .. note::
  2749. O index é exibido na console usando-se a opção -S.
  2750. Especificar arquivo saída
  2751. ^^^^^^^^^^^^^^^^^^^^^^^^^
  2752. Para especificar arquivo de saída em Downloads de BitTorrent, faz-se necessário
  2753. conhecer o index do arquivo no torrent usando a opção :option:`--show-files <-S>`.
  2754. Por exemplo, a saída exibirá algo como::
  2755. idx|path/length
  2756. ===+======================
  2757. 1|dist/base-2.6.18.iso
  2758. |99.9MiB
  2759. ---+----------------------
  2760. 2|dist/driver-2.6.18.iso
  2761. |169.0MiB
  2762. ---+----------------------
  2763. Para salvar 'dist/base-2.6.18.iso' em '/tmp/meudir/base.iso' e
  2764. 'dist/driver-2.6.18.iso' em '/tmp/dir/driver.iso', use o seguinte comando:
  2765. .. code-block:: console
  2766. $ aria2c --dir=/tmp --index-out=1=meudir/base.iso --index-out=2=dir/driver.iso arquivo.torrent
  2767. Modificar porta escuta para peer de entrada
  2768. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2769. .. code-block:: console
  2770. $ aria2c --listen-port=7000-7001,8000 arquivo.torrent
  2771. .. note::
  2772. Já que aria2 não configura o firewall ou porta de roteamento para portas
  2773. de encaminhamento, isto deve ser explicitado manualmente por você.
  2774. Especificar condição para para o programa torrent após término do download
  2775. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2776. .. code-block:: console
  2777. $ aria2c --seed-time=120 --seed-ratio=1.0 arquivo.torrent
  2778. .. note::
  2779. No exemplo acima, o programa termina após transcorrer 120 minutos após
  2780. término do download ou taxa chegar a 1.0.
  2781. Controlar velocidade upload Torrent
  2782. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2783. .. code-block:: console
  2784. $ aria2c --max-upload-limit=100K arquivo.torrent
  2785. Habilitar IPv4 DHT
  2786. ^^^^^^^^^^^^^^^^^^
  2787. .. code-block:: console
  2788. $ aria2c --enable-dht --dht-listen-port=6881 arquivo.torrent
  2789. .. note::
  2790. DHT utiliza a porta udp, como o aria2 não configura firewall nem porta de roteamento
  2791. ou forwarding, por favor executar estas configurações manualmente.
  2792. Habilitar IPv6 DHT
  2793. ^^^^^^^^^^^^^^^^^^
  2794. .. code-block:: console
  2795. $ aria2c --enable-dht6 --dht-listen-port=6881 --dht-listen-addr6=YOUR_GLOBAL_UNICAST_IPV6_ADDR --enable-async-dns6
  2796. .. note::
  2797. Se aria2c não foi compilado com c-ares, a opção :option:`--enable-async-dns6`
  2798. não é necessária. aria2 compartilha a mesma porta ente IPv4 e IPv6 DHT.
  2799. Adicionar e remover rastreador URI
  2800. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2801. Remover todos os rastreadores (tracker) das URIs descritas no arquivo.torrent
  2802. utilize ``http://tracker1/announce`` e ``http://tracker2/announce``
  2803. .. code-block:: console
  2804. $ aria2c --bt-exclude-tracker="*" --bt-tracker="http://tracker1/announce,http://tracker2/announce" file.torrent
  2805. Funcionalidades avançadas HTTP
  2806. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2807. Carregar cookies
  2808. ^^^^^^^^^^^^^^^^
  2809. .. code-block:: console
  2810. $ aria2c --load-cookies=cookies.txt "http://servidor/arquivo.zip"
  2811. .. note::
  2812. Podem ser utilizados sem nenhuma modificação coookies dos navegadores:
  2813. Firefox / Mozilla / Chromium.
  2814. Continuar download iniciado por navegadores ou outros programas
  2815. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2816. Quando desejar continuar ou retomar um download cujo processamento foi
  2817. interrompido, seja em navegador ou qualquer outro programa utilize
  2818. o aria2c para retomar este download do ponto onde parou.
  2819. .. code-block:: console
  2820. $ aria2c -c -s2 "http://servidor/arquivodedownloadparcial.zip"
  2821. Autenticação certificado para Cliente SSL/TLS
  2822. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2823. .. code-block:: console
  2824. $ aria2c --certificate=/path/para/mycert.pem --private-key=/path/para/mykey.pem https://servidor/arquivo
  2825. .. note::
  2826. O arquivo especificado na opção :option:`--private-key` não pode estar
  2827. criptografado. O comportamento do processo fica indefinido quando o
  2828. arquivo estiver criptografado.
  2829. Verificar peer em SSL/TLS usando certificados CA
  2830. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2831. .. code-block:: console
  2832. $ aria2c --ca-certificate=/path/para/ca-certificates.crt
  2833. --check-certificate https://servidor/arquivo
  2834. Funcionalidades avançadas adicionais
  2835. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2836. Controlar velocidade de download
  2837. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2838. Quando for necessário o controle da utilização da banda disponível, pode ser
  2839. utilizado a opção abaixo. Atenção o sufixo K ou M deve ser em letra maiúscula.
  2840. .. code-block:: console
  2841. $ aria2c --max-download-limit=100K arquivo.metalink
  2842. Reparar um download danificado
  2843. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2844. .. code-block:: console
  2845. $ aria2c -V arquivo.metalink
  2846. .. note::
  2847. Reparar downloads danificados pode ser mais eficiente usando
  2848. BitTorrent ou Metalink com a opção verificação (checksums).
  2849. Desconectar conexão se a velocidade download for menor que um valor
  2850. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2851. .. code-block:: console
  2852. $ aria2c --lowest-speed-limit=10K file.metalink
  2853. Suporte a URI parametrizada
  2854. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2855. A URI pode ser especificada como partes de um conjunto:
  2856. .. code-block:: console
  2857. $ aria2c -P "http://{svr1,svr2,svr3}/arquivo.iso"
  2858. Também podem ser especificados sequencias de intervalos:
  2859. .. code-block:: console
  2860. $ aria2c -Z -P "http://servidor/imagem[000-100].png"
  2861. .. note::
  2862. -Z opção requerida para que todas URIs não apontem para o mesmo arquivo,
  2863. como declarado no código acima.
  2864. Especificar incrementos para contador:
  2865. .. code-block:: console
  2866. $ aria2c -Z -P "http://servidor/imagem[A-Z:2].png"
  2867. Verificar validação checksum
  2868. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2869. .. code-block:: console
  2870. $ aria2c --checksum=sha-1=0192ba11326fe2298c8cb4de616f4d4140213837
  2871. http://dobrasil.org/arquivo
  2872. Download Paralelo de uma quantidade arbitrária de URI, Metalink ou Torrent
  2873. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2874. .. code-block:: console
  2875. $ aria2c -j3 -Z "http://servidor/arquivo1" arquivo2.torrent arq3.metalink
  2876. BitTorrent Criptografado
  2877. ^^^^^^^^^^^^^^^^^^^^^^^^
  2878. Criptografar todo conjunto usando ARC4:
  2879. .. code-block:: console
  2880. $ aria2c --bt-min-crypto-level=arc4 --bt-require-crypto=true arquivo.torrent
  2881. Ver Também
  2882. ----------
  2883. Site do Projeto aria2: http://aria2.sourceforge.net/
  2884. Wiki aria2: http://sourceforge.net/apps/trac/aria2/wiki
  2885. Site do Projeto Metalink: http://www.metalinker.org/
  2886. Descrição do Formato Download Metalink: :rfc:`5854`
  2887. COPYRIGHT
  2888. ---------
  2889. Copyright (C) 2006, 2013 Tatsuhiro Tsujikawa
  2890. Tradução para Português do Brasil 2013, Gilberto dos Santos Alves
  2891. utilizando editor kate e gedit no Debian squeeze 6.0.6 novembro de 2012
  2892. revisado em março de 2013 usando editor kate e gedit no ubuntu 12.04 LTS
  2893. Esse programa é software livre; pode ser redistribuido e/ou modificado
  2894. sob os termos da Licença GNU General Public License como publicada por
  2895. Free Software Foundation www.fsf.org; versão 2 da Licença, ou qualquer
  2896. versão mais recente, qualquer que seja sua escolha.
  2897. Este programa é distribuído na intenção de ser útil, mas SEM NENHUMA GARANTIA;
  2898. sem qualquer garantia implícita de ser COMERCIALIZÁVEL ou para PROPÓSITO
  2899. ESPECÍFICO. Consulte a Linceça GNU Genérica para mais detalhes.
  2900. Você precisa receber uma cópia da Licença Pública GNU Genérica junto com
  2901. este programa; caso não tenha, escrevá para Free Software Foundation, Inc.,
  2902. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  2903. Adicionalmente, como uma exceção especial, os detentores do direito autoral
  2904. autorizam a permissão para compilar programas que possuem ligação com
  2905. parte do código com a biblioteca OpenSSL sob certas condições como descritas
  2906. em cada arquivo fonte e autorizam a distribuição das das combinações das
  2907. ligações incluindo ambas.
  2908. Devem ser obedecidos todos os detalhes da Licença Pública GNU Genérica
  2909. em relação a OpenSSL. Caso haja modificação nos arquivos com esta exceção
  2910. deverá ser extendida esta exceção para as versões modificadas dos arquivos, mas
  2911. isto não é obrigatório. Se não houver esta intenção exclua esta declaração
  2912. de exceção da sua versão. Caso sejam excluídas as declarações de todos
  2913. os arquivos fontes, exclua também esta declaração daqui.
  2914. Anotação sobre divergência entre Manual e o aria2:
  2915. Esta página de manual pode não necessariamente conter a última informação.
  2916. Caso haja discrepância entre alguma informação do manual e o aria2, por
  2917. favor refira-se a versão em inglês resultante do comando man aria2c