aria2c.rst 142 KB

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