camenduru commited on
Commit
51101ce
·
1 Parent(s): 0f82f07

thanks to aria2 ❤

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +1 -0
  2. bin/aria2c +3 -0
  3. share/doc/aria2/README +1 -0
  4. share/doc/aria2/README.html +904 -0
  5. share/doc/aria2/README.rst +565 -0
  6. share/doc/aria2/bash_completion/README.txt +11 -0
  7. share/doc/aria2/bash_completion/aria2c +90 -0
  8. share/doc/aria2/xmlrpc/README.txt +3 -0
  9. share/doc/aria2/xmlrpc/aria2mon +157 -0
  10. share/doc/aria2/xmlrpc/aria2rpc +427 -0
  11. share/locale/ar/LC_MESSAGES/aria2.mo +0 -0
  12. share/locale/bg/LC_MESSAGES/aria2.mo +0 -0
  13. share/locale/bn/LC_MESSAGES/aria2.mo +0 -0
  14. share/locale/ca/LC_MESSAGES/aria2.mo +0 -0
  15. share/locale/da/LC_MESSAGES/aria2.mo +0 -0
  16. share/locale/de/LC_MESSAGES/aria2.mo +0 -0
  17. share/locale/el/LC_MESSAGES/aria2.mo +0 -0
  18. share/locale/en@boldquot/LC_MESSAGES/aria2.mo +0 -0
  19. share/locale/en@quot/LC_MESSAGES/aria2.mo +0 -0
  20. share/locale/es/LC_MESSAGES/aria2.mo +0 -0
  21. share/locale/fa/LC_MESSAGES/aria2.mo +0 -0
  22. share/locale/fi/LC_MESSAGES/aria2.mo +0 -0
  23. share/locale/fil/LC_MESSAGES/aria2.mo +0 -0
  24. share/locale/fr/LC_MESSAGES/aria2.mo +0 -0
  25. share/locale/he/LC_MESSAGES/aria2.mo +0 -0
  26. share/locale/hr/LC_MESSAGES/aria2.mo +0 -0
  27. share/locale/hu/LC_MESSAGES/aria2.mo +0 -0
  28. share/locale/id/LC_MESSAGES/aria2.mo +0 -0
  29. share/locale/it/LC_MESSAGES/aria2.mo +0 -0
  30. share/locale/ja/LC_MESSAGES/aria2.mo +0 -0
  31. share/locale/kk/LC_MESSAGES/aria2.mo +0 -0
  32. share/locale/ko/LC_MESSAGES/aria2.mo +0 -0
  33. share/locale/ms/LC_MESSAGES/aria2.mo +0 -0
  34. share/locale/nb/LC_MESSAGES/aria2.mo +0 -0
  35. share/locale/nl/LC_MESSAGES/aria2.mo +0 -0
  36. share/locale/nn/LC_MESSAGES/aria2.mo +0 -0
  37. share/locale/oc/LC_MESSAGES/aria2.mo +0 -0
  38. share/locale/pl/LC_MESSAGES/aria2.mo +0 -0
  39. share/locale/pt/LC_MESSAGES/aria2.mo +0 -0
  40. share/locale/pt_BR/LC_MESSAGES/aria2.mo +0 -0
  41. share/locale/ro/LC_MESSAGES/aria2.mo +0 -0
  42. share/locale/ru/LC_MESSAGES/aria2.mo +0 -0
  43. share/locale/sk/LC_MESSAGES/aria2.mo +0 -0
  44. share/locale/sr/LC_MESSAGES/aria2.mo +0 -0
  45. share/locale/sv/LC_MESSAGES/aria2.mo +0 -0
  46. share/locale/th/LC_MESSAGES/aria2.mo +0 -0
  47. share/locale/tr/LC_MESSAGES/aria2.mo +0 -0
  48. share/locale/uk/LC_MESSAGES/aria2.mo +0 -0
  49. share/locale/vi/LC_MESSAGES/aria2.mo +0 -0
  50. share/locale/zh_CN/LC_MESSAGES/aria2.mo +0 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ bin/aria2c filter=lfs diff=lfs merge=lfs -text
bin/aria2c ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ff1c2ec1b4be76ebf602969a4416b7b6e6ae30955ef9d2bfea579330421d55a
3
+ size 82219952
share/doc/aria2/README ADDED
@@ -0,0 +1 @@
 
 
1
+ See README.rst
share/doc/aria2/README.html ADDED
@@ -0,0 +1,904 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <meta name="generator" content="Docutils 0.16: http://docutils.sourceforge.net/" />
7
+ <title>aria2 - The ultra fast download utility</title>
8
+ <style type="text/css">
9
+
10
+ /*
11
+ :Author: David Goodger (goodger@python.org)
12
+ :Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
13
+ :Copyright: This stylesheet has been placed in the public domain.
14
+
15
+ Default cascading style sheet for the HTML output of Docutils.
16
+
17
+ See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
18
+ customize this style sheet.
19
+ */
20
+
21
+ /* used to remove borders from tables and images */
22
+ .borderless, table.borderless td, table.borderless th {
23
+ border: 0 }
24
+
25
+ table.borderless td, table.borderless th {
26
+ /* Override padding for "table.docutils td" with "! important".
27
+ The right padding separates the table cells. */
28
+ padding: 0 0.5em 0 0 ! important }
29
+
30
+ .first {
31
+ /* Override more specific margin styles with "! important". */
32
+ margin-top: 0 ! important }
33
+
34
+ .last, .with-subtitle {
35
+ margin-bottom: 0 ! important }
36
+
37
+ .hidden {
38
+ display: none }
39
+
40
+ .subscript {
41
+ vertical-align: sub;
42
+ font-size: smaller }
43
+
44
+ .superscript {
45
+ vertical-align: super;
46
+ font-size: smaller }
47
+
48
+ a.toc-backref {
49
+ text-decoration: none ;
50
+ color: black }
51
+
52
+ blockquote.epigraph {
53
+ margin: 2em 5em ; }
54
+
55
+ dl.docutils dd {
56
+ margin-bottom: 0.5em }
57
+
58
+ object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
59
+ overflow: hidden;
60
+ }
61
+
62
+ /* Uncomment (and remove this text!) to get bold-faced definition list terms
63
+ dl.docutils dt {
64
+ font-weight: bold }
65
+ */
66
+
67
+ div.abstract {
68
+ margin: 2em 5em }
69
+
70
+ div.abstract p.topic-title {
71
+ font-weight: bold ;
72
+ text-align: center }
73
+
74
+ div.admonition, div.attention, div.caution, div.danger, div.error,
75
+ div.hint, div.important, div.note, div.tip, div.warning {
76
+ margin: 2em ;
77
+ border: medium outset ;
78
+ padding: 1em }
79
+
80
+ div.admonition p.admonition-title, div.hint p.admonition-title,
81
+ div.important p.admonition-title, div.note p.admonition-title,
82
+ div.tip p.admonition-title {
83
+ font-weight: bold ;
84
+ font-family: sans-serif }
85
+
86
+ div.attention p.admonition-title, div.caution p.admonition-title,
87
+ div.danger p.admonition-title, div.error p.admonition-title,
88
+ div.warning p.admonition-title, .code .error {
89
+ color: red ;
90
+ font-weight: bold ;
91
+ font-family: sans-serif }
92
+
93
+ /* Uncomment (and remove this text!) to get reduced vertical space in
94
+ compound paragraphs.
95
+ div.compound .compound-first, div.compound .compound-middle {
96
+ margin-bottom: 0.5em }
97
+
98
+ div.compound .compound-last, div.compound .compound-middle {
99
+ margin-top: 0.5em }
100
+ */
101
+
102
+ div.dedication {
103
+ margin: 2em 5em ;
104
+ text-align: center ;
105
+ font-style: italic }
106
+
107
+ div.dedication p.topic-title {
108
+ font-weight: bold ;
109
+ font-style: normal }
110
+
111
+ div.figure {
112
+ margin-left: 2em ;
113
+ margin-right: 2em }
114
+
115
+ div.footer, div.header {
116
+ clear: both;
117
+ font-size: smaller }
118
+
119
+ div.line-block {
120
+ display: block ;
121
+ margin-top: 1em ;
122
+ margin-bottom: 1em }
123
+
124
+ div.line-block div.line-block {
125
+ margin-top: 0 ;
126
+ margin-bottom: 0 ;
127
+ margin-left: 1.5em }
128
+
129
+ div.sidebar {
130
+ margin: 0 0 0.5em 1em ;
131
+ border: medium outset ;
132
+ padding: 1em ;
133
+ background-color: #ffffee ;
134
+ width: 40% ;
135
+ float: right ;
136
+ clear: right }
137
+
138
+ div.sidebar p.rubric {
139
+ font-family: sans-serif ;
140
+ font-size: medium }
141
+
142
+ div.system-messages {
143
+ margin: 5em }
144
+
145
+ div.system-messages h1 {
146
+ color: red }
147
+
148
+ div.system-message {
149
+ border: medium outset ;
150
+ padding: 1em }
151
+
152
+ div.system-message p.system-message-title {
153
+ color: red ;
154
+ font-weight: bold }
155
+
156
+ div.topic {
157
+ margin: 2em }
158
+
159
+ h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
160
+ h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
161
+ margin-top: 0.4em }
162
+
163
+ h1.title {
164
+ text-align: center }
165
+
166
+ h2.subtitle {
167
+ text-align: center }
168
+
169
+ hr.docutils {
170
+ width: 75% }
171
+
172
+ img.align-left, .figure.align-left, object.align-left, table.align-left {
173
+ clear: left ;
174
+ float: left ;
175
+ margin-right: 1em }
176
+
177
+ img.align-right, .figure.align-right, object.align-right, table.align-right {
178
+ clear: right ;
179
+ float: right ;
180
+ margin-left: 1em }
181
+
182
+ img.align-center, .figure.align-center, object.align-center {
183
+ display: block;
184
+ margin-left: auto;
185
+ margin-right: auto;
186
+ }
187
+
188
+ table.align-center {
189
+ margin-left: auto;
190
+ margin-right: auto;
191
+ }
192
+
193
+ .align-left {
194
+ text-align: left }
195
+
196
+ .align-center {
197
+ clear: both ;
198
+ text-align: center }
199
+
200
+ .align-right {
201
+ text-align: right }
202
+
203
+ /* reset inner alignment in figures */
204
+ div.align-right {
205
+ text-align: inherit }
206
+
207
+ /* div.align-center * { */
208
+ /* text-align: left } */
209
+
210
+ .align-top {
211
+ vertical-align: top }
212
+
213
+ .align-middle {
214
+ vertical-align: middle }
215
+
216
+ .align-bottom {
217
+ vertical-align: bottom }
218
+
219
+ ol.simple, ul.simple {
220
+ margin-bottom: 1em }
221
+
222
+ ol.arabic {
223
+ list-style: decimal }
224
+
225
+ ol.loweralpha {
226
+ list-style: lower-alpha }
227
+
228
+ ol.upperalpha {
229
+ list-style: upper-alpha }
230
+
231
+ ol.lowerroman {
232
+ list-style: lower-roman }
233
+
234
+ ol.upperroman {
235
+ list-style: upper-roman }
236
+
237
+ p.attribution {
238
+ text-align: right ;
239
+ margin-left: 50% }
240
+
241
+ p.caption {
242
+ font-style: italic }
243
+
244
+ p.credits {
245
+ font-style: italic ;
246
+ font-size: smaller }
247
+
248
+ p.label {
249
+ white-space: nowrap }
250
+
251
+ p.rubric {
252
+ font-weight: bold ;
253
+ font-size: larger ;
254
+ color: maroon ;
255
+ text-align: center }
256
+
257
+ p.sidebar-title {
258
+ font-family: sans-serif ;
259
+ font-weight: bold ;
260
+ font-size: larger }
261
+
262
+ p.sidebar-subtitle {
263
+ font-family: sans-serif ;
264
+ font-weight: bold }
265
+
266
+ p.topic-title {
267
+ font-weight: bold }
268
+
269
+ pre.address {
270
+ margin-bottom: 0 ;
271
+ margin-top: 0 ;
272
+ font: inherit }
273
+
274
+ pre.literal-block, pre.doctest-block, pre.math, pre.code {
275
+ margin-left: 2em ;
276
+ margin-right: 2em }
277
+
278
+ pre.code .ln { color: grey; } /* line numbers */
279
+ pre.code, code { background-color: #eeeeee }
280
+ pre.code .comment, code .comment { color: #5C6576 }
281
+ pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
282
+ pre.code .literal.string, code .literal.string { color: #0C5404 }
283
+ pre.code .name.builtin, code .name.builtin { color: #352B84 }
284
+ pre.code .deleted, code .deleted { background-color: #DEB0A1}
285
+ pre.code .inserted, code .inserted { background-color: #A3D289}
286
+
287
+ span.classifier {
288
+ font-family: sans-serif ;
289
+ font-style: oblique }
290
+
291
+ span.classifier-delimiter {
292
+ font-family: sans-serif ;
293
+ font-weight: bold }
294
+
295
+ span.interpreted {
296
+ font-family: sans-serif }
297
+
298
+ span.option {
299
+ white-space: nowrap }
300
+
301
+ span.pre {
302
+ white-space: pre }
303
+
304
+ span.problematic {
305
+ color: red }
306
+
307
+ span.section-subtitle {
308
+ /* font-size relative to parent (h1..h6 element) */
309
+ font-size: 80% }
310
+
311
+ table.citation {
312
+ border-left: solid 1px gray;
313
+ margin-left: 1px }
314
+
315
+ table.docinfo {
316
+ margin: 2em 4em }
317
+
318
+ table.docutils {
319
+ margin-top: 0.5em ;
320
+ margin-bottom: 0.5em }
321
+
322
+ table.footnote {
323
+ border-left: solid 1px black;
324
+ margin-left: 1px }
325
+
326
+ table.docutils td, table.docutils th,
327
+ table.docinfo td, table.docinfo th {
328
+ padding-left: 0.5em ;
329
+ padding-right: 0.5em ;
330
+ vertical-align: top }
331
+
332
+ table.docutils th.field-name, table.docinfo th.docinfo-name {
333
+ font-weight: bold ;
334
+ text-align: left ;
335
+ white-space: nowrap ;
336
+ padding-left: 0 }
337
+
338
+ /* "booktabs" style (no vertical lines) */
339
+ table.docutils.booktabs {
340
+ border: 0px;
341
+ border-top: 2px solid;
342
+ border-bottom: 2px solid;
343
+ border-collapse: collapse;
344
+ }
345
+ table.docutils.booktabs * {
346
+ border: 0px;
347
+ }
348
+ table.docutils.booktabs th {
349
+ border-bottom: thin solid;
350
+ text-align: left;
351
+ }
352
+
353
+ h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
354
+ h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
355
+ font-size: 100% }
356
+
357
+ ul.auto-toc {
358
+ list-style-type: none }
359
+
360
+ </style>
361
+ </head>
362
+ <body>
363
+ <div class="document" id="aria2-the-ultra-fast-download-utility">
364
+ <h1 class="title">aria2 - The ultra fast download utility</h1>
365
+
366
+ <div class="section" id="disclaimer">
367
+ <h1>Disclaimer</h1>
368
+ <p>This program comes with no warranty.
369
+ You must use this program at your own risk.</p>
370
+ </div>
371
+ <div class="section" id="introduction">
372
+ <h1>Introduction</h1>
373
+ <p>aria2 is a utility for downloading files. The supported protocols are
374
+ HTTP(S), FTP, SFTP, BitTorrent, and Metalink. aria2 can download a
375
+ file from multiple sources/protocols and tries to utilize your maximum
376
+ download bandwidth. It supports downloading a file from
377
+ HTTP(S)/FTP/SFTP and BitTorrent at the same time, while the data
378
+ downloaded from HTTP(S)/FTP/SFTP is uploaded to the BitTorrent
379
+ swarm. Using Metalink's chunk checksums, aria2 automatically validates
380
+ chunks of data while downloading a file like BitTorrent.</p>
381
+ <p>The project page is located at <a class="reference external" href="https://aria2.github.io/">https://aria2.github.io/</a>.</p>
382
+ <p>See <a class="reference external" href="https://aria2.github.io/manual/en/html/">aria2 Online Manual</a> (<a class="reference external" href="https://aria2.github.io/manual/ru/html/">Russian translation</a>, <a class="reference external" href="https://aria2.github.io/manual/pt/html/">Portuguese
383
+ translation</a>) to learn
384
+ how to use aria2.</p>
385
+ </div>
386
+ <div class="section" id="features">
387
+ <h1>Features</h1>
388
+ <p>Here is a list of features:</p>
389
+ <ul class="simple">
390
+ <li>Command-line interface</li>
391
+ <li>Download files through HTTP(S)/FTP/SFTP/BitTorrent</li>
392
+ <li>Segmented downloading</li>
393
+ <li>Metalink version 4 (RFC 5854) support(HTTP/FTP/SFTP/BitTorrent)</li>
394
+ <li>Metalink version 3.0 support(HTTP/FTP/SFTP/BitTorrent)</li>
395
+ <li>Metalink/HTTP (RFC 6249) support</li>
396
+ <li>HTTP/1.1 implementation</li>
397
+ <li>HTTP Proxy support</li>
398
+ <li>HTTP BASIC authentication support</li>
399
+ <li>HTTP Proxy authentication support</li>
400
+ <li>Well-known environment variables for proxy: <tt class="docutils literal">http_proxy</tt>,
401
+ <tt class="docutils literal">https_proxy</tt>, <tt class="docutils literal">ftp_proxy</tt>, <tt class="docutils literal">all_proxy</tt> and <tt class="docutils literal">no_proxy</tt></li>
402
+ <li>HTTP gzip, deflate content encoding support</li>
403
+ <li>Verify peer using given trusted CA certificate in HTTPS</li>
404
+ <li>Client certificate authentication in HTTPS</li>
405
+ <li>Chunked transfer encoding support</li>
406
+ <li>Load Cookies from file using the Firefox3 format, Chromium/Google Chrome
407
+ and the Mozilla/Firefox
408
+ (1.x/2.x)/Netscape format.</li>
409
+ <li>Save Cookies in the Mozilla/Firefox (1.x/2.x)/Netscape format.</li>
410
+ <li>Custom HTTP Header support</li>
411
+ <li>Persistent Connections support</li>
412
+ <li>FTP/SFTP through HTTP Proxy</li>
413
+ <li>Download/Upload speed throttling</li>
414
+ <li>BitTorrent extensions: Fast extension, DHT, PEX, MSE/PSE,
415
+ Multi-Tracker, UDP tracker</li>
416
+ <li>BitTorrent <a class="reference external" href="http://getright.com/seedtorrent.html">WEB-Seeding</a>.
417
+ aria2 requests chunks more than piece size to reduce the request
418
+ overhead. It also supports pipelined requests with piece size.</li>
419
+ <li>BitTorrent Local Peer Discovery</li>
420
+ <li>Rename/change the directory structure of BitTorrent downloads
421
+ completely</li>
422
+ <li>JSON-RPC (over HTTP and WebSocket)/XML-RPC interface</li>
423
+ <li>Run as a daemon process</li>
424
+ <li>Selective download in multi-file torrent/Metalink</li>
425
+ <li>Chunk checksum validation in Metalink</li>
426
+ <li>Can disable segmented downloading in Metalink</li>
427
+ <li>Netrc support</li>
428
+ <li>Configuration file support</li>
429
+ <li>Download URIs found in a text file or stdin and the destination
430
+ directory and output file name can be specified optionally</li>
431
+ <li>Parameterized URI support</li>
432
+ <li>IPv6 support with Happy Eyeballs</li>
433
+ <li>Disk cache to reduce disk activity</li>
434
+ </ul>
435
+ </div>
436
+ <div class="section" id="versioning-and-release-schedule">
437
+ <h1>Versioning and release schedule</h1>
438
+ <p>We use 3 numbers for aria2 version: MAJOR.MINOR.PATCH. We will ship
439
+ MINOR update on 15th of every month. We may skip a release if we have
440
+ no changes since the last release. The feature and documentation
441
+ freeze happens 10 days before the release day (5th day of the month)
442
+ for translation teams. We will raise an issue about the upcoming
443
+ release around that day.</p>
444
+ <p>We may release PATCH releases between regular releases if we have
445
+ security issues.</p>
446
+ <p>MAJOR version will stay at 1 for the time being.</p>
447
+ </div>
448
+ <div class="section" id="how-to-get-source-code">
449
+ <h1>How to get source code</h1>
450
+ <p>We maintain the source code at Github:
451
+ <a class="reference external" href="https://github.com/aria2/aria2">https://github.com/aria2/aria2</a></p>
452
+ <p>To get the latest source code, run following command:</p>
453
+ <pre class="literal-block">
454
+ $ git clone https://github.com/aria2/aria2.git
455
+ </pre>
456
+ <p>This will create aria2 directory in your current directory and source
457
+ files are stored there.</p>
458
+ </div>
459
+ <div class="section" id="dependency">
460
+ <h1>Dependency</h1>
461
+ <table border="1" class="docutils">
462
+ <colgroup>
463
+ <col width="35%" />
464
+ <col width="65%" />
465
+ </colgroup>
466
+ <thead valign="bottom">
467
+ <tr><th class="head">features</th>
468
+ <th class="head">dependency</th>
469
+ </tr>
470
+ </thead>
471
+ <tbody valign="top">
472
+ <tr><td>HTTPS</td>
473
+ <td>OSX or GnuTLS or OpenSSL or Windows</td>
474
+ </tr>
475
+ <tr><td>SFTP</td>
476
+ <td>libssh2</td>
477
+ </tr>
478
+ <tr><td>BitTorrent</td>
479
+ <td>None. Optional: libnettle+libgmp or libgcrypt
480
+ or OpenSSL (see note)</td>
481
+ </tr>
482
+ <tr><td>Metalink</td>
483
+ <td>libxml2 or Expat.</td>
484
+ </tr>
485
+ <tr><td>Checksum</td>
486
+ <td>None. Optional: OSX or libnettle or libgcrypt
487
+ or OpenSSL or Windows (see note)</td>
488
+ </tr>
489
+ <tr><td>gzip, deflate in HTTP</td>
490
+ <td>zlib</td>
491
+ </tr>
492
+ <tr><td>Async DNS</td>
493
+ <td>C-Ares</td>
494
+ </tr>
495
+ <tr><td>Firefox3/Chromium cookie</td>
496
+ <td>libsqlite3</td>
497
+ </tr>
498
+ <tr><td>XML-RPC</td>
499
+ <td>libxml2 or Expat.</td>
500
+ </tr>
501
+ <tr><td>JSON-RPC over WebSocket</td>
502
+ <td>libnettle or libgcrypt or OpenSSL</td>
503
+ </tr>
504
+ </tbody>
505
+ </table>
506
+ <div class="admonition note">
507
+ <p class="first admonition-title">Note</p>
508
+ <p class="last">libxml2 has precedence over Expat if both libraries are installed.
509
+ If you prefer Expat, run configure with <tt class="docutils literal"><span class="pre">--without-libxml2</span></tt>.</p>
510
+ </div>
511
+ <div class="admonition note">
512
+ <p class="first admonition-title">Note</p>
513
+ <p>On Apple OSX the OS-level SSL/TLS support will be preferred. Hence
514
+ neither GnuTLS nor OpenSSL are required on that platform. If you'd
515
+ like to disable this behavior, run configure with
516
+ <tt class="docutils literal"><span class="pre">--without-appletls</span></tt>.</p>
517
+ <p>GnuTLS has precedence over OpenSSL if both libraries are installed.
518
+ If you prefer OpenSSL, run configure with <tt class="docutils literal"><span class="pre">--without-gnutls</span></tt>
519
+ <tt class="docutils literal"><span class="pre">--with-openssl</span></tt>.</p>
520
+ <p class="last">On Windows there is SSL implementation available that is based on
521
+ the native Windows SSL capabilities (Schannel) and it will be
522
+ preferred. Hence neither GnuTLS nor OpenSSL are required on that
523
+ platform. If you'd like to disable this behavior, run configure
524
+ with <tt class="docutils literal"><span class="pre">--without-wintls</span></tt>.</p>
525
+ </div>
526
+ <div class="admonition note">
527
+ <p class="first admonition-title">Note</p>
528
+ <p>On Apple OSX the OS-level checksum support will be preferred,
529
+ unless aria2 is configured with <tt class="docutils literal"><span class="pre">--without-appletls</span></tt>.</p>
530
+ <p>libnettle has precedence over libgcrypt if both libraries are
531
+ installed. If you prefer libgcrypt, run configure with
532
+ <tt class="docutils literal"><span class="pre">--without-libnettle</span> <span class="pre">--with-libgcrypt</span></tt>. If OpenSSL is selected over
533
+ GnuTLS, neither libnettle nor libgcrypt will be used.</p>
534
+ <p>If none of the optional dependencies are installed, an internal
535
+ implementation that only supports md5 and sha1 will be used.</p>
536
+ <p class="last">On Windows there is SSL implementation available that is based on
537
+ the native Windows capabilities and it will be preferred, unless
538
+ aria2 is configured with <tt class="docutils literal"><span class="pre">--without-wintls</span></tt>.</p>
539
+ </div>
540
+ <p>A user can have one of the following configurations for SSL and crypto
541
+ libraries:</p>
542
+ <ul class="simple">
543
+ <li>OpenSSL</li>
544
+ <li>GnuTLS + libgcrypt</li>
545
+ <li>GnuTLS + libnettle</li>
546
+ <li>Apple TLS (OSX only)</li>
547
+ <li>Windows TLS (Windows only)</li>
548
+ </ul>
549
+ <p>You can disable BitTorrent and Metalink support by providing
550
+ <tt class="docutils literal"><span class="pre">--disable-bittorrent</span></tt> and <tt class="docutils literal"><span class="pre">--disable-metalink</span></tt> to the configure
551
+ script respectively.</p>
552
+ <p>In order to enable async DNS support, you need c-ares.</p>
553
+ <ul class="simple">
554
+ <li>c-ares: <a class="reference external" href="http://c-ares.haxx.se/">http://c-ares.haxx.se/</a></li>
555
+ </ul>
556
+ </div>
557
+ <div class="section" id="how-to-build">
558
+ <h1>How to build</h1>
559
+ <p>aria2 is primarily written in C++. Initially it was written based on
560
+ C++98/C++03 standard features. We are now migrating aria2 to C++11
561
+ standard. The current source code requires C++11 aware compiler. For
562
+ well-known compilers, such as g++ and clang, the <tt class="docutils literal"><span class="pre">-std=c++11</span></tt> or
563
+ <tt class="docutils literal"><span class="pre">-std=c++0x</span></tt> flag must be supported.</p>
564
+ <p>In order to build aria2 from the source package, you need following
565
+ development packages (package name may vary depending on the
566
+ distribution you use):</p>
567
+ <ul class="simple">
568
+ <li>libgnutls-dev (Required for HTTPS, BitTorrent, Checksum support)</li>
569
+ <li>nettle-dev (Required for BitTorrent, Checksum support)</li>
570
+ <li>libgmp-dev (Required for BitTorrent)</li>
571
+ <li>libssh2-1-dev (Required for SFTP support)</li>
572
+ <li>libc-ares-dev (Required for async DNS support)</li>
573
+ <li>libxml2-dev (Required for Metalink support)</li>
574
+ <li>zlib1g-dev (Required for gzip, deflate decoding support in HTTP)</li>
575
+ <li>libsqlite3-dev (Required for Firefox3/Chromium cookie support)</li>
576
+ <li>pkg-config (Required to detect installed libraries)</li>
577
+ </ul>
578
+ <p>You can use libgcrypt-dev instead of nettle-dev and libgmp-dev:</p>
579
+ <ul class="simple">
580
+ <li>libgpg-error-dev (Required for BitTorrent, Checksum support)</li>
581
+ <li>libgcrypt-dev (Required for BitTorrent, Checksum support)</li>
582
+ </ul>
583
+ <p>You can use libssl-dev instead of
584
+ libgnutls-dev, nettle-dev, libgmp-dev, libgpg-error-dev and libgcrypt-dev:</p>
585
+ <ul class="simple">
586
+ <li>libssl-dev (Required for HTTPS, BitTorrent, Checksum support)</li>
587
+ </ul>
588
+ <p>You can use libexpat1-dev instead of libxml2-dev:</p>
589
+ <ul class="simple">
590
+ <li>libexpat1-dev (Required for Metalink support)</li>
591
+ </ul>
592
+ <p>On Fedora you need the following packages: gcc, gcc-c++, kernel-devel,
593
+ libgcrypt-devel, libxml2-devel, openssl-devel, gettext-devel, cppunit</p>
594
+ <p>If you downloaded source code from git repository, you have to install
595
+ following packages to get autoconf macros:</p>
596
+ <ul class="simple">
597
+ <li>libxml2-dev</li>
598
+ <li>libcppunit-dev</li>
599
+ <li>autoconf</li>
600
+ <li>automake</li>
601
+ <li>autotools-dev</li>
602
+ <li>autopoint</li>
603
+ <li>libtool</li>
604
+ </ul>
605
+ <p>And run following command to generate configure script and other files
606
+ necessary to build the program:</p>
607
+ <pre class="literal-block">
608
+ $ autoreconf -i
609
+ </pre>
610
+ <p>Also you need <a class="reference external" href="http://sphinx-doc.org/">Sphinx</a> to build man page.</p>
611
+ <p>If you are building aria2 for Mac OS X, take a look at
612
+ the makerelease-osx.mk GNU Make makefile.</p>
613
+ <p>The quickest way to build aria2 is first run configure script:</p>
614
+ <pre class="literal-block">
615
+ $ ./configure
616
+ </pre>
617
+ <p>To build statically linked aria2, use <tt class="docutils literal">ARIA2_STATIC=yes</tt>
618
+ command-line option:</p>
619
+ <pre class="literal-block">
620
+ $ ./configure ARIA2_STATIC=yes
621
+ </pre>
622
+ <p>After configuration is done, run <tt class="docutils literal">make</tt> to compile the program:</p>
623
+ <pre class="literal-block">
624
+ $ make
625
+ </pre>
626
+ <p>See <a class="reference internal" href="#cross-compiling-windows-binary">Cross-compiling Windows binary</a> to create a Windows binary.
627
+ See <a class="reference internal" href="#cross-compiling-android-binary">Cross-compiling Android binary</a> to create an Android binary.</p>
628
+ <p>The configure script checks available libraries and enables as many
629
+ features as possible except for experimental features not enabled by
630
+ default.</p>
631
+ <p>Since 1.1.0, aria2 checks the certificate of HTTPS servers by default.
632
+ If you build with OpenSSL or the recent version of GnuTLS which has
633
+ <tt class="docutils literal">gnutls_certificate_set_x509_system_trust()</tt> function and the
634
+ library is properly configured to locate the system-wide CA
635
+ certificates store, aria2 will automatically load those certificates
636
+ at the startup. If it is not the case, I recommend to supply the path
637
+ to the CA bundle file. For example, in Debian the path to CA bundle
638
+ file is '/etc/ssl/certs/ca-certificates.crt' (in ca-certificates
639
+ package). This may vary depending on your distribution. You can give
640
+ it to configure script using <tt class="docutils literal"><span class="pre">--with-ca-bundle</span> option</tt>:</p>
641
+ <pre class="literal-block">
642
+ $ ./configure --with-ca-bundle='/etc/ssl/certs/ca-certificates.crt'
643
+ $ make
644
+ </pre>
645
+ <p>Without <tt class="docutils literal"><span class="pre">--with-ca-bundle</span></tt> option, you will encounter the error when
646
+ accessing HTTPS servers because the certificate cannot be verified
647
+ without CA bundle. In such case, you can specify the CA bundle file
648
+ using aria2's <tt class="docutils literal"><span class="pre">--ca-certificate</span></tt> option. If you don't have CA bundle
649
+ file installed, then the last resort is disable the certificate
650
+ validation using <tt class="docutils literal"><span class="pre">--check-certificate=false</span></tt>.</p>
651
+ <p>Using the native OSX (AppleTLS) and/or Windows (WinTLS) implementation
652
+ will automatically use the system certificate store, so
653
+ <tt class="docutils literal"><span class="pre">--with-ca-bundle</span></tt> is not necessary and will be ignored when using
654
+ these implementations.</p>
655
+ <p>By default, the bash_completion file named <tt class="docutils literal">aria2c</tt> is installed to
656
+ the directory <tt class="docutils literal">$prefix/share/doc/aria2/bash_completion</tt>. To change
657
+ the install directory of the file, use <tt class="docutils literal"><span class="pre">--with-bashcompletiondir</span></tt>
658
+ option.</p>
659
+ <p>After a <tt class="docutils literal">make</tt> the executable is located at <tt class="docutils literal">src/aria2c</tt>.</p>
660
+ <p>aria2 uses CppUnit for automated unit testing. To run the unit test:</p>
661
+ <pre class="literal-block">
662
+ $ make check
663
+ </pre>
664
+ </div>
665
+ <div class="section" id="cross-compiling-windows-binary">
666
+ <h1>Cross-compiling Windows binary</h1>
667
+ <p>In this section, we describe how to build a Windows binary using a
668
+ mingw-w64 (<a class="reference external" href="http://mingw-w64.org/doku.php">http://mingw-w64.org/doku.php</a>) cross-compiler on Debian
669
+ Linux. The MinGW (<a class="reference external" href="http://www.mingw.org/">http://www.mingw.org/</a>) may not be able to build
670
+ aria2.</p>
671
+ <p>The easiest way to build Windows binary is use Dockerfile.mingw. See
672
+ Dockerfile.mingw how to build binary. If you cannot use Dockerfile,
673
+ then continue to read following paragraphs.</p>
674
+ <p>Basically, after compiling and installing depended libraries, you can
675
+ do cross-compile just passing appropriate <tt class="docutils literal"><span class="pre">--host</span></tt> option and
676
+ specifying <tt class="docutils literal">CPPFLAGS</tt>, <tt class="docutils literal">LDFLAGS</tt> and <tt class="docutils literal">PKG_CONFIG_LIBDIR</tt>
677
+ variables to configure. For convenience and lowering our own
678
+ development cost, we provide easier way to configure the build
679
+ settings.</p>
680
+ <p><tt class="docutils literal"><span class="pre">mingw-config</span></tt> script is a configure script wrapper for mingw-w64.
681
+ We use it to create official Windows build. This script assumes
682
+ following libraries have been built for cross-compile:</p>
683
+ <ul class="simple">
684
+ <li>c-ares</li>
685
+ <li>expat</li>
686
+ <li>sqlite3</li>
687
+ <li>zlib</li>
688
+ <li>libssh2</li>
689
+ <li>cppunit</li>
690
+ </ul>
691
+ <p>Some environment variables can be adjusted to change build settings:</p>
692
+ <dl class="docutils">
693
+ <dt><tt class="docutils literal">HOST</tt></dt>
694
+ <dd>cross-compile to build programs to run on <tt class="docutils literal">HOST</tt>. It defaults to
695
+ <tt class="docutils literal"><span class="pre">i686-w64-mingw32</span></tt>. To build 64bit binary, specify
696
+ <tt class="docutils literal"><span class="pre">x86_64-w64-mingw32</span></tt>.</dd>
697
+ <dt><tt class="docutils literal">PREFIX</tt></dt>
698
+ <dd>Prefix to the directory where dependent libraries are installed. It
699
+ defaults to <tt class="docutils literal"><span class="pre">/usr/local/$HOST</span></tt>. <tt class="docutils literal"><span class="pre">-I$PREFIX/include</span></tt> will be
700
+ added to <tt class="docutils literal">CPPFLAGS</tt>. <tt class="docutils literal"><span class="pre">-L$PREFIX/lib</span></tt> will be added to
701
+ <tt class="docutils literal">LDFLAGS</tt>. <tt class="docutils literal">$PREFIX/lib/pkgconfig</tt> will be set to
702
+ <tt class="docutils literal">PKG_CONFIG_LIBDIR</tt>.</dd>
703
+ </dl>
704
+ <p>For example, to build 64bit binary do this:</p>
705
+ <pre class="literal-block">
706
+ $ HOST=x86_64-w64-mingw32 ./mingw-config
707
+ </pre>
708
+ <p>If you want libaria2 dll with <tt class="docutils literal"><span class="pre">--enable-libaria2</span></tt>, then don't use
709
+ <tt class="docutils literal">ARIA2_STATIC=yes</tt> and prepare the DLL version of external
710
+ libraries.</p>
711
+ </div>
712
+ <div class="section" id="cross-compiling-android-binary">
713
+ <h1>Cross-compiling Android binary</h1>
714
+ <p>In this section, we describe how to build Android binary using Android
715
+ NDK cross-compiler on Debian Linux.</p>
716
+ <p>At the time of this writing, Android NDK r21e should compile aria2
717
+ without errors.</p>
718
+ <p><tt class="docutils literal"><span class="pre">android-config</span></tt> script is a configure script wrapper for Android
719
+ build. We use it to create official Android build. This script
720
+ assumes the following libraries have been built for cross-compile:</p>
721
+ <ul class="simple">
722
+ <li>c-ares</li>
723
+ <li>openssl</li>
724
+ <li>expat</li>
725
+ <li>zlib</li>
726
+ <li>libssh2</li>
727
+ </ul>
728
+ <p>When building the above libraries, make sure that disable shared
729
+ library and enable only static library. We are going to link those
730
+ libraries statically.</p>
731
+ <p><tt class="docutils literal"><span class="pre">android-config</span></tt> assumes that <tt class="docutils literal">$ANDROID_HOME</tt> and <tt class="docutils literal">$NDK</tt>
732
+ environment variables are defined.</p>
733
+ <p>We currently use Android NDK r21e. <tt class="docutils literal">$NDK</tt> should point to the
734
+ directory to Anroid NDK. The build tools will be found under
735
+ <tt class="docutils literal"><span class="pre">$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/</span></tt>.</p>
736
+ <p>All the dependent libraries must be installed under
737
+ <tt class="docutils literal">$ANDROID_HOME/usr/local</tt>.</p>
738
+ <p>After <tt class="docutils literal"><span class="pre">android-config</span></tt>, run <tt class="docutils literal">make</tt> to compile sources.</p>
739
+ </div>
740
+ <div class="section" id="building-documentation">
741
+ <h1>Building documentation</h1>
742
+ <p><a class="reference external" href="http://sphinx-doc.org/">Sphinx</a> is used to build the
743
+ documentation. aria2 man pages will be build when you run <tt class="docutils literal">make</tt> if
744
+ they are not up-to-date. You can also build HTML version of aria2 man
745
+ page by <tt class="docutils literal">make html</tt>. The HTML version manual is also available at
746
+ <a class="reference external" href="https://aria2.github.io/manual/en/html/">online</a> (<a class="reference external" href="https://aria2.github.io/manual/ru/html/">Russian
747
+ translation</a>, <a class="reference external" href="https://aria2.github.io/manual/pt/html/">Portuguese
748
+ translation</a>).</p>
749
+ </div>
750
+ <div class="section" id="bittorrent">
751
+ <h1>BitTorrent</h1>
752
+ <div class="section" id="about-file-names">
753
+ <h2>About file names</h2>
754
+ <p>The file name of the downloaded file is determined as follows:</p>
755
+ <dl class="docutils">
756
+ <dt>single-file mode</dt>
757
+ <dd>If &quot;name&quot; key is present in .torrent file, file name is the value
758
+ of &quot;name&quot; key. Otherwise, file name is the base name of .torrent
759
+ file appended by &quot;.file&quot;. For example, .torrent file is
760
+ &quot;test.torrent&quot;, then file name is &quot;test.torrent.file&quot;. The
761
+ directory to store the downloaded file can be specified by -d
762
+ option.</dd>
763
+ <dt>multi-file mode</dt>
764
+ <dd>The complete directory/file structure mentioned in .torrent file
765
+ is created. The directory to store the top directory of
766
+ downloaded files can be specified by -d option.</dd>
767
+ </dl>
768
+ <p>Before download starts, a complete directory structure is created if
769
+ needed. By default, aria2 opens at most 100 files mentioned in
770
+ .torrent file, and directly writes to and reads from these files.
771
+ The number of files to open simultaneously can be controlled by
772
+ <tt class="docutils literal"><span class="pre">--bt-max-open-files</span></tt> option.</p>
773
+ </div>
774
+ <div class="section" id="dht">
775
+ <h2>DHT</h2>
776
+ <p>aria2 supports mainline compatible DHT. By default, the routing table
777
+ for IPv4 DHT is saved to <tt class="docutils literal">$XDG_CACHE_HOME/aria2/dht.dat</tt> and the
778
+ routing table for IPv6 DHT is saved to
779
+ <tt class="docutils literal">$XDG_CACHE_HOME/aria2/dht6.dat</tt> unless files exist at
780
+ <tt class="docutils literal"><span class="pre">$HOME/.aria2/dht.dat</span></tt> or <tt class="docutils literal"><span class="pre">$HOME/.aria2/dht6.dat</span></tt>. aria2 uses same
781
+ port number to listen on for both IPv4 and IPv6 DHT.</p>
782
+ </div>
783
+ <div class="section" id="udp-tracker">
784
+ <h2>UDP tracker</h2>
785
+ <p>UDP tracker support is enabled when IPv4 DHT is enabled. The port
786
+ number of UDP tracker is shared with DHT. Use <tt class="docutils literal"><span class="pre">--dht-listen-port</span></tt>
787
+ option to change the port number.</p>
788
+ </div>
789
+ <div class="section" id="other-things-should-be-noted">
790
+ <h2>Other things should be noted</h2>
791
+ <ul class="simple">
792
+ <li><tt class="docutils literal"><span class="pre">-o</span></tt> option is used to change the file name of .torrent file itself,
793
+ not a file name of a file in .torrent file. For this purpose, use
794
+ <tt class="docutils literal"><span class="pre">--index-out</span></tt> option instead.</li>
795
+ <li>The port numbers that aria2 uses by default are 6881-6999 for TCP
796
+ and UDP.</li>
797
+ <li>aria2 doesn't configure port-forwarding automatically. Please
798
+ configure your router or firewall manually.</li>
799
+ <li>The maximum number of peers is 55. This limit may be exceeded when
800
+ download rate is low. This download rate can be adjusted using
801
+ <tt class="docutils literal"><span class="pre">--bt-request-peer-speed-limit</span></tt> option.</li>
802
+ <li>As of release 0.10.0, aria2 stops sending request message after
803
+ selective download completes.</li>
804
+ </ul>
805
+ </div>
806
+ </div>
807
+ <div class="section" id="metalink">
808
+ <h1>Metalink</h1>
809
+ <p>The current implementation supports HTTP(S)/FTP/SFTP/BitTorrent. The
810
+ other P2P protocols are ignored. Both Metalink4 (RFC 5854) and
811
+ Metalink version 3.0 documents are supported.</p>
812
+ <p>For checksum verification, md5, sha-1, sha-224, sha-256, sha-384 and
813
+ sha-512 are supported. If multiple hash algorithms are provided, aria2
814
+ uses stronger one. If whole file checksum verification fails, aria2
815
+ doesn't retry the download and just exits with non-zero return code.</p>
816
+ <p>The supported user preferences are version, language, location,
817
+ protocol and os.</p>
818
+ <p>If chunk checksums are provided in Metalink file, aria2 automatically
819
+ validates chunks of data during download. This behavior can be turned
820
+ off by a command-line option.</p>
821
+ <p>If signature is included in a Metalink file, aria2 saves it as a file
822
+ after the completion of the download. The file name is download
823
+ file name + &quot;.sig&quot;. If same file already exists, the signature file is
824
+ not saved.</p>
825
+ <p>In Metalink4, multi-file torrent could appear in metalink:metaurl
826
+ element. Since aria2 cannot download 2 same torrents at the same
827
+ time, aria2 groups files in metalink:file element which has same
828
+ BitTorrent metaurl and downloads them from a single BitTorrent swarm.
829
+ This is basically multi-file torrent download with file selection, so
830
+ the adjacent files which is not in Metalink document but shares same
831
+ piece with selected file are also created.</p>
832
+ <p>If relative URI is specified in metalink:url or metalink:metaurl
833
+ element, aria2 uses the URI of Metalink file as base URI to resolve
834
+ the relative URI. If relative URI is found in Metalink file which is
835
+ read from local disk, aria2 uses the value of <tt class="docutils literal"><span class="pre">--metalink-base-uri</span></tt>
836
+ option as base URI. If this option is not specified, the relative URI
837
+ will be ignored.</p>
838
+ </div>
839
+ <div class="section" id="metalink-http">
840
+ <h1>Metalink/HTTP</h1>
841
+ <p>The current implementation only uses rel=duplicate links only. aria2
842
+ understands Digest header fields and check whether it matches the
843
+ digest value from other sources. If it differs, drop connection.
844
+ aria2 also uses this digest value to perform checksum verification
845
+ after download finished. aria2 recognizes geo value. To tell aria2
846
+ which location you prefer, you can use <tt class="docutils literal"><span class="pre">--metalink-location</span></tt> option.</p>
847
+ </div>
848
+ <div class="section" id="netrc">
849
+ <h1>netrc</h1>
850
+ <p>netrc support is enabled by default for HTTP(S)/FTP/SFTP. To disable
851
+ netrc support, specify -n command-line option. Your .netrc file
852
+ should have correct permissions(600).</p>
853
+ </div>
854
+ <div class="section" id="websocket">
855
+ <h1>WebSocket</h1>
856
+ <p>The WebSocket server embedded in aria2 implements the specification
857
+ defined in RFC 6455. The supported protocol version is 13.</p>
858
+ </div>
859
+ <div class="section" id="libaria2">
860
+ <h1>libaria2</h1>
861
+ <p>The libaria2 is a C++ library which offers aria2 functionality to the
862
+ client code. Currently, libaria2 is not built by default. To enable
863
+ libaria2, use <tt class="docutils literal"><span class="pre">--enable-libaria2</span></tt> configure option. By default,
864
+ only the shared library is built. To build static library, use
865
+ <tt class="docutils literal"><span class="pre">--enable-static</span></tt> configure option as well. See libaria2
866
+ documentation to know how to use API.</p>
867
+ </div>
868
+ <div class="section" id="references">
869
+ <h1>References</h1>
870
+ <ul class="simple">
871
+ <li><a class="reference external" href="https://aria2.github.io/manual/en/html/">aria2 Online Manual</a></li>
872
+ <li><a class="reference external" href="https://aria2.github.io/">https://aria2.github.io/</a></li>
873
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc959">RFC 959 FILE TRANSFER PROTOCOL (FTP)</a></li>
874
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc1738">RFC 1738 Uniform Resource Locators (URL)</a></li>
875
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc2428">RFC 2428 FTP Extensions for IPv6 and NATs</a></li>
876
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc2616">RFC 2616 Hypertext Transfer Protocol -- HTTP/1.1</a></li>
877
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc3659">RFC 3659 Extensions to FTP</a></li>
878
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc3986">RFC 3986 Uniform Resource Identifier (URI): Generic Syntax</a></li>
879
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc4038">RFC 4038 Application Aspects of IPv6 Transition</a></li>
880
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc5854">RFC 5854 The Metalink Download Description Format</a></li>
881
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc6249">RFC 6249 Metalink/HTTP: Mirrors and Hashes</a></li>
882
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc6265">RFC 6265 HTTP State Management Mechanism</a></li>
883
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc6266">RFC 6266 Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)</a></li>
884
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc6455">RFC 6455 The WebSocket Protocol</a></li>
885
+ <li><a class="reference external" href="http://tools.ietf.org/html/rfc6555">RFC 6555 Happy Eyeballs: Success with Dual-Stack Hosts</a></li>
886
+ <li><a class="reference external" href="http://www.bittorrent.org/beps/bep_0003.html">The BitTorrent Protocol Specification</a></li>
887
+ <li><a class="reference external" href="http://www.bittorrent.org/beps/bep_0005.html">BitTorrent: DHT Protocol</a></li>
888
+ <li><a class="reference external" href="http://www.bittorrent.org/beps/bep_0006.html">BitTorrent: Fast Extension</a></li>
889
+ <li><a class="reference external" href="http://www.bittorrent.org/beps/bep_0007.html">BitTorrent: IPv6 Tracker Extension</a></li>
890
+ <li><a class="reference external" href="http://www.bittorrent.org/beps/bep_0009.html">BitTorrent: Extension for Peers to Send Metadata Files</a></li>
891
+ <li><a class="reference external" href="http://www.bittorrent.org/beps/bep_0010.html">BitTorrent: Extension Protocol</a></li>
892
+ <li><a class="reference external" href="http://www.bittorrent.org/beps/bep_0012.html">BitTorrent: Multitracker Metadata Extension</a></li>
893
+ <li><a class="reference external" href="http://www.bittorrent.org/beps/bep_0015.html">BitTorrent: UDP Tracker Protocol for BitTorrent</a>
894
+ and <a class="reference external" href="http://www.rasterbar.com/products/libtorrent/udp_tracker_protocol.html">BitTorrent udp-tracker protocol specification</a>.</li>
895
+ <li><a class="reference external" href="http://www.bittorrent.org/beps/bep_0019.html">BitTorrent: WebSeed - HTTP/FTP Seeding (GetRight style)</a></li>
896
+ <li><a class="reference external" href="http://www.bittorrent.org/beps/bep_0027.html">BitTorrent: Private Torrents</a></li>
897
+ <li><a class="reference external" href="http://www.bittorrent.org/beps/bep_0032.html">BitTorrent: BitTorrent DHT Extensions for IPv6</a></li>
898
+ <li><a class="reference external" href="http://wiki.vuze.com/w/Message_Stream_Encryption">BitTorrent: Message Stream Encryption</a></li>
899
+ <li><a class="reference external" href="https://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf">Kademlia: A Peer-to-peer Information System Based on the XOR Metric</a></li>
900
+ </ul>
901
+ </div>
902
+ </div>
903
+ </body>
904
+ </html>
share/doc/aria2/README.rst ADDED
@@ -0,0 +1,565 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aria2 - The ultra fast download utility
2
+ =======================================
3
+
4
+ Disclaimer
5
+ ----------
6
+ This program comes with no warranty.
7
+ You must use this program at your own risk.
8
+
9
+ Introduction
10
+ ------------
11
+
12
+ aria2 is a utility for downloading files. The supported protocols are
13
+ HTTP(S), FTP, SFTP, BitTorrent, and Metalink. aria2 can download a
14
+ file from multiple sources/protocols and tries to utilize your maximum
15
+ download bandwidth. It supports downloading a file from
16
+ HTTP(S)/FTP/SFTP and BitTorrent at the same time, while the data
17
+ downloaded from HTTP(S)/FTP/SFTP is uploaded to the BitTorrent
18
+ swarm. Using Metalink's chunk checksums, aria2 automatically validates
19
+ chunks of data while downloading a file like BitTorrent.
20
+
21
+ The project page is located at https://aria2.github.io/.
22
+
23
+ See `aria2 Online Manual
24
+ <https://aria2.github.io/manual/en/html/>`_ (`Russian translation
25
+ <https://aria2.github.io/manual/ru/html/>`_, `Portuguese
26
+ translation <https://aria2.github.io/manual/pt/html/>`_) to learn
27
+ how to use aria2.
28
+
29
+ Features
30
+ --------
31
+
32
+ Here is a list of features:
33
+
34
+ * Command-line interface
35
+ * Download files through HTTP(S)/FTP/SFTP/BitTorrent
36
+ * Segmented downloading
37
+ * Metalink version 4 (RFC 5854) support(HTTP/FTP/SFTP/BitTorrent)
38
+ * Metalink version 3.0 support(HTTP/FTP/SFTP/BitTorrent)
39
+ * Metalink/HTTP (RFC 6249) support
40
+ * HTTP/1.1 implementation
41
+ * HTTP Proxy support
42
+ * HTTP BASIC authentication support
43
+ * HTTP Proxy authentication support
44
+ * Well-known environment variables for proxy: ``http_proxy``,
45
+ ``https_proxy``, ``ftp_proxy``, ``all_proxy`` and ``no_proxy``
46
+ * HTTP gzip, deflate content encoding support
47
+ * Verify peer using given trusted CA certificate in HTTPS
48
+ * Client certificate authentication in HTTPS
49
+ * Chunked transfer encoding support
50
+ * Load Cookies from file using the Firefox3 format, Chromium/Google Chrome
51
+ and the Mozilla/Firefox
52
+ (1.x/2.x)/Netscape format.
53
+ * Save Cookies in the Mozilla/Firefox (1.x/2.x)/Netscape format.
54
+ * Custom HTTP Header support
55
+ * Persistent Connections support
56
+ * FTP/SFTP through HTTP Proxy
57
+ * Download/Upload speed throttling
58
+ * BitTorrent extensions: Fast extension, DHT, PEX, MSE/PSE,
59
+ Multi-Tracker, UDP tracker
60
+ * BitTorrent `WEB-Seeding <http://getright.com/seedtorrent.html>`_.
61
+ aria2 requests chunks more than piece size to reduce the request
62
+ overhead. It also supports pipelined requests with piece size.
63
+ * BitTorrent Local Peer Discovery
64
+ * Rename/change the directory structure of BitTorrent downloads
65
+ completely
66
+ * JSON-RPC (over HTTP and WebSocket)/XML-RPC interface
67
+ * Run as a daemon process
68
+ * Selective download in multi-file torrent/Metalink
69
+ * Chunk checksum validation in Metalink
70
+ * Can disable segmented downloading in Metalink
71
+ * Netrc support
72
+ * Configuration file support
73
+ * Download URIs found in a text file or stdin and the destination
74
+ directory and output file name can be specified optionally
75
+ * Parameterized URI support
76
+ * IPv6 support with Happy Eyeballs
77
+ * Disk cache to reduce disk activity
78
+
79
+
80
+ Versioning and release schedule
81
+ -------------------------------
82
+
83
+ We use 3 numbers for aria2 version: MAJOR.MINOR.PATCH. We will ship
84
+ MINOR update on 15th of every month. We may skip a release if we have
85
+ no changes since the last release. The feature and documentation
86
+ freeze happens 10 days before the release day (5th day of the month)
87
+ for translation teams. We will raise an issue about the upcoming
88
+ release around that day.
89
+
90
+ We may release PATCH releases between regular releases if we have
91
+ security issues.
92
+
93
+ MAJOR version will stay at 1 for the time being.
94
+
95
+ How to get source code
96
+ ----------------------
97
+
98
+ We maintain the source code at Github:
99
+ https://github.com/aria2/aria2
100
+
101
+ To get the latest source code, run following command::
102
+
103
+ $ git clone https://github.com/aria2/aria2.git
104
+
105
+ This will create aria2 directory in your current directory and source
106
+ files are stored there.
107
+
108
+ Dependency
109
+ ----------
110
+
111
+
112
+ ======================== ========================================
113
+ features dependency
114
+ ======================== ========================================
115
+ HTTPS OSX or GnuTLS or OpenSSL or Windows
116
+ SFTP libssh2
117
+ BitTorrent None. Optional: libnettle+libgmp or libgcrypt
118
+ or OpenSSL (see note)
119
+ Metalink libxml2 or Expat.
120
+ Checksum None. Optional: OSX or libnettle or libgcrypt
121
+ or OpenSSL or Windows (see note)
122
+ gzip, deflate in HTTP zlib
123
+ Async DNS C-Ares
124
+ Firefox3/Chromium cookie libsqlite3
125
+ XML-RPC libxml2 or Expat.
126
+ JSON-RPC over WebSocket libnettle or libgcrypt or OpenSSL
127
+ ======================== ========================================
128
+
129
+
130
+ .. note::
131
+
132
+ libxml2 has precedence over Expat if both libraries are installed.
133
+ If you prefer Expat, run configure with ``--without-libxml2``.
134
+
135
+ .. note::
136
+
137
+ On Apple OSX the OS-level SSL/TLS support will be preferred. Hence
138
+ neither GnuTLS nor OpenSSL are required on that platform. If you'd
139
+ like to disable this behavior, run configure with
140
+ ``--without-appletls``.
141
+
142
+ GnuTLS has precedence over OpenSSL if both libraries are installed.
143
+ If you prefer OpenSSL, run configure with ``--without-gnutls``
144
+ ``--with-openssl``.
145
+
146
+ On Windows there is SSL implementation available that is based on
147
+ the native Windows SSL capabilities (Schannel) and it will be
148
+ preferred. Hence neither GnuTLS nor OpenSSL are required on that
149
+ platform. If you'd like to disable this behavior, run configure
150
+ with ``--without-wintls``.
151
+
152
+ .. note::
153
+
154
+ On Apple OSX the OS-level checksum support will be preferred,
155
+ unless aria2 is configured with ``--without-appletls``.
156
+
157
+ libnettle has precedence over libgcrypt if both libraries are
158
+ installed. If you prefer libgcrypt, run configure with
159
+ ``--without-libnettle --with-libgcrypt``. If OpenSSL is selected over
160
+ GnuTLS, neither libnettle nor libgcrypt will be used.
161
+
162
+ If none of the optional dependencies are installed, an internal
163
+ implementation that only supports md5 and sha1 will be used.
164
+
165
+ On Windows there is SSL implementation available that is based on
166
+ the native Windows capabilities and it will be preferred, unless
167
+ aria2 is configured with ``--without-wintls``.
168
+
169
+ A user can have one of the following configurations for SSL and crypto
170
+ libraries:
171
+
172
+ * OpenSSL
173
+ * GnuTLS + libgcrypt
174
+ * GnuTLS + libnettle
175
+ * Apple TLS (OSX only)
176
+ * Windows TLS (Windows only)
177
+
178
+ You can disable BitTorrent and Metalink support by providing
179
+ ``--disable-bittorrent`` and ``--disable-metalink`` to the configure
180
+ script respectively.
181
+
182
+ In order to enable async DNS support, you need c-ares.
183
+
184
+ * c-ares: http://c-ares.haxx.se/
185
+
186
+ How to build
187
+ ------------
188
+
189
+ aria2 is primarily written in C++. Initially it was written based on
190
+ C++98/C++03 standard features. We are now migrating aria2 to C++11
191
+ standard. The current source code requires C++11 aware compiler. For
192
+ well-known compilers, such as g++ and clang, the ``-std=c++11`` or
193
+ ``-std=c++0x`` flag must be supported.
194
+
195
+ In order to build aria2 from the source package, you need following
196
+ development packages (package name may vary depending on the
197
+ distribution you use):
198
+
199
+ * libgnutls-dev (Required for HTTPS, BitTorrent, Checksum support)
200
+ * nettle-dev (Required for BitTorrent, Checksum support)
201
+ * libgmp-dev (Required for BitTorrent)
202
+ * libssh2-1-dev (Required for SFTP support)
203
+ * libc-ares-dev (Required for async DNS support)
204
+ * libxml2-dev (Required for Metalink support)
205
+ * zlib1g-dev (Required for gzip, deflate decoding support in HTTP)
206
+ * libsqlite3-dev (Required for Firefox3/Chromium cookie support)
207
+ * pkg-config (Required to detect installed libraries)
208
+
209
+ You can use libgcrypt-dev instead of nettle-dev and libgmp-dev:
210
+
211
+ * libgpg-error-dev (Required for BitTorrent, Checksum support)
212
+ * libgcrypt-dev (Required for BitTorrent, Checksum support)
213
+
214
+ You can use libssl-dev instead of
215
+ libgnutls-dev, nettle-dev, libgmp-dev, libgpg-error-dev and libgcrypt-dev:
216
+
217
+ * libssl-dev (Required for HTTPS, BitTorrent, Checksum support)
218
+
219
+ You can use libexpat1-dev instead of libxml2-dev:
220
+
221
+ * libexpat1-dev (Required for Metalink support)
222
+
223
+ On Fedora you need the following packages: gcc, gcc-c++, kernel-devel,
224
+ libgcrypt-devel, libxml2-devel, openssl-devel, gettext-devel, cppunit
225
+
226
+ If you downloaded source code from git repository, you have to install
227
+ following packages to get autoconf macros:
228
+
229
+ * libxml2-dev
230
+ * libcppunit-dev
231
+ * autoconf
232
+ * automake
233
+ * autotools-dev
234
+ * autopoint
235
+ * libtool
236
+
237
+ And run following command to generate configure script and other files
238
+ necessary to build the program::
239
+
240
+ $ autoreconf -i
241
+
242
+ Also you need `Sphinx <http://sphinx-doc.org/>`_ to build man page.
243
+
244
+ If you are building aria2 for Mac OS X, take a look at
245
+ the makerelease-osx.mk GNU Make makefile.
246
+
247
+ The quickest way to build aria2 is first run configure script::
248
+
249
+ $ ./configure
250
+
251
+ To build statically linked aria2, use ``ARIA2_STATIC=yes``
252
+ command-line option::
253
+
254
+ $ ./configure ARIA2_STATIC=yes
255
+
256
+ After configuration is done, run ``make`` to compile the program::
257
+
258
+ $ make
259
+
260
+ See `Cross-compiling Windows binary`_ to create a Windows binary.
261
+ See `Cross-compiling Android binary`_ to create an Android binary.
262
+
263
+ The configure script checks available libraries and enables as many
264
+ features as possible except for experimental features not enabled by
265
+ default.
266
+
267
+ Since 1.1.0, aria2 checks the certificate of HTTPS servers by default.
268
+ If you build with OpenSSL or the recent version of GnuTLS which has
269
+ ``gnutls_certificate_set_x509_system_trust()`` function and the
270
+ library is properly configured to locate the system-wide CA
271
+ certificates store, aria2 will automatically load those certificates
272
+ at the startup. If it is not the case, I recommend to supply the path
273
+ to the CA bundle file. For example, in Debian the path to CA bundle
274
+ file is '/etc/ssl/certs/ca-certificates.crt' (in ca-certificates
275
+ package). This may vary depending on your distribution. You can give
276
+ it to configure script using ``--with-ca-bundle option``::
277
+
278
+ $ ./configure --with-ca-bundle='/etc/ssl/certs/ca-certificates.crt'
279
+ $ make
280
+
281
+ Without ``--with-ca-bundle`` option, you will encounter the error when
282
+ accessing HTTPS servers because the certificate cannot be verified
283
+ without CA bundle. In such case, you can specify the CA bundle file
284
+ using aria2's ``--ca-certificate`` option. If you don't have CA bundle
285
+ file installed, then the last resort is disable the certificate
286
+ validation using ``--check-certificate=false``.
287
+
288
+ Using the native OSX (AppleTLS) and/or Windows (WinTLS) implementation
289
+ will automatically use the system certificate store, so
290
+ ``--with-ca-bundle`` is not necessary and will be ignored when using
291
+ these implementations.
292
+
293
+ By default, the bash_completion file named ``aria2c`` is installed to
294
+ the directory ``$prefix/share/doc/aria2/bash_completion``. To change
295
+ the install directory of the file, use ``--with-bashcompletiondir``
296
+ option.
297
+
298
+ After a ``make`` the executable is located at ``src/aria2c``.
299
+
300
+ aria2 uses CppUnit for automated unit testing. To run the unit test::
301
+
302
+ $ make check
303
+
304
+ Cross-compiling Windows binary
305
+ ------------------------------
306
+
307
+ In this section, we describe how to build a Windows binary using a
308
+ mingw-w64 (http://mingw-w64.org/doku.php) cross-compiler on Debian
309
+ Linux. The MinGW (http://www.mingw.org/) may not be able to build
310
+ aria2.
311
+
312
+ The easiest way to build Windows binary is use Dockerfile.mingw. See
313
+ Dockerfile.mingw how to build binary. If you cannot use Dockerfile,
314
+ then continue to read following paragraphs.
315
+
316
+ Basically, after compiling and installing depended libraries, you can
317
+ do cross-compile just passing appropriate ``--host`` option and
318
+ specifying ``CPPFLAGS``, ``LDFLAGS`` and ``PKG_CONFIG_LIBDIR``
319
+ variables to configure. For convenience and lowering our own
320
+ development cost, we provide easier way to configure the build
321
+ settings.
322
+
323
+ ``mingw-config`` script is a configure script wrapper for mingw-w64.
324
+ We use it to create official Windows build. This script assumes
325
+ following libraries have been built for cross-compile:
326
+
327
+ * c-ares
328
+ * expat
329
+ * sqlite3
330
+ * zlib
331
+ * libssh2
332
+ * cppunit
333
+
334
+ Some environment variables can be adjusted to change build settings:
335
+
336
+ ``HOST``
337
+ cross-compile to build programs to run on ``HOST``. It defaults to
338
+ ``i686-w64-mingw32``. To build 64bit binary, specify
339
+ ``x86_64-w64-mingw32``.
340
+
341
+ ``PREFIX``
342
+ Prefix to the directory where dependent libraries are installed. It
343
+ defaults to ``/usr/local/$HOST``. ``-I$PREFIX/include`` will be
344
+ added to ``CPPFLAGS``. ``-L$PREFIX/lib`` will be added to
345
+ ``LDFLAGS``. ``$PREFIX/lib/pkgconfig`` will be set to
346
+ ``PKG_CONFIG_LIBDIR``.
347
+
348
+ For example, to build 64bit binary do this::
349
+
350
+ $ HOST=x86_64-w64-mingw32 ./mingw-config
351
+
352
+ If you want libaria2 dll with ``--enable-libaria2``, then don't use
353
+ ``ARIA2_STATIC=yes`` and prepare the DLL version of external
354
+ libraries.
355
+
356
+ Cross-compiling Android binary
357
+ ------------------------------
358
+
359
+ In this section, we describe how to build Android binary using Android
360
+ NDK cross-compiler on Debian Linux.
361
+
362
+ At the time of this writing, Android NDK r21e should compile aria2
363
+ without errors.
364
+
365
+ ``android-config`` script is a configure script wrapper for Android
366
+ build. We use it to create official Android build. This script
367
+ assumes the following libraries have been built for cross-compile:
368
+
369
+ * c-ares
370
+ * openssl
371
+ * expat
372
+ * zlib
373
+ * libssh2
374
+
375
+ When building the above libraries, make sure that disable shared
376
+ library and enable only static library. We are going to link those
377
+ libraries statically.
378
+
379
+ ``android-config`` assumes that ``$ANDROID_HOME`` and ``$NDK``
380
+ environment variables are defined.
381
+
382
+ We currently use Android NDK r21e. ``$NDK`` should point to the
383
+ directory to Anroid NDK. The build tools will be found under
384
+ ``$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/``.
385
+
386
+ All the dependent libraries must be installed under
387
+ ``$ANDROID_HOME/usr/local``.
388
+
389
+ After ``android-config``, run ``make`` to compile sources.
390
+
391
+ Building documentation
392
+ ----------------------
393
+
394
+ `Sphinx <http://sphinx-doc.org/>`_ is used to build the
395
+ documentation. aria2 man pages will be build when you run ``make`` if
396
+ they are not up-to-date. You can also build HTML version of aria2 man
397
+ page by ``make html``. The HTML version manual is also available at
398
+ `online <https://aria2.github.io/manual/en/html/>`_ (`Russian
399
+ translation <https://aria2.github.io/manual/ru/html/>`_, `Portuguese
400
+ translation <https://aria2.github.io/manual/pt/html/>`_).
401
+
402
+ BitTorrent
403
+ -----------
404
+
405
+ About file names
406
+ ~~~~~~~~~~~~~~~~
407
+ The file name of the downloaded file is determined as follows:
408
+
409
+ single-file mode
410
+ If "name" key is present in .torrent file, file name is the value
411
+ of "name" key. Otherwise, file name is the base name of .torrent
412
+ file appended by ".file". For example, .torrent file is
413
+ "test.torrent", then file name is "test.torrent.file". The
414
+ directory to store the downloaded file can be specified by -d
415
+ option.
416
+
417
+ multi-file mode
418
+ The complete directory/file structure mentioned in .torrent file
419
+ is created. The directory to store the top directory of
420
+ downloaded files can be specified by -d option.
421
+
422
+ Before download starts, a complete directory structure is created if
423
+ needed. By default, aria2 opens at most 100 files mentioned in
424
+ .torrent file, and directly writes to and reads from these files.
425
+ The number of files to open simultaneously can be controlled by
426
+ ``--bt-max-open-files`` option.
427
+
428
+ DHT
429
+ ~~~
430
+
431
+ aria2 supports mainline compatible DHT. By default, the routing table
432
+ for IPv4 DHT is saved to ``$XDG_CACHE_HOME/aria2/dht.dat`` and the
433
+ routing table for IPv6 DHT is saved to
434
+ ``$XDG_CACHE_HOME/aria2/dht6.dat`` unless files exist at
435
+ ``$HOME/.aria2/dht.dat`` or ``$HOME/.aria2/dht6.dat``. aria2 uses same
436
+ port number to listen on for both IPv4 and IPv6 DHT.
437
+
438
+ UDP tracker
439
+ ~~~~~~~~~~~
440
+
441
+ UDP tracker support is enabled when IPv4 DHT is enabled. The port
442
+ number of UDP tracker is shared with DHT. Use ``--dht-listen-port``
443
+ option to change the port number.
444
+
445
+ Other things should be noted
446
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
447
+
448
+ * ``-o`` option is used to change the file name of .torrent file itself,
449
+ not a file name of a file in .torrent file. For this purpose, use
450
+ ``--index-out`` option instead.
451
+ * The port numbers that aria2 uses by default are 6881-6999 for TCP
452
+ and UDP.
453
+ * aria2 doesn't configure port-forwarding automatically. Please
454
+ configure your router or firewall manually.
455
+ * The maximum number of peers is 55. This limit may be exceeded when
456
+ download rate is low. This download rate can be adjusted using
457
+ ``--bt-request-peer-speed-limit`` option.
458
+ * As of release 0.10.0, aria2 stops sending request message after
459
+ selective download completes.
460
+
461
+ Metalink
462
+ --------
463
+
464
+ The current implementation supports HTTP(S)/FTP/SFTP/BitTorrent. The
465
+ other P2P protocols are ignored. Both Metalink4 (RFC 5854) and
466
+ Metalink version 3.0 documents are supported.
467
+
468
+ For checksum verification, md5, sha-1, sha-224, sha-256, sha-384 and
469
+ sha-512 are supported. If multiple hash algorithms are provided, aria2
470
+ uses stronger one. If whole file checksum verification fails, aria2
471
+ doesn't retry the download and just exits with non-zero return code.
472
+
473
+ The supported user preferences are version, language, location,
474
+ protocol and os.
475
+
476
+ If chunk checksums are provided in Metalink file, aria2 automatically
477
+ validates chunks of data during download. This behavior can be turned
478
+ off by a command-line option.
479
+
480
+ If signature is included in a Metalink file, aria2 saves it as a file
481
+ after the completion of the download. The file name is download
482
+ file name + ".sig". If same file already exists, the signature file is
483
+ not saved.
484
+
485
+ In Metalink4, multi-file torrent could appear in metalink:metaurl
486
+ element. Since aria2 cannot download 2 same torrents at the same
487
+ time, aria2 groups files in metalink:file element which has same
488
+ BitTorrent metaurl and downloads them from a single BitTorrent swarm.
489
+ This is basically multi-file torrent download with file selection, so
490
+ the adjacent files which is not in Metalink document but shares same
491
+ piece with selected file are also created.
492
+
493
+ If relative URI is specified in metalink:url or metalink:metaurl
494
+ element, aria2 uses the URI of Metalink file as base URI to resolve
495
+ the relative URI. If relative URI is found in Metalink file which is
496
+ read from local disk, aria2 uses the value of ``--metalink-base-uri``
497
+ option as base URI. If this option is not specified, the relative URI
498
+ will be ignored.
499
+
500
+ Metalink/HTTP
501
+ -------------
502
+
503
+ The current implementation only uses rel=duplicate links only. aria2
504
+ understands Digest header fields and check whether it matches the
505
+ digest value from other sources. If it differs, drop connection.
506
+ aria2 also uses this digest value to perform checksum verification
507
+ after download finished. aria2 recognizes geo value. To tell aria2
508
+ which location you prefer, you can use ``--metalink-location`` option.
509
+
510
+ netrc
511
+ -----
512
+
513
+ netrc support is enabled by default for HTTP(S)/FTP/SFTP. To disable
514
+ netrc support, specify -n command-line option. Your .netrc file
515
+ should have correct permissions(600).
516
+
517
+ WebSocket
518
+ ---------
519
+
520
+ The WebSocket server embedded in aria2 implements the specification
521
+ defined in RFC 6455. The supported protocol version is 13.
522
+
523
+ libaria2
524
+ --------
525
+
526
+ The libaria2 is a C++ library which offers aria2 functionality to the
527
+ client code. Currently, libaria2 is not built by default. To enable
528
+ libaria2, use ``--enable-libaria2`` configure option. By default,
529
+ only the shared library is built. To build static library, use
530
+ ``--enable-static`` configure option as well. See libaria2
531
+ documentation to know how to use API.
532
+
533
+ References
534
+ ----------
535
+
536
+ * `aria2 Online Manual <https://aria2.github.io/manual/en/html/>`_
537
+ * https://aria2.github.io/
538
+ * `RFC 959 FILE TRANSFER PROTOCOL (FTP) <http://tools.ietf.org/html/rfc959>`_
539
+ * `RFC 1738 Uniform Resource Locators (URL) <http://tools.ietf.org/html/rfc1738>`_
540
+ * `RFC 2428 FTP Extensions for IPv6 and NATs <http://tools.ietf.org/html/rfc2428>`_
541
+ * `RFC 2616 Hypertext Transfer Protocol -- HTTP/1.1 <http://tools.ietf.org/html/rfc2616>`_
542
+ * `RFC 3659 Extensions to FTP <http://tools.ietf.org/html/rfc3659>`_
543
+ * `RFC 3986 Uniform Resource Identifier (URI): Generic Syntax <http://tools.ietf.org/html/rfc3986>`_
544
+ * `RFC 4038 Application Aspects of IPv6 Transition <http://tools.ietf.org/html/rfc4038>`_
545
+ * `RFC 5854 The Metalink Download Description Format <http://tools.ietf.org/html/rfc5854>`_
546
+ * `RFC 6249 Metalink/HTTP: Mirrors and Hashes <http://tools.ietf.org/html/rfc6249>`_
547
+ * `RFC 6265 HTTP State Management Mechanism <http://tools.ietf.org/html/rfc6265>`_
548
+ * `RFC 6266 Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP) <http://tools.ietf.org/html/rfc6266>`_
549
+ * `RFC 6455 The WebSocket Protocol <http://tools.ietf.org/html/rfc6455>`_
550
+ * `RFC 6555 Happy Eyeballs: Success with Dual-Stack Hosts <http://tools.ietf.org/html/rfc6555>`_
551
+
552
+ * `The BitTorrent Protocol Specification <http://www.bittorrent.org/beps/bep_0003.html>`_
553
+ * `BitTorrent: DHT Protocol <http://www.bittorrent.org/beps/bep_0005.html>`_
554
+ * `BitTorrent: Fast Extension <http://www.bittorrent.org/beps/bep_0006.html>`_
555
+ * `BitTorrent: IPv6 Tracker Extension <http://www.bittorrent.org/beps/bep_0007.html>`_
556
+ * `BitTorrent: Extension for Peers to Send Metadata Files <http://www.bittorrent.org/beps/bep_0009.html>`_
557
+ * `BitTorrent: Extension Protocol <http://www.bittorrent.org/beps/bep_0010.html>`_
558
+ * `BitTorrent: Multitracker Metadata Extension <http://www.bittorrent.org/beps/bep_0012.html>`_
559
+ * `BitTorrent: UDP Tracker Protocol for BitTorrent <http://www.bittorrent.org/beps/bep_0015.html>`_
560
+ and `BitTorrent udp-tracker protocol specification <http://www.rasterbar.com/products/libtorrent/udp_tracker_protocol.html>`_.
561
+ * `BitTorrent: WebSeed - HTTP/FTP Seeding (GetRight style) <http://www.bittorrent.org/beps/bep_0019.html>`_
562
+ * `BitTorrent: Private Torrents <http://www.bittorrent.org/beps/bep_0027.html>`_
563
+ * `BitTorrent: BitTorrent DHT Extensions for IPv6 <http://www.bittorrent.org/beps/bep_0032.html>`_
564
+ * `BitTorrent: Message Stream Encryption <http://wiki.vuze.com/w/Message_Stream_Encryption>`_
565
+ * `Kademlia: A Peer-to-peer Information System Based on the XOR Metric <https://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf>`_
share/doc/aria2/bash_completion/README.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Bash_completion for aria2c
2
+ ==========================
3
+
4
+ Install
5
+ -------
6
+
7
+ Copy 'aria2c' to the directory where bash_completion searches
8
+ completion files. For Debian and Ubuntu, copy 'aria2c' to
9
+ '/etc/bash_completion.d/' and run
10
+
11
+ . /etc/bash_completion
share/doc/aria2/bash_completion/aria2c ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _aria2c()
2
+ {
3
+ local cur prev split=false
4
+ COMPREPLY=()
5
+ COMP_WORDBREAKS=${COMP_WORDBREAKS//=}
6
+
7
+ cmd=${COMP_WORDS[0]}
8
+ _get_comp_words_by_ref cur prev
9
+ case $prev in
10
+ --ftp-type)
11
+ COMPREPLY=( $( compgen -W 'binary ascii' -- "$cur" ) )
12
+ return 0
13
+ ;;
14
+ --proxy-method)
15
+ COMPREPLY=( $( compgen -W 'get tunnel' -- "$cur" ) )
16
+ return 0
17
+ ;;
18
+ --metalink-preferred-protocol)
19
+ COMPREPLY=( $( compgen -W 'http https ftp none' -- "$cur" ) )
20
+ return 0
21
+ ;;
22
+ --bt-min-crypto-level)
23
+ COMPREPLY=( $( compgen -W 'plain arc4' -- "$cur" ) )
24
+ return 0
25
+ ;;
26
+ --follow-metalink)
27
+ COMPREPLY=( $( compgen -W 'true mem false' -- "$cur" ) )
28
+ return 0
29
+ ;;
30
+ --file-allocation)
31
+ COMPREPLY=( $( compgen -W 'none prealloc trunc falloc' -- "$cur" ) )
32
+ return 0
33
+ ;;
34
+ --log-level)
35
+ COMPREPLY=( $( compgen -W 'debug info notice warn error' -- "$cur" ) )
36
+ return 0
37
+ ;;
38
+ --uri-selector)
39
+ COMPREPLY=( $( compgen -W 'inorder feedback adaptive' -- "$cur" ) )
40
+ return 0
41
+ ;;
42
+ --event-poll)
43
+ COMPREPLY=( $( compgen -W 'epoll poll select' -- "$cur" ) )
44
+ return 0
45
+ ;;
46
+ --follow-torrent)
47
+ COMPREPLY=( $( compgen -W 'true mem false' -- "$cur" ) )
48
+ return 0
49
+ ;;
50
+ --stream-piece-selector)
51
+ COMPREPLY=( $( compgen -W 'default inorder random geom' -- "$cur" ) )
52
+ return 0
53
+ ;;
54
+ --download-result)
55
+ COMPREPLY=( $( compgen -W 'default full hide' -- "$cur" ) )
56
+ return 0
57
+ ;;
58
+ --min-tls-version)
59
+ COMPREPLY=( $( compgen -W 'TLSv1.1 TLSv1.2 TLSv1.3' -- "$cur" ) )
60
+ return 0
61
+ ;;
62
+ --console-log-level)
63
+ COMPREPLY=( $( compgen -W 'debug info notice warn error' -- "$cur" ) )
64
+ return 0
65
+ ;;
66
+ --dir)
67
+ _filedir -d
68
+ return 0
69
+ ;;
70
+ --torrent-file)
71
+ _filedir '@(torrent)'
72
+ return 0
73
+ ;;
74
+ --metalink-file)
75
+ _filedir '@(meta4|metalink)'
76
+ return 0
77
+ ;;
78
+ esac
79
+ case $cur in
80
+ -*)
81
+ COMPREPLY=( $( compgen -W '--rpc-save-upload-metadata --rpc-save-upload-metadata=false --on-download-start --metalink-language --rpc-secret --torrent-file --enable-peer-exchange --enable-peer-exchange=false --http-proxy-passwd --bt-tracker-timeout --ftp-type --seed-time --keep-unfinished-download-result --keep-unfinished-download-result=false --bt-tracker-connect-timeout --bt-max-open-files --no-netrc --no-netrc=false --force-sequential --force-sequential=false --metalink-base-uri --private-key --ftp-passwd --allow-overwrite --allow-overwrite=false --rpc-allow-origin-all --rpc-allow-origin-all=false --bt-detach-seed-only --bt-detach-seed-only=false --dht-entry-point6 --summary-interval --lowest-speed-limit --bt-tracker-interval --proxy-method --metalink-preferred-protocol --enable-http-keep-alive --enable-http-keep-alive=false --metalink-version --stderr --stderr=false --bt-lpd-interface --force-save --force-save=false --rpc-secure --rpc-secure=false --listen-port --rpc-private-key --server-stat-of --server-stat-timeout --bt-load-saved-metadata --bt-load-saved-metadata=false --https-proxy-user --piece-length --dry-run --dry-run=false --truncate-console-readout --truncate-console-readout=false --save-not-found --save-not-found=false --async-dns-server --bt-max-peers --max-overall-upload-limit --rpc-user --optimize-concurrent-downloads --optimize-concurrent-downloads=true --optimize-concurrent-downloads=false --optimize-concurrent-downloads=A:B --dir --split --on-download-pause --auto-file-renaming --auto-file-renaming=false --http-proxy --save-session-interval --daemon --daemon=false --https-proxy --min-tls-version --save-cookies --out --rlimit-nofile --max-file-not-found --on-download-stop --certificate --bt-min-crypto-level --remove-control-file --remove-control-file=false --enable-dht --enable-dht=false --file-allocation --follow-metalink --on-bt-download-complete --ftp-proxy --show-files --show-files=false --timeout --bt-hash-check-seed --bt-hash-check-seed=false --ftp-pasv --ftp-pasv=false --check-certificate --check-certificate=false --always-resume --always-resume=false --load-cookies --bt-remove-unselected-file --bt-remove-unselected-file=false --bt-stop-timeout --version --max-concurrent-downloads --quiet --quiet=false --max-download-result --content-disposition-default-utf8 --content-disposition-default-utf8=false --max-resume-failure-tries --header --rpc-listen-all --rpc-listen-all=false --all-proxy-user --server-stat-if --dht-file-path6 --save-session --bt-external-ip --max-tries --conditional-get --conditional-get=false --ftp-reuse-connection --ftp-reuse-connection=false --gid --dscp --max-download-limit --bt-prioritize-piece --check-integrity --check-integrity=false --log-level --remote-time --remote-time=false --uri-selector --rpc-listen-port --index-out --bt-tracker --referer --ssh-host-key-md --console-log-level --connect-timeout --stream-piece-selector --dht-message-timeout --select-file --download-result --disable-ipv6 --disable-ipv6=false --rpc-max-request-size --rpc-passwd --stop-with-process --https-proxy-passwd --continue --continue=false --no-file-allocation-limit --netrc-path --ftp-proxy-user --enable-color --enable-color=false --metalink-location --allow-piece-length-change --allow-piece-length-change=false --max-connection-per-server --no-conf --no-conf=false --rpc-certificate --metalink-os --enable-http-pipelining --enable-http-pipelining=false --http-passwd --user-agent --enable-dht6 --enable-dht6=false --dht-file-path --http-auth-challenge --http-auth-challenge=false --bt-enable-hook-after-hash-check --bt-enable-hook-after-hash-check=false --peer-id-prefix --max-mmap-limit --enable-mmap --enable-mmap=false --use-head --use-head=false --bt-require-crypto --bt-require-crypto=false --show-console-readout --show-console-readout=false --conf-path --log --no-proxy --dht-entry-point --dht-listen-port --http-user --retry-wait --on-download-complete --help --help=#basic --help=#advanced --help=#http --help=#https --help=#ftp --help=#metalink --help=#bittorrent --help=#cookie --help=#hook --help=#file --help=#rpc --help=#checksum --help=#experimental --help=#deprecated --help=#help --help=#all --max-overall-download-limit --event-poll --http-accept-gzip --http-accept-gzip=false --metalink-file --all-proxy --disk-cache --hash-check-only --hash-check-only=false --dht-listen-addr6 --human-readable --human-readable=false --ftp-user --all-proxy-passwd --bt-exclude-tracker --pause-metadata --pause-metadata=false --http-proxy-user --deferred-input --deferred-input=false --metalink-enable-unique-protocol --metalink-enable-unique-protocol=false --stop --peer-agent --max-upload-limit --multiple-interface --realtime-chunk-checksum --realtime-chunk-checksum=false --http-no-cache --http-no-cache=false --ca-certificate --bt-force-encryption --bt-force-encryption=false --bt-save-metadata --bt-save-metadata=false --seed-ratio --follow-torrent --pause --pause=false --checksum --auto-save-interval --async-dns --async-dns=false --bt-enable-lpd --bt-enable-lpd=false --parameterized-uri --parameterized-uri=false --ftp-proxy-passwd --enable-rpc --enable-rpc=false --min-split-size --bt-seed-unverified --bt-seed-unverified=false --input-file --interface --enable-async-dns6 --enable-async-dns6=false --reuse-uri --reuse-uri=false --socket-recv-buffer-size --bt-request-peer-speed-limit --on-download-error --bt-metadata-only --bt-metadata-only=false ' -- "$cur" ) )
82
+ ;;
83
+ *)
84
+ _filedir '@(torrent|meta4|metalink|text|txt|list|lst)'
85
+ [ ${#COMPREPLY[@]} -eq 0 ] && _filedir
86
+ return 0
87
+ esac
88
+ return 0
89
+ }
90
+ complete -F _aria2c aria2c
share/doc/aria2/xmlrpc/README.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ This directory contains sample scripts to interact with aria2 via
2
+ XML-RPC. For more information, see
3
+ https://aria2.github.io/manual/en/html/aria2c.html#rpc-interface
share/doc/aria2/xmlrpc/aria2mon ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env ruby
2
+ # The MIT License
3
+ #
4
+ # Copyright (c) 2009 Tatsuhiro Tsujikawa
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ # THE SOFTWARE.
23
+ require 'xmlrpc/client'
24
+ require 'optparse'
25
+
26
+ program_name=File.basename($0)
27
+ options={}
28
+ args=nil
29
+ OptionParser.new do |opt|
30
+ opt.on("--server SERVER", "hostname of XML-RPC server. Default: localhost"){|val| options["server"]=val }
31
+ opt.on("--port PORT", "port of XML-RPC server. Default: 6800"){|val| options["port"]=val }
32
+
33
+ opt.on("--user USERNAME", "XML-RPC username"){|val| options["user"]=val }
34
+ opt.on("--passwd PASSWORD", "XML-RPC password"){|val| options["passwd"]=val }
35
+ opt.on("--secret SECRET", "XML-RPC secret authorization token"){|val| options["secret"]=val }
36
+
37
+ opt.banner=<<EOS
38
+ Usage: #{program_name} [options]
39
+ EOS
40
+
41
+ args=opt.parse(ARGV)
42
+ end
43
+
44
+ def compute_eta speed,rem_length
45
+ return "n/a" if speed == 0
46
+ remsec=rem_length/speed
47
+ hr=remsec/3600
48
+ remsec=remsec%3600
49
+ min=remsec/60
50
+ remsec=remsec%60
51
+ result=""
52
+ result += "#{hr}h" if hr > 0
53
+ result += "#{min}m" if min > 0
54
+ result += "#{remsec}s"
55
+ end
56
+
57
+ def abbrev value
58
+ n=value/1024.0
59
+ if n < 1 then
60
+ return "#{value}"
61
+ end
62
+ value=n
63
+ n=value/1024.0
64
+ if n < 1 then
65
+ return sprintf("%.1fKi", value)
66
+ else
67
+ return sprintf("%.1fMi", n)
68
+ end
69
+ end
70
+
71
+ auth=""
72
+ if options.has_key?("user") then
73
+ auth=options["user"]+":"+options["passwd"]+"@"
74
+ end
75
+ if not options.has_key?("server") then
76
+ options["server"]="localhost"
77
+ end
78
+ if not options.has_key?("port") then
79
+ options["port"]="6800"
80
+ end
81
+ secret = if options.has_key?("secret") then "token:"+options["secret"] else nil end
82
+
83
+ client=XMLRPC::Client.new3({:host => options["server"],
84
+ :port => options["port"],
85
+ :path => "/rpc",
86
+ :user => options["user"],
87
+ :password => options["passwd"]})
88
+
89
+ options.delete("server")
90
+ options.delete("port")
91
+ options.delete("user")
92
+ options.delete("passwd")
93
+ options.delete("secret")
94
+
95
+ def client_call client, secret, method, *params
96
+ if secret.nil?
97
+ client.call(method, *params)
98
+ else
99
+ client.call(method, secret, *params)
100
+ end
101
+ end
102
+
103
+ result=client_call(client, secret, "aria2.tellActive")
104
+
105
+ print "-- Download Progress --\n"
106
+ result.each { |entry|
107
+ gid=entry['gid']
108
+ total_length=entry['totalLength'].to_i
109
+ completed_length=entry['completedLength'].to_i
110
+ upload_length=entry['uploadLength'].to_i
111
+ download_speed=entry['downloadSpeed'].to_i
112
+ print "GID##{gid}"
113
+ if total_length == completed_length then
114
+ if entry.key? 'infoHash' then
115
+ # for BitTorrent print seed status
116
+ print " SEEDING"
117
+ if completed_length > 0 then
118
+ print "(#{upload_length*100/completed_length}%)"
119
+ end
120
+ end
121
+ else
122
+ print " SIZE:#{abbrev completed_length}B/#{abbrev total_length}B"
123
+ if total_length > 0 then
124
+ print "(#{completed_length*100/total_length}%)"
125
+ end
126
+ end
127
+ print " CN:#{entry['connections']}"
128
+ if entry.key? 'numSeeders' then
129
+ print " SEED:#{entry['numSeeders']}"
130
+ end
131
+ print " SPD:#{abbrev download_speed}B/s"
132
+ if entry.key? 'infoHash'
133
+ printf " UP:#{abbrev entry['uploadSpeed'].to_i}B/s(#{abbrev upload_length}B)"
134
+ end
135
+ print " ETA:#{compute_eta(download_speed, total_length-completed_length)}"
136
+ print "\n"
137
+
138
+ if entry.key? 'infoHash'
139
+ print " InfoHash:#{entry['infoHash']}"
140
+ end
141
+ print "\n"
142
+
143
+ files=client_call(client,secret,"aria2.getFiles",entry['gid'])
144
+ if files.length > 0 then
145
+ first_file=files.find{|file| file["selected"]=="true"}
146
+ if first_file != nil then
147
+ print " File:#{first_file['path']}"
148
+ count=0
149
+ files.each {|file| count += 1 if file["selected"]=="true"}
150
+ if count > 1 then
151
+ print "(#{count-1}more)"
152
+ end
153
+ print "\n"
154
+ end
155
+ end
156
+ print "--------------------------------------------------------------------------------\n"
157
+ }
share/doc/aria2/xmlrpc/aria2rpc ADDED
@@ -0,0 +1,427 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env ruby
2
+ # The MIT License
3
+ #
4
+ # Copyright (c) 2009 Tatsuhiro Tsujikawa
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ # THE SOFTWARE.
23
+ require 'xmlrpc/client'
24
+ require 'pp'
25
+ require 'optparse'
26
+
27
+ program_name=File.basename($0)
28
+ options={}
29
+ args=nil
30
+ OptionParser.new do |opt|
31
+ opt.on("-d","--dir DIR"){|val| options["dir"]=val}
32
+ opt.on("-V","--check-integrity [BOOL]", ["true","false"]){|val|
33
+ options["check-integrity"]= val||"true"
34
+ }
35
+ opt.on("-c","--continue [BOOL]",["true","false"]){|val|
36
+ options["continue"]=val||"true"
37
+ }
38
+ opt.on("--all-proxy PROXY"){|val| options["all-proxy"]=val}
39
+ opt.on("--all-proxy-user USER"){|val| options["all-proxy-user"]=val}
40
+ opt.on("--all-proxy-passwd PASSWD"){|val| options["all-proxy-passwd"]=val}
41
+ opt.on("--connect-timeout SEC"){|val| options["connect-timeout"]=val}
42
+ opt.on("--dry-run [BOOL]",["true","false"]){|val|
43
+ options["dry-run"]=val||"true"
44
+ }
45
+ opt.on("--lowest-speed-limit SPEED"){|val| options["lowest-speed-limit"]=val}
46
+ opt.on("--max-file-not-found NUM"){|val| options["max-file-not-found"]=val}
47
+ opt.on("-m","--max-tries N"){|val| options["max-tries"]=val}
48
+ opt.on("--no-proxy DOMAINS"){|val| options["no-proxy"]=val}
49
+ opt.on("-o","--out FILE"){|val| options["out"]=val}
50
+ opt.on("--proxy-method METHOD"){|val| options["proxy-method"]=val}
51
+ opt.on("-R","--remote-time [BOOL]",["true","false"]){|val|
52
+ options["remote-time"]=val||"true"
53
+ }
54
+ opt.on("-s","--split N"){|val| options["split"]=val}
55
+ opt.on("-t","--timeout SEC"){|val| options["timeout"]=val}
56
+ opt.on("--http-auth-challenge [BOOL]",["true","false"]){|val|
57
+ options["http-auth-challenge"]=val||"true"
58
+ }
59
+ opt.on("--http-no-cache [BOOL]",["true","false"]){|val|
60
+ options["http-no-cache"]=val||"true"
61
+ }
62
+ opt.on("--http-user USER"){|val| options["http-user"]=val}
63
+ opt.on("--http-passwd PASSWD"){|val| options["http-passwd"]=val}
64
+ opt.on("--http-proxy PROXY"){|val| options["http-proxy"]=val}
65
+ opt.on("--http-proxy-user USER"){|val| options["http-proxy-user"]=val}
66
+ opt.on("--http-proxy-passwd PASSWD"){|val| options["http-proxy-passwd"]=val}
67
+ opt.on("--https-proxy PROXY"){|val| options["https-proxy"]=val}
68
+ opt.on("--https-proxy-user USER"){|val| options["https-proxy-user"]=val}
69
+ opt.on("--https-proxy-passwd PASSWD"){|val| options["https-proxy-passwd"]=val}
70
+ opt.on("--referer REFERER"){|val| options["referer"]=val}
71
+ opt.on("--enable-http-keep-alive [BOOL]",["true","false"]){|val|
72
+ options["enable-http-keep-alive"]=val||"true"
73
+ }
74
+ opt.on("--enable-http-pipelining [BOOL]",["true","false"]){|val|
75
+ options["enable-http-pipelining"]=val||"true"
76
+ }
77
+ opt.on("--header HEADER"){|val|
78
+ options["header"] = [] if options["header"] == nil
79
+ options["header"] << val
80
+ }
81
+ opt.on("--use-head [BOOL]",["true","false"]){|val|
82
+ options["use-head"]=val||"true"
83
+ }
84
+ opt.on("-U","--user-agent USERAGENT"){|val| options["user-agent"]=val}
85
+ opt.on("--ftp-user USER"){|val| options["ftp-user"]=val}
86
+ opt.on("--ftp-passwd PASSWD"){|val| options["ftp-passwd"]=val}
87
+ opt.on("-p","--ftp-pasv [BOOL]",["true","false"]){|val|
88
+ options["ftp-pasv"]=val||"true"
89
+ }
90
+ opt.on("--ftp-proxy PROXY"){|val| options["ftp-proxy"]=val}
91
+ opt.on("--ftp-proxy-user USER"){|val| options["ftp-proxy-user"]=val}
92
+ opt.on("--ftp-proxy-passwd PASSWD"){|val| options["ftp-proxy-passwd"]=val}
93
+ opt.on("--ftp-type TYPE"){|val| options["ftp-type"]=val}
94
+ opt.on("--ftp-reuse-connection [BOOL]",["true","false"]){|val|
95
+ options["ftp-reuse-connection"]=val||"true"
96
+ }
97
+ opt.on("-n","--no-netrc [BOOL]",["true","false"]){|val|
98
+ options["no-netrc"]=val||"true"
99
+ }
100
+ opt.on("--reuse-uri [BOOL]",["true","false"]){|val|
101
+ options["reuse-uri"]=val||"true"
102
+ }
103
+ opt.on("--select-file INDEXES"){|val| options["select-file"]=val}
104
+ opt.on("--bt-enable-lpd [BOOL]",["true","false"]){|val|
105
+ options["bt-enable-lpd"]=val||"true"
106
+ }
107
+ opt.on("--bt-external-ip IPADDRESS"){|val| options["bt-external-ip"]=val}
108
+ opt.on("--bt-hash-check-seed [BOOL]",["true","false"]){|val|
109
+ options["bt-hash-check-seed"]=val||"true"
110
+ }
111
+ opt.on("--bt-max-open-files NUM"){|val| options["bt-max-open-files"]=val}
112
+ opt.on("--bt-max-peers NUM"){|val| options["bt-max-peers"]=val}
113
+ opt.on("--bt-metadata-only [BOOL]",["true","false"]){|val|
114
+ options["bt-metadata-only"]=val||"true"
115
+ }
116
+ opt.on("--bt-min-crypto-level LEVEL",["plain","arc4"]){|val|
117
+ options["bt-min-crypto-level"]=val
118
+ }
119
+ opt.on("--bt-prioritize-piece RANGE") {|val|
120
+ options["bt-prioritize-piece"]=val
121
+ }
122
+ opt.on("--bt-require-crypto [BOOL]",["true","false"]){|val|
123
+ options["bt-require-crypto"]=val||"true"
124
+ }
125
+ opt.on("--bt-request-peer-speed-limit SPEED"){|val|
126
+ options["bt-request-peer-speed-limit"]=val
127
+ }
128
+ opt.on("--bt-save-metadata [BOOL]",["true","false"]){|val|
129
+ options["bt-save-metadata"]=val||"true"
130
+ }
131
+ opt.on("--bt-seed-unverified [BOOL]",["true","false"]){|val|
132
+ options["bt-seed-unverified"]=val||"true"
133
+ }
134
+ opt.on("--bt-stop-timeout SEC"){|val| options["bt-stop-timeout"]=val}
135
+ opt.on("--bt-tracker-interval SEC"){|val| options["bt-tracker-interval"]=val}
136
+ opt.on("--bt-tracker-timeout SEC"){|val| options["bt-tracker-timeout"]=val}
137
+ opt.on("--bt-tracker-connect-timeout SEC"){|val|
138
+ options["bt-tracker-connect-timeout"]=val
139
+ }
140
+ opt.on("--enable-peer-exchange [BOOL]",["true","false"]){|val|
141
+ options["enable-peer-exchange"]=val||"true"
142
+ }
143
+ opt.on("--follow-torrent VALUE", ["true","false","mem"]){|val|
144
+ options["follow-torrent"]=val
145
+ }
146
+ opt.on("-O","--index-out INDEXPATH"){|val|
147
+ options["index-out"]=[] if options["index-out"] == nil
148
+ options["index-out"] << val
149
+ }
150
+ opt.on("-u","--max-upload-limit SPEED"){|val| options["max-upload-limit"]=val}
151
+ opt.on("--seed-ratio RATIO"){|val| options["seed-ratio"]=val}
152
+ opt.on("--seed-time MINUTES"){|val| options["seed-time"]=val}
153
+ opt.on("--follow-metalink VALUE", ["true","false","mem"]){|val|
154
+ options["follow-metalink"]=val
155
+ }
156
+ opt.on("-C","--metalink-servers NUM"){|val| options["metalink-servers"]=val}
157
+ opt.on("--metalink-language LANG"){|val| options["metalink-language"]=val}
158
+ opt.on("--metalink-location LOCS"){|val| options["metalink-location"]=val}
159
+ opt.on("--metalink-os OS"){|val| options["metalink-os"]=val}
160
+ opt.on("--metalink-version VERSION"){|val| options["metalink-version"]=val}
161
+ opt.on("--metalink-preferred-protocol PROTO"){|val|
162
+ options["metalink-preferred-protocol"]=val
163
+ }
164
+ opt.on("--metalink-enable-unique-protocol [BOOL]",["true","false"]){|val|
165
+ options["metalink-enable-unique-protocol"]=val||"true"
166
+ }
167
+ opt.on("--allow-overwrite [BOOL]",["true","false"]){|val|
168
+ options["allow-overwrite"]=val||"true"
169
+ }
170
+ opt.on("--allow-piece-length-change [BOOL]",["true","false"]){|val|
171
+ options["allow-piece-length-change"]=val||"true"
172
+ }
173
+ opt.on("--async-dns [BOOL]",["true","false"]){|val|
174
+ options["async-dns"]=val||"true"
175
+ }
176
+ opt.on("--auto-file-renaming [BOOL]",["true","false"]){|val|
177
+ options["auto-file-renaming"]=val||"true"
178
+ }
179
+ opt.on("--file-allocation METHOD",["none","prealloc","falloc"]){|val|
180
+ options["file-allocation"]=val
181
+ }
182
+ opt.on("--max-download-limit LIMIT"){|val| options["max-download-limit"]=val}
183
+ opt.on("--no-file-allocation-limit SIZE"){|val|
184
+ options["no-file-allocation-limit"]=val
185
+ }
186
+ opt.on("-P","--parameterized-uri [BOOL]",["true","false"]){|val|
187
+ options["parameterized-uri"]=val||"true"
188
+ }
189
+ opt.on("--realtime-chunk-checksum [BOOL]",["true","false"]){|val|
190
+ options["realtime-chunk-checksum"]=val||"true"
191
+ }
192
+ opt.on("--remove-control-file [BOOL]",["true","false"]){|val|
193
+ options["remove-control-file"]=val||"true"
194
+ }
195
+ opt.on("--always-resume [BOOL]",["true","false"]){|val|
196
+ options["always-resume"]=val||"true"
197
+ }
198
+ opt.on("--max-resume-failure-tries N"){|val|
199
+ options["max-resume-failure-tries"]=val
200
+ }
201
+ opt.on("--http-accept-gzip [BOOL]",["true","false"]){|val|
202
+ options["http-accept-gzip"]=val||"true"
203
+ }
204
+ opt.on("-x","--max-connection-per-server NUM"){|val| options["max-connection-per-server"]=val}
205
+ opt.on("-k","--min-split-size SIZE"){|val| options["min-split-size"]=val}
206
+ opt.on("--conditional-get [BOOL]",["true","false"]){|val|
207
+ options["conditional-get"]=val||"true"
208
+ }
209
+ opt.on("--enable-async-dns6 [BOOL]",["true","false"]){|val|
210
+ options["enable-async-dns6"]=val||"true"
211
+ }
212
+ opt.on("--bt-tracker URIS"){|val| options["bt-tracker"]=val}
213
+ opt.on("--bt-exclude-tracker URIS"){|val| options["bt-exclude-tracker"]=val}
214
+ opt.on("--retry-wait SEC"){|val| options["retry-wait"]=val}
215
+ opt.on("--metalink-base-uri URI"){|val| options["metalink-base-uri"]=val}
216
+ opt.on("--pause [BOOL]",["true","false"]){|val| options["pause"]=val||"true"}
217
+ opt.on("--stream-piece-selector SELECTOR"){|val| options["stream-piece-selector"]=val}
218
+ opt.on("--hash-check-only [BOOL]",["true","false"]){|val|
219
+ options["hash-check-only"]=val||"true"
220
+ }
221
+ opt.on("--checksum TYPE_DIGEST"){|val| options["checksum"]=val}
222
+ opt.on("--piece-length LENGTH"){|val| options["piece-length"]=val}
223
+ opt.on("--uri-selector SELECTOR"){|val| options["uri-selector"]=val}
224
+
225
+ opt.on("--max-overall-download-limit LIMIT"){|val| options["max-overall-download-limit"]=val}
226
+ opt.on("--max-overall-upload-limit LIMIT"){|val| options["max-overall-upload-limit"]=val}
227
+ opt.on("-j","--max-concurrent-downloads N"){|val| options["max-concurrent-downloads"]=val}
228
+ opt.on("-l","--log FILE"){|val| options["log"]=val}
229
+ opt.on("--max-download-result NUM"){|val| options["max-download-result"]=val}
230
+ opt.on("--download-result OPT"){|val| options["download-result"]=val}
231
+ opt.on("--keep-unfinished-download-result [BOOL]",["true","false"]){|val|
232
+ options["keep-unfinished-download-result"]=val||"true"
233
+ }
234
+ opt.on("--save-session FILE"){|val| options["save-session"]=val}
235
+ opt.on("--server-stat-of FILE"){|val| options["server-stat-of"]=val}
236
+ opt.on("--save-cookies FILE"){|val| options["save-cookies"]=val}
237
+ opt.on("--gid GID"){|val| options["gid"]=val}
238
+ opt.on("--pause-metadata [BOOL]",["true","false"]){|val| options["pause-metadata"]=val||"true"}
239
+
240
+ opt.on("--server SERVER", "hostname of XML-RPC server. Default: localhost"){|val| options["server"]=val }
241
+ opt.on("--port PORT", "port of XML-RPC server. Default: 6800"){|val| options["port"]=val }
242
+
243
+ opt.on("--user USERNAME", "XML-RPC username"){|val| options["user"]=val }
244
+ opt.on("--passwd PASSWORD", "XML-RPC password"){|val| options["passwd"]=val }
245
+ opt.on("--secure [BOOL]",["true","false"]){|val| options["secure"]=val||"true" }
246
+ opt.on("--check-rpc-cert [BOOL]",["true","false"]){|val| options["check-rpc-cert"]=val||"true" }
247
+
248
+ opt.on("--secret SECRET", "XML-RPC secret authorization token"){|val| options["secret"]=val }
249
+
250
+ opt.banner=<<EOS
251
+ Usage: #{program_name} addUri URI... [options]
252
+ #{program_name} addTorrent /path/to/torrent_file URI... [options]
253
+ #{program_name} addMetalink /path/to/metalink_file [options]
254
+ #{program_name} remove GID [options]
255
+ #{program_name} forceRemove GID [options]
256
+ #{program_name} pause GID [options]
257
+ #{program_name} pauseAll [options]
258
+ #{program_name} forcePause GID [options]
259
+ #{program_name} forcePauseAll [options]
260
+ #{program_name} unpause GID [options]
261
+ #{program_name} unpauseAll [options]
262
+ #{program_name} changePosition GID pos how [options]
263
+ #{program_name} tellStatus GID [keys] [options]
264
+ #{program_name} tellActive [keys] [options]
265
+ #{program_name} tellWaiting offset num [keys] [options]
266
+ #{program_name} tellStopped offset num [keys] [options]
267
+ #{program_name} getOption GID [options]
268
+ #{program_name} getGlobalOption [options]
269
+ #{program_name} getFiles GID [options]
270
+ #{program_name} getUris GID [options]
271
+ #{program_name} getPeers GID [options]
272
+ #{program_name} getServers GID [options]
273
+ #{program_name} purgeDownloadResult [options]
274
+ #{program_name} removeDownloadResult GID [options]
275
+ #{program_name} changeOption GID [options]
276
+ #{program_name} changeGlobalOption [options]
277
+ #{program_name} getVersion [options]
278
+ #{program_name} getSessionInfo [options]
279
+ #{program_name} shutdown [options]
280
+ #{program_name} forceShutdown [options]
281
+ #{program_name} getGlobalStat [options]
282
+ #{program_name} saveSession [options]
283
+ #{program_name} appendUri GID fileIndex URI... [options]
284
+ This command calls aria2.changeUri(GID, fileIndex, [], [URI,...])
285
+ internally.
286
+ Options:
287
+ EOS
288
+
289
+
290
+ args=opt.parse(ARGV)
291
+
292
+ end
293
+
294
+ if !args or args.size == 0 then
295
+ puts "No command specified"
296
+ exit 1
297
+ end
298
+
299
+ command=args[0]
300
+ resources=args[1..-1]
301
+
302
+ auth=""
303
+ if options.has_key?("user") then
304
+ auth=options["user"]+":"+options["passwd"]+"@"
305
+ end
306
+ if not options.has_key?("server") then
307
+ options["server"]="localhost"
308
+ end
309
+ if not options.has_key?("port") then
310
+ options["port"]="6800"
311
+ end
312
+ if not options.has_key?("secure") then
313
+ options["secure"]="false"
314
+ end
315
+ if not options.has_key?("check-rpc-cert") then
316
+ options["check-rpc-cert"]="true"
317
+ end
318
+ secret = if options.has_key?("secret") then "token:"+options["secret"] else nil end
319
+
320
+ client=XMLRPC::Client.new3({:host => options["server"],
321
+ :port => options["port"],
322
+ :path => "/rpc",
323
+ :user => options["user"],
324
+ :password => options["passwd"],
325
+ :use_ssl => options["secure"] == "true"})
326
+
327
+ if options["check-rpc-cert"] == "false" then
328
+ client.instance_variable_get(:@http).instance_variable_set(:@verify_mode, OpenSSL::SSL::VERIFY_NONE)
329
+ end
330
+
331
+ options.delete("server")
332
+ options.delete("port")
333
+ options.delete("user")
334
+ options.delete("passwd")
335
+ options.delete("secret")
336
+ options.delete("secure")
337
+ options.delete("check-rpc-cert")
338
+
339
+ def client_call client, secret, method, *params
340
+ if secret.nil?
341
+ client.call(method, *params)
342
+ else
343
+ client.call(method, secret, *params)
344
+ end
345
+ end
346
+
347
+ if command == "addUri" then
348
+ result=client_call(client, secret, "aria2."+command, resources, options)
349
+ elsif command == "addTorrent" then
350
+ torrentData=IO.read(resources[0])
351
+ result=client_call(client, secret, "aria2."+command,
352
+ XMLRPC::Base64.new(torrentData), resources[1..-1], options)
353
+ elsif command == "addMetalink" then
354
+ metalinkData=IO.read(resources[0])
355
+ result=client_call(client, secret, "aria2."+command,
356
+ XMLRPC::Base64.new(metalinkData), options)
357
+ elsif command == "tellStatus" then
358
+ result=client_call(client, secret, "aria2."+command,
359
+ resources[0], resources[1..-1])
360
+ elsif command == "tellActive" then
361
+ result=client_call(client, secret, "aria2."+command, resources[0..-1])
362
+ elsif command == "tellWaiting" then
363
+ result=client_call(client, secret, "aria2."+command, resources[0].to_i(),
364
+ resources[1].to_i(), resources[2..-1])
365
+ elsif command == "tellStopped" then
366
+ result=client_call(client, secret, "aria2."+command, resources[0].to_i(),
367
+ resources[1].to_i(), resources[2..-1])
368
+ elsif command == "getOption" then
369
+ result=client_call(client, secret, "aria2."+command, resources[0])
370
+ elsif command == "getGlobalOption" then
371
+ result=client_call(client, secret, "aria2."+command)
372
+ elsif command == "pause" then
373
+ result=client_call(client, secret, "aria2."+command, resources[0])
374
+ elsif command == "pauseAll" then
375
+ result=client_call(client, secret, "aria2."+command)
376
+ elsif command == "forcePause" then
377
+ result=client_call(client, secret, "aria2."+command, resources[0])
378
+ elsif command == "forcePauseAll" then
379
+ result=client_call(client, secret, "aria2."+command)
380
+ elsif command == "unpause" then
381
+ result=client_call(client, secret, "aria2."+command, resources[0])
382
+ elsif command == "unpauseAll" then
383
+ result=client_call(client, secret, "aria2."+command)
384
+ elsif command == "remove" then
385
+ result=client_call(client, secret, "aria2."+command, resources[0])
386
+ elsif command == "forceRemove" then
387
+ result=client_call(client, secret, "aria2."+command, resources[0])
388
+ elsif command == "changePosition" then
389
+ result=client_call(client, secret, "aria2."+command, resources[0],
390
+ resources[1].to_i(), resources[2])
391
+ elsif command == "getFiles" then
392
+ result=client_call(client, secret, "aria2."+command, resources[0])
393
+ elsif command == "getUris" then
394
+ result=client_call(client, secret, "aria2."+command, resources[0])
395
+ elsif command == "getPeers" then
396
+ result=client_call(client, secret, "aria2."+command, resources[0])
397
+ elsif command == "getServers" then
398
+ result=client_call(client, secret, "aria2."+command, resources[0])
399
+ elsif command == "purgeDownloadResult" then
400
+ result=client_call(client, secret, "aria2."+command)
401
+ elsif command == "removeDownloadResult" then
402
+ result=client_call(client, secret, "aria2."+command, resources[0])
403
+ elsif command == "changeOption" then
404
+ result=client_call(client, secret, "aria2."+command, resources[0], options)
405
+ elsif command == "changeGlobalOption" then
406
+ result=client_call(client, secret, "aria2."+command, options)
407
+ elsif command == "getVersion" then
408
+ result=client_call(client, secret, "aria2."+command)
409
+ elsif command == "getSessionInfo" then
410
+ result=client_call(client, secret, "aria2."+command)
411
+ elsif command == "shutdown" then
412
+ result=client_call(client, secret, "aria2."+command)
413
+ elsif command == "forceShutdown" then
414
+ result=client_call(client, secret, "aria2."+command)
415
+ elsif command == "getGlobalStat" then
416
+ result=client_call(client, secret, "aria2."+command)
417
+ elsif command == "saveSession" then
418
+ result=client_call(client, secret, "aria2."+command)
419
+ elsif command == "appendUri" then
420
+ result=client_call(client, secret, "aria2.changeUri", resources[0],
421
+ resources[1].to_i(), [], resources[2..-1])
422
+ else
423
+ puts "Command not recognized"
424
+ exit 1
425
+ end
426
+
427
+ pp result
share/locale/ar/LC_MESSAGES/aria2.mo ADDED
Binary file (2.2 kB). View file
 
share/locale/bg/LC_MESSAGES/aria2.mo ADDED
Binary file (48.7 kB). View file
 
share/locale/bn/LC_MESSAGES/aria2.mo ADDED
Binary file (950 Bytes). View file
 
share/locale/ca/LC_MESSAGES/aria2.mo ADDED
Binary file (17.4 kB). View file
 
share/locale/da/LC_MESSAGES/aria2.mo ADDED
Binary file (10.1 kB). View file
 
share/locale/de/LC_MESSAGES/aria2.mo ADDED
Binary file (50.4 kB). View file
 
share/locale/el/LC_MESSAGES/aria2.mo ADDED
Binary file (113 kB). View file
 
share/locale/en@boldquot/LC_MESSAGES/aria2.mo ADDED
Binary file (155 kB). View file
 
share/locale/en@quot/LC_MESSAGES/aria2.mo ADDED
Binary file (154 kB). View file
 
share/locale/es/LC_MESSAGES/aria2.mo ADDED
Binary file (22.3 kB). View file
 
share/locale/fa/LC_MESSAGES/aria2.mo ADDED
Binary file (1.49 kB). View file
 
share/locale/fi/LC_MESSAGES/aria2.mo ADDED
Binary file (15.6 kB). View file
 
share/locale/fil/LC_MESSAGES/aria2.mo ADDED
Binary file (1.7 kB). View file
 
share/locale/fr/LC_MESSAGES/aria2.mo ADDED
Binary file (54.2 kB). View file
 
share/locale/he/LC_MESSAGES/aria2.mo ADDED
Binary file (9.69 kB). View file
 
share/locale/hr/LC_MESSAGES/aria2.mo ADDED
Binary file (1.33 kB). View file
 
share/locale/hu/LC_MESSAGES/aria2.mo ADDED
Binary file (892 Bytes). View file
 
share/locale/id/LC_MESSAGES/aria2.mo ADDED
Binary file (21.3 kB). View file
 
share/locale/it/LC_MESSAGES/aria2.mo ADDED
Binary file (56.5 kB). View file
 
share/locale/ja/LC_MESSAGES/aria2.mo ADDED
Binary file (85.4 kB). View file
 
share/locale/kk/LC_MESSAGES/aria2.mo ADDED
Binary file (1.79 kB). View file
 
share/locale/ko/LC_MESSAGES/aria2.mo ADDED
Binary file (2.19 kB). View file
 
share/locale/ms/LC_MESSAGES/aria2.mo ADDED
Binary file (1.46 kB). View file
 
share/locale/nb/LC_MESSAGES/aria2.mo ADDED
Binary file (1 kB). View file
 
share/locale/nl/LC_MESSAGES/aria2.mo ADDED
Binary file (5.8 kB). View file
 
share/locale/nn/LC_MESSAGES/aria2.mo ADDED
Binary file (1.55 kB). View file
 
share/locale/oc/LC_MESSAGES/aria2.mo ADDED
Binary file (1 kB). View file
 
share/locale/pl/LC_MESSAGES/aria2.mo ADDED
Binary file (14.1 kB). View file
 
share/locale/pt/LC_MESSAGES/aria2.mo ADDED
Binary file (17.6 kB). View file
 
share/locale/pt_BR/LC_MESSAGES/aria2.mo ADDED
Binary file (165 kB). View file
 
share/locale/ro/LC_MESSAGES/aria2.mo ADDED
Binary file (4.62 kB). View file
 
share/locale/ru/LC_MESSAGES/aria2.mo ADDED
Binary file (198 kB). View file
 
share/locale/sk/LC_MESSAGES/aria2.mo ADDED
Binary file (3.22 kB). View file
 
share/locale/sr/LC_MESSAGES/aria2.mo ADDED
Binary file (3.35 kB). View file
 
share/locale/sv/LC_MESSAGES/aria2.mo ADDED
Binary file (10.1 kB). View file
 
share/locale/th/LC_MESSAGES/aria2.mo ADDED
Binary file (1.02 kB). View file
 
share/locale/tr/LC_MESSAGES/aria2.mo ADDED
Binary file (24.8 kB). View file
 
share/locale/uk/LC_MESSAGES/aria2.mo ADDED
Binary file (77.7 kB). View file
 
share/locale/vi/LC_MESSAGES/aria2.mo ADDED
Binary file (1.64 kB). View file
 
share/locale/zh_CN/LC_MESSAGES/aria2.mo ADDED
Binary file (112 kB). View file