aria2c.rst 142 KB

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