ARIA2C(1) aria2 ARIA2C(1) NAME aria2c - aria2c [<>] [|>|>|>] ... aria2 - . : HTTP(S), FTP, SFTP, BitTorrent Metalink. aria2 / . HTTP(S)/FTP/SFTP BitTorrent , HTTP(S)/FTP, BitTorrent-. Metalink, aria2 . : FTP SFTP. SFTP (, --ftp-pasv) -d, --dir= . -i, --input-file= URI, FILE. , URI , TAB (). URI-. C (SPACE TAB) . FILE -, aria2 stdin ( ). gzip-. . --deferred-input. --save-session. -l, --log= . -, stdout ( ). ("") , . -j, --max-concurrent-downloads= . --split. : 5 : --max-concurrent-downloads , . --split --min-split-size . (. --input-file): http://example.com/foo http://example.com/bar 2 . aria2 , , --max-concurrent-downloads, 2. , , --split / --min-split-size. -V, --check-integrity [true|false] . BitTorrent, Metalink HTTP(S)/FTP --checksum. . , , . . , . , . : false -c, --continue [true|false] . , , - , . HTTP(S)/FTP-. : false -h, --help[=|] (TAG). #. , --help=#http , #http. (KEYWORD), , , . : #basic, #advanced, #http, #https, #ftp, #metalink, #bittorrent, #cookie, #hook, #file, #rpc, #checksum, #experimental, #deprecated, #help, #all. : #basic HTTP/FTP/SFTP --all-proxy= - . "". - , --http-proxy, --https-proxy --ftp-proxy. . PROXY - [http://][:@][:]. . : URI- --{http,https,ftp,all}-proxy-{user,passwd}, , . , http-proxy-user="myname", http-proxy-passwd="mypass" aria2.conf --http-proxy="http://proxy" , HTTP- http://proxy myname mypass. : --http-proxy="http://user:pass@proxy" --http-proxy-user="myname" --http-proxy-passwd="mypass", HTTP- http://proxy myname mypass. : --http-proxy-user="myname" --http-proxy-passwd="mypass" --http-proxy="http://user:pass@proxy", HTTP- http://proxy user pass. --all-proxy-passwd= --all-proxy. --all-proxy-user= --all-proxy. --checksum== . TYPE - . aria2c -v. DIGEST - . , sha-1 : sha-1=0192ba11326fe2298c8cb4de616f4d4140213838 HTTP(S)/FTP . --connect-timeout= HTTP/FTP/-. , --timeout. : 60 --dry-run [true|false] true, aria2 , . HTTP/FTP-. BitTorrent- , true. : false --lowest-speed-limit= , SPEED ( ). 0 , aria2 . K M (1K = 1024, 1M = 1024K). BitTorrent-. : 0 -x, --max-connection-per-server= . : 1 --max-file-not-found= aria2 "file not found" ( ) HTTP/FTP- NUM , , . 0, . , HTTP/FTP-. --max-tries, , . : 0 -m, --max-tries= . 0 . --retry-wait. : 5 -k, --min-split-size= aria2 2*SIZE . , 20. SIZE 10M, aria2 2- [0-10) [10-20) , 2 ( --split >= 2, ). SIZE 15M, .. 2*15M > 20MiB, aria2 , 1 . K M (1K = 1024, 1M = 1024K). : 1M -1024M. : 20M --netrc-path= .netrc. : $(HOME)/.netrc : .netrc 600. , . -n, --no-netrc [true|false] netrc. netrc . : netrc , --no-netrc false. --no-netrc true , netrc . netrc, --no-netrc=false, aria2.changeGlobalOption(). --no-proxy= , , . : IPv4- IPv6- . URI --no-proxy. , , URI IP-. -o, --out= , , --dir. , --force-sequential. : Metalink BitTorrent . , URI aria2 , --input-file, --force-sequential. : $ aria2c -o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip" --proxy-method= -. METHOD : get tunnel. HTTPS- tunnel, . : get -R, --remote-time [true|false] HTTP/FTP- , , . : false --reuse-uri [true|false] URI, URI. : true --retry-wait= . SEC > 0`, HTTP- 503, aria2 . : 0 --server-stat-of= , . , --server-stat-if. . --server-stat-if= . URI , feedback. --uri-selector. . --server-stat-timeout= , , , , . : 86400 (24 ) -s, --split= , N . N URI, N URI, URI . N URI, URI , N . --max-connection-per-server. --min-split-size. : 5 : Metalink . aria2 . , Metalink maxconnections N, aria2 , , N. --stream-piece-selector= , HTTP/FTP-. - , , , . default, aria2 , . , . inorder, aria2 , . Index=0 . , . --enable-http-pipelining . , aria2 --min-split-size, --min-split-size. random, aria2 . inorder --min-split-size. geom, aria2 , inorder, . . , . : default -t, --timeout= . : 60 --uri-selector= URI. : inorder, feedback adaptive. inorder, URI URI. feedback, aria2 , , URI. . , --server-stat-of --server-stat-if. adaptive, . , , , , , , . . feedback, . : feedback HTTP --ca-certificate= FILE . FILE PEM- CA-. --check-certificate, . : OpenSSL GnuTLS, gnutls_certificate_set_x509_system_trust(), , CA-, aria2 . : WinTLS AppleTLS . . --certificate= FILE. : PKCS12 (.p12, .pfx) PEM-. PKCS12- , , , . PKCS12- ! PEM, --private-key, : WinTLS PEM- . PKCS12-. : AppleTLS KeyChain Access SHA-1 Information. aria2c --certificate=. PKCS12- . PEM-, , . --check-certificate [true|false] , , --ca-certificate. : true --http-accept-gzip [true|false] Accept-Encoding: deflate, gzip - , Content-Encoding: gzip Content-Encoding: deflate. : false : Content-Encoding: gzip , (gzipped). aria2 , , - . --http-auth-challenge [true|false] HTTP- , . false, . : URI, , . : false --http-no-cache [true|false] Cache-Control: no-cache Pragma: no-cache, . false, , Cache-Control --header. : false --http-user= HTTP. URI. --http-passwd= HTTP. URI. --http-proxy= - HTTP. "". --all-proxy. HTTP-. PROXY - [http://][:@][:]. --http-proxy-passwd= --http-proxy. --http-proxy-user= --http-proxy. --https-proxy= - HTTPS. "". --all-proxy. HTTPS-. PROXY - [http://][:@][:]. --https-proxy-passwd= --https-proxy. --https-proxy-user= --https-proxy. --private-key= FILE. PEM-. , , . --certificate. --referer= HTTP (Referer). HTTP/HTTPS-. *, URI . --parameterized-uri. --enable-http-keep-alive [true|false] HTTP/1.1 . : true --enable-http-pipelining [true|false] HTTP/1.1. : false : , , . --header=
HEADER HTTP -. , : $ aria2c --header="X-A: b78" --header="X-B: 9J1" "http://host/file" --load-cookies= - FILE, Firefox3 (SQLite3), Chromium/Google Chrome (SQLite3) Mozilla/Firefox(1.x/2.x)/Netscape. : aria2 libsqlite3, - Firefox3 Chromium/Google Chrome . --save-cookies= FILE Mozilla/Firefox(1.x/2.x)/Netscape. FILE , . - , 0. : /// --use-head [true|false] HEAD HTTP . : false --no-want-digest-header [true|false] Want-Digest . : false -U, --user-agent= HTTP(S)-. : aria2/$VERSION, $VERSION . FTP/SFTP --ftp-user= FTP. URI. : anonymous --ftp-passwd= FTP. URI. , URI, aria2 .netrc. .netrc, . , , . : ARIA2USER@ -p, --ftp-pasv [true|false] FTP. false, . : true : SFTP-. --ftp-proxy= - FTP. "". --all-proxy. FTP-. PROXY - [http://][:@][:] --ftp-proxy-passwd= --ftp-proxy. --ftp-proxy-user= --ftp-proxy. --ftp-type= FTP. TYPE : binary ascii. : binary : SFTP-. --ftp-reuse-connection [true|false] FTP . : true --ssh-host-key-md== SSH- . TYPE - . - sha-1 md5. DIGEST - . : sha-1=b030503d4de4539dc7885e6f0f5e256704edf4c3. SFTP. ( ), . BitTorrent/Metalink --select-file=... . , --show-files. , ,, : 3,6. -, : 1-5. , - : 1-5,8,9. -M, ( --metalink-*). : , , . , . , aria2 . -S, --show-files [true|false] ".torrent", ".meta4" ".metalink" . .torrent ( , .). BitTorrent --bt-detach-seed-only [true|false] ( -j). , -j3 , 3 (), ( 2), . , RPC- . : false --bt-enable-hook-after-hash-check [true|false] () (. -V) BitTorrent-. , , --on-bt-download-complete. false, . : true --bt-enable-lpd [true|false] . torrent- , aria2 , true. : false --bt-exclude-tracker=[,...] URI BitTorrent-, . *, URI, , URI . * , , . --bt-tracker. --bt-external-ip= IP- BitTorrent- DHT. BitTorrent-. DHT, , , . , DHT . , external (), IP-. --bt-force-encryption [true|false] arc4 BitTorrent-. --bt-require-crypto --bt-min-crypto-level=arc4. . true, BitTorrent- (handshake), (handshake) . : false --bt-hash-check-seed [true|false] true, --check-integrity, , . , false. BitTorrent-. : true --bt-load-saved-metadata [true|false] , DHT magnet-, , --bt-save-metadata. , DHT. : false --bt-lpd-interface= . , . IP-. : , IP-. --bt-max-open-files= BitTorrent/Metalink-. : 100 --bt-max-peers= . 0 . --bt-request-peer-speed-limit. : 55 --bt-metadata-only [true|false] . (), . , BitTorrent Magnet-. --bt-save-metadata. : false --bt-min-crypto-level=plain|arc4 . , aria2 , . : plain --bt-prioritize-piece=head[=],tail[=] . . 2 : head tail. , . , SIZE. , head=, , SIZE , . tail= SIZE . SIZE K M , (1K = 1024, 1M = 1024K). SIZE , : SIZE=1M. --bt-remove-unselected-file [true|false] , BitTorrent. , --select-file. , , . , , . : false --bt-require-crypto [true|false] true, aria2 BitTorrent- (handshake) (\19BitTorrent ). , aria2 handshake-. : false --bt-request-peer-speed-limit= , SPEED, aria2 , . , , . K M (1K = 1024, 1M = 1024K). : 50K --bt-save-metadata [true|false] ".torrent". BitTorrent Magnet-. ".torrent". , , . , . --bt-metadata-only. : false --bt-seed-unverified [true|false] . : false --bt-stop-timeout= BitTorrent , 0 SEC . 0, . : 0 --bt-tracker=[,...] URI BitTorrent-. URI --bt-exclude-tracker, URI, --bt-exclude-tracker, . --bt-tracker-connect-timeout= . , , --bt-tracker-timeout. : 60 --bt-tracker-interval= . aria2 . 0, aria2 , . : 0 --bt-tracker-timeout= . : 60 --dht-entry-point=: , IPv4 DHT . --dht-entry-point6=: , IPv6 DHT . --dht-file-path= IPv4 DHT PATH. : $HOME/.aria2/dht.dat , $XDG_CACHE_HOME/aria2/dht.dat. --dht-file-path6= IPv6 DHT PATH. : $HOME/.aria2/dht6.dat , $XDG_CACHE_HOME/aria2/dht6.dat. --dht-listen-addr6= IPv6 DHT. IPv6 unicast- . --dht-listen-port=... UDP- DHT (IPv4, IPv6) UDP-. ,, : 6881,6885. - : 6881-6999. , - . : 6881-6999 : , UDP-. --dht-message-timeout= . : 10 --enable-dht [true|false] IPv4 DHT. UDP-. torrent- , aria2 DHT , true. : true --enable-dht6 [true|false] IPv6 DHT . torrent- , aria2 DHT , true. --dht-listen-port . --dht-listen-addr6. --enable-peer-exchange [true|false] BitTorrent- . torrent- , , true. : true --follow-torrent=true|false|mem true mem, , - .torrent mime- - application/x-bittorrent, aria2 torrent- , . mem, torrent- , . false, .torrent , . : true -O, --index-out== PATH INDEX. , --show-files. PATH , --dir. . , BitTorrent-. --listen-port=... TCP- BitTorrent-. , ,, : 6881,6885. -, : 6881-6999. , - : 6881-6889,6999. : 6881-6999 : , TCP-. --max-overall-upload-limit= /. 0 . K M (1K = 1024, 1M = 1024K). , --max-upload-limit. : 0 -u, --max-upload-limit= /. 0 . K M (1K = 1024, 1M = 1024K). , --max-overall-upload-limit. : 0 --peer-id-prefix= ID . ID BitTorrent 20 . 20 , 20 , 20, 20 . : A2-$MAJOR-$MINOR-$PATCH-, $MAJOR, $MINOR $PATCH , . , aria2 1.18.8 ID- A2-1-18-8-. --peer-agent= , , bitorrent- (extended handshake). : aria2/$MAJOR.$MINOR.$PATCH, $MAJOR, $MINOR $PATCH , . , aria2 1.18.8 ID- aria2/1.18.8. --seed-ratio= . , RATIO. 1.0. 0.0, . --seed-time , , . : 1.0 --seed-time= [] () . --seed-ratio. : --seed-time=0 . -T, --torrent-file= ".torrent". , .. ".torrent" --torrent-file. Metalink --follow-metalink=true|false|mem true mem .meta4 .metalink, mime- application/metalink4+xml application/metalink+xml, aria2 metalink- . mem, metalink- , . false, .metalink , metalink- . : true --metalink-base-uri= URI URI metalink:url metalink:metaurl metalink-, . URI , URI /. -M, --metalink-file= ".meta4" ".metalink". stdin, -. , .. .metalink --metalink-file. --metalink-language= . --metalink-location=[,...] . , , , , jp,us. --metalink-os= . --metalink-version= . --metalink-preferred-protocol= . : http, https, ftp none. none . : none --metalink-enable-unique-protocol [true|false] true, metalink- , aria2 . --metalink-preferred-protocol, . : true RPC --enable-rpc [true|false] JSON-RPC/XML-RPC-. , --rpc-secret. --rpc-listen-port. : false --pause [true|false] . , --enable-rpc=true. : false --pause-metadata [true|false] , . 3 aria2: (1) .torrent-. (2) , magnet-. (3) metalink-. , . . --enable-rpc=true. : false --rpc-allow-origin-all [true|false] Access-Control-Allow-Origin * RPC-. : false --rpc-certificate= FILE RPC-. : PKCS12 (.p12, .pfx) PEM-. PKCS12- , , , . PKCS12- ! PEM, --rpc-private-key, --rpc-secure . : WinTLS PEM- . PKCS12-. : AppleTLS Keyhain Access, SSL-Server , , , SHA-1 Information. aria2c --rpc-secure --rpc-certificate=. PKCS12- . PEM-, , . --rpc-listen-all [true|false] JSON-RPC/XML-RPC- . false, (loopback). : false --rpc-listen-port= , JSON-RPC/XML-RPC-. : 1024 -65535. : 6800 --rpc-max-request-size= JSON-RPC/XML-RPC-. aria2 , SIZE , . : 2M --rpc-passwd= JSON-RPC/XML-RPC . : --rpc-passwd . --rpc-secret . --rpc-private-key= FILE RPC-. PEM-. --rpc-secure . --rpc-certificate. --rpc-save-upload-metadata [true|false] torrent metalink , --dir. SHA-1- . torrent '.torrent'. metalink - '.meta4'. false, , aria2.addTorrent() aria2.addMetalink(), --save-session. : true --rpc-secret= RPC-. RPC- , , . --rpc-secure [true|false] RPC- SSL/TLS. RPC- https- . WebSocket-, wss-. --rpc-certificate --rpc-private-key . --rpc-user= JSON-RPC/XML-RPC . : --rpc-user . --rpc-secret . --allow-overwrite [true|false] , . --auto-file-renaming. : false --allow-piece-length-change [true|false] false, aria2 , , . true, , . : false --always-resume [true|false] . true, aria2 , . false, URI , aria2 URI N- ( N --max-resume-failure-tries, aria2 . --max-resume-failure-tries. : true --async-dns [true|false] DNS. : true --async-dns-server=[,...] DNS-, DNS-. DNS- DNS- /etc/resolv.conf. , DNS-, /etc/resolv.conf. IPv4 IPv6 . , /etc/resolv.conf . --auto-file-renaming [true|false] , . HTTP(S)/FTP-. , ( ), 1 9999. : true --auto-save-interval= (*.aria2) SEC . 0, . aria2 , , . : 0 600. : 60 --conditional-get [true|false] , . HTTP(S)-. , Metalink. Content-Disposition. , . If-Modified-Since, . , (. --out) URI, --out . --allow-overwrite. : false --conf-path= PATH. : $HOME/.aria2/aria2.conf , $XDG_CACHE_HOME/aria2/aria2.conf. --console-log-level= . LEVEL : debug, info, notice, warn error. : notice --content-disposition-default-utf8 [true|false] Content-Disposition UTF-8 ISO-8859-1, , filename, filename*. : false -D, --daemon [true|false] ( ). /, , , /dev/null. : false --deferred-input [true|false] true, aria2 URI , --input-file, , . , URI . false, aria2 URI . : false : --deferred-input , --save-session. --disable-ipv6 [true|false] IPv6. , DNS AAAA-. : false --disk-cache= . SIZE 0, . , SIZE . - aria2 . - /, .. , . - , . SIZE K M (1K = 1024, 1M = 1024K). : 16M --download-result= . OPT default, GID, , /URI. , /URI , . OPT full, GID, , , /URI. /URI . OPT hide, . : default --dscp= DSCP IP- BitTorrent- QoS. DSCP- ToS IP-, . /usr/include/netinet/ip.h, 4 ( , , CS1 CS4). RFC, , , . --rlimit-nofile= (soft) . , : a. (posix). b. (hard) . c. , . nofile ulimit, , . , API rlimit. --enable-color [true|false] . : true --enable-mmap [true|false] . , . --file-allocation. : false --event-poll= . : epoll, kqueue, port, poll select. epoll, kqueue, port poll , . epoll Linux. kqueue *BSD-, Mac OS X. port Open Solaris. , . --file-allocation= . none . prealloc - . , . , ext4 ( ), btrfs, xfs NTFS ( MinGW-) falloc. ( ) . falloc , ext3 FAT32, , prealloc, aria2, . falloc , posix_fallocate(3). trunc ftruncate(2) , . : none, prealloc, trunc, falloc : prealloc : trunc, , , , . , . : , , . --force-save [true|false] --save-session, . . , BitTorrent-, . : false --save-not-found [true|false] --save-session, . . : true --gid= GID . aria2 ID, GID. GID 16 , [0-9a-fA-F], . GID 0 . GID , . , --save-session. , GID aria2. --hash-check-only [true|false] true, , --check-integrity, , . : false --human-readable [true|false] (, 1.2, 3.4) . : true --interface= . , IP- . : (, eth0), IP- (, 192.168.0.12), (, myhost). : , IP- . --disable-ipv6. getifaddrs(3), . --keep-unfinished-download-result [true|false] , --max-download-result. , (. --save-session). , , . , . : true --max-download-result= , . - // . FIFO , NUM . , , . . 0 . , . . --keep-unfinished-download-result. : 1000 --max-mmap-limit= mmap (. --enable-mmap). , . , 5 , - . , , mmap . : 9223372036854775807 --max-resume-failure-tries= --always-resume=false, aria2 , N - URI, . N =``0``, aria2 , URI . --always-resume. : 0 --min-tls-version= SSL/TLS. : TLSv1.1, TLSv1.2, TLSv1.3 : TLSv1.2 --multiple-interface= . . (, eth0), IP- (, 192.168.0.12) (, myhost). --interface, . : , IP-, . --log-level= . LEVEL : debug, info, notice, warn error. : debug --on-bt-download-complete= BitTorrent, --on-download-complete , . , , , . COMMAND. : /// --on-download-complete= , . COMMAND. --on-download-stop. : /// --on-download-error= , , - . COMMAND. --on-download-stop. : /// --on-download-pause= , , . COMMAND. : /// --on-download-start= , , . COMMAND. : /// --on-download-stop= , , . , , --on-download-complete --on-download-error. , , . COMMAND. : /// --optimize-concurrent-downloads [true|false|:] . aria2 , , , N = A + B Log10 ( /c). , . (A=5, B=25) 5 1/ 50 100 /. , --max-concurrent-downloads. : false --piece-length= HTTP/FTP-. , aria2 . . BitTorrent-. , Metalink- . : 1M : --piece-length - HTTP-. HTTP --enable-http-pipelining. --show-console-readout [true|false] . : true --stderr [true|false] stderr ( ), stdout ( ). : false --summary-interval= . 0 . : 60 -Z, --force-sequential [true|false] URI URI , . : false --max-overall-download-limit= /. 0 . K M (1K = 1024, 1M = 1024K). , --max-download-limit. : 0 --max-download-limit= /. 0 . K M (1K = 1024, 1M = 1024K). , --max-overall-download-limit. : 0 --no-conf [true|false] aria2.conf. --no-file-allocation-limit= , SIZE. K M (1K = 1024, 1M = 1024K). : 5M -P, --parameterized-uri [true|false] URI. : http://{sv1,sv2,sv3}/foo.iso. : http://host/image[000-100:2].img. . URI , , -Z. : false -q, --quiet [true|false] aria2 ( ). : false --realtime-chunk-checksum [true|false] , . : true --remove-control-file [true|false] . --allow-overwrite=true . -, . --save-session= / FILE . aria2c --input-file . , .gz. , , RPC- aria2.addTorrent(), aria2.addMetalink() , . , aria2.remove() aria2.forceRemove() . GID gid, , . : , GID . (, BitTorrent Metalink). . magnet-, torrent- GID BitTorrent-. URI torrent-, torrent- GID torrent- . URI metalink-, , metalink- GID metalink- . torrent- GID torrent-. metalink- GID . --save-session-interval= / , --save-session, SEC . 0, , aria2 . : 0 --socket-recv-buffer-size= . 0 . SO_RCVBUF, setsockopt(). : 0 --stop= SEC . 0, . : 0 --stop-with-process= , PID . , aria2 . aria2 () - , aria2 . --truncate-console-readout [true|false] , . : true -v, --version , , . , ([]), () . true. (, -V) , (, -Vfalse). , URI, , . (K M) K M 1024 1048576 . aria2 . , k m K M . URI, MAGNET-, TORRENT-, METALINK- URI . --force-sequential, URI . BitTorrent Magnet URI. , . Info Hash ( ), 40 , 32 Base32-. tr. .. BitTorrent Magnet URI &, URI (') (") . DHT, tr . http://www.bittorrent.org/beps/bep_0009.html BitTorrent Magnet URI. torrent- Metalink-, . , . : Metalink4 Metalink 3.0. , torrent- --torrent-file URI. , , torrent- HTTP(S)/FTP/SFTP- , HTTP(S)/FTP/SFTP torrent-. , URI , , /, name () torrent- . , name () path () torrent- URI . : , URI (') (") , & , . , , (aria2c URI), , aria2. - wget- , --continue . aria2 , , . : --on-bt-download-complete, --on-download-pause, --on-download-complete, --on-download-start, --on-download-error, --on-download-stop. aria2 3 , . : GID, . HTTP-, FTP- SFTP-, - 1. BitTorrent . , . , path , true (), RPC- aria2.getFiles(). , JSON-RPC/XML-RPC. , HTTP - Content-Disposition. , : $ cat hook.sh #!/bin/sh echo "Called with [$1] [$2] [$3]" $ aria2c --on-download-complete hook.sh http://example.org/file.iso Called with [1] [1] [/path/to/file.iso] aria2 , . aria2 , . 0 . 1 . 2 . 3 . 4 aria2 " ". --max-file-not-found. 5 , . --lowest-speed-limit. 6 . 7 . , , aria2 Ctrl-C TERM INT. 8 , . 9 . 10 .aria2-. --allow-piece-length-change. 11 aria2 . 12 aria2 . 13 . --allow-overwrite. 14 . --auto-file-renaming. 15 aria2 . 16 aria2 . 17 / . 18 aria2 . 19 (DNS). 20 aria2 Metalink-. 21 FTP- . 22 HTTP- . 23 . 24 HTTP- . 25 aria2 ( ".torrent"). 26 ".torrent" , aria2. 27 Magnet- . 28 / . 29 - . 30 aria2 JSON-RPC-. 31 . . 32 . : , , . aria2 . http_proxy [http://][:@][:] - HTTP. http-proxy . --http-proxy . https_proxy [http://][:@][:] - HTTPS. https-proxy . --https-proxy . ftp_proxy [http://][:@][:] - FTP. ftp-proxy . --ftp-proxy . all_proxy [http://][:@][:] - , . all-proxy . --all-proxy . : , aria2 ftp:// https:// URI, , http:// , . no_proxy [,...] , , , , . no-proxy . --no-proxy . aria2.conf , aria2 $HOME/.aria2/aria2.conf , $XDG_CONFIG_HOME/aria2/aria2.conf . --conf-path. , --no-conf. - , . , - : =, - , --. , . # : # sample configuration file for aria2c listen-port=60000 dht-listen-port=60000 seed-ratio=1.0 max-upload-limit=50K ftp-pasv=true : / . (, chmod 600 aria2.conf), . , ${HOME}, . , , , . , ${HOME}, . , aria2 ${HOME}, : o ca-certificate o certificate o dht-file-path o dht-file-path6 o dir o input-file o load-cookies o log o metalink-file o netrc-path o on-bt-download-complete o on-download-complete o on-download-error o on-download-start o on-download-stop o on-download-pause o out o private-key o rpc-certificate o rpc-private-key o save-cookies o save-session o server-stat-if o server-stat-of o torrent-file , , . , 2 : , aria2c. dht.dat $HOME/.aria2/dht.dat $HOME/.aria2/dht6.dat , IPv4 DHT $XDG_CACHE_HOME/aria2/dht.dat, IPv6 DHT $XDG_CACHE_HOME/aria2/dht6.dat. Netrc Netrc HTTP(S)/FTP/SFTP. netrc, --no-netrc. .netrc (600). (machine) ., aria2 . aria2. , .netrc: machine .example.org login myid password mypasswd aria2.example.org .example.org myid mypasswd. : example.net .example.org. example.org .example.org - .. example.org, - example.org. aria2 . , , , .aria2. , file.zip , file.zip.aria2. ( . , " " .aria2. " " - "name" "info" torrent-.) . aria2 , (, HTTP-, ), . , , . torrent metalink , , -V aria2c. URI aria2. URI , URI, , . , . , --force-sequential --parameterized-uri. aria2 URI , (') (") . , # . , URI. (). o all-proxy o all-proxy-passwd o all-proxy-user o allow-overwrite o allow-piece-length-change o always-resume o async-dns o auto-file-renaming o bt-enable-hook-after-hash-check o bt-enable-lpd o bt-exclude-tracker o bt-external-ip o bt-force-encryption o bt-hash-check-seed o bt-load-saved-metadata o bt-max-peers o bt-metadata-only o bt-min-crypto-level o bt-prioritize-piece o bt-remove-unselected-file o bt-request-peer-speed-limit o bt-require-crypto o bt-save-metadata o bt-seed-unverified o bt-stop-timeout o bt-tracker o bt-tracker-connect-timeout o bt-tracker-interval o bt-tracker-timeout o check-integrity o checksum o conditional-get o connect-timeout o content-disposition-default-utf8 o continue o dir o dry-run o enable-http-keep-alive o enable-http-pipelining o enable-mmap o enable-peer-exchange o file-allocation o follow-metalink o follow-torrent o force-save o ftp-passwd o ftp-pasv o ftp-proxy o ftp-proxy-passwd o ftp-proxy-user o ftp-reuse-connection o ftp-type o ftp-user o gid o hash-check-only o header o http-accept-gzip o http-auth-challenge o http-no-cache o http-passwd o http-proxy o http-proxy-passwd o http-proxy-user o http-user o https-proxy o https-proxy-passwd o https-proxy-user o index-out o lowest-speed-limit o max-connection-per-server o max-download-limit o max-file-not-found o max-mmap-limit o max-resume-failure-tries o max-tries o max-upload-limit o metalink-base-uri o metalink-enable-unique-protocol o metalink-language o metalink-location o metalink-os o metalink-preferred-protocol o metalink-version o min-split-size o no-file-allocation-limit o no-netrc o no-proxy o out o parameterized-uri o pause o pause-metadata o piece-length o proxy-method o realtime-chunk-checksum o referer o remote-time o remove-control-file o retry-wait o reuse-uri o rpc-save-upload-metadata o seed-ratio o seed-time o select-file o split o ssh-host-key-md o stream-piece-selector o timeout o uri-selector o use-head o user-agent , , URI, . , --. , uri.txt: http://server/file.iso http://mirror/file.iso dir=/iso_images out=file.img http://foo/bar aria2 -i uri.txt -d /tmp, http://server/file.iso http://mirror/file.iso, file.iso /iso_images/file.img. bar http://foo/bar /tmp/bar. , out . --out. . , =, . : host . . protocol , ftp, http. . dl_speed , , /. . sc_avg_speed , , /. , AdaptiveURISelector. . mc_avg_speed , , /. , AdaptiveURISelector. . counter . AdaptiveURISelector. . last_updated , GMT, , , 00:00:00 1 , 1970, UTC. . status ERROR, - -. - OK. . . , ; . , : host=localhost, protocol=http, dl_speed=32000, last_updated=1222491640, status=OK host=localhost, protocol=ftp, dl_speed=0, last_updated=1222491632, status=ERROR RPC- aria2 JSON-RPC HTTP XML-RPC HTTP . aria2 JSON-RPC WebSocket. JSON-RPC WebSocket JSON-RPC HTTP, , . JSON-RPC WebSocket . JSON-RPC- ( HTTP WebSocket) - /jsonrpc. XML-RPC- - /rpc. WebSocket URI JSON-RPC WebSocket ws://HOST:PORT/jsonrpc. SSL/TLS-, wss://HOST:PORT/jsonrpc. JSON-RPC JSON-RPC 2.0 HTTP POST GET (JSONP). WebSocket- aria2. JSON-RPC- HTTP, RPC- WebSocket. . UTF-8. JSON-RPC, JSON-. GID GID ( gid) - , . GID. GID aria2 64- . RPC-, 16 (, 2089b05ecca3d829). , aria2 GID , GID , --gid. GID, GID . RPC- 1.18.4, HTTP-, aria2 method-level RPC-. , HTTP- method-level RPC- . method-level RPC-, RPC-, --rpc-secret. RPC-, token:. --rpc-secret , RPC- token:, , . , RPC- - $$secret$$, RPC- aria2.addUri : aria2.addUri("token:$$secret$$", ["http://example.org/file"]) RPC- system.multicall . XML-RPC , . , . : aria2 , , / RPC-. system.multicall , . system.listMethods system.listNotifications . /, , . Python 2.7. secret RPC- . aria2.addUri([secret], uris[, options[, position]]) . uris - HTTP(S)/FTP/SFTP/BitTorrent Magnet URI (), . URI, , aria2. BitTorrent Magnet URI, uris , BitTorrent Magnet-. options - , . . position , , 0. position . position , . GID . JSON-RPC http://example.org/file aria2: >>> import urllib2, json >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.addUri', ... 'params':[['http://example.org/file']]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> c.read() '{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}' XML-RPC http://example.org/file aria2: >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.addUri(['http://example.org/file']) '2089b05ecca3d829' : >>> s.aria2.addUri(['http://example.org/file', 'http://mirror/file'], dict(dir="/tmp")) 'd2703803b52216d1' : >>> s.aria2.addUri(['http://example.org/file'], {}, 0) 'ca3d829cee549a4d' aria2.addTorrent([secret], torrent[, uris[, options[, position]]]) BitTorrent- .torrent-. BitTorrent Magnet URI, aria2.addUri(). torrent base64- , .torrent-. uris - c URI (). uris Web-. , URI , ; URI /, torrent-. , c URI , . options - , . . position , , 0. position . position , . GID . --rpc-save-upload-metadata true, SHA-1- ".torrent", --dir. , 0a3893293e27ac0490424c06de4d09242215f0a6.torrent. , ! --rpc-save-upload-metadata false, , , --save-session. file.torrent. JSON-RPC >>> import urllib2, json, base64 >>> torrent = base64.b64encode(open('file.torrent').read()) >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'asdf', ... 'method':'aria2.addTorrent', 'params':[torrent]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> c.read() '{"id":"asdf","jsonrpc":"2.0","result":"2089b05ecca3d829"}' XML-RPC >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent', mode='rb').read())) '2089b05ecca3d829' aria2.addMetalink([secret], metalink[, options[, position]]) Metalink- .metalink-. metalink base64- , .metalink-. options - , . . position , , 0. position . position , . GID . --rpc-save-upload-metadata true, SHA-1- ".metalink", --dir. , 0a3893293e27ac0490424c06de4d09242215f0a6.metalink. , ! --rpc-save-upload-metadata false, , , --save-session. file.meta4. JSON-RPC >>> import urllib2, json, base64 >>> metalink = base64.b64encode(open('file.meta4').read()) >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.addMetalink', ... 'params':[metalink]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> c.read() '{"id":"qwer","jsonrpc":"2.0","result":["2089b05ecca3d829"]}' XML-RPC >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.addMetalink(xmlrpclib.Binary(open('file.meta4', mode='rb').read())) ['2089b05ecca3d829'] aria2.remove([secret], gid) , gid (). , , . removed (). GID . c GID#2089b05ecca3d829. JSON-RPC >>> import urllib2, json >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.remove', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> c.read() '{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}' XML-RPC >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.remove('2089b05ecca3d829') '2089b05ecca3d829' aria2.forceRemove([secret], gid) , gid. aria2.remove(), , - , , BitTorrent- . aria2.pause([secret], gid) , gid (). paused (). , . paused, . waiting, aria2.unpause(). GID . aria2.pauseAll([secret]) aria2.pause(), / . OK. aria2.forcePause([secret], gid) , gid. aria2.pause(), , - , , BitTorrent- . aria2.forcePauseAll([secret]) aria2.forcePause(), / . OK. aria2.unpause([secret], gid) , 'gid' (), paused waiting, . GID , . aria2.unpauseAll([secret]) aria2.unpause(), . OK. aria2.tellStatus([secret], gid[, keys]) , gid (). keys - . keys , keys. keys , . , , . , aria2.tellStatus("2089b05ecca3d829", ["gid", "status"]) gid status. - . . gid GID . status active - / . waiting - ; . paused - . error - , .. . complete - . removed - . totalLength . completedLength . uploadLength . bitfield . 0. , , / . 0. , . downloadSpeed /. uploadSpeed /. infoHash (InfoHash). BitTorrent. numSeeders , aria2. BitTorrent. seeder true - . false. BitTorrent. pieceLength . numPieces . connections /, aria2. errorCode , . . . / . errorMessage , () , errorCode. followedBy GID, . , aria2 Metalink-, , Metalink- (. --follow-metalink). . , . following followedBy. , followedBy, GID following. belongsTo GID . . , Metalink BitTorrent , ".torrent" . , . dir . files . - , , aria2.getFiles(). bittorrent , , .torrent-. BitTorrent. . announceList URI . `announce, announce-list`, announce` announce-list`. comment . comment.utf-8, . creationDate . , , . mode . : single () multi (). info , Info. . name info. name.utf-8, . verifiedLength . , . verifyIntegrityPending true - . , . JSON-RPC GID#2089b05ecca3d829: >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.tellStatus', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': {u'bitfield': u'0000000000', u'completedLength': u'901120', u'connections': u'1', u'dir': u'/downloads', u'downloadSpeed': u'15158', u'files': [{u'index': u'1', u'length': u'34896138', u'completedLength': u'34896138', u'path': u'/downloads/file', u'selected': u'true', u'uris': [{u'status': u'used', u'uri': u'http://example.org/file'}]}], u'gid': u'2089b05ecca3d829', u'numPieces': u'34', u'pieceLength': u'1048576', u'status': u'active', u'totalLength': u'34896138', u'uploadLength': u'0', u'uploadSpeed': u'0'}} : >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.tellStatus', ... 'params':['2089b05ecca3d829', ... ['gid', ... 'totalLength', ... 'completedLength']]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': {u'completedLength': u'5701632', u'gid': u'2089b05ecca3d829', u'totalLength': u'34896138'}} XML-RPC GID#2089b05ecca3d829: >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.tellStatus('2089b05ecca3d829') >>> pprint(r) {'bitfield': 'ffff80', 'completedLength': '34896138', 'connections': '0', 'dir': '/downloads', 'downloadSpeed': '0', 'errorCode': '0', 'files': [{'index': '1', 'length': '34896138', 'completedLength': '34896138', 'path': '/downloads/file', 'selected': 'true', 'uris': [{'status': 'used', 'uri': 'http://example.org/file'}]}], 'gid': '2089b05ecca3d829', 'numPieces': '17', 'pieceLength': '2097152', 'status': 'complete', 'totalLength': '34896138', 'uploadLength': '0', 'uploadSpeed': '0'} : >>> r = s.aria2.tellStatus('2089b05ecca3d829', ['gid', 'totalLength', 'completedLength']) >>> pprint(r) {'completedLength': '34896138', 'gid': '2089b05ecca3d829', 'totalLength': '34896138'} aria2.getUris([secret], gid) URI, , gid (). - . . uri URI status 'used', URI . 'waiting', URI . JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getUris', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [{u'status': u'used', u'uri': u'http://example.org/file'}]} XML-RPC >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getUris('2089b05ecca3d829') >>> pprint(r) [{'status': 'used', 'uri': 'http://example.org/file'}] aria2.getFiles([secret], gid) , gid (). - , . . index , 1, , . path . length . completedLength . , , completedLength aria2.tellStatus(). , completedLength aria2.getFiles() . , completedLength aria2.tellStatus() . selected true - --select-file. --select-file , true. false. uris URI . , aria2.getUris(). JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getFiles', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [{u'index': u'1', u'length': u'34896138', u'completedLength': u'34896138', u'path': u'/downloads/file', u'selected': u'true', u'uris': [{u'status': u'used', u'uri': u'http://example.org/file'}]}]} XML-RPC >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getFiles('2089b05ecca3d829') >>> pprint(r) [{'index': '1', 'length': '34896138', 'completedLength': '34896138', 'path': '/downloads/file', 'selected': 'true', 'uris': [{'status': 'used', 'uri': 'http://example.org/file'}]}] aria2.getPeers([secret], gid) , gid (). BitTorrent. - , . . peerId ID . ip IP- . port . bitfield . 0. , , . 0. amChoking true - aria2 . false. peerChoking true - aria2. false. downloadSpeed (/), . uploadSpeed (/), . seeder true - . false. JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getPeers', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [{u'amChoking': u'true', u'bitfield': u'ffffffffffffffffffffffffffffffffffffffff', u'downloadSpeed': u'10602', u'ip': u'10.0.0.9', u'peerChoking': u'false', u'peerId': u'aria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6', u'port': u'6881', u'seeder': u'true', u'uploadSpeed': u'0'}, {u'amChoking': u'false', u'bitfield': u'ffffeff0fffffffbfffffff9fffffcfff7f4ffff', u'downloadSpeed': u'8654', u'ip': u'10.0.0.30', u'peerChoking': u'false', u'peerId': u'bittorrent client758', u'port': u'37842', u'seeder': u'false', u'uploadSpeed': u'6890'}]} XML-RPC >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getPeers('2089b05ecca3d829') >>> pprint(r) [{'amChoking': 'true', 'bitfield': 'ffffffffffffffffffffffffffffffffffffffff', 'downloadSpeed': '10602', 'ip': '10.0.0.9', 'peerChoking': 'false', 'peerId': 'aria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6', 'port': '6881', 'seeder': 'true', 'uploadSpeed': '0'}, {'amChoking': 'false', 'bitfield': 'ffffeff0fffffffbfffffff9fffffcfff7f4ffff', 'downloadSpeed': '8654', 'ip': '10.0.0.30', 'peerChoking': 'false', 'peerId': 'bittorrent client758', 'port': '37842', 'seeder': 'false, 'uploadSpeed': '6890'}] aria2.getServers([secret], gid) HTTP(S)/FTP/SFTP- , gid (). - , . . index , 1, , metalink. servers , . uri URI. currentUri URI . , currentUri uri . downloadSpeed (/) JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getServers', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [{u'index': u'1', u'servers': [{u'currentUri': u'http://example.org/file', u'downloadSpeed': u'10467', u'uri': u'http://example.org/file'}]}]} XML-RPC >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getServers('2089b05ecca3d829') >>> pprint(r) [{'index': '1', 'servers': [{'currentUri': 'http://example.org/dl/file', 'downloadSpeed': '20285', 'uri': 'http://example.org/file'}]}] aria2.tellActive([secret][, keys]) . - , aria2.tellStatus(). keys, aria2.tellStatus(). aria2.tellWaiting([secret], offset, num[, keys]) , . offset , . num . keys, aria2.tellStatus(). , [offset, offset*+*num). offset . offset == -1 , , offset == -2 , . . , , "A","B" "C", , . aria2.tellWaiting(0, 1) ["A"]. aria2.tellWaiting(1, 2) ["B", "C"]. aria2.tellWaiting(-1, 2) ["C", "B"]. - , aria2.tellStatus(). aria2.tellStopped([secret], offset, num[, keys]) . offset , , , . num . keys, aria2.tellStatus(). offset num , aria2.tellWaiting(). - , aria2.tellStatus(). aria2.changePosition([secret], gid, pos, how) , gid. pos . how . how - POS_SET, , . how - POS_CUR, , . how - POS_END, , . 0 , . , . , GID#2089b05ecca3d829 3, aria2.changePosition('2089b05ecca3d829', -1, 'POS_CUR') 2. aria2.changePosition('2089b05ecca3d829', 0, 'POS_SET') 0 ( ). GID#2089b05ecca3d829 . JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.changePosition', ... 'params':['2089b05ecca3d829', 0, 'POS_SET']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': 0} XML-RPC >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.changePosition('2089b05ecca3d829', 0, 'POS_SET') 0 aria2.changeUri([secret], gid, fileIndex, delUris, addUris[, position]) URI delUris URI addUris , gid. delUris addUris . URI . fileIndex , / URI. fileIndex 1. position , URI URI. position 0. position , URI . , . position URI, , , . URI, URI , , URI delUris. , URI http://example.org/aria2 , ( ) 3 http://example.org/aria2 delUris. , . - URI. - URI. URI http://example.org/file 1, GID#2089b05ecca3d829. JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.changeUri', ... 'params':['2089b05ecca3d829', 1, [], ['http://example.org/file']]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [0, 1]} XML-RPC >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.changeUri('2089b05ecca3d829', 1, [], ['http://example.org/file']) [0, 1] aria2.getOption([secret], gid) , gid. - , . . , , , RPC-. GID#2089b05ecca3d829. JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getOption', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': {u'allow-overwrite': u'false', u'allow-piece-length-change': u'false', u'always-resume': u'true', u'async-dns': u'true', ... XML-RPC >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getOption('2089b05ecca3d829') >>> pprint(r) {'allow-overwrite': 'false', 'allow-piece-length-change': 'false', 'always-resume': 'true', 'async-dns': 'true', .... aria2.changeOption([secret], gid, options) , gid (). options . , : o dry-run o metalink-base-uri o parameterized-uri o pause o piece-length o rpc-save-upload-metadata , ( aria2, ): o bt-max-peers o bt-request-peer-speed-limit o bt-remove-unselected-file o force-save o max-download-limit o max-upload-limit OK, . max-download-limit 20K GID#2089b05ecca3d829. JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.changeOption', ... 'params':['2089b05ecca3d829', ... {'max-download-limit':'10K'}]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'OK'} XML-RPC >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.changeOption('2089b05ecca3d829', {'max-download-limit':'20K'}) 'OK' aria2.getGlobalOption([secret]) . . - . . , , , RPC-. , aria2.getOption(). aria2.changeGlobalOption([secret], options) . options . : o bt-max-open-files o download-result o keep-unfinished-download-result o log o log-level o max-concurrent-downloads o max-download-result o max-overall-download-limit o max-overall-upload-limit o optimize-concurrent-downloads o save-cookies o save-session o server-stat-of , , : checksum, index-out, out, pause, select-file. C log, . , ("") . , . OK, . aria2.getGlobalStat([secret]) . . . downloadSpeed (/). uploadSpeed (/). numActive . numWaiting . numStopped . --max-download-result. numStoppedTotal --max-download-result. JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getGlobalStat'}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': {u'downloadSpeed': u'21846', u'numActive': u'2', u'numStopped': u'0', u'numWaiting': u'0', u'uploadSpeed': u'0'}} XML-RPC >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getGlobalStat() >>> pprint(r) {'downloadSpeed': '23136', 'numActive': '2', 'numStopped': '0', 'numWaiting': '0', 'uploadSpeed': '0'} aria2.purgeDownloadResult([secret]) , , // . OK. aria2.removeDownloadResult([secret], gid) // , gid. OK, . GID#2089b05ecca3d829. JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.removeDownloadResult', ... 'params':['2089b05ecca3d829']}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'OK'} XML-RPC >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.removeDownloadResult('2089b05ecca3d829') 'OK' aria2.getVersion([secret]) aria2 . . version aria2 . enabledFeatures . . JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getVersion'}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': {u'enabledFeatures': [u'Async DNS', u'BitTorrent', u'Firefox3 Cookie', u'GZip', u'HTTPS', u'Message Digest', u'Metalink', u'XML-RPC'], u'version': u'1.11.0'}} XML-RPC >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> r = s.aria2.getVersion() >>> pprint(r) {'enabledFeatures': ['Async DNS', 'BitTorrent', 'Firefox3 Cookie', 'GZip', 'HTTPS', 'Message Digest', 'Metalink', 'XML-RPC'], 'version': '1.11.0'} aria2.getSessionInfo([secret]) . . sessionId ID , , aria2. JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.getSessionInfo'}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': {u'sessionId': u'cd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9'}} XML-RPC >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.getSessionInfo() {'sessionId': 'cd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9'} aria2.shutdown([secret]) aria2. OK. aria2.forceShutdown([secret]) aria2. aria2.shutdown(), , - , , BitTorrent- . OK. aria2.saveSession([secret]) , --save-session. OK . system.multicall(methods) . methods . : methodName params. methodName - , params - . . : , , , . 2 . - http://example.org/file - file.torrent. JSON-RPC >>> import urllib2, json, base64 >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'system.multicall', ... 'params':[[{'methodName':'aria2.addUri', ... 'params':[['http://example.org']]}, ... {'methodName':'aria2.addTorrent', ... 'params':[base64.b64encode(open('file.torrent').read())]}]]}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [[u'2089b05ecca3d829'], [u'd2703803b52216d1']]} JSON-RPC , JSON-RPC 2.0: >>> jsonreq = json.dumps([{'jsonrpc':'2.0', 'id':'qwer', ... 'method':'aria2.addUri', ... 'params':[['http://example.org']]}, ... {'jsonrpc':'2.0', 'id':'asdf', ... 'method':'aria2.addTorrent', ... 'params':[base64.b64encode(open('file.torrent').read())]}]) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) [{u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'2089b05ecca3d829'}, {u'id': u'asdf', u'jsonrpc': u'2.0', u'result': u'd2703803b52216d1'}] XML-RPC >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> mc = xmlrpclib.MultiCall(s) >>> mc.aria2.addUri(['http://example.org/file']) >>> mc.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent', mode='rb').read())) >>> r = mc() >>> tuple(r) ('2089b05ecca3d829', 'd2703803b52216d1') system.listMethods() RPC- . , . , . JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'system.listMethods'}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [u'aria2.addUri', u'aria2.addTorrent', ... XML-RPC >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.system.listMethods() ['aria2.addUri', 'aria2.addTorrent', ... system.listNotifications() RPC- . , . , . JSON-RPC >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', ... 'method':'system.listNotifications'}) >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) >>> pprint(json.loads(c.read())) {u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [u'aria2.onDownloadStart', u'aria2.onDownloadPause', ... XML-RPC >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.system.listNotifications() ['aria2.onDownloadStart', 'aria2.onDownloadPause', ... JSON-RPC, aria2 JSON-, code message. XML-RPC, aria2 faultCode=1 faultString. , --input-file. . , - ( --), - . JSON-RPC {'split':'1', 'http-proxy':'http://proxy/'} XML-RPC split 1 http-proxy http://proxy/ header index-out . ( XML-RPC ), . , , . JSON-RPC {'header':['Accept-Language: ja', 'Accept-Charset: utf-8']} XML-RPC header Accept-Language: ja Accept-Charset: utf-8 : dir header. header 2 , : >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> opts = dict(dir='/tmp', ... header=['Accept-Language: ja', ... 'Accept-Charset: utf-8']) >>> s.aria2.addUri(['http://example.org/file'], opts) '1' JSON-RPC HTTP GET JSON-RPC- HTTP GET. GET JSON-RPC HTTP [2008-1-15(RC1)]. GET : /jsonrpc?method=METHOD_NAME&id=ID¶ms=BASE64_ENCODED_PARAMS method id JSON- UTF-8. , aria2.tellStatus('2089b05ecca3d829') id='foo' : /jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D params - JSON- Base64-, params JSON-RPC- . , params - ["2089b05ecca3d829"], : ["2089b05ecca3d829"] --(Base64)--> WyIyMDg5YjA1ZWNjYTNkODI5Il0= --( )--> WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D JSON-RPC- JSONP. jsoncallback: /jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D&jsoncallback=cb , method id . params. , : [{'jsonrpc':'2.0', 'id':'qwer', 'method':'aria2.getVersion'}, {'jsonrpc':'2.0', 'id':'asdf', 'method':'aria2.tellActive'}] : /jsonrpc?params=W3sianNvbnJwYyI6ICIyLjAiLCAiaWQiOiAicXdlciIsICJtZXRob2QiOiAiYXJpYTIuZ2V0VmVyc2lvbiJ9LCB7Impzb25ycGMiOiAiMi4wIiwgImlkIjogImFzZGYiLCAibWV0aG9kIjogImFyaWEyLnRlbGxBY3RpdmUifV0%3D JSON-RPC WebSocket JSON-RPC WebSocket JSON-RPC HTTP. WebSocket, 13, RFC 6455. RPC- RPC-, JSON- . RPC- . RPC- . , , , . , , id. , params, , . . . aria2.onDownloadStart(event) , . event . . gid GID . aria2.onDownloadPause(event) , . event - , event aria2.onDownloadStart(). aria2.onDownloadStop(event) , . event - , event aria2.onDownloadStart(). aria2.onDownloadComplete(event) , . BitTorrent-, , . event - , event aria2.onDownloadStart(). aria2.onDownloadError(event) , - . event - , event aria2.onDownloadStart(). aria2.onBtDownloadComplete(event) , torrent- , . event - , event aria2.onDownloadStart(). XML-RPC- Ruby- http://localhost/aria2.tar.bz2 aria2c ( localhost) --dir=/downloads, RPC-: #!/usr/bin/env ruby require 'xmlrpc/client' require 'pp' client=XMLRPC::Client.new2("http://localhost:6800/rpc") options={ "dir" => "/downloads" } result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options) pp result Python, xmlrpclib (Python3 xmlrpc.client) aria2: import xmlrpclib from pprint import pprint s = xmlrpclib.ServerProxy("http://localhost:6800/rpc") r = s.aria2.addUri(["http://localhost/aria2.tar.bz2"], {"dir":"/downloads"}) pprint(r) , aria2 , . : [#2089b0 400.0KiB/33.2MiB(1%) CN:1 DL:115.7KiB ETA:4m51s] . #NNNNNN 6 GID . GID ID ( aria2) . GID aria2, RPC-. X/Y(Z%) , . --select-file, . SEED , aria2 . CN , aria2. SD , aria2. DL (/). UL (/) . ETA . 1- , , , , . . aria2 , : FileAlloc GID, . Checksum GID, . HTTP/FTP- $ aria2c "http://host/file.zip" : , Ctrl-C. , aria2c . URI, . 2- HTTP- $ aria2c "http://host/file.zip" "http://mirror/file.zip" , $ aria2c -x2 -k1M "http://host/file.zip" : -x , -k . HTTP- FTP- $ aria2c "http://host1/file.zip" "ftp://host2/file.zip" , $ aria2c -ifiles.txt -j2 : -j . - HTTP: $ aria2c --http-proxy="http://proxy:8080" "http://host/file" $ aria2c --http-proxy="http://proxy:8080" --no-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://host/file" FTP: $ aria2c --ftp-proxy="http://proxy:8080" "ftp://host/file" : --http-proxy, --https-proxy, --ftp-proxy, --all-proxy --no-proxy. . . - $ aria2c --http-proxy="http://username:password@proxy:8080" "http://host/file" $ aria2c --http-proxy="http://proxy:8080" --http-proxy-user="username" --http-proxy-passwd="password" "http://host/file" Metalink Metalink $ aria2c --follow-metalink=mem "http://host/file.metalink" , metalink- $ aria2c -p --lowest-speed-limit=4000 file.metalink : , Ctrl-C. , aria2c . metalink- $ aria2c -j2 file1.metalink file2.metalink $ aria2c --select-file=1-4,8 file.metalink : -S. , metalink- $ aria2c --metalink-location=jp,us --metalink-version=1.1 --metalink-language=en-US file.metalink BitTorrent , BitTorrent- $ aria2c --follow-torrent=mem "http://host/file.torrent" , torrent- $ aria2c --max-upload-limit=40K file.torrent : --max-upload-limit . : , Ctrl-C. , aria2c . , BitTorrent Magnet URI $ aria2c "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C&dn=aria2" : BitTorrent Magnet URI, &, (') (") , URI . 2- $ aria2c -j2 file1.torrent file2.torrent HTTP/FTP- $ aria2c -Ttest.torrent "http://host1/file" "ftp://host2/file" ( " ") $ aria2c --select-file=1-4,8 file.torrent : -S. torrent-, $ aria2c --follow-torrent=false "http://host/file.torrent" BitTorrent-, (.:option:--show-files <-S>). , : idx|path/length ===+====================== 1|dist/base-2.6.18.iso |99.9MiB ---+---------------------- 2|dist/driver-2.6.18.iso |169.0MiB ---+---------------------- 'dist/base-2.6.18.iso' '/tmp/mydir/base.iso' 'dist/driver-2.6.18.iso' '/tmp/dir/driver.iso', : $ aria2c --dir=/tmp --index-out=1=mydir/base.iso --index-out=2=dir/driver.iso file.torrent $ aria2c --listen-port=7000-7001,8000 file.torrent : .. aria2 , , . $ aria2c --seed-time=120 --seed-ratio=1.0 file.torrent : , 120 1.0. $ aria2c --max-upload-limit=100K file.torrent IPv4 DHT $ aria2c --enable-dht --dht-listen-port=6881 file.torrent : DHT UDP. aria2 , , . IPv6 DHT $ aria2c --enable-dht6 --dht-listen-port=6881 --dht-listen-addr6=YOUR_GLOBAL_UNICAST_IPV6_ADDR : aria2 IPv4 IPv6 DHT. URI URI , file.torrent http://tracker1/announce http://tracker2/announce: $ aria2c --bt-exclude-tracker="*" --bt-tracker="http://tracker1/announce,http://tracker2/announce" file.torrent HTTP $ aria2c --load-cookies=cookies.txt "http://host/file.zip" : cookie- Firefox/Mozilla/Chromium. , $ aria2c -c -s2 "http://host/partiallydownloadedfile.zip" : , . SSL/TLS PKCS12- : $ aria2c --certificate=/path/to/mycert.p12 : --certificate PKCS12- . . , PEM- , : $ aria2c --certificate=/path/to/mycert.pem --private-key=/path/to/mykey.pem https://host/file : --private-key . . SSL/TLS-, CA- $ aria2c --ca-certificate=/path/to/ca-certificates.crt --check-certificate https://host/file : aria2 GnuTLS OpenSSL. WinTLS AppleTLS . --ca-certificate . RPC RPC- SSL/TLS PKC12- : $ aria2c --enable-rpc --rpc-certificate=/path/to/server.p12 --rpc-secure : --rpc-certificate PKCS12- . . , PEM- (GnuTLS OpenSSL), : $ aria2c --enable-rpc --rpc-certificate=/path/to/server.crt --rpc-private-key=/path/to/server.key --rpc-secure : $ aria2c --max-download-limit=100K file.metalink : $ aria2c --max-overall-download-limit=100K file.metalink $ aria2c -V file.metalink : BitTorrent Metalink . , $ aria2c --lowest-speed-limit=10K file.metalink URI : $ aria2c -P "http://{host1,host2,host3}/file.iso" : $ aria2c -Z -P "http://host/image[000-100].png" : -Z , URI , . : $ aria2c -Z -P "http://host/image[A-Z:2].png" $ aria2c --checksum=sha-1=0192ba11326fe2298c8cb4de616f4d4140213837 http://example.org/file URI, metalink, torrent $ aria2c -j3 -Z "http://host/file1" file2.torrent file3.metalink BitTorrent ARC4 (): $ aria2c --bt-min-crypto-level=arc4 --bt-require-crypto=true file.torrent - : https://aria2.github.io/ Metalink: http://www.metalinker.org/ Metalink: RFC 5854 (C) 2006, 2015 Tatsuhiro Tsujikawa ; / GNU General Public License, Free Software Foundation; License 2, ( ) . , , - , . . GNU General Public License . GNU General Public License ; , Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA , , OpenSSL , , . GNU General Public License , OpenSSL. () , (), . , . , . ITriskTI , , , , , e-mail. . , , . 1.37.0 . 15, 2023 ARIA2C(1)