746
792
\fB\-\-dht\-entry\-point\fR=HOST:PORT
748
Set host and port as an entry point to DHT network\&.
794
Set host and port as an entry point to IPv4 DHT network\&.
797
\fB\-\-dht\-entry\-point6\fR=HOST:PORT
799
Set host and port as an entry point to IPv6 DHT network\&.
751
802
\fB\-\-dht\-file\-path\fR=PATH
753
Change the DHT routing table file to PATH\&. Default:
804
Change the IPv4 DHT routing table file to PATH\&. Default:
754
805
\fI$HOME/\&.aria2/dht\&.dat\fR
808
\fB\-\-dht\-file\-path6\fR=PATH
810
Change the IPv6 DHT routing table file to PATH\&. Default:
811
\fI$HOME/\&.aria2/dht6\&.dat\fR
814
\fB\-\-dht\-listen\-addr6\fR=ADDR
816
Specify address to bind socket for IPv6 DHT\&. It should be a global unicast IPv6 address of the host\&.
757
819
\fB\-\-dht\-listen\-port\fR=PORT\&...
759
Set UDP listening port for DHT\&. Multiple ports can be specified by using ",", for example:
821
Set UDP listening port for both IPv4 and IPv6 DHT\&. Multiple ports can be specified by using ",", for example:
760
822
\fI6881,6885\fR\&. You can also use "\-" to specify a range:
761
823
\fI6881\-6999\fR\&. "," and "\-" can be used together\&. Default:
1605
1670
.SS "dht\&.dat"
1607
By default, the routing table of DHT is saved to the path $HOME/\&.aria2/dht\&.dat\&.
1672
By default, the routing table of IPv4 DHT is saved to the path \fI$HOME/\&.aria2/dht\&.dat\fR and the routing table of IPv6 DHT is saved to the path \fI$HOME/\&.aria2/dht6\&.dat\fR\&.
1675
Netrc support is enabled by default for HTTP(S)/FTP\&. To disable netrc support, specify \fB\-n\fR option\&. Your \&.netrc file should have correct permissions(600)\&.
1677
If machine name starts "\&.", aria2 performs domain match instead of exact match\&. This is an extension of aria2\&. For example of domain match, imagine the following \&.netrc entry:
1683
machine \&.example\&.org login myid password mypasswd
1689
In domain match, aria2\&.example\&.org matches \&.example\&.org and uses myid and mypasswd\&. example\&.org also matches \&.example\&.org\&. But example\&.net does not match \&.example\&.org\&.
1608
1690
.SS "Control File"
1610
1692
aria2 uses a control file to track the progress of a download\&. A control file is placed in the same directory as the downloading file and its filename is the filename of downloading file with "\&.aria2" appended\&. For example, if you are downloading file\&.zip, then the control file should be file\&.zip\&.aria2\&. (There is a exception for this naming convention\&. If you are downloading a multi torrent, its control file is the "top directory" name of the torrent with "\&.aria2" appended\&. The "top directory" name is a value of "name" key in "info" directory in a torrent file\&.)
1638
\h'-04'\(bu\h'+03'\c
1649
\h'-04'\(bu\h'+03'\c
1660
\h'-04'\(bu\h'+03'\c
1671
\h'-04'\(bu\h'+03'\c
1682
\h'-04'\(bu\h'+03'\c
1693
\h'-04'\(bu\h'+03'\c
1704
\h'-04'\(bu\h'+03'\c
1715
\h'-04'\(bu\h'+03'\c
1721
lowest\-speed\-limit
1726
\h'-04'\(bu\h'+03'\c
1732
max\-file\-not\-found
1737
\h'-04'\(bu\h'+03'\c
1748
\h'-04'\(bu\h'+03'\c
1759
\h'-04'\(bu\h'+03'\c
1770
\h'-04'\(bu\h'+03'\c
1781
\h'-04'\(bu\h'+03'\c
1792
\h'-04'\(bu\h'+03'\c
1803
\h'-04'\(bu\h'+03'\c
1814
\h'-04'\(bu\h'+03'\c
1820
http\-auth\-challenge
1825
\h'-04'\(bu\h'+03'\c
1836
\h'-04'\(bu\h'+03'\c
1847
\h'-04'\(bu\h'+03'\c
1858
\h'-04'\(bu\h'+03'\c
1869
\h'-04'\(bu\h'+03'\c
1880
\h'-04'\(bu\h'+03'\c
1891
\h'-04'\(bu\h'+03'\c
1902
\h'-04'\(bu\h'+03'\c
1913
\h'-04'\(bu\h'+03'\c
1919
https\-proxy\-passwd
1924
\h'-04'\(bu\h'+03'\c
1935
\h'-04'\(bu\h'+03'\c
1941
enable\-http\-keep\-alive
1946
\h'-04'\(bu\h'+03'\c
1952
enable\-http\-pipelining
1957
\h'-04'\(bu\h'+03'\c
1968
\h'-04'\(bu\h'+03'\c
1979
\h'-04'\(bu\h'+03'\c
1990
\h'-04'\(bu\h'+03'\c
2001
\h'-04'\(bu\h'+03'\c
2012
\h'-04'\(bu\h'+03'\c
2023
\h'-04'\(bu\h'+03'\c
2034
\h'-04'\(bu\h'+03'\c
2045
\h'-04'\(bu\h'+03'\c
2056
\h'-04'\(bu\h'+03'\c
2067
\h'-04'\(bu\h'+03'\c
2073
ftp\-reuse\-connection
2078
\h'-04'\(bu\h'+03'\c
2089
\h'-04'\(bu\h'+03'\c
2100
\h'-04'\(bu\h'+03'\c
2111
\h'-04'\(bu\h'+03'\c
2122
\h'-04'\(bu\h'+03'\c
2133
\h'-04'\(bu\h'+03'\c
2139
bt\-hash\-check\-seed
2144
\h'-04'\(bu\h'+03'\c
2150
bt\-max\-open\-files
2155
\h'-04'\(bu\h'+03'\c
2166
\h'-04'\(bu\h'+03'\c
2177
\h'-04'\(bu\h'+03'\c
2183
bt\-min\-crypto\-level
2188
\h'-04'\(bu\h'+03'\c
2194
bt\-prioritize\-piece
2199
\h'-04'\(bu\h'+03'\c
2210
\h'-04'\(bu\h'+03'\c
2216
bt\-request\-peer\-speed\-limit
2221
\h'-04'\(bu\h'+03'\c
2232
\h'-04'\(bu\h'+03'\c
2238
bt\-seed\-unverified
2243
\h'-04'\(bu\h'+03'\c
2254
\h'-04'\(bu\h'+03'\c
2260
bt\-tracker\-interval
2265
\h'-04'\(bu\h'+03'\c
2271
bt\-tracker\-timeout
2276
\h'-04'\(bu\h'+03'\c
2282
bt\-tracker\-connect\-timeout
2287
\h'-04'\(bu\h'+03'\c
2293
enable\-peer\-exchange
2298
\h'-04'\(bu\h'+03'\c
2309
\h'-04'\(bu\h'+03'\c
2320
\h'-04'\(bu\h'+03'\c
2331
\h'-04'\(bu\h'+03'\c
2342
\h'-04'\(bu\h'+03'\c
2353
\h'-04'\(bu\h'+03'\c
2364
\h'-04'\(bu\h'+03'\c
2375
\h'-04'\(bu\h'+03'\c
2386
\h'-04'\(bu\h'+03'\c
2397
\h'-04'\(bu\h'+03'\c
2408
\h'-04'\(bu\h'+03'\c
2419
\h'-04'\(bu\h'+03'\c
2425
metalink\-preferred\-protocol
2430
\h'-04'\(bu\h'+03'\c
2436
metalink\-enable\-unique\-protocol
2441
\h'-04'\(bu\h'+03'\c
2452
\h'-04'\(bu\h'+03'\c
2458
allow\-piece\-length\-change
2463
\h'-04'\(bu\h'+03'\c
2474
\h'-04'\(bu\h'+03'\c
2480
auto\-file\-renaming
2485
\h'-04'\(bu\h'+03'\c
2496
\h'-04'\(bu\h'+03'\c
2502
max\-download\-limit
2507
\h'-04'\(bu\h'+03'\c
2513
no\-file\-allocation\-limit
2518
\h'-04'\(bu\h'+03'\c
2529
\h'-04'\(bu\h'+03'\c
2535
realtime\-chunk\-checksum
2540
\h'-04'\(bu\h'+03'\c
2546
remove\-control\-file
2551
\h'-04'\(bu\h'+03'\c
2562
\h'-04'\(bu\h'+03'\c
2568
max\-resume\-failure\-tries
2573
\h'-04'\(bu\h'+03'\c
2584
\h'-04'\(bu\h'+03'\c
2590
max\-connection\-per\-server
2595
\h'-04'\(bu\h'+03'\c
2606
\h'-04'\(bu\h'+03'\c
2615
These options have exactly same meaning of the ones in the command\-line options, but it just applies to the URIs it belongs to\&.
1721
\h'-04'\(bu\h'+03'\c
1728
\fBall\-proxy\-passwd\fR
1733
\h'-04'\(bu\h'+03'\c
1740
\fBall\-proxy\-user\fR
1745
\h'-04'\(bu\h'+03'\c
1752
\fBallow\-overwrite\fR
1757
\h'-04'\(bu\h'+03'\c
1764
\fBallow\-piece\-length\-change\fR
1769
\h'-04'\(bu\h'+03'\c
1776
\fBalways\-resume\fR
1781
\h'-04'\(bu\h'+03'\c
1793
\h'-04'\(bu\h'+03'\c
1800
\fBauto\-file\-renaming\fR
1805
\h'-04'\(bu\h'+03'\c
1812
\fBbt\-enable\-lpd\fR
1817
\h'-04'\(bu\h'+03'\c
1824
\fBbt\-exclude\-tracker\fR
1829
\h'-04'\(bu\h'+03'\c
1836
\fBbt\-external\-ip\fR
1841
\h'-04'\(bu\h'+03'\c
1848
\fBbt\-hash\-check\-seed\fR
1853
\h'-04'\(bu\h'+03'\c
1860
\fBbt\-max\-open\-files\fR
1865
\h'-04'\(bu\h'+03'\c
1872
\fBbt\-max\-peers\fR
1877
\h'-04'\(bu\h'+03'\c
1884
\fBbt\-metadata\-only\fR
1889
\h'-04'\(bu\h'+03'\c
1896
\fBbt\-min\-crypto\-level\fR
1901
\h'-04'\(bu\h'+03'\c
1908
\fBbt\-prioritize\-piece\fR
1913
\h'-04'\(bu\h'+03'\c
1920
\fBbt\-request\-peer\-speed\-limit\fR
1925
\h'-04'\(bu\h'+03'\c
1932
\fBbt\-require\-crypto\fR
1937
\h'-04'\(bu\h'+03'\c
1944
\fBbt\-save\-metadata\fR
1949
\h'-04'\(bu\h'+03'\c
1956
\fBbt\-seed\-unverified\fR
1961
\h'-04'\(bu\h'+03'\c
1968
\fBbt\-stop\-timeout\fR
1973
\h'-04'\(bu\h'+03'\c
1985
\h'-04'\(bu\h'+03'\c
1992
\fBbt\-tracker\-connect\-timeout\fR
1997
\h'-04'\(bu\h'+03'\c
2004
\fBbt\-tracker\-interval\fR
2009
\h'-04'\(bu\h'+03'\c
2016
\fBbt\-tracker\-timeout\fR
2021
\h'-04'\(bu\h'+03'\c
2028
\fBcheck\-integrity\fR
2033
\h'-04'\(bu\h'+03'\c
2040
\fBconditional\-get\fR
2045
\h'-04'\(bu\h'+03'\c
2052
\fBconnect\-timeout\fR
2057
\h'-04'\(bu\h'+03'\c
2069
\h'-04'\(bu\h'+03'\c
2081
\h'-04'\(bu\h'+03'\c
2093
\h'-04'\(bu\h'+03'\c
2100
\fBenable\-async\-dns6\fR
2105
\h'-04'\(bu\h'+03'\c
2112
\fBenable\-http\-keep\-alive\fR
2117
\h'-04'\(bu\h'+03'\c
2124
\fBenable\-http\-pipelining\fR
2129
\h'-04'\(bu\h'+03'\c
2136
\fBenable\-peer\-exchange\fR
2141
\h'-04'\(bu\h'+03'\c
2148
\fBfile\-allocation\fR
2153
\h'-04'\(bu\h'+03'\c
2160
\fBfollow\-metalink\fR
2165
\h'-04'\(bu\h'+03'\c
2172
\fBfollow\-torrent\fR
2177
\h'-04'\(bu\h'+03'\c
2189
\h'-04'\(bu\h'+03'\c
2201
\h'-04'\(bu\h'+03'\c
2213
\h'-04'\(bu\h'+03'\c
2220
\fBftp\-proxy\-passwd\fR
2225
\h'-04'\(bu\h'+03'\c
2232
\fBftp\-proxy\-user\fR
2237
\h'-04'\(bu\h'+03'\c
2244
\fBftp\-reuse\-connection\fR
2249
\h'-04'\(bu\h'+03'\c
2261
\h'-04'\(bu\h'+03'\c
2273
\h'-04'\(bu\h'+03'\c
2285
\h'-04'\(bu\h'+03'\c
2292
\fBhttp\-accept\-gzip\fR
2297
\h'-04'\(bu\h'+03'\c
2304
\fBhttp\-auth\-challenge\fR
2309
\h'-04'\(bu\h'+03'\c
2316
\fBhttp\-no\-cache\fR
2321
\h'-04'\(bu\h'+03'\c
2333
\h'-04'\(bu\h'+03'\c
2345
\h'-04'\(bu\h'+03'\c
2352
\fBhttp\-proxy\-passwd\fR
2357
\h'-04'\(bu\h'+03'\c
2364
\fBhttp\-proxy\-user\fR
2369
\h'-04'\(bu\h'+03'\c
2381
\h'-04'\(bu\h'+03'\c
2393
\h'-04'\(bu\h'+03'\c
2400
\fBhttps\-proxy\-passwd\fR
2405
\h'-04'\(bu\h'+03'\c
2412
\fBhttps\-proxy\-user\fR
2417
\h'-04'\(bu\h'+03'\c
2429
\h'-04'\(bu\h'+03'\c
2436
\fBlowest\-speed\-limit\fR
2441
\h'-04'\(bu\h'+03'\c
2448
\fBmax\-connection\-per\-server\fR
2453
\h'-04'\(bu\h'+03'\c
2460
\fBmax\-download\-limit\fR
2465
\h'-04'\(bu\h'+03'\c
2472
\fBmax\-file\-not\-found\fR
2477
\h'-04'\(bu\h'+03'\c
2484
\fBmax\-resume\-failure\-tries\fR
2489
\h'-04'\(bu\h'+03'\c
2501
\h'-04'\(bu\h'+03'\c
2508
\fBmax\-upload\-limit\fR
2513
\h'-04'\(bu\h'+03'\c
2520
\fBmetalink\-enable\-unique\-protocol\fR
2525
\h'-04'\(bu\h'+03'\c
2532
\fBmetalink\-language\fR
2537
\h'-04'\(bu\h'+03'\c
2544
\fBmetalink\-location\fR
2549
\h'-04'\(bu\h'+03'\c
2561
\h'-04'\(bu\h'+03'\c
2568
\fBmetalink\-preferred\-protocol\fR
2573
\h'-04'\(bu\h'+03'\c
2580
\fBmetalink\-servers\fR
2585
\h'-04'\(bu\h'+03'\c
2592
\fBmetalink\-version\fR
2597
\h'-04'\(bu\h'+03'\c
2604
\fBmin\-split\-size\fR
2609
\h'-04'\(bu\h'+03'\c
2616
\fBno\-file\-allocation\-limit\fR
2621
\h'-04'\(bu\h'+03'\c
2633
\h'-04'\(bu\h'+03'\c
2645
\h'-04'\(bu\h'+03'\c
2657
\h'-04'\(bu\h'+03'\c
2664
\fBparameterized\-uri\fR
2669
\h'-04'\(bu\h'+03'\c
2681
\h'-04'\(bu\h'+03'\c
2688
\fBrealtime\-chunk\-checksum\fR
2693
\h'-04'\(bu\h'+03'\c
2705
\h'-04'\(bu\h'+03'\c
2717
\h'-04'\(bu\h'+03'\c
2724
\fBremove\-control\-file\fR
2729
\h'-04'\(bu\h'+03'\c
2741
\h'-04'\(bu\h'+03'\c
2753
\h'-04'\(bu\h'+03'\c
2765
\h'-04'\(bu\h'+03'\c
2777
\h'-04'\(bu\h'+03'\c
2789
\h'-04'\(bu\h'+03'\c
2801
\h'-04'\(bu\h'+03'\c
2813
\h'-04'\(bu\h'+03'\c
2823
These options have exactly same meaning of the ones in the command\-line options, but it just applies to the URIs it belongs to\&. Please note that for options in input file "\-\-" prefix must be stripped\&.
2617
2825
For example, the content of uri\&.txt is
2702
\fBaria2\&.addUri\fR \fIuris[, options[, position]]\fR
2704
This method adds new HTTP(S)/FTP/BitTorrent Magnet URI\&. \fIuris\fR is of type array and its element is URI which is of type string\&. For BitTorrent Magnet URI, \fIuris\fR must have only one element and it should be BitTorrent Magnet URI\&. URIs in \fIuris\fR must point to the same file\&. For example, a file chunkybaconlinux\&.iso is hosted in 2 locations: http://server/chunkybaconlinux\&.iso and http://mirror/chunkybaconlinux\&.iso\&. You can download this iso image using 2 URIs by issuing aria2\&.addUri([\fIhttp://server/chunkybaconlinux\&.iso\fR, \fIhttp://mirror/chunkybaconlinux\&.iso\fR])\&. Imagine there is an another file URI, say, http://mirror2/chunkydonutslinux\&.iso, which is different iso image\&. You cannot mix this URI with previous URIs in one aria2\&.addUri command\&. If you do, aria2 does not complain but download may fail\&. \fIoptions\fR is of type struct and its members are a pair of option name and value\&. See \fBOptions\fR below for more details\&. If \fIposition\fR is given as an integer starting from 0, the new download is inserted at \fIposition\fR in the waiting queue\&. If \fIposition\fR is not given or \fIposition\fR is larger than the size of the queue, it is appended at the end of the queue\&. This method returns GID of registered download\&.
2706
\fBaria2\&.addTorrent\fR \fItorrent[, uris[, options[, position]]]\fR
2910
All code examples come from Python2\&.7 interpreter\&.
2913
.nr an-no-space-flag 1
2917
\fBaria2.addUri (uris[, options[, position]])\fR
2920
This method adds new HTTP(S)/FTP/BitTorrent Magnet URI\&. \fIuris\fR is of type array and its element is URI which is of type string\&. For BitTorrent Magnet URI, \fIuris\fR must have only one element and it should be BitTorrent Magnet URI\&. URIs in \fIuris\fR must point to the same file\&. If you mix other URIs which point to another file, aria2 does not complain but download may fail\&. \fIoptions\fR is of type struct and its members are a pair of option name and value\&. See \fBOptions\fR below for more details\&. If \fIposition\fR is given as an integer starting from 0, the new download is inserted at \fIposition\fR in the waiting queue\&. If \fIposition\fR is not given or \fIposition\fR is larger than the size of the queue, it is appended at the end of the queue\&. This method returns GID of registered download\&.
2922
The following example adds http://example\&.org/file to aria2:
2928
>>> import xmlrpclib
2929
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
2930
>>> s\&.aria2\&.addUri([\*(Aqhttp://example\&.org/file\*(Aq])
2937
The following example adds 2 sources and some options:
2943
>>> s\&.aria2\&.addUri([\*(Aqhttp://example\&.org/file\*(Aq], dict(dir="/tmp"))
2950
The following example adds a download and insert it to the front of waiting downloads:
2956
>>> s\&.aria2\&.addUri([\*(Aqhttp://example\&.org/file\*(Aq], {}, 0)
2965
.nr an-no-space-flag 1
2969
\fBaria2.addTorrent (torrent[, uris[, options[, position]]])\fR
2708
2972
This method adds BitTorrent download by uploading \&.torrent file\&. If you want to add BitTorrent Magnet URI, use \fBaria2\&.addUri\fR method instead\&. \fItorrent\fR is of type base64 which contains Base64\-encoded \&.torrent file\&. \fIuris\fR is of type array and its element is URI which is of type string\&. \fIuris\fR is used for Web\-seeding\&. For single file torrents, URI can be a complete URI pointing to the resource or if URI ends with /, name in torrent file is added\&. For multi\-file torrents, name and path in torrent are added to form a URI for each file\&. \fIoptions\fR is of type struct and its members are a pair of option name and value\&. See \fBOptions\fR below for more details\&. If \fIposition\fR is given as an integer starting from 0, the new download is inserted at \fIposition\fR in the waiting queue\&. If \fIposition\fR is not given or \fIposition\fR is larger than the size of the queue, it is appended at the end of the queue\&. This method returns GID of registered download\&. Please note that the downloads added by this method are not saved by \fB\-\-save\-session\fR\&.
2710
\fBaria2\&.addMetalink\fR \fImetalink[, options[, position]]\fR
2974
The following example adds local file file\&.torrent to aria2:
2980
>>> import xmlrpclib
2981
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
2982
>>> s\&.aria2\&.addTorrent(xmlrpclib\&.Binary(open(\*(Aqfile\&.torrent\*(Aq)\&.read()))
2991
.nr an-no-space-flag 1
2995
\fBaria2.addMetalink (metalink[, options[, position]])\fR
2712
2998
This method adds Metalink download by uploading \&.metalink file\&. \fImetalink\fR is of type base64 which contains Base64\-encoded \&.metalink file\&. \fIoptions\fR is of type struct and its members are a pair of option name and value\&. See \fBOptions\fR below for more details\&. If \fIposition\fR is given as an integer starting from 0, the new download is inserted at \fIposition\fR in the waiting queue\&. If \fIposition\fR is not given or \fIposition\fR is larger than the size of the queue, it is appended at the end of the queue\&. This method returns array of GID of registered download\&. Please note that the downloads added by this method are not saved by \fB\-\-save\-session\fR\&.
2714
\fBaria2\&.remove\fR \fIgid\fR
3000
The following example adds local file file\&.meta4 to aria2:
3006
>>> import xmlrpclib
3007
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
3008
>>> s\&.aria2\&.addMetalink(xmlrpclib\&.Binary(open(\*(Aqfile\&.meta4\*(Aq)\&.read()))
3017
.nr an-no-space-flag 1
3021
\fBaria2.remove (gid)\fR
2716
3024
This method removes the download denoted by \fIgid\fR\&. \fIgid\fR is of type string\&. If specified download is in progress, it is stopped at first\&. The status of removed download becomes "removed"\&. This method returns GID of removed download\&.
2718
\fBaria2\&.forceRemove\fR \fIgid\fR
3026
The following example removes download whose GID is "3":
3032
>>> import xmlrpclib
3033
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
3034
>>> s\&.aria2\&.remove(\*(Aq3\*(Aq)
3043
.nr an-no-space-flag 1
3047
\fBaria2.forceRemove (gid)\fR
2720
3050
This method removes the download denoted by \fIgid\fR\&. This method behaves just like \fBaria2\&.remove\fR except that this method removes download without any action which takes time such as contacting BitTorrent tracker\&.
2722
\fBaria2\&.pause\fR \fIgid\fR
3054
.nr an-no-space-flag 1
3058
\fBaria2.pause (gid)\fR
2724
3061
This method pauses the download denoted by \fIgid\fR\&. \fIgid\fR is of type string\&. The status of paused download becomes "paused"\&. If the download is active, the download is placed on the first position of waiting queue\&. As long as the status is "paused", the download is not started\&. To change status to "waiting", use \fBaria2\&.unpause\fR method\&. This method returns GID of paused download\&.
2726
\fBaria2\&.pauseAll\fR
3065
.nr an-no-space-flag 1
3069
\fBaria2.pauseAll ()\fR
2728
3072
This method is equal to calling \fBaria2\&.pause\fR for every active/waiting download\&. This methods returns "OK" for success\&.
2730
\fBaria2\&.forcePause\fR \fIpid\fR
3076
.nr an-no-space-flag 1
3080
\fBaria2.forcePause (pid)\fR
2732
3083
This method pauses the download denoted by \fIgid\fR\&. This method behaves just like \fBaria2\&.pause\fR except that this method pauses download without any action which takes time such as contacting BitTorrent tracker\&.
2734
\fBaria2\&.forcePauseAll\fR
3087
.nr an-no-space-flag 1
3091
\fBaria2.forcePauseAll ()\fR
2736
3094
This method is equal to calling \fBaria2\&.forcePause\fR for every active/waiting download\&. This methods returns "OK" for success\&.
2738
\fBaria2\&.unpause\fR \fIgid\fR
3098
.nr an-no-space-flag 1
3102
\fBaria2.unpause (gid)\fR
2740
3105
This method changes the status of the download denoted by \fIgid\fR from "paused" to "waiting"\&. This makes the download eligible to restart\&. \fIgid\fR is of type string\&. This method returns GID of unpaused download\&.
2742
\fBaria2\&.unpauseAll\fR
3109
.nr an-no-space-flag 1
3113
\fBaria2.unpauseAll ()\fR
2744
3116
This method is equal to calling \fBaria2\&.unpause\fR for every active/waiting download\&. This methods returns "OK" for success\&.
2746
\fBaria2\&.tellStatus\fR \fIgid\fR
2748
This method returns download progress of the download denoted by \fIgid\fR\&. \fIgid\fR is of type string\&. The response is of type struct and it contains following keys\&. The value type is string\&.
3120
.nr an-no-space-flag 1
3124
\fBaria2.tellStatus (gid[, keys])\fR
3127
This method returns download progress of the download denoted by \fIgid\fR\&. \fIgid\fR is of type string\&. \fIkeys\fR is array of string\&. If it is specified, the response contains only keys in \fIkeys\fR array\&. If \fIkeys\fR is empty or not specified, the response contains all keys\&. This is useful when you just want specific keys and avoid unnecessary transfers\&. For example, \fBaria2\&.tellStatus\fR("1", ["gid", "status"]) returns \fIgid\fR and \fIstatus\fR key\&. The response is of type struct and it contains following keys\&. The value type is string\&.
2882
\fBaria2\&.getUris\fR \fIgid\fR
3263
The following example gets information about download whose GID is "1":
3269
>>> import xmlrpclib
3270
>>> from pprint import pprint
3271
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
3272
>>> r = s\&.aria2\&.tellStatus(\*(Aq1\*(Aq)
3274
{\*(Aqbitfield\*(Aq: \*(Aqffff80\*(Aq,
3275
\*(AqcompletedLength\*(Aq: \*(Aq34896138\*(Aq,
3276
\*(Aqconnections\*(Aq: \*(Aq0\*(Aq,
3277
\*(Aqdir\*(Aq: \*(Aq/downloads\*(Aq,
3278
\*(AqdownloadSpeed\*(Aq: \*(Aq0\*(Aq,
3279
\*(AqerrorCode\*(Aq: \*(Aq0\*(Aq,
3280
\*(Aqfiles\*(Aq: [{\*(Aqindex\*(Aq: \*(Aq1\*(Aq,
3281
\*(Aqlength\*(Aq: \*(Aq34896138\*(Aq,
3282
\*(Aqpath\*(Aq: \*(Aq/downloads/file\*(Aq,
3283
\*(Aqselected\*(Aq: \*(Aqtrue\*(Aq,
3284
\*(Aquris\*(Aq: [{\*(Aqstatus\*(Aq: \*(Aqused\*(Aq,
3285
\*(Aquri\*(Aq: \*(Aqhttp://example\&.org/file\*(Aq}]}],
3286
\*(Aqgid\*(Aq: \*(Aq1\*(Aq,
3287
\*(AqnumPieces\*(Aq: \*(Aq17\*(Aq,
3288
\*(AqpieceLength\*(Aq: \*(Aq2097152\*(Aq,
3289
\*(Aqstatus\*(Aq: \*(Aqcomplete\*(Aq,
3290
\*(AqtotalLength\*(Aq: \*(Aq34896138\*(Aq,
3291
\*(AquploadLength\*(Aq: \*(Aq0\*(Aq,
3292
\*(AquploadSpeed\*(Aq: \*(Aq0\*(Aq}
3298
The following example gets information specifying keys you are interested in:
3304
>>> r = s\&.aria2\&.tellStatus(\*(Aq1\*(Aq, [\*(Aqgid\*(Aq, \*(AqtotalLength\*(Aq, \*(AqcompletedLength\*(Aq])
3306
{\*(AqcompletedLength\*(Aq: \*(Aq34896138\*(Aq, \*(Aqgid\*(Aq: \*(Aq1\*(Aq, \*(AqtotalLength\*(Aq: \*(Aq34896138\*(Aq}
3314
.nr an-no-space-flag 1
3318
\fBaria2.getUris (gid)\fR
2884
3321
This method returns URIs used in the download denoted by \fIgid\fR\&. \fIgid\fR is of type string\&. The response is of type array and its element is of type struct and it contains following keys\&. The value type is string\&.
2935
\fBaria2\&.getPeers\fR \fIgid\fR
3398
>>> import xmlrpclib
3399
>>> from pprint import pprint
3400
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
3401
>>> r = s\&.aria2\&.getFiles(\*(Aq1\*(Aq)
3403
[{\*(Aqindex\*(Aq: \*(Aq1\*(Aq,
3404
\*(Aqlength\*(Aq: \*(Aq34896138\*(Aq,
3405
\*(Aqpath\*(Aq: \*(Aq/downloads/file\*(Aq,
3406
\*(Aqselected\*(Aq: \*(Aqtrue\*(Aq,
3407
\*(Aquris\*(Aq: [{\*(Aqstatus\*(Aq: \*(Aqused\*(Aq,
3408
\*(Aquri\*(Aq: \*(Aqhttp://example\&.org/file\*(Aq}]}]
3416
.nr an-no-space-flag 1
3420
\fBaria2.getPeers (gid)\fR
2937
3423
This method returns peer list of the download denoted by \fIgid\fR\&. \fIgid\fR is of type string\&. This method is for BitTorrent only\&. The response is of type array and its element is of type struct and it contains following keys\&. The value type is string\&.
2981
3467
"true" is this client is a seeder\&. Otherwise "false"\&.
2984
\fBaria2\&.getServers\fR \fIgid\fR
3474
>>> import xmlrpclib
3475
>>> from pprint import pprint
3476
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
3477
>>> r = s\&.aria2\&.getPeers(\*(Aq1\*(Aq)
3479
[{\*(AqamChoking\*(Aq: \*(Aqtrue\*(Aq,
3480
\*(Aqbitfield\*(Aq: \*(Aqffffffffffffffffffffffffffffffffffffffff\*(Aq,
3481
\*(AqdownloadSpeed\*(Aq: \*(Aq10602\*(Aq,
3482
\*(Aqip\*(Aq: \*(Aq10\&.0\&.0\&.9\*(Aq,
3483
\*(AqpeerChoking\*(Aq: \*(Aqfalse\*(Aq,
3484
\*(AqpeerId\*(Aq: \*(Aqaria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6\*(Aq,
3485
\*(Aqport\*(Aq: \*(Aq6881\*(Aq,
3486
\*(Aqseeder\*(Aq: \*(Aqtrue\*(Aq,
3487
\*(AquploadSpeed\*(Aq: \*(Aq0\*(Aq},
3488
{\*(AqamChoking\*(Aq: \*(Aqfalse\*(Aq,
3489
\*(Aqbitfield\*(Aq: \*(Aqffffeff0fffffffbfffffff9fffffcfff7f4ffff\*(Aq,
3490
\*(AqdownloadSpeed\*(Aq: \*(Aq8654\*(Aq,
3491
\*(Aqip\*(Aq: \*(Aq10\&.0\&.0\&.30\*(Aq,
3492
\*(AqpeerChoking\*(Aq: \*(Aqfalse\*(Aq,
3493
\*(AqpeerId\*(Aq: \*(Aqbittorrent client758\*(Aq,
3494
\*(Aqport\*(Aq: \*(Aq37842\*(Aq,
3495
\*(Aqseeder\*(Aq: \*(Aqfalse,
3496
\*(AquploadSpeed\*(Aq: \*(Aq6890\*(Aq}]
3504
.nr an-no-space-flag 1
3508
\fBaria2.getServers (gid)\fR
2986
3511
This method returns currently connected HTTP(S)/FTP servers of the download denoted by \fIgid\fR\&. \fIgid\fR is of type string\&. The response is of type array and its element is of type struct and it contains following keys\&. The value type is string\&.
3013
\fBaria2\&.tellActive\fR
3015
This method returns the list of active downloads\&. The response is of type array and its element is the same struct returned by \fBaria2\&.tellStatus\fR method\&.
3017
\fBaria2\&.tellWaiting\fR \fIoffset, num\fR
3019
This method returns the list of waiting download, including paused downloads\&. \fIoffset\fR is of type integer and specifies the offset from the download waiting at the front\&. \fInum\fR is of type integer and specifies the number of downloads to be returned\&.
3542
>>> import xmlrpclib
3543
>>> from pprint import pprint
3544
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
3545
>>> r = s\&.aria2\&.getServers(\*(Aq1\*(Aq)
3547
[{\*(Aqindex\*(Aq: \*(Aq1\*(Aq,
3548
\*(Aqservers\*(Aq: [{\*(AqcurrentUri\*(Aq: \*(Aqhttp://example\&.org/dl/file\*(Aq,
3549
\*(AqdownloadSpeed\*(Aq: \*(Aq20285\*(Aq,
3550
\*(Aquri\*(Aq: \*(Aqhttp://example\&.org/file\*(Aq}]}]
3558
.nr an-no-space-flag 1
3562
\fBaria2.tellActive ([keys])\fR
3565
This method returns the list of active downloads\&. The response is of type array and its element is the same struct returned by \fBaria2\&.tellStatus\fR method\&. For \fIkeys\fR parameter, please refer to \fBaria2\&.tellStatus\fR method\&.
3569
.nr an-no-space-flag 1
3573
\fBaria2.tellWaiting (offset, num, [keys])\fR
3576
This method returns the list of waiting download, including paused downloads\&. \fIoffset\fR is of type integer and specifies the offset from the download waiting at the front\&. \fInum\fR is of type integer and specifies the number of downloads to be returned\&. For \fIkeys\fR parameter, please refer to \fBaria2\&.tellStatus\fR method\&.
3021
3578
If offset is a positive integer, this method returns downloads in the range of [\fIoffset\fR, \fIoffset\fR+\fInum\fR)\&.
3025
3582
For example, imagine that three downloads "A","B" and "C" are waiting in this order\&. aria2\&.tellWaiting(0, 1) returns ["A"]\&. aria2\&.tellWaiting(1, 2) returns ["B", "C"]\&. aria2\&.tellWaiting(\-1, 2) returns ["C", "B"]\&.
3027
3584
The response is of type array and its element is the same struct returned by \fBaria2\&.tellStatus\fR method\&.
3029
\fBaria2\&.tellStopped\fR \fIoffset, num\fR
3031
This method returns the list of stopped download\&. \fIoffset\fR is of type integer and specifies the offset from the oldest download\&. \fInum\fR is of type integer and specifies the number of downloads to be returned\&.
3588
.nr an-no-space-flag 1
3592
\fBaria2.tellStopped (offset, num, [keys])\fR
3595
This method returns the list of stopped download\&. \fIoffset\fR is of type integer and specifies the offset from the oldest download\&. \fInum\fR is of type integer and specifies the number of downloads to be returned\&. For \fIkeys\fR parameter, please refer to \fBaria2\&.tellStatus\fR method\&.
3033
3597
\fIoffset\fR and \fInum\fR have the same semantics as \fBaria2\&.tellWaiting\fR method\&.
3035
3599
The response is of type array and its element is the same struct returned by \fBaria2\&.tellStatus\fR method\&.
3037
\fBaria2\&.changePosition\fR \fIgid, pos, how\fR
3603
.nr an-no-space-flag 1
3607
\fBaria2.changePosition (gid, pos, how)\fR
3039
3610
This method changes the position of the download denoted by \fIgid\fR\&. \fIpos\fR is of type integer\&. \fIhow\fR is of type string\&. If \fIhow\fR is "POS_SET", it moves the download to a position relative to the beginning of the queue\&. If \fIhow\fR is "POS_CUR", it moves the download to a position relative to the current position\&. If \fIhow\fR is "POS_END", it moves the download to a position relative to the end of the queue\&. If the destination position is less than 0 or beyond the end of the queue, it moves the download to the beginning or the end of the queue respectively\&. The response is of type integer and it is the destination position\&.
3041
3612
For example, if GID#1 is placed in position 3, aria2\&.changePosition(1, \-1, POS_CUR) will change its position to 2\&. Additional aria2\&.changePosition(1, 0, POS_SET) will change its position to 0(the beginning of the queue)\&.
3043
\fBaria2\&.changeUri\fR \fIgid, fileIndex, delUris, addUris[, position]\fR
3614
The following example moves the download whose GID is "3" to the front of the waiting queue:
3620
>>> import xmlrpclib
3621
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
3622
>>> s\&.aria2\&.changePosition(\*(Aq3\*(Aq, 0, \*(AqPOS_SET\*(Aq)
3631
.nr an-no-space-flag 1
3635
\fBaria2.changeUri (gid, fileIndex, delUris, addUris[, position])\fR
3045
3638
This method removes URIs in \fIdelUris\fR from and appends URIs in \fIaddUris\fR to download denoted by \fIgid\fR\&. \fIdelUris\fR and \fIaddUris\fR are list of string\&. A download can contain multiple files and URIs are attached to each file\&. \fIfileIndex\fR is used to select which file to remove/attach given URIs\&. \fIfileIndex\fR is 1\-based\&. \fIposition\fR is used to specify where URIs are inserted in the existing waiting URI list\&. \fIposition\fR is 0\-based\&. When \fIposition\fR is omitted, URIs are appended to the back of the list\&. This method first execute removal and then addition\&. \fIposition\fR is the position after URIs are removed, not the position when this method is called\&. When removing URI, if same URIs exist in download, only one of them is removed for each URI in \fIdelUris\fR\&. In other words, there are three URIs "http://example\&.org/aria2" and you want remove them all, you have to specify (at least) 3 "http://example\&.org/aria2" in \fIdelUris\fR\&. This method returns a list which contains 2 integers\&. The first integer is the number of URIs deleted\&. The second integer is the number of URIs added\&.
3047
\fBaria2\&.getOption\fR \fIgid\fR
3640
The following example adds 1 URI http://example\&.org/file to the file whose index is "1" and belongs to the download whose GID is "2":
3646
>>> import xmlrpclib
3647
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
3648
>>> s\&.aria2\&.changeUri(\*(Aq2\*(Aq, 1, [], [\*(Aqhttp://example\&.org/file\*(Aq])
3657
.nr an-no-space-flag 1
3661
\fBaria2.getOption (gid)\fR
3049
3664
This method returns options of the download denoted by \fIgid\fR\&. The response is of type struct\&. Its key is the name of option\&. The value type is string\&.
3051
\fBaria2\&.changeOption\fR \fIgid, options\fR
3666
The following example gets options of the download whose GID is "1":
3672
>>> import xmlrpclib
3673
>>> from pprint import pprint
3674
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
3675
>>> r = s\&.aria2\&.getOption(\*(Aq1\*(Aq)
3677
{\*(Aqallow\-overwrite\*(Aq: \*(Aqfalse\*(Aq,
3678
\*(Aqallow\-piece\-length\-change\*(Aq: \*(Aqfalse\*(Aq,
3679
\*(Aqalways\-resume\*(Aq: \*(Aqtrue\*(Aq,
3680
\*(Aqasync\-dns\*(Aq: \*(Aqtrue\*(Aq,
3689
.nr an-no-space-flag 1
3693
\fBaria2.changeOption (gid, options)\fR
3053
3696
This method changes options of the download denoted by \fIgid\fR dynamically\&. \fIgid\fR is of type string\&. \fIoptions\fR is of type struct and the available options are: \fBbt\-max\-peers\fR, \fBbt\-request\-peer\-speed\-limit\fR, \fBmax\-download\-limit\fR and \fBmax\-upload\-limit\fR\&. This method returns "OK" for success\&.
3055
\fBaria2\&.getGlobalOption\fR
3698
The following example sets \fBmax\-download\-limit\fR option to "20K" for the download whose GID is "1"\&.
3704
>>> import xmlrpclib
3705
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
3706
>>> s\&.aria2\&.changeOption(\*(Aq1\*(Aq, {\*(Aqmax\-download\-limit\*(Aq:\*(Aq20K\*(Aq})
3715
.nr an-no-space-flag 1
3719
\fBaria2.getGlobalOption ()\fR
3057
3722
This method returns global options\&. The response is of type struct\&. Its key is the name of option\&. The value type is string\&. Because global options are used as a template for the options of newly added download, the response contains keys returned by \fBaria2\&.getOption\fR method\&.
3059
\fBaria2\&.changeGlobalOption\fR \fIoptions\fR
3726
.nr an-no-space-flag 1
3730
\fBaria2.changeGlobalOption (options)\fR
3061
3733
This method changes global options dynamically\&. \fIoptions\fR is of type struct and the available options are \fBmax\-concurrent\-downloads\fR, \fBmax\-overall\-download\-limit\fR, \fBmax\-overall\-upload\-limit\fR, \fBlog\-level\fR and \fBlog\fR\&. Using \fBlog\fR option, you can dynamically start logging or change log file\&. To stop logging, give empty string("") as a parameter value\&. Note that log file is always opened in append mode\&. This method returns "OK" for success\&.
3063
\fBaria2\&.purgeDownloadResult\fR
3737
.nr an-no-space-flag 1
3741
\fBaria2.purgeDownloadResult ()\fR
3065
3744
This method purges completed/error/removed downloads to free memory\&. This method returns "OK"\&.
3067
\fBaria2\&.getVersion\fR
3748
.nr an-no-space-flag 1
3752
\fBaria2.getVersion ()\fR
3069
3755
This method returns version of the program and the list of enabled features\&. The response is of type struct and contains following keys\&.
3087
3803
Session ID, which is generated each time when aria2 is invoked\&.
3090
\fBaria2\&.shutdown\fR
3810
>>> import xmlrpclib
3811
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
3812
>>> s\&.aria2\&.getSessionInfo()
3813
{\*(AqsessionId\*(Aq: \*(Aqcd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9\*(Aq}
3821
.nr an-no-space-flag 1
3825
\fBaria2.shutdown ()\fR
3092
3828
This method shutdowns aria2\&. This method returns "OK"\&.
3094
\fBaria2\&.forceShutdown\fR
3832
.nr an-no-space-flag 1
3836
\fBaria2.forceShutdown ()\fR
3096
3839
This method shutdowns aria2\&. This method behaves like \fBaria2\&.shutdown\fR except that any actions which takes time such as contacting BitTorrent tracker are skipped\&. This method returns "OK"\&.
3098
\fBsystem\&.multicall\fR \fImethods\fR
3843
.nr an-no-space-flag 1
3847
\fBsystem.multicall (methods)\fR
3100
3850
This methods encapsulates multiple method calls in a single request\&. \fImethods\fR is of type array and its element is struct\&. The struct contains two keys: "methodName" and "params"\&. "methodName" is the method name to call and "params" is array containing parameters to the method\&. This method returns array of responses\&. The element of array will either be a one\-item array containing the return value of each method call or struct of fault element if an encapsulated method call fails\&.
3852
In the following example, we add 2 downloads\&. First one is http://example\&.org/file and second one is file\&.torrent:
3858
>>> import xmlrpclib
3859
>>> s = xmlrpclib\&.ServerProxy(\*(Aqhttp://localhost:6800/rpc\*(Aq)
3860
>>> mc = xmlrpclib\&.MultiCall(s)
3861
>>> mc\&.aria2\&.addUri([\*(Aqhttp://example\&.org/file\*(Aq])
3862
>>> mc\&.aria2\&.addTorrent(xmlrpclib\&.Binary(open(\*(Aqfile\&.torrent\*(Aq)\&.read()))
3865
(\*(Aq2\*(Aq, \*(Aq3\*(Aq)
3101
3871
.SS "Error Handling"
3103
3873
In case of error, aria2 returns faultCode=1 and the error message in faultString\&.