.TH "ARIA2C" "1" "May 27, 2012" "1.15.1" "aria2" .SH NAME aria2c \- The ultra fast download utility . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .\" Man page generated from reStructeredText. . .SH SYNOPSIS .sp \fBaria2c\fP [] [|||] ... .SH DESCRIPTION .sp aria2 is a utility for downloading files. The supported protocols are HTTP(S), FTP, BitTorrent, and Metalink. aria2 can download a file from multiple sources/protocols and tries to utilize your maximum download bandwidth. It supports downloading a file from HTTP(S)/FTP and BitTorrent at the same time, while the data downloaded from HTTP(S)/FTP is uploaded to the BitTorrent swarm. Using Metalink\(aqs chunk checksums, aria2 automatically validates chunks of data while downloading a file like BitTorrent. .SH OPTIONS .SS Basic Options .INDENT 0.0 .TP .B \-d, \-\-dir= The directory to store the downloaded file. .UNINDENT .INDENT 0.0 .TP .B \-i, \-\-input\-file= Downloads URIs found in FILE. You can specify multiple URIs for a single entity: separate URIs on a single line using the TAB character. Reads input from stdin when \fB\-\fP is specified. Additionally, options can be specified after each line of URI. This optional line must start with one or more white spaces and have one option per single line. See \fI\%Input File\fP subsection for details. See also \fI\%--deferred-input\fP option. .UNINDENT .INDENT 0.0 .TP .B \-l, \-\-log= The file name of the log file. If \fB\-\fP is specified, log is written to stdout. If empty string("") is specified, log is not written to file. .UNINDENT .INDENT 0.0 .TP .B \-j, \-\-max\-concurrent\-downloads= Set maximum number of parallel downloads for every static (HTTP/FTP) URI, torrent and metalink. See also \fI\%--split\fP option. Default: \fB5\fP .UNINDENT .INDENT 0.0 .TP .B \-V, \-\-check\-integrity[=true|false] Check file integrity by validating piece hashes or a hash of entire file. This option has effect only in BitTorrent, Metalink downloads with checksums or HTTP(S)/FTP downloads with \fI\%--checksum\fP option. If piece hashes are provided, this option can detect damaged portions of a file and re\-download them. If a hash of entire file is provided, hash check is only done when file has been already download. This is determined by file length. If hash check fails, file is re\-downloaded from scratch. If both piece hashes and a hash of entire file are provided, only piece hashes are used. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-c, \-\-continue[=true|false] Continue downloading a partially downloaded file. Use this option to resume a download started by a web browser or another program which downloads files sequentially from the beginning. Currently this option is only applicable to HTTP(S)/FTP downloads. .UNINDENT .INDENT 0.0 .TP .B \-h, \-\-help[=|] The help messages are classified with tags. A tag starts with \fB#\fP. For example, type \fB\-\-help=#http\fP to get the usage for the options tagged with \fB#http\fP. If non\-tag word is given, print the usage for the options whose name includes that word. Available Values: \fB#basic\fP, \fB#advanced\fP, \fB#http\fP, \fB#https\fP, \fB#ftp\fP, \fB#metalink\fP, \fB#bittorrent\fP, \fB#cookie\fP, \fB#hook\fP, \fB#file\fP, \fB#rpc\fP, \fB#checksum\fP, \fB#experimental\fP, \fB#deprecated\fP, \fB#help\fP, \fB#all\fP Default: \fB#basic\fP .UNINDENT .SS HTTP/FTP Options .INDENT 0.0 .TP .B \-\-all\-proxy= Use this proxy server for all protocols. To erase previously defined proxy, use "". You can override this setting and specify a proxy server for a particular protocol using \fI\%--http-proxy\fP, \fI\%--https-proxy\fP and \fI\%--ftp-proxy\fP options. This affects all URIs. The format of PROXY is \fB[http://][USER:PASSWORD@]HOST[:PORT]\fP. See also \fI\%ENVIRONMENT\fP section. .IP Note If user and password are embedded in proxy URI and they are also specified by \fI\-\-{http,https,ftp,all}\-proxy\-{user,passwd}\fP options, those appeared later have precedence. For example, you have \fBhttp\-proxy\-user=myname\fP, \fBhttp\-proxy\-passwd=mypass\fP in aria2.conf and you specify \fB\-\-http\-proxy="http://proxy"\fP in command\-line, then you get HTTP proxy \fBhttp://proxy\fP with user \fBmyname\fP and password \fBmypass\fP. .sp Another example: if you specified in command\-line \fB\-\-http\-proxy="http://user:pass@proxy" \-\-http\-proxy\-user="myname" \-\-http\-proxy\-passwd="mypass"\fP, then you will get HTTP proxy \fBhttp://proxy\fP with user \fBmyname\fP and password \fBmypass\fP. .sp One more example: if you specified in command\-line \fB\-\-http\-proxy\-user="myname" \-\-http\-proxy\-passwd="mypass" \-\-http\-proxy="http://user:pass@proxy"\fP, then you get HTTP proxy \fBhttp://proxy\fP with user \fBuser\fP and password \fBpass\fP. .RE .UNINDENT .INDENT 0.0 .TP .B \-\-all\-proxy\-passwd= Set password for \fI\%--all-proxy\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-all\-proxy\-user= Set user for \fI\%--all-proxy\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-checksum== Set checksum. TYPE is hash type. The supported hash type is listed in \fBHash Algorithms\fP in \fBaria2c \-v\fP. DIGEST is hex digest. For example, setting sha\-1 digest looks like this: \fBsha\-1=0192ba11326fe2298c8cb4de616f4d4140213838\fP This option applies only to HTTP(S)/FTP downloads. .UNINDENT .INDENT 0.0 .TP .B \-\-connect\-timeout= Set the connect timeout in seconds to establish connection to HTTP/FTP/proxy server. After the connection is established, this option makes no effect and \fI\%--timeout\fP option is used instead. Default: \fB60\fP .UNINDENT .INDENT 0.0 .TP .B \-\-dry\-run[=true|false] If \fBtrue\fP is given, aria2 just checks whether the remote file is available and doesn\(aqt download data. This option has effect on HTTP/FTP download. BitTorrent downloads are canceled if \fBtrue\fP is specified. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-lowest\-speed\-limit= Close connection if download speed is lower than or equal to this value(bytes per sec). \fB0\fP means aria2 does not have a lowest speed limit. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). This option does not affect BitTorrent downloads. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-x, \-\-max\-connection\-per\-server= The maximum number of connections to one server for each download. Default: \fB1\fP .UNINDENT .INDENT 0.0 .TP .B \-\-max\-file\-not\-found= If aria2 receives "file not found" status from the remote HTTP/FTP servers NUM times without getting a single byte, then force the download to fail. Specify \fB0\fP to disable this option. This options is effective only when using HTTP/FTP servers. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-m, \-\-max\-tries= Set number of tries. \fB0\fP means unlimited. See also \fI\%--retry-wait\fP. Default: \fB5\fP .UNINDENT .INDENT 0.0 .TP .B \-k, \-\-min\-split\-size= aria2 does not split less than 2*SIZE byte range. For example, let\(aqs consider downloading 20MiB file. If SIZE is 10M, aria2 can split file into 2 range [0\-10MiB) and [10MiB\-20MiB) and download it using 2 sources(if \fI\%--split\fP >= 2, of course). If SIZE is 15M, since 2*15M > 20MiB, aria2 does not split file and download it using 1 source. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). Possible Values: \fB1M\fP \-\fB1024M\fP Default: \fB20M\fP .UNINDENT .INDENT 0.0 .TP .B \-n, \-\-no\-netrc[=true|false] Disables netrc support. netrc support is enabled by default. .IP Note netrc file is only read at the startup if \fI\%--no-netrc\fP is \fBfalse\fP. So if \fI\%--no-netrc\fP is \fBtrue\fP at the startup, no netrc is available throughout the session. You cannot get netrc enabled even if you send \fI\%--no-netrc=false\fP using \fI\%aria2.changeGlobalOption()\fP. .RE .UNINDENT .INDENT 0.0 .TP .B \-\-no\-proxy= Specify comma separated hostnames, domains and network address with or without CIDR block where proxy should not be used. .IP Note For network address with CIDR block, both IPv4 and IPv6 addresses work. Current implementation does not resolve hostname in URI to compare network address specified in \fI\%--no-proxy\fP. So it is only effecive if URI has numeric IP addresses. .RE .UNINDENT .INDENT 0.0 .TP .B \-o, \-\-out= The file name of the downloaded file. When \fI\%--force-sequential\fP option is used, this option is ignored. .IP Note In Metalink or BitTorrent download you cannot specify file name. The file name specified here is only used when the URIs fed to aria2 are done by command line without \fI\%--input-file\fP, \fI\%--force-sequential\fP option. For example: .sp .nf .ft C $ aria2c \-o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip" .ft P .fi .RE .UNINDENT .INDENT 0.0 .TP .B \-\-proxy\-method= Set the method to use in proxy request. METHOD is either \fBget\fP or \fBtunnel\fP. HTTPS downloads always use \fBtunnel\fP regardless of this option. Default: \fBget\fP .UNINDENT .INDENT 0.0 .TP .B \-R, \-\-remote\-time[=true|false] Retrieve timestamp of the remote file from the remote HTTP/FTP server and if it is available, apply it to the local file. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-reuse\-uri[=true|false] Reuse already used URIs if no unused URIs are left. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-retry\-wait= Set the seconds to wait between retries. With SEC > 0, aria2 will retry download when the HTTP server returns 503 response. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-\-server\-stat\-of= Specify the filename to which performance profile of the servers is saved. You can load saved data using \fI\%--server-stat-if\fP option. See \fI\%Server Performance Profile\fP subsection below for file format. .UNINDENT .INDENT 0.0 .TP .B \-\-server\-stat\-if= Specify the filename to load performance profile of the servers. The loaded data will be used in some URI selector such as \fBfeedback\fP. See also \fI\%--uri-selector\fP option. See \fI\%Server Performance Profile\fP subsection below for file format. .UNINDENT .INDENT 0.0 .TP .B \-\-server\-stat\-timeout= Specifies timeout in seconds to invalidate performance profile of the servers since the last contact to them. Default: \fB86400\fP (24hours) .UNINDENT .INDENT 0.0 .TP .B \-s, \-\-split= Download a file using N connections. If more than N URIs are given, first N URIs are used and remaining URIs are used for backup. If less than N URIs are given, those URIs are used more than once so that N connections total are made simultaneously. The number of connections to the same host is restricted by \fI\%--max-connection-per-server\fP option. See also \fI\%--min-split-size\fP option. Default: \fB5\fP .IP Note Some Metalinks regulate the number of servers to connect. aria2 strictly respects them. This means that if Metalink defines the maxconnections attribute lower than N, then aria2 uses the value of maxconnections attribute instead of N. .RE .UNINDENT .INDENT 0.0 .TP .B \-\-stream\-piece\-selector= Specify piece selection algorithm used in HTTP/FTP download. Piece means fixed length segment which is downloaded in parallel in segmented download. If \fBdefault\fP is given, aria2 selects piece so that it reduces the number of establishing connection. This is reasonable default behaviour because establishing connection is an expensive operation. If \fBinorder\fP is given, aria2 selects piece which has minimum index. Index=0 means first of the file. This will be useful to view movie while downloading it. \fI\%--enable-http-pipelining\fP option may be useful to reduce reconnection overhead. Please note that aria2 honors \fI\%--min-split-size\fP option, so it will be necessary to specify a reasonable value to \fI\%--min-split-size\fP option. If \fBgeom\fP is given, at the beginning aria2 selects piece which has minimum index like \fBinorder\fP, but it exponentially increasingly keeps space from previously selected piece. This will reduce the number of establishing connection and at the same time it will download the beginning part of the file first. This will be useful to view movie while downloading it. Default: \fBdefault\fP .UNINDENT .INDENT 0.0 .TP .B \-t, \-\-timeout= Set timeout in seconds. Default: \fB60\fP .UNINDENT .INDENT 0.0 .TP .B \-\-uri\-selector= Specify URI selection algorithm. The possible values are \fBinorder\fP, \fBfeedback\fP and \fBadaptive\fP. If \fBinorder\fP is given, URI is tried in the order appeared in the URI list. If \fBfeedback\fP is given, aria2 uses download speed observed in the previous downloads and choose fastest server in the URI list. This also effectively skips dead mirrors. The observed download speed is a part of performance profile of servers mentioned in \fI\%--server-stat-of\fP and \fI\%--server-stat-if\fP options. If \fBadaptive\fP is given, selects one of the best mirrors for the first and reserved connections. For supplementary ones, it returns mirrors which has not been tested yet, and if each of them has already been tested, returns mirrors which has to be tested again. Otherwise, it doesn\(aqt select anymore mirrors. Like \fBfeedback\fP, it uses a performance profile of servers. Default: \fBfeedback\fP .UNINDENT .SS HTTP Specific Options .INDENT 0.0 .TP .B \-\-ca\-certificate= Use the certificate authorities in FILE to verify the peers. The certificate file must be in PEM format and can contain multiple CA certificates. Use \fI\%--check-certificate\fP option to enable verification. .UNINDENT .INDENT 0.0 .TP .B \-\-certificate= Use the client certificate in FILE. The certificate must be in PEM format. You may use \fI\%--private-key\fP option to specify the private key. .UNINDENT .INDENT 0.0 .TP .B \-\-check\-certificate[=true|false] Verify the peer using certificates specified in \fI\%--ca-certificate\fP option. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-http\-accept\-gzip[=true|false] Send \fBAccept: deflate, gzip\fP request header and inflate response if remote server responds with \fBContent\-Encoding: gzip\fP or \fBContent\-Encoding: deflate\fP. Default: \fBfalse\fP .IP Note Some server responds with \fBContent\-Encoding: gzip\fP for files which itself is gzipped file. aria2 inflates them anyway because of the response header. .RE .UNINDENT .INDENT 0.0 .TP .B \-\-http\-auth\-challenge[=true|false] Send HTTP authorization header only when it is requested by the server. If \fBfalse\fP is set, then authorization header is always sent to the server. There is an exception: if username and password are embedded in URI, authorization header is always sent to the server regardless of this option. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-http\-no\-cache[=true|false] Send Cache\-Control: no\-cache and Pragma: no\-cache header to avoid cached content. If \fBfalse\fP is given, these headers are not sent and you can add Cache\-Control header with a directive you like using \fI\%--header\fP option. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-http\-user= Set HTTP user. This affects all URIs. .UNINDENT .INDENT 0.0 .TP .B \-\-http\-passwd= Set HTTP password. This affects all URIs. .UNINDENT .INDENT 0.0 .TP .B \-\-http\-proxy= Use this proxy server for HTTP. To erase previously defined proxy, use "". See also \fI\%--all-proxy\fP option. This affects all URIs. The format of PROXY is \fB[http://][USER:PASSWORD@]HOST[:PORT]\fP .UNINDENT .INDENT 0.0 .TP .B \-\-http\-proxy\-passwd= Set password for \fI\%--http-proxy\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-http\-proxy\-user= Set user for \fI\%--http-proxy\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-https\-proxy= Use this proxy server for HTTPS. To erase previously defined proxy, use "". See also \fI\%--all-proxy\fP option. This affects all URIs. The format of PROXY is \fB[http://][USER:PASSWORD@]HOST[:PORT]\fP .UNINDENT .INDENT 0.0 .TP .B \-\-https\-proxy\-passwd= Set password for \fI\%--https-proxy\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-https\-proxy\-user= Set user for \fI\%--https-proxy\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-private\-key= Use the private key in FILE. The private key must be decrypted and in PEM format. The behavior when encrypted one is given is undefined. See also \fI\%--certificate\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-referer= Set Referer. This affects all URIs. .UNINDENT .INDENT 0.0 .TP .B \-\-enable\-http\-keep\-alive[=true|false] Enable HTTP/1.1 persistent connection. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-enable\-http\-pipelining[=true|false] Enable HTTP/1.1 pipelining. Default: \fBfalse\fP .IP Note In performance perspective, there is usually no advantage to enable this option. .RE .UNINDENT .INDENT 0.0 .TP .B \-\-header=
Append HEADER to HTTP request header. You can use this option repeatedly to specify more than one header: .sp .nf .ft C $ aria2c \-\-header="X\-A: b78" \-\-header="X\-B: 9J1" "http://host/file" .ft P .fi .UNINDENT .INDENT 0.0 .TP .B \-\-load\-cookies= Load Cookies from FILE using the Firefox3 format (SQLite3), Chromium/Google Chrome (SQLite3) and the Mozilla/Firefox(1.x/2.x)/Netscape format. .IP Note If aria2 is built without libsqlite3, then it doesn\(aqt support Firefox3 and Chromium/Google Chrome cookie format. .RE .UNINDENT .INDENT 0.0 .TP .B \-\-save\-cookies= Save Cookies to FILE in Mozilla/Firefox(1.x/2.x)/ Netscape format. If FILE already exists, it is overwritten. Session Cookies are also saved and their expiry values are treated as 0. Possible Values: \fB/path/to/file\fP .UNINDENT .INDENT 0.0 .TP .B \-\-use\-head[=true|false] Use HEAD method for the first request to the HTTP server. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-U, \-\-user\-agent= Set user agent for HTTP(S) downloads. Default: \fBaria2/$VERSION\fP, $VERSION is replaced by package version. .UNINDENT .SS FTP Specific Options .INDENT 0.0 .TP .B \-\-ftp\-user= Set FTP user. This affects all URIs. Default: \fBanonymous\fP .UNINDENT .INDENT 0.0 .TP .B \-\-ftp\-passwd= Set FTP password. This affects all URIs. If user name is embedded but password is missing in URI, aria2 tries to resolve password using .netrc. If password is found in .netrc, then use it as password. If not, use the password specified in this option. Default: \fBARIA2USER@\fP .UNINDENT .INDENT 0.0 .TP .B \-p, \-\-ftp\-pasv[=true|false] Use the passive mode in FTP. If \fBfalse\fP is given, the active mode will be used. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-ftp\-proxy= Use this proxy server for FTP. To erase previously defined proxy, use "". See also \fI\%--all-proxy\fP option. This affects all URIs. The format of PROXY is \fB[http://][USER:PASSWORD@]HOST[:PORT]\fP .UNINDENT .INDENT 0.0 .TP .B \-\-ftp\-proxy\-passwd= Set password for \fI\%--ftp-proxy\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-ftp\-proxy\-user= Set user for \fI\%--ftp-proxy\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-ftp\-type= Set FTP transfer type. TYPE is either \fBbinary\fP or \fBascii\fP. Default: \fBbinary\fP .UNINDENT .INDENT 0.0 .TP .B \-\-ftp\-reuse\-connection[=true|false] Reuse connection in FTP. Default: \fBtrue\fP .UNINDENT .SS BitTorrent/Metalink Options .INDENT 0.0 .TP .B \-\-select\-file=... Set file to download by specifying its index. You can find the file index using the \fI\%--show-files\fP option. Multiple indexes can be specified by using \fB,\fP, for example: \fB3,6\fP. You can also use \fB\-\fP to specify a range: \fB1\-5\fP. \fB,\fP and \fB\-\fP can be used together: \fB1\-5,8,9\fP. When used with the \-M option, index may vary depending on the query (see \fI\-\-metalink\-*\fP options). .IP Note In multi file torrent, the adjacent files specified by this option may also be downloaded. This is by design, not a bug. A single piece may include several files or part of files, and aria2 writes the piece to the appropriate files. .RE .UNINDENT .INDENT 0.0 .TP .B \-S, \-\-show\-files[=true|false] Print file listing of .torrent, .meta4 and .metalink file and exit. In case of .torrent file, additional information (infohash, piece length, etc) is also printed. .UNINDENT .SS BitTorrent Specific Options .INDENT 0.0 .TP .B \-\-bt\-enable\-lpd[=true|false] Enable Local Peer Discovery. If a private flag is set in a torrent, aria2 doesn\(aqt use this feature for that download even if \fBtrue\fP is given. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-exclude\-tracker=[,...] Comma separated list of BitTorrent tracker\(aqs announce URI to remove. You can use special value \fB*\fP which matches all URIs, thus removes all announce URIs. When specifying \fB*\fP in shell command\-line, don\(aqt forget to escape or quote it. See also \fI\%--bt-tracker\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-external\-ip= Specify the external IP address to report to a BitTorrent tracker. Although this function is named \fBexternal\fP, it can accept any kind of IP addresses. IPADDRESS must be a numeric IP address. .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-hash\-check\-seed[=true|false] If \fBtrue\fP is given, after hash check using \fI\%--check-integrity\fP option and file is complete, continue to seed file. If you want to check file and download it only when it is damaged or incomplete, set this option to \fBfalse\fP. This option has effect only on BitTorrent download. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-lpd\-interface= Use given interface for Local Peer Discovery. If this option is not specified, the default interface is chosen. You can specify interface name and IP address. Possible Values: interface, IP addres .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-max\-open\-files= Specify maximum number of files to open in each BitTorrent download. Default: \fB100\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-max\-peers= Specify the maximum number of peers per torrent. \fB0\fP means unlimited. See also \fI\%--bt-request-peer-speed-limit\fP option. Default: \fB55\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-metadata\-only[=true|false] Download metadata only. The file(s) described in metadata will not be downloaded. This option has effect only when BitTorrent Magnet URI is used. See also \fI\%--bt-save-metadata\fP option. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-min\-crypto\-level=plain|arc4 Set minimum level of encryption method. If several encryption methods are provided by a peer, aria2 chooses the lowest one which satisfies the given level. Default: \fBplain\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-prioritize\-piece=head[=],tail[=] Try to download first and last pieces of each file first. This is useful for previewing files. The argument can contain 2 keywords: \fBhead\fP and \fBtail\fP. To include both keywords, they must be separated by comma. These keywords can take one parameter, SIZE. For example, if \fBhead=\fP is specified, pieces in the range of first SIZE bytes of each file get higher priority. \fBtail=\fP means the range of last SIZE bytes of each file. SIZE can include \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). If SIZE is omitted, SIZE=1M is used. .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-remove\-unselected\-file[=true|false] Removes the unselected files when download is completed in BitTorrent. To select files, use \fI\%--select-file\fP option. If it is not used, all files are assumed to be selected. Please use this option with care because it will actually remove files from your disk. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-require\-crypto[=true|false] If true is given, aria2 doesn\(aqt accept and establish connection with legacy BitTorrent handshake(19BitTorrent protocol). Thus aria2 always uses Obfuscation handshake. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-request\-peer\-speed\-limit= If the whole download speed of every torrent is lower than SPEED, aria2 temporarily increases the number of peers to try for more download speed. Configuring this option with your preferred download speed can increase your download speed in some cases. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). Default: \fB50K\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-save\-metadata[=true|false] Save metadata as .torrent file. This option has effect only when BitTorrent Magnet URI is used. The filename is hex encoded info hash with suffix .torrent. The directory to be saved is the same directory where download file is saved. If the same file already exists, metadata is not saved. See also \fI\%--bt-metadata-only\fP option. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-seed\-unverified[=true|false] Seed previously downloaded files without verifying piece hashes. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-stop\-timeout= Stop BitTorrent download if download speed is 0 in consecutive SEC seconds. If \fB0\fP is given, this feature is disabled. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-tracker=[,...] Comma separated list of additional BitTorrent tracker\(aqs announce URI. These URIs are not affected by \fI\%--bt-exclude-tracker\fP option because they are added after URIs in \fI\%--bt-exclude-tracker\fP option are removed. .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-tracker\-connect\-timeout= Set the connect timeout in seconds to establish connection to tracker. After the connection is established, this option makes no effect and \fI\%--bt-tracker-timeout\fP option is used instead. Default: \fB60\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-tracker\-interval= Set the interval in seconds between tracker requests. This completely overrides interval value and aria2 just uses this value and ignores the min interval and interval value in the response of tracker. If \fB0\fP is set, aria2 determines interval based on the response of tracker and the download progress. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-tracker\-timeout= Set timeout in seconds. Default: \fB60\fP .UNINDENT .INDENT 0.0 .TP .B \-\-dht\-entry\-point=: Set host and port as an entry point to IPv4 DHT network. .UNINDENT .INDENT 0.0 .TP .B \-\-dht\-entry\-point6=: Set host and port as an entry point to IPv6 DHT network. .UNINDENT .INDENT 0.0 .TP .B \-\-dht\-file\-path= Change the IPv4 DHT routing table file to PATH. Default: \fB$HOME/.aria2/dht.dat\fP .UNINDENT .INDENT 0.0 .TP .B \-\-dht\-file\-path6= Change the IPv6 DHT routing table file to PATH. Default: \fB$HOME/.aria2/dht6.dat\fP .UNINDENT .INDENT 0.0 .TP .B \-\-dht\-listen\-addr6= Specify address to bind socket for IPv6 DHT. It should be a global unicast IPv6 address of the host. .UNINDENT .INDENT 0.0 .TP .B \-\-dht\-listen\-port=... Set UDP listening port for both IPv4 and IPv6 DHT. Multiple ports can be specified by using \fB,\fP, for example: \fB6881,6885\fP. You can also use \fB\-\fP to specify a range: \fB6881\-6999\fP. \fB,\fP and \fB\-\fP can be used together. Default: \fB6881\-6999\fP .IP Note Make sure that the specified ports are open for incoming UDP traffic. .RE .UNINDENT .INDENT 0.0 .TP .B \-\-dht\-message\-timeout= Set timeout in seconds. Default: \fB10\fP .UNINDENT .INDENT 0.0 .TP .B \-\-enable\-dht[=true|false] Enable IPv4 DHT functionality. If a private flag is set in a torrent, aria2 doesn\(aqt use DHT for that download even if \fBtrue\fP is given. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-enable\-dht6[=true|false] Enable IPv6 DHT functionality. If a private flag is set in a torrent, aria2 doesn\(aqt use DHT for that download even if \fBtrue\fP is given. Use \fI\%--dht-listen-port\fP option to specify port number to listen on. See also \fI\%--dht-listen-addr6\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-enable\-peer\-exchange[=true|false] Enable Peer Exchange extension. If a private flag is set in a torrent, this feature is disabled for that download even if \fBtrue\fP is given. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-follow\-torrent=true|false|mem If \fBtrue\fP or \fBmem\fP is specified, when a file whose suffix is \fB.torrent\fP or content type is \fBapplication/x\-bittorrent\fP is downloaded, aria2 parses it as a torrent file and downloads files mentioned in it. If \fBmem\fP is specified, a torrent file is not written to the disk, but is just kept in memory. If \fBfalse\fP is specified, the action mentioned above is not taken. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-O, \-\-index\-out== Set file path for file with index=INDEX. You can find the file index using the \fI\%--show-files\fP option. PATH is a relative path to the path specified in \fI\%--dir\fP option. You can use this option multiple times. Using this option, you can specify the output filenames of BitTorrent downloads. .UNINDENT .INDENT 0.0 .TP .B \-\-listen\-port=... Set TCP port number for BitTorrent downloads. Multiple ports can be specified by using \fB,\fP, for example: \fB6881,6885\fP. You can also use \fB\-\fP to specify a range: \fB6881\-6999\fP. \fB,\fP and \fB\-\fP can be used together: \fB6881\-6889,6999\fP. Default: \fB6881\-6999\fP .IP Note Make sure that the specified ports are open for incoming TCP traffic. .RE .UNINDENT .INDENT 0.0 .TP .B \-\-max\-overall\-upload\-limit= Set max overall upload speed in bytes/sec. \fB0\fP means unrestricted. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). To limit the upload speed per torrent, use \fI\%--max-upload-limit\fP option. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-u, \-\-max\-upload\-limit= Set max upload speed per each torrent in bytes/sec. \fB0\fP means unrestricted. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). To limit the overall upload speed, use \fI\%--max-overall-upload-limit\fP option. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-\-peer\-id\-prefix= Specify the prefix of peer ID. The peer ID in BitTorrent is 20 byte length. If more than 20 bytes are specified, only first 20 bytes are used. If less than 20 bytes are specified, random byte data are added to make its length 20 bytes. Default: \fBaria2/$VERSION\-\fP, $VERSION is replaced by package version. .UNINDENT .INDENT 0.0 .TP .B \-\-seed\-ratio= Specify share ratio. Seed completed torrents until share ratio reaches RATIO. You are strongly encouraged to specify equals or more than \fB1.0\fP here. Specify \fB0.0\fP if you intend to do seeding regardless of share ratio. If \fI\%--seed-time\fP option is specified along with this option, seeding ends when at least one of the conditions is satisfied. Default: \fB1.0\fP .UNINDENT .INDENT 0.0 .TP .B \-\-seed\-time= Specify seeding time in minutes. Also see the \fI\%--seed-ratio\fP option. .IP Note Specifying \fI\%--seed-time=0\fP disables seeding after download completed. .RE .UNINDENT .INDENT 0.0 .TP .B \-T, \-\-torrent\-file= The path to the .torrent file. You are not required to use this option because you can specify .torrent files without \fI\%--torrent-file\fP. .UNINDENT .SS Metalink Specific Options .INDENT 0.0 .TP .B \-\-follow\-metalink=true|false|mem If \fBtrue\fP or \fBmem\fP is specified, when a file whose suffix is \fB.meta4\fP or \fB.metalink\fP or content type of \fBapplication/metalink4+xml\fP or \fBapplication/metalink+xml\fP is downloaded, aria2 parses it as a metalink file and downloads files mentioned in it. If \fBmem\fP is specified, a metalink file is not written to the disk, but is just kept in memory. If \fBfalse\fP is specified, the action mentioned above is not taken. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-metalink\-base\-uri= Specify base URI to resolve relative URI in metalink:url and metalink:metaurl element in a metalink file stored in local disk. If URI points to a directory, URI must end with \fB/\fP. .UNINDENT .INDENT 0.0 .TP .B \-M, \-\-metalink\-file= The file path to .meta4 and .metalink file. Reads input from stdin when \fB\-\fP is specified. You are not required to use this option because you can specify .metalink files without \fI\%--metalink-file\fP. .UNINDENT .INDENT 0.0 .TP .B \-\-metalink\-language= The language of the file to download. .UNINDENT .INDENT 0.0 .TP .B \-\-metalink\-location=[,...] The location of the preferred server. A comma\-delimited list of locations is acceptable, for example, \fBjp,us\fP. .UNINDENT .INDENT 0.0 .TP .B \-\-metalink\-os= The operating system of the file to download. .UNINDENT .INDENT 0.0 .TP .B \-\-metalink\-version= The version of the file to download. .UNINDENT .INDENT 0.0 .TP .B \-\-metalink\-preferred\-protocol= Specify preferred protocol. The possible values are \fBhttp\fP, \fBhttps\fP, \fBftp\fP and \fBnone\fP. Specify \fBnone\fP to disable this feature. Default: \fBnone\fP .UNINDENT .INDENT 0.0 .TP .B \-\-metalink\-enable\-unique\-protocol[=true|false] If \fBtrue\fP is given and several protocols are available for a mirror in a metalink file, aria2 uses one of them. Use \fI\%--metalink-preferred-protocol\fP option to specify the preference of protocol. Default: \fBtrue\fP .UNINDENT .SS RPC Options .INDENT 0.0 .TP .B \-\-enable\-rpc[=true|false] Enable JSON\-RPC/XML\-RPC server. It is strongly recommended to set username and password using \fI\%--rpc-user\fP and \fI\%--rpc-passwd\fP option. See also \fI\%--rpc-listen-port\fP option. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-pause[=true|false] Pause download after added. This option is effective only when \fI\%--enable-rpc=true\fP is given. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-rpc\-allow\-origin\-all[=true|false] Add Access\-Control\-Allow\-Origin header field with value \fB*\fP to the RPC response. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-rpc\-listen\-all[=true|false] Listen incoming JSON\-RPC/XML\-RPC requests on all network interfaces. If false is given, listen only on local loopback interface. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-rpc\-listen\-port= Specify a port number for JSON\-RPC/XML\-RPC server to listen to. Possible Values: \fB1024\fP \-\fB65535\fP Default: \fB6800\fP .UNINDENT .INDENT 0.0 .TP .B \-\-rpc\-max\-request\-size= Set max size of JSON\-RPC/XML\-RPC request. If aria2 detects the request is more than SIZE bytes, it drops connection. Default: \fB2M\fP .UNINDENT .INDENT 0.0 .TP .B \-\-rpc\-passwd= Set JSON\-RPC/XML\-RPC password. .UNINDENT .INDENT 0.0 .TP .B \-\-rpc\-user= Set JSON\-RPC/XML\-RPC user. .UNINDENT .SS Advanced Options .INDENT 0.0 .TP .B \-\-allow\-overwrite[=true|false] Restart download from scratch if the corresponding control file doesn\(aqt exist. See also \fI\%--auto-file-renaming\fP option. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-allow\-piece\-length\-change[=true|false] If false is given, aria2 aborts download when a piece length is different from one in a control file. If true is given, you can proceed but some download progress will be lost. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-always\-resume[=true|false] Always resume download. If \fBtrue\fP is given, aria2 always tries to resume download and if resume is not possible, aborts download. If \fBfalse\fP is given, when all given URIs do not support resume or aria2 encounters \fBN\fP URIs which does not support resume (\fBN\fP is the value specified using \fI\%--max-resume-failure-tries\fP option), aria2 downloads file from scratch. See \fI\%--max-resume-failure-tries\fP option. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-async\-dns[=true|false] Enable asynchronous DNS. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-async\-dns\-server=[,...] Comma separated list of DNS server address used in asynchronous DNS resolver. Usually asynchronous DNS resolver reads DNS server addresses from \fB/etc/resolv.conf\fP. When this option is used, it uses DNS servers specified in this option instead of ones in \fB/etc/resolv.conf\fP. You can specify both IPv4 and IPv6 address. This option is useful when the system does not have \fB/etc/resolv.conf\fP and user does not have the permission to create it. .UNINDENT .INDENT 0.0 .TP .B \-\-auto\-file\-renaming[=true|false] Rename file name if the same file already exists. This option works only in HTTP(S)/FTP download. The new file name has a dot and a number(1..9999) appended. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-auto\-save\-interval= Save a control file(*.aria2) every SEC seconds. If \fB0\fP is given, a control file is not saved during download. aria2 saves a control file when it stops regardless of the value. The possible values are between \fB0\fP to \fB600\fP. Default: \fB60\fP .UNINDENT .INDENT 0.0 .TP .B \-\-conditional\-get[=true|false] Download file only when the local file is older than remote file. This function only works with HTTP(S) downloads only. It does not work if file size is specified in Metalink. It also ignores Content\-Disposition header. If a control file exists, this option will be ignored. This function uses If\-Modified\-Since header to get only newer file conditionally. When getting modification time of local file, it uses user supplied filename(see \fI\%--out\fP option) or filename part in URI if \fI\%--out\fP is not specified. To overwrite existing file, \fI\%--allow-overwrite\fP is required. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-conf\-path= Change the configuration file path to PATH. Default: \fB$HOME/.aria2/aria2.conf\fP .UNINDENT .INDENT 0.0 .TP .B \-D, \-\-daemon[=true|false] Run as daemon. The current working directory will be changed to \fB/\fP and standard input, standard output and standard error will be redirected to \fB/dev/null\fP. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-deferred\-input[=true|false] If \fBtrue\fP is given, aria2 does not read all URIs and options from file specified by \fI\%--input-file\fP option at startup, but it reads one by one when it needs later. This may reduce memory usage if input file contains a lot of URIs to download. If \fBfalse\fP is given, aria2 reads all URIs and options at startup. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-disable\-ipv6[=true|false] Disable IPv6. This is useful if you have to use broken DNS and want to avoid terribly slow AAAA record lookup. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-download\-result= This option changes the way \fBDownload Results\fP is formatted. If OPT is \fBdefault\fP, print GID, status, average download speed and path/URI. If multiple files are involved, path/URI of first requested file is printed and remaining ones are omitted. If OPT is \fBfull\fP, print GID, status, average download speed, percentage of progress and path/URI. The percentage of progress and path/URI are printed for each requested file in each row. Default: \fBdefault\fP .UNINDENT .INDENT 0.0 .TP .B \-\-enable\-async\-dns6[=true|false] Enable IPv6 name resolution in asynchronous DNS resolver. This option will be ignored when \fI\%--async-dns=false.\fP Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-event\-poll= Specify the method for polling events. The possible values are \fBepoll\fP, \fBkqueue\fP, \fBport\fP, \fBpoll\fP and \fBselect\fP. For each \fBepoll\fP, \fBkqueue\fP, \fBport\fP and \fBpoll\fP, it is available if system supports it. \fBepoll\fP is available on recent Linux. \fBkqueue\fP is available on various *BSD systems including Mac OS X. \fBport\fP is available on Open Solaris. The default value may vary depending on the system you use. .UNINDENT .INDENT 0.0 .TP .B \-\-file\-allocation= Specify file allocation method. \fBnone\fP doesn\(aqt pre\-allocate file space. \fBprealloc\fP pre\-allocates file space before download begins. This may take some time depending on the size of the file. If you are using newer file systems such as ext4 (with extents support), btrfs, xfs or NTFS(MinGW build only), \fBfalloc\fP is your best choice. It allocates large(few GiB) files almost instantly. Don\(aqt use \fBfalloc\fP with legacy file systems such as ext3 and FAT32 because it takes almost same time as \fBprealloc\fP and it blocks aria2 entirely until allocation finishes. \fBfalloc\fP may not be available if your system doesn\(aqt have \fIposix_fallocate(3)\fP function. Possible Values: \fBnone\fP, \fBprealloc\fP, \fBfalloc\fP Default: \fBprealloc\fP .UNINDENT .INDENT 0.0 .TP .B \-\-hash\-check\-only[=true|false] If \fBtrue\fP is given, after hash check using \fI\%--check-integrity\fP option, abort download whether or not download is complete. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-human\-readable[=true|false] Print sizes and speed in human readable format (e.g., 1.2Ki, 3.4Mi) in the console readout. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-interface= Bind sockets to given interface. You can specify interface name, IP address and hostname. Possible Values: interface, IP address, hostname .IP Note If an interface has multiple addresses, it is highly recommended to specify IP address explicitly. See also \fI\%--disable-ipv6\fP. If your system doesn\(aqt have \fIgetifaddrs(3)\fP, this option doesn\(aqt accept interface name. .RE .UNINDENT .INDENT 0.0 .TP .B \-\-max\-download\-result= Set maximum number of download result kept in memory. The download results are completed/error/removed downloads. The download results are stored in FIFO queue and it can store at most NUM download results. When queue is full and new download result is created, oldest download result is removed from the front of the queue and new one is pushed to the back. Setting big number in this option may result high memory consumption after thousands of downloads. Specifying 0 means no download result is kept. Default: \fB1000\fP .UNINDENT .INDENT 0.0 .TP .B \-\-max\-resume\-failure\-tries= When used with \fI\%--always-resume=false,\fP aria2 downloads file from scratch when aria2 detects N number of URIs that does not support resume. If N is \fB0\fP, aria2 downloads file from scratch when all given URIs do not support resume. See \fI\%--always-resume\fP option. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-\-log\-level= Set log level to output. LEVEL is either \fBdebug\fP, \fBinfo\fP, \fBnotice\fP, \fBwarn\fP or \fBerror\fP. Default: \fBdebug\fP .UNINDENT .INDENT 0.0 .TP .B \-\-on\-bt\-download\-complete= For BitTorrent, a command specified in \fI\%--on-download-complete\fP is called after download completed and seeding is over. On the other hand, this option set the command to be executed after download completed but before seeding. See \fI\%Event Hook\fP for more details about COMMAND. Possible Values: \fB/path/to/command\fP .UNINDENT .INDENT 0.0 .TP .B \-\-on\-download\-complete= Set the command to be executed after download completed. See See \fI\%Event Hook\fP for more details about COMMAND. See also \fI\%--on-download-stop\fP option. Possible Values: \fB/path/to/command\fP .UNINDENT .INDENT 0.0 .TP .B \-\-on\-download\-error= Set the command to be executed after download aborted due to error. See \fI\%Event Hook\fP for more details about COMMAND. See also \fI\%--on-download-stop\fP option. Possible Values: \fB/path/to/command\fP .UNINDENT .INDENT 0.0 .TP .B \-\-on\-download\-pause= Set the command to be executed after download was paused. See \fI\%Event Hook\fP for more details about COMMAND. Possible Values: \fB/path/to/command\fP .UNINDENT .INDENT 0.0 .TP .B \-\-on\-download\-start= Set the command to be executed after download got started. See \fI\%Event Hook\fP for more details about COMMAND. Possible Values: \fB/path/to/command\fP .UNINDENT .INDENT 0.0 .TP .B \-\-on\-download\-stop= Set the command to be executed after download stopped. You can override the command to be executed for particular download result using \fI\%--on-download-complete\fP and \fI\%--on-download-error\fP. If they are specified, command specified in this option is not executed. See \fI\%Event Hook\fP for more details about COMMAND. Possible Values: \fB/path/to/command\fP .UNINDENT .INDENT 0.0 .TP .B \-\-piece\-length= Set a piece length for HTTP/FTP downloads. This is the boundary when aria2 splits a file. All splits occur at multiple of this length. This option will be ignored in BitTorrent downloads. It will be also ignored if Metalink file contains piece hashes. Default: \fB1M\fP .IP Note The possible usecase of \fI\%--piece-length\fP option is change the request range in one HTTP pipelined request. To enable HTTP pipelining use \fI\%--enable-http-pipelining\fP. .RE .UNINDENT .INDENT 0.0 .TP .B \-\-show\-console\-readout[=true|false] Show console readout. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-summary\-interval= Set interval in seconds to output download progress summary. Setting \fB0\fP suppresses the output. Default: \fB60\fP .IP Note In multi file torrent downloads, the files adjacent forward to the specified files are also allocated if they share the same piece. .RE .UNINDENT .INDENT 0.0 .TP .B \-Z, \-\-force\-sequential[=true|false] Fetch URIs in the command\-line sequentially and download each URI in a separate session, like the usual command\-line download utilities. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-max\-overall\-download\-limit= Set max overall download speed in bytes/sec. \fB0\fP means unrestricted. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). To limit the download speed per download, use \fI\%--max-download-limit\fP option. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-\-max\-download\-limit= Set max download speed per each download in bytes/sec. \fB0\fP means unrestricted. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). To limit the overall download speed, use \fI\%--max-overall-download-limit\fP option. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-\-no\-conf[=true|false] Disable loading aria2.conf file. .UNINDENT .INDENT 0.0 .TP .B \-\-no\-file\-allocation\-limit= No file allocation is made for files whose size is smaller than SIZE. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). Default: \fB5M\fP .UNINDENT .INDENT 0.0 .TP .B \-P, \-\-parameterized\-uri[=true|false] Enable parameterized URI support. You can specify set of parts: \fBhttp://{sv1,sv2,sv3}/foo.iso\fP. Also you can specify numeric sequences with step counter: \fBhttp://host/image[000\-100:2].img\fP. A step counter can be omitted. If all URIs do not point to the same file, such as the second example above, \-Z option is required. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-q, \-\-quiet[=true|false] Make aria2 quiet (no console output). Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-realtime\-chunk\-checksum[=true|false] Validate chunk of data by calculating checksum while downloading a file if chunk checksums are provided. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-remove\-control\-file[=true|false] Remove control file before download. Using with \fI\%--allow-overwrite=true,\fP download always starts from scratch. This will be useful for users behind proxy server which disables resume. .UNINDENT .INDENT 0.0 .TP .B \-\-save\-session= Save error/unfinished downloads to FILE on exit. You can pass this output file to aria2c with \fI\%--input-file\fP option on restart. Please note that downloads added by \fI\%aria2.addTorrent()\fP and \fI\%aria2.addMetalink()\fP RPC method and whose metadata could not be saved as a file are not saved. Downloads removed using \fI\%aria2.remove()\fP and \fI\%aria2.forceRemove()\fP will not be saved. .UNINDENT .INDENT 0.0 .TP .B \-\-stop= Stop application after SEC seconds has passed. If \fB0\fP is given, this feature is disabled. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-\-stop\-with\-process= Stop application when process PID is not running. This is useful if aria2 process is forked from a parent process. The parent process can fork aria2 with its own pid and when parent process exits for some reason, aria2 can detect it and shutdown itself. .UNINDENT .INDENT 0.0 .TP .B \-\-truncate\-console\-readout[=true|false] Truncate console readout to fit in a single line. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-v, \-\-version Print the version number, copyright and the configuration information and exit. .UNINDENT .SS Options That Take An Optional Argument .sp The options that have its argument surrounded by square brackets([]) take an optional argument. Usually omiting the argument is evaluated to \fBtrue\fP. If you use short form of these options(such as \fB\-V\fP) and give an argument, then the option name and its argument should be concatenated(e.g. \fB\-Vfalse\fP). If any spaces are inserted between the option name and the argument, the argument will be treated as URI and usually this is not what you expect. .SS URI, MAGNET, TORRENT_FILE, METALINK_FILE .sp You can specify multiple URIs in command\-line. Unless you specify \fI\%--force-sequential\fP option, all URIs must point to the same file or downloading will fail. .sp You can specify arbitrary number of BitTorrent Magnet URI. Please note that they are always treated as a separate download. Both hex encoded 40 characters Info Hash and Base32 encoded 32 characters Info Hash are supported. The multiple \fBtr\fP parameters are supported. Because BitTorrent Magnet URI is likely to contain \fB&\fP character, it is highly recommended to always quote URI with single(\fB\(aq\fP) or double(\fB"\fP) quotation. It is strongly recommended to enable DHT especially when \fBtr\fP parameter is missing. See \fI\%http://www.bittorrent.org/beps/bep_0009.html\fP for more details about BitTorrent Magnet URI. .sp You can also specify arbitrary number of torrent files and Metalink documents stored on a local drive. Please note that they are always treated as a separate download. Both Metalink4 and Metalink version 3.0 are supported. .sp You can specify both torrent file with \-T option and URIs. By doing this, you can download a file from both torrent swarm and HTTP(S)/FTP server at the same time, while the data from HTTP(S)/FTP are uploaded to the torrent swarm. For single file torrents, URI can be a complete URI pointing to the resource or if URI ends with /, name in torrent file in torrent is added. For multi\-file torrents, name and path are added to form a URI for each file. .IP Note Make sure that URI is quoted with single(\fB\(aq\fP) or double(\fB"\fP) quotation if it contains \fB&\fP or any characters that have special meaning in shell. .RE .SS Resuming Download .sp Usually, you can resume transfer by just issuing same command(aria2c URI) if the previous transfer is made by aria2. .sp If the previous transfer is made by a browser or wget like sequential download manager, then use \fI\%--continue\fP option to continue the transfer. .SS Event Hook .sp aria2 provides options to specify arbitrary command after specific event occurred. Currently following options are available: \fI\%--on-bt-download-complete\fP, \fI\%--on-download-pause\fP, \fI\%--on-download-complete\fP. \fI\%--on-download-start\fP, \fI\%--on-download-error\fP, \fI\%--on-download-stop\fP. .sp aria2 passes 3 arguments to specified command when it is executed. These arguments are: GID, the number of files and file path. For HTTP, FTP downloads, usually the number of files is 1. BitTorrent download can contain multiple files. If number of files is more than one, file path is first one. In other words, this is the value of path key of first struct whose selected key is true in the response of \fI\%aria2.getFiles()\fP RPC method. If you want to get all file paths, consider to use JSON\-RPC/XML\-RPC. Please note that file path may change during download in HTTP because of redirection or Content\-Disposition header. .sp Let\(aqs see an example of how arguments are passed to command: .sp .nf .ft C $ 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] .ft P .fi .SH EXIT STATUS .sp Because aria2 can handle multiple downloads at once, it encounters lots of errors in a session. aria2 returns the following exit status based on the last error encountered. .INDENT 0.0 .TP .B 0 If all downloads were successful. .TP .B 1 If an unknown error occurred. .TP .B 2 If time out occurred. .TP .B 3 If a resource was not found. .TP .B 4 If aria2 saw the specfied number of "resource not found" error. See \fI\%--max-file-not-found\fP option). .TP .B 5 If a download aborted because download speed was too slow. See \fI\%--lowest-speed-limit\fP option) .TP .B 6 If network problem occurred. .TP .B 7 If there were unfinished downloads. This error is only reported if all finished downloads were successful and there were unfinished downloads in a queue when aria2 exited by pressing \fBCtrl\-C\fP by an user or sending TERM or INT signal. .TP .B 8 If remote server did not support resume when resume was required to complete download. .TP .B 9 If there was not enough disk space available. .TP .B 10 If piece length was different from one in .aria2 control file. See \fI\%--allow-piece-length-change\fP option. .TP .B 11 If aria2 was downloading same file at that moment. .TP .B 12 If aria2 was downloading same info hash torrent at that moment. .TP .B 13 If file already existed. See \fI\%--allow-overwrite\fP option. .TP .B 14 If renaming file failed. See \fI\%--auto-file-renaming\fP option. .TP .B 15 If aria2 could not open existing file. .TP .B 16 If aria2 could not create new file or truncate existing file. .TP .B 17 If file I/O error occurred. .TP .B 18 If aria2 could not create directory. .TP .B 19 If name resolution failed. .TP .B 20 If aria2 could not parse Metalink document. .TP .B 21 If FTP command failed. .TP .B 22 If HTTP response header was bad or unexpected. .TP .B 23 If too many redirections occurred. .TP .B 24 If HTTP authorization failed. .TP .B 25 If aria2 could not parse bencoded file(usually .torrent file). .TP .B 26 If .torrent file was corrupted or missing information that aria2 needed. .TP .B 27 If Magnet URI was bad. .TP .B 28 If bad/unrecognized option was given or unexpected option argument was given. .TP .B 29 If the remote server was unable to handle the request due to a temporary overloading or maintenance. .TP .B 30 If aria2 could not parse JSON\-RPC request. .UNINDENT .IP Note An error occurred in a finished download will not be reported as exit status. .RE .SH ENVIRONMENT .sp aria2 recognizes the following environment variables. .INDENT 0.0 .TP .B \fBhttp_proxy [http://][USER:PASSWORD@]HOST[:PORT]\fP Specify proxy server for use in HTTP. Overrides http\-proxy value in configuration file. The command\-line option \fI\%--http-proxy\fP overrides this value. .TP .B \fBhttps_proxy [http://][USER:PASSWORD@]HOST[:PORT]\fP Specify proxy server for use in HTTPS. Overrides https\-proxy value in configuration file. The command\-line option \fI\%--https-proxy\fP overrides this value. .TP .B \fBftp_proxy [http://][USER:PASSWORD@]HOST[:PORT]\fP Specify proxy server for use in FTP. Overrides ftp\-proxy value in configuration file. The command\-line option \fI\%--ftp-proxy\fP overrides this value. .TP .B \fBall_proxy [http://][USER:PASSWORD@]HOST[:PORT]\fP Specify proxy server for use if no protocol\-specific proxy is specified. Overrides all\-proxy value in configuration file. The command\-line option \fI\%--all-proxy\fP overrides this value. .UNINDENT .IP Note Although aria2 accepts \fBftp://\fP and \fBhttps://\fP scheme in proxy URI, it simply assumes that \fBhttp://\fP is specified and does not change its behavior based on the specified scheme. .RE .INDENT 0.0 .TP .B \fBno_proxy [DOMAIN,...]\fP Specify comma\-separated hostname, domains and network address with or without CIDR block to which proxy should not be used. Overrides no\-proxy value in configuration file. The command\-line option \fI\%--no-proxy\fP overrides this value. .UNINDENT .SH FILES .SS aria2.conf .sp By default, aria2 parses \fB$HOME/.aria2/aria2.conf\fP as a configuraiton file. You can specify the path to configuration file using \fI\%--conf-path\fP option. If you don\(aqt want to use the configuraitonf file, use \fI\%--no-conf\fP option. .sp The configuration file is a text file and has 1 option per each line. In each line, you can specify name\-value pair in the format: \fBNAME=VALUE\fP, where name is the long command\-line option name without \fB\-\-\fP prefix. You can use same syntax for the command\-line option. The lines beginning \fB#\fP are treated as comments: .sp .nf .ft C # sample configuration file for aria2c listen\-port=60000 dht\-listen\-port=60000 seed\-ratio=1.0 max\-upload\-limit=50K ftp\-pasv=true .ft P .fi .SS dht.dat .sp By default, the routing table of IPv4 DHT is saved to the path \fB$HOME/.aria2/dht.dat\fP and the routing table of IPv6 DHT is saved to the path \fB$HOME/.aria2/dht6.dat\fP. .SS Netrc .sp Netrc support is enabled by default for HTTP(S)/FTP. To disable netrc support, specify \fI\%--no-netrc\fP option. Your .netrc file should have correct permissions(600). .sp If machine name starts \fB.\fP, aria2 performs domain\-match instead of exact match. This is an extension of aria2. For example of domain match, imagine the following .netrc entry: .sp .nf .ft C machine .example.org login myid password mypasswd .ft P .fi .sp \fBaria2.example.org\fP domain\-matches \fB.example.org\fP and uses \fBmyid\fP and \fBmypasswd\fP. .sp Some domain\-match example follow: \fBexample.net\fP does not domain\-match \fB.example.org\fP. \fBexample.org\fP does not domain\-match \fB.example.org\fP because of preceding \fB.\fP. If you want to match \fBexample.org\fP, specify \fBexample.org\fP. .SS Control File .sp 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 \fB.aria2\fP 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 \fB.aria2\fP appended. The "top directory" name is a value of "name" key in "info" directory in a torrent file.) .sp Usually a control file is deleted once download completed. If aria2 decides that download cannot be resumed(for example, when downloading a file from a HTTP server which doesn\(aqt support resume), a control file is not created. .sp Normally if you lose a control file, you cannot resume download. But if you have a torrent or metalink with chunk checksums for the file, you can resume the download without a control file by giving \-V option to aria2c in command\-line. .SS Input File .sp The input file can contain a list of URIs for aria2 to download. You can specify multiple URIs for a single entity: separate URIs on a single line using the TAB character. .sp Each line is treated as if it is provided in command\-line argument. Therefore they are affected by \fI\%--force-sequential\fP and \fI\%--parameterized-uri\fP options. .sp Since URIs in the input file are directly read by aria2, they must not be quoted with single(\fB\(aq\fP) or double(\fB"\fP) quotation. .sp Lines starting with \fB#\fP are treated as comments and skipped. .sp Additionally, the following options can be specified after each line of URIs. These optional lines must start with white space(s). .INDENT 0.0 .INDENT 2.0 .IP \(bu 2 \fI\%all-proxy\fP .IP \(bu 2 \fI\%all-proxy-passwd\fP .IP \(bu 2 \fI\%all-proxy-user\fP .IP \(bu 2 \fI\%allow-overwrite\fP .IP \(bu 2 \fI\%allow-piece-length-change\fP .IP \(bu 2 \fI\%always-resume\fP .IP \(bu 2 \fI\%async-dns\fP .IP \(bu 2 \fI\%auto-file-renaming\fP .IP \(bu 2 \fI\%bt-enable-lpd\fP .IP \(bu 2 \fI\%bt-exclude-tracker\fP .IP \(bu 2 \fI\%bt-external-ip\fP .IP \(bu 2 \fI\%bt-hash-check-seed\fP .IP \(bu 2 \fI\%bt-max-open-files\fP .IP \(bu 2 \fI\%bt-max-peers\fP .IP \(bu 2 \fI\%bt-metadata-only\fP .IP \(bu 2 \fI\%bt-min-crypto-level\fP .IP \(bu 2 \fI\%bt-prioritize-piece\fP .IP \(bu 2 \fI\%bt-request-peer-speed-limit\fP .IP \(bu 2 \fI\%bt-require-crypto\fP .IP \(bu 2 \fI\%bt-save-metadata\fP .IP \(bu 2 \fI\%bt-seed-unverified\fP .IP \(bu 2 \fI\%bt-stop-timeout\fP .IP \(bu 2 \fI\%bt-tracker\fP .IP \(bu 2 \fI\%bt-tracker-connect-timeout\fP .IP \(bu 2 \fI\%bt-tracker-interval\fP .IP \(bu 2 \fI\%bt-tracker-timeout\fP .IP \(bu 2 \fI\%bt-remove-unselected-file\fP .IP \(bu 2 \fI\%check-integrity\fP .IP \(bu 2 \fI\%conditional-get\fP .IP \(bu 2 \fI\%connect-timeout\fP .IP \(bu 2 \fI\%continue\fP .IP \(bu 2 \fI\%dir\fP .IP \(bu 2 \fI\%dry-run\fP .IP \(bu 2 \fI\%enable-async-dns6\fP .UNINDENT .INDENT 2.0 .IP \(bu 2 \fI\%enable-http-keep-alive\fP .IP \(bu 2 \fI\%enable-http-pipelining\fP .IP \(bu 2 \fI\%enable-peer-exchange\fP .IP \(bu 2 \fI\%file-allocation\fP .IP \(bu 2 \fI\%follow-metalink\fP .IP \(bu 2 \fI\%follow-torrent\fP .IP \(bu 2 \fI\%ftp-passwd\fP .IP \(bu 2 \fI\%ftp-pasv\fP .IP \(bu 2 \fI\%ftp-proxy\fP .IP \(bu 2 \fI\%ftp-proxy-passwd\fP .IP \(bu 2 \fI\%ftp-proxy-user\fP .IP \(bu 2 \fI\%ftp-reuse-connection\fP .IP \(bu 2 \fI\%ftp-type\fP .IP \(bu 2 \fI\%ftp-user\fP .IP \(bu 2 \fI\%header\fP .IP \(bu 2 \fI\%http-accept-gzip\fP .IP \(bu 2 \fI\%http-auth-challenge\fP .IP \(bu 2 \fI\%http-no-cache\fP .IP \(bu 2 \fI\%http-passwd\fP .IP \(bu 2 \fI\%http-proxy\fP .IP \(bu 2 \fI\%http-proxy-passwd\fP .IP \(bu 2 \fI\%http-proxy-user\fP .IP \(bu 2 \fI\%http-user\fP .IP \(bu 2 \fI\%https-proxy\fP .IP \(bu 2 \fI\%https-proxy-passwd\fP .IP \(bu 2 \fI\%https-proxy-user\fP .IP \(bu 2 \fI\%index-out\fP .IP \(bu 2 \fI\%lowest-speed-limit\fP .IP \(bu 2 \fI\%max-connection-per-server\fP .IP \(bu 2 \fI\%max-download-limit\fP .IP \(bu 2 \fI\%max-file-not-found\fP .IP \(bu 2 \fI\%max-resume-failure-tries\fP .IP \(bu 2 \fI\%max-tries\fP .IP \(bu 2 \fI\%max-upload-limit\fP .UNINDENT .INDENT 2.0 .IP \(bu 2 \fI\%metalink-enable-unique-protocol\fP .IP \(bu 2 \fI\%metalink-language\fP .IP \(bu 2 \fI\%metalink-location\fP .IP \(bu 2 \fI\%metalink-os\fP .IP \(bu 2 \fI\%metalink-preferred-protocol\fP .IP \(bu 2 \fI\%metalink-version\fP .IP \(bu 2 \fI\%min-split-size\fP .IP \(bu 2 \fI\%no-file-allocation-limit\fP .IP \(bu 2 \fI\%no-netrc\fP .IP \(bu 2 \fI\%no-proxy\fP .IP \(bu 2 \fI\%out\fP .IP \(bu 2 \fI\%parameterized-uri\fP .IP \(bu 2 \fI\%proxy-method\fP .IP \(bu 2 \fI\%realtime-chunk-checksum\fP .IP \(bu 2 \fI\%referer\fP .IP \(bu 2 \fI\%remote-time\fP .IP \(bu 2 \fI\%remove-control-file\fP .IP \(bu 2 \fI\%reuse-uri\fP .IP \(bu 2 \fI\%seed-ratio\fP .IP \(bu 2 \fI\%seed-time\fP .IP \(bu 2 \fI\%select-file\fP .IP \(bu 2 \fI\%split\fP .IP \(bu 2 \fI\%timeout\fP .IP \(bu 2 \fI\%use-head\fP .IP \(bu 2 \fI\%user-agent\fP .IP \(bu 2 \fI\%retry-wait\fP .IP \(bu 2 \fI\%metalink-base-uri\fP .IP \(bu 2 \fI\%pause\fP .IP \(bu 2 \fI\%stream-piece-selector\fP .IP \(bu 2 \fI\%hash-check-only\fP .IP \(bu 2 \fI\%checksum\fP .IP \(bu 2 \fI\%piece-length\fP .IP \(bu 2 \fI\%uri-selector\fP .UNINDENT .UNINDENT .sp 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 \fB\-\-\fP prefix must be stripped. .sp For example, the content of uri.txt is: .sp .nf .ft C http://server/file.iso http://mirror/file.iso dir=/iso_images out=file.img http://foo/bar .ft P .fi .sp If aria2 is executed with \fB\-i uri.txt \-d /tmp\fP options, then \fBfile.iso\fP is saved as \fB/iso_images/file.img\fP and it is downloaded from http://server/file.iso and http://mirror/file.iso. The file \fBbar\fP is downloaded from http://foo/bar and saved as \fB/tmp/bar\fP. .sp In some cases, \fI\%out\fP parameter has no effect. See note of \fI\%--out\fP option for the restrictions. .SS Server Performance Profile .sp This section describes the format of server performance profile. The file is plain text and each line has several \fBNAME=VALUE\fP pair, delimited by comma. Currently following NAMEs are recognized: .INDENT 0.0 .TP .B \fBhost\fP Hostname of the server. Required. .TP .B \fBprotocol\fP Protocol for this profile, such as ftp, http. Required. .TP .B \fBdl_speed\fP The average download speed observed in the previous download in bytes per sec. Required. .TP .B \fBsc_avg_speed\fP The average download speed observed in the previous download in bytes per sec. This value is only updated if the download is done in single connection environment and only used by AdaptiveURISelector. Optional. .TP .B \fBmc_avg_speed\fP The average download speed observed in the previous download in bytes per sec. This value is only updated if the download is done in multi connection environment and only used by AdaptiveURISelector. Optional. .TP .B \fBcounter\fP How many times the server is used. Currently this value is only used by AdaptiveURISelector. Optional. .TP .B \fBlast_updated\fP Last contact time in GMT with this server, specified in the seconds since the Epoch(00:00:00 on January 1, 1970, UTC). Required. .TP .B \fBstatus\fP ERROR is set when server cannot be reached or out\-of\-service or timeout occurred. Otherwise, OK is set. .UNINDENT .sp Those fields must exist in one line. The order of the fields is not significant. You can put pairs other than the above; they are simply ignored. .sp An example follows: .sp .nf .ft C host=localhost, protocol=http, dl_speed=32000, last_updated=1222491640, status=OK host=localhost, protocol=ftp, dl_speed=0, last_updated=1222491632, status=ERROR .ft P .fi .SH RPC INTERFACE .sp aria2 provides JSON\-RPC over HTTP and XML\-RPC over HTTP and they basically have the same functionality. aria2 also provides JSON\-RPC over WebSocket. JSON\-RPC over WebSocket uses same method signatures and response format with JSON\-RPC over HTTP, but it additionally has server\-initiated notifications. See \fI\%JSON-RPC over WebSocket\fP section for details. .sp The request path of JSON\-RPC interface (for both over HTTP and over WebSocket) is \fB/jsonrpc\fP. The request path of XML\-RPC interface is \fB/rpc\fP. .sp The WebSocket URI for JSON\-RPC over WebSocket is \fBws://HOST:PORT/jsonrpc\fP. .sp The implemented JSON\-RPC is based on JSON\-RPC 2.0 <\fI\%http://jsonrpc.org/specification\fP>, and supports HTTP POST and GET (JSONP). Using WebSocket as a transport is the original extension of aria2. .sp The JSON\-RPC interface does not support notification in HTTP, but the RPC server will send the notification in WebSocket. It also does not support floating point number. The character encoding must be UTF\-8. .sp When reading following document for JSON\-RPC, interpret struct as JSON object. .SS Terminology .INDENT 0.0 .TP .B GID GID(or gid) is the key to manage each download. Each download has an unique GID. Currently GID looks like an integer, but don\(aqt treat it as integer because it may be changed to another type in the future release. Please note that GID is session local and not persisted when aria2 exits. .UNINDENT .SS Methods .sp All code examples come from Python2.7 interpreter. .INDENT 0.0 .TP .B aria2.addUri(uris[, options[, position]]) This method adds new HTTP(S)/FTP/BitTorrent Magnet URI. \fIuris\fP is of type array and its element is URI which is of type string. For BitTorrent Magnet URI, \fIuris\fP must have only one element and it should be BitTorrent Magnet URI. URIs in \fIuris\fP 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\fP is of type struct and its members are a pair of option name and value. See \fI\%Options\fP below for more details. If \fIposition\fP is given as an integer starting from 0, the new download is inserted at \fIposition\fP in the waiting queue. If \fIposition\fP is not given or \fIposition\fP is larger than the size of the queue, it is appended at the end of the queue. This method returns GID of registered download. .sp \fBJSON\-RPC Example\fP .sp The following example adds http://example.org/file to aria2: .sp .nf .ft C >>> import urllib2, json >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.addUri\(aq, \&... \(aqparams\(aq:[[\(aqhttp://example.org/file\(aq]]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> c.read() \(aq{"id":"qwer","jsonrpc":"2.0","result":"1"}\(aq .ft P .fi .sp \fBXML\-RPC Example\fP .sp The following example adds http://example.org/file to aria2: .sp .nf .ft C >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.addUri([\(aqhttp://example.org/file\(aq]) \(aq1\(aq .ft P .fi .sp The following example adds 2 sources and some options: .sp .nf .ft C >>> s.aria2.addUri([\(aqhttp://example.org/file\(aq, \(aqhttp://mirror/file\(aq], dict(dir="/tmp")) \(aq2\(aq .ft P .fi .sp The following example adds a download and insert it to the front of waiting downloads: .sp .nf .ft C >>> s.aria2.addUri([\(aqhttp://example.org/file\(aq], {}, 0) \(aq3\(aq .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.addTorrent(torrent[, uris[, options[, position]]]) This method adds BitTorrent download by uploading .torrent file. If you want to add BitTorrent Magnet URI, use \fI\%aria2.addUri()\fP method instead. \fItorrent\fP is of type base64 which contains Base64\-encoded .torrent file. \fIuris\fP is of type array and its element is URI which is of type string. \fIuris\fP 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\fP is of type struct and its members are a pair of option name and value. See \fI\%Options\fP below for more details. If \fIposition\fP is given as an integer starting from 0, the new download is inserted at \fIposition\fP in the waiting queue. If \fIposition\fP is not given or \fIposition\fP is larger than the size of the queue, it is appended at the end of the queue. This method returns GID of registered download. The uploaded data is saved as a file named hex string of SHA\-1 hash of data plus ".torrent" in the directory specified by \fI\%--dir\fP option. The example of filename is 0a3893293e27ac0490424c06de4d09242215f0a6.torrent. If same file already exists, it is overwritten. If the file cannot be saved successfully, the downloads added by this method are not saved by \fI\%--save-session\fP. .sp \fBJSON\-RPC Example\fP .sp The following example adds local file file.torrent to aria2: .sp .nf .ft C >>> import urllib2, json, base64 >>> torrent = base64.b64encode(open(\(aqfile.torrent\(aq).read()) >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqasdf\(aq, \&... \(aqmethod\(aq:\(aqaria2.addTorrent\(aq, \(aqparams\(aq:[torrent]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> c.read() \(aq{"id":"asdf","jsonrpc":"2.0","result":"6"}\(aq .ft P .fi .sp \fBXML\-RPC Example\fP .sp The following example adds local file file.torrent to aria2: .sp .nf .ft C >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.addTorrent(xmlrpclib.Binary(open(\(aqfile.torrent\(aq).read())) \(aq6\(aq .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.addMetalink(metalink[, options[, position]]) This method adds Metalink download by uploading .metalink file. \fImetalink\fP is of type base64 which contains Base64\-encoded .metalink file. \fIoptions\fP is of type struct and its members are a pair of option name and value. See \fI\%Options\fP below for more details. If \fIposition\fP is given as an integer starting from 0, the new download is inserted at \fIposition\fP in the waiting queue. If \fIposition\fP is not given or \fIposition\fP 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. The uploaded data is saved as a file named hex string of SHA\-1 hash of data plus ".metalink" in the directory specified by \fI\%--dir\fP option. The example of filename is 0a3893293e27ac0490424c06de4d09242215f0a6.metalink. If same file already exists, it is overwritten. If the file cannot be saved successfully, the downloads added by this method are not saved by \fI\%--save-session\fP. .sp \fBJSON\-RPC Example\fP .sp The following example adds local file file.meta4 to aria2: .sp .nf .ft C >>> import urllib2, json, base64 >>> metalink = base64.b64encode(open(\(aqfile.meta4\(aq).read()) >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.addMetalink\(aq, \(aqparams\(aq:[metalink]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> c.read() \(aq{"id":"qwer","jsonrpc":"2.0","result":["8"]}\(aq .ft P .fi .sp \fBXML\-RPC Example\fP .sp The following example adds local file file.meta4 to aria2: .sp .nf .ft C >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.addMetalink(xmlrpclib.Binary(open(\(aqfile.meta4\(aq).read())) [\(aq8\(aq] .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.remove(gid) This method removes the download denoted by \fIgid\fP. \fIgid\fP is of type string. If specified download is in progress, it is stopped at first. The status of removed download becomes \fB"removed"\fP. This method returns GID of removed download. .sp \fBJSON\-RPC Example\fP .sp The following example removes download whose GID is "3": .sp .nf .ft C >>> import urllib2, json >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.remove\(aq, \(aqparams\(aq:[\(aq3\(aq]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> c.read() \(aq{"id":"qwer","jsonrpc":"2.0","result":"3"}\(aq .ft P .fi .sp \fBXML\-RPC Example\fP .sp The following example removes download whose GID is "3": .sp .nf .ft C >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.remove(\(aq3\(aq) \(aq3\(aq .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.forceRemove(gid) This method removes the download denoted by \fIgid\fP. This method behaves just like \fI\%aria2.remove()\fP except that this method removes download without any action which takes time such as contacting BitTorrent tracker. .UNINDENT .INDENT 0.0 .TP .B aria2.pause(gid) This method pauses the download denoted by \fIgid\fP. \fIgid\fP is of type string. The status of paused download becomes \fB"paused"\fP. If the download is active, the download is placed on the first position of waiting queue. As long as the status is \fB"paused"\fP, the download is not started. To change status to \fB"waiting"\fP, use \fI\%aria2.unpause()\fP method. This method returns GID of paused download. .UNINDENT .INDENT 0.0 .TP .B aria2.pauseAll() This method is equal to calling \fI\%aria2.pause()\fP for every active/waiting download. This methods returns \fB"OK"\fP for success. .UNINDENT .INDENT 0.0 .TP .B aria2.forcePause(pid) This method pauses the download denoted by \fIgid\fP. This method behaves just like \fI\%aria2.pause()\fP except that this method pauses download without any action which takes time such as contacting BitTorrent tracker. .UNINDENT .INDENT 0.0 .TP .B aria2.forcePauseAll() This method is equal to calling \fI\%aria2.forcePause()\fP for every active/waiting download. This methods returns \fB"OK"\fP for success. .UNINDENT .INDENT 0.0 .TP .B aria2.unpause(gid) This method changes the status of the download denoted by \fIgid\fP from \fB"paused"\fP to \fB"waiting"\fP. This makes the download eligible to restart. \fIgid\fP is of type string. This method returns GID of unpaused download. .UNINDENT .INDENT 0.0 .TP .B aria2.unpauseAll() This method is equal to calling \fI\%aria2.unpause()\fP for every active/waiting download. This methods returns \fB"OK"\fP for success. .UNINDENT .INDENT 0.0 .TP .B aria2.tellStatus(gid[, keys]) This method returns download progress of the download denoted by \fIgid\fP. \fIgid\fP is of type string. \fIkeys\fP is array of string. If it is specified, the response contains only keys in \fIkeys\fP array. If \fIkeys\fP 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("1", ["gid", "status"])\fP returns \fIgid\fP and \(aqstatus\(aq key. The response is of type struct and it contains following keys. The value type is string. .INDENT 7.0 .TP .B \fBgid\fP GID of this download. .TP .B \fBstatus\fP \fB"active"\fP for currently downloading/seeding entry. \fB"waiting"\fP for the entry in the queue; download is not started. \fB"paused"\fP for the paused entry. \fB"error"\fP for the stopped download because of error. \fB"complete"\fP for the stopped and completed download. \fB"removed"\fP for the download removed by user. .TP .B \fBtotalLength\fP Total length of this download in bytes. .TP .B \fBcompletedLength\fP Completed length of this download in bytes. .TP .B \fBuploadLength\fP Uploaded length of this download in bytes. .TP .B \fBbitfield\fP Hexadecimal representation of the download progress. The highest bit corresponds to piece index 0. The set bits indicate the piece is available and unset bits indicate the piece is missing. The spare bits at the end are set to zero. When download has not started yet, this key will not be included in the response. .TP .B \fBdownloadSpeed\fP Download speed of this download measured in bytes/sec. .TP .B \fBuploadSpeed\fP Upload speed of this download measured in bytes/sec. .TP .B \fBinfoHash\fP InfoHash. BitTorrent only. .TP .B \fBnumSeeders\fP The number of seeders the client has connected to. BitTorrent only. .TP .B \fBpieceLength\fP Piece length in bytes. .TP .B \fBnumPieces\fP The number of pieces. .TP .B \fBconnections\fP The number of peers/servers the client has connected to. .TP .B \fBerrorCode\fP The last error code occurred in this download. The value is of type string. The error codes are defined in \fI\%EXIT STATUS\fP section. This value is only available for stopped/completed downloads. .TP .B \fBfollowedBy\fP List of GIDs which are generated by the consequence of this download. For example, when aria2 downloaded Metalink file, it generates downloads described in it(see \fI\%--follow-metalink\fP option). This value is useful to track these auto generated downloads. If there is no such downloads, this key will not be included in the response. .TP .B \fBbelongsTo\fP GID of a parent download. Some downloads are a part of another download. For example, if a file in Metalink has BitTorrent resource, the download of .torrent is a part of that file. If this download has no parent, this key will not be included in the response. .TP .B \fBdir\fP Directory to save files. This key is not available for stopped downloads. .TP .B \fBfiles\fP Returns the list of files. The element of list is the same struct used in \fI\%aria2.getFiles()\fP method. .TP .B \fBbittorrent\fP Struct which contains information retrieved from .torrent file. BitTorrent only. It contains following keys. .INDENT 7.0 .TP .B \fBannounceList\fP List of lists of announce URI. If .torrent file contains announce and no announce\-list, announce is converted to announce\-list format. .TP .B \fBcomment\fP The comment for the torrent. comment.utf\-8 is used if available. .TP .B \fBcreationDate\fP The creation time of the torrent. The value is an integer since the Epoch, measured in seconds. .TP .B \fBmode\fP File mode of the torrent. The value is either \(aqsingle\(aq or \(aqmulti\(aq. .TP .B \fBinfo\fP Struct which contains data from Info dictionary. It contains following keys. .INDENT 7.0 .TP .B \fBname\fP name in info dictionary. name.utf\-8 is used if available. .UNINDENT .UNINDENT .UNINDENT .sp \fBJSON\-RPC Example\fP .sp The following example gets information about download whose GID is "1": .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.tellStatus\(aq, \(aqparams\(aq:[\(aq1\(aq]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: {u\(aqbitfield\(aq: u\(aq0000000000\(aq, u\(aqcompletedLength\(aq: u\(aq901120\(aq, u\(aqconnections\(aq: u\(aq1\(aq, u\(aqdir\(aq: u\(aq/downloads\(aq, u\(aqdownloadSpeed\(aq: u\(aq15158\(aq, u\(aqfiles\(aq: [{u\(aqindex\(aq: u\(aq1\(aq, u\(aqlength\(aq: u\(aq34896138\(aq, u\(aqcompletedLength\(aq: u\(aq34896138\(aq, u\(aqpath\(aq: u\(aq/downloads/file\(aq, u\(aqselected\(aq: u\(aqtrue\(aq, u\(aquris\(aq: [{u\(aqstatus\(aq: u\(aqused\(aq, u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]}], u\(aqgid\(aq: u\(aq1\(aq, u\(aqnumPieces\(aq: u\(aq34\(aq, u\(aqpieceLength\(aq: u\(aq1048576\(aq, u\(aqstatus\(aq: u\(aqactive\(aq, u\(aqtotalLength\(aq: u\(aq34896138\(aq, u\(aquploadLength\(aq: u\(aq0\(aq, u\(aquploadSpeed\(aq: u\(aq0\(aq}} .ft P .fi .sp The following example gets information specifying keys you are interested in: .sp .nf .ft C >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.tellStatus\(aq, \&... \(aqparams\(aq:[\(aq1\(aq, [\(aqgid\(aq, \&... \(aqtotalLength\(aq, \&... \(aqcompletedLength\(aq]]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: {u\(aqcompletedLength\(aq: u\(aq5701632\(aq, u\(aqgid\(aq: u\(aq1\(aq, u\(aqtotalLength\(aq: u\(aq34896138\(aq}} .ft P .fi .sp \fBXML\-RPC Example\fP .sp The following example gets information about download whose GID is "1": .sp .nf .ft C >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.tellStatus(\(aq1\(aq) >>> pprint(r) {\(aqbitfield\(aq: \(aqffff80\(aq, \(aqcompletedLength\(aq: \(aq34896138\(aq, \(aqconnections\(aq: \(aq0\(aq, \(aqdir\(aq: \(aq/downloads\(aq, \(aqdownloadSpeed\(aq: \(aq0\(aq, \(aqerrorCode\(aq: \(aq0\(aq, \(aqfiles\(aq: [{\(aqindex\(aq: \(aq1\(aq, \(aqlength\(aq: \(aq34896138\(aq, \(aqcompletedLength\(aq: \(aq34896138\(aq, \(aqpath\(aq: \(aq/downloads/file\(aq, \(aqselected\(aq: \(aqtrue\(aq, \(aquris\(aq: [{\(aqstatus\(aq: \(aqused\(aq, \(aquri\(aq: \(aqhttp://example.org/file\(aq}]}], \(aqgid\(aq: \(aq1\(aq, \(aqnumPieces\(aq: \(aq17\(aq, \(aqpieceLength\(aq: \(aq2097152\(aq, \(aqstatus\(aq: \(aqcomplete\(aq, \(aqtotalLength\(aq: \(aq34896138\(aq, \(aquploadLength\(aq: \(aq0\(aq, \(aquploadSpeed\(aq: \(aq0\(aq} .ft P .fi .sp The following example gets information specifying keys you are interested in: .sp .nf .ft C >>> r = s.aria2.tellStatus(\(aq1\(aq, [\(aqgid\(aq, \(aqtotalLength\(aq, \(aqcompletedLength\(aq]) >>> pprint(r) {\(aqcompletedLength\(aq: \(aq34896138\(aq, \(aqgid\(aq: \(aq1\(aq, \(aqtotalLength\(aq: \(aq34896138\(aq} .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.getUris(gid) This method returns URIs used in the download denoted by \fIgid\fP. \fIgid\fP 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. .INDENT 7.0 .TP .B \fBuri\fP URI .TP .B \fBstatus\fP \(aqused\(aq if the URI is already used. \(aqwaiting\(aq if the URI is waiting in the queue. .UNINDENT .sp \fBJSON\-RPC Example\fP .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.getUris\(aq, \(aqparams\(aq:[\(aq1\(aq]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: [{u\(aqstatus\(aq: u\(aqused\(aq, u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]} .ft P .fi .sp \fBXML\-RPC Example\fP .sp .nf .ft C >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.getUris(\(aq1\(aq) >>> pprint(r) [{\(aqstatus\(aq: \(aqused\(aq, \(aquri\(aq: \(aqhttp://example.org/file\(aq}] .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.getFiles(gid) This method returns file list of the download denoted by \fIgid\fP. \fIgid\fP 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. .INDENT 7.0 .TP .B \fBindex\fP Index of file. Starting with 1. This is the same order with the files in multi\-file torrent. .TP .B \fBpath\fP File path. .TP .B \fBlength\fP File size in bytes. .TP .B \fBcompletedLength\fP Completed length of this file in bytes. Please note that it is possible that sum of completedLength is less than completedLength in \fI\%aria2.tellStatus()\fP method. This is because completedLength in \fI\%aria2.getFiles()\fP only calculates completed pieces. On the other hand, completedLength in \fI\%aria2.tellStatus()\fP takes into account of partially completed piece. .TP .B \fBselected\fP \fB"true"\fP if this file is selected by \fI\%--select-file\fP option. If \fI\%--select-file\fP is not specified or this is single torrent or no torrent download, this value is always \fB"true"\fP. Otherwise \fB"false"\fP. .TP .B \fBuris\fP Returns the list of URI for this file. The element of list is the same struct used in \fI\%aria2.getUris()\fP method. .UNINDENT .sp \fBJSON\-RPC Example\fP .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.getFiles\(aq, \(aqparams\(aq:[\(aq1\(aq]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: [{u\(aqindex\(aq: u\(aq1\(aq, u\(aqlength\(aq: u\(aq34896138\(aq, u\(aqcompletedLength\(aq: u\(aq34896138\(aq, u\(aqpath\(aq: u\(aq/downloads/file\(aq, u\(aqselected\(aq: u\(aqtrue\(aq, u\(aquris\(aq: [{u\(aqstatus\(aq: u\(aqused\(aq, u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]}]} .ft P .fi .sp \fBXML\-RPC Example\fP .sp .nf .ft C >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.getFiles(\(aq1\(aq) >>> pprint(r) [{\(aqindex\(aq: \(aq1\(aq, \(aqlength\(aq: \(aq34896138\(aq, \(aqcompletedLength\(aq: \(aq34896138\(aq, \(aqpath\(aq: \(aq/downloads/file\(aq, \(aqselected\(aq: \(aqtrue\(aq, \(aquris\(aq: [{\(aqstatus\(aq: \(aqused\(aq, \(aquri\(aq: \(aqhttp://example.org/file\(aq}]}] .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.getPeers(gid) This method returns peer list of the download denoted by \fIgid\fP. \fIgid\fP 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. .INDENT 7.0 .TP .B \fBpeerId\fP Percent\-encoded peer ID. .TP .B \fBip\fP IP address of the peer. .TP .B \fBport\fP Port number of the peer. .TP .B \fBbitfield\fP Hexadecimal representation of the download progress of the peer. The highest bit corresponds to piece index 0. The set bits indicate the piece is available and unset bits indicate the piece is missing. The spare bits at the end are set to zero. .TP .B \fBamChoking\fP \fB"true"\fP if this client is choking the peer. Otherwise \fB"false"\fP. .TP .B \fBpeerChoking\fP \fB"true"\fP if the peer is choking this client. Otherwise \fB"false"\fP. .TP .B \fBdownloadSpeed\fP Download speed (byte/sec) that this client obtains from the peer. .TP .B \fBuploadSpeed\fP Upload speed(byte/sec) that this client uploads to the peer. .TP .B \fBseeder\fP \fB"true"\fP is this client is a seeder. Otherwise \fB"false"\fP. .UNINDENT .sp \fBJSON\-RPC Example\fP .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.getPeers\(aq, \(aqparams\(aq:[\(aq1\(aq]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: [{u\(aqamChoking\(aq: u\(aqtrue\(aq, u\(aqbitfield\(aq: u\(aqffffffffffffffffffffffffffffffffffffffff\(aq, u\(aqdownloadSpeed\(aq: u\(aq10602\(aq, u\(aqip\(aq: u\(aq10.0.0.9\(aq, u\(aqpeerChoking\(aq: u\(aqfalse\(aq, u\(aqpeerId\(aq: u\(aqaria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6\(aq, u\(aqport\(aq: u\(aq6881\(aq, u\(aqseeder\(aq: u\(aqtrue\(aq, u\(aquploadSpeed\(aq: u\(aq0\(aq}, {u\(aqamChoking\(aq: u\(aqfalse\(aq, u\(aqbitfield\(aq: u\(aqffffeff0fffffffbfffffff9fffffcfff7f4ffff\(aq, u\(aqdownloadSpeed\(aq: u\(aq8654\(aq, u\(aqip\(aq: u\(aq10.0.0.30\(aq, u\(aqpeerChoking\(aq: u\(aqfalse\(aq, u\(aqpeerId\(aq: u\(aqbittorrent client758\(aq, u\(aqport\(aq: u\(aq37842\(aq, u\(aqseeder\(aq: u\(aqfalse\(aq, u\(aquploadSpeed\(aq: u\(aq6890\(aq}]} .ft P .fi .sp \fBXML\-RPC Example\fP .sp .nf .ft C >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.getPeers(\(aq1\(aq) >>> pprint(r) [{\(aqamChoking\(aq: \(aqtrue\(aq, \(aqbitfield\(aq: \(aqffffffffffffffffffffffffffffffffffffffff\(aq, \(aqdownloadSpeed\(aq: \(aq10602\(aq, \(aqip\(aq: \(aq10.0.0.9\(aq, \(aqpeerChoking\(aq: \(aqfalse\(aq, \(aqpeerId\(aq: \(aqaria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6\(aq, \(aqport\(aq: \(aq6881\(aq, \(aqseeder\(aq: \(aqtrue\(aq, \(aquploadSpeed\(aq: \(aq0\(aq}, {\(aqamChoking\(aq: \(aqfalse\(aq, \(aqbitfield\(aq: \(aqffffeff0fffffffbfffffff9fffffcfff7f4ffff\(aq, \(aqdownloadSpeed\(aq: \(aq8654\(aq, \(aqip\(aq: \(aq10.0.0.30\(aq, \(aqpeerChoking\(aq: \(aqfalse\(aq, \(aqpeerId\(aq: \(aqbittorrent client758\(aq, \(aqport\(aq: \(aq37842\(aq, \(aqseeder\(aq: \(aqfalse, \(aquploadSpeed\(aq: \(aq6890\(aq}] .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.getServers(gid) This method returns currently connected HTTP(S)/FTP servers of the download denoted by \fIgid\fP. \fIgid\fP 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. .INDENT 7.0 .TP .B \fBindex\fP Index of file. Starting with 1. This is the same order with the files in multi\-file torrent. .TP .B \fBservers\fP The list of struct which contains following keys. .INDENT 7.0 .TP .B \fBuri\fP URI originally added. .TP .B \fBcurrentUri\fP This is the URI currently used for downloading. If redirection is involved, currentUri and uri may differ. .TP .B \fBdownloadSpeed\fP Download speed (byte/sec) .UNINDENT .UNINDENT .sp \fBJSON\-RPC Example\fP .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.getServers\(aq, \(aqparams\(aq:[\(aq1\(aq]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: [{u\(aqindex\(aq: u\(aq1\(aq, u\(aqservers\(aq: [{u\(aqcurrentUri\(aq: u\(aqhttp://example.org/file\(aq, u\(aqdownloadSpeed\(aq: u\(aq10467\(aq, u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]}]} .ft P .fi .sp \fBXML\-RPC Example\fP .sp .nf .ft C >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.getServers(\(aq1\(aq) >>> pprint(r) [{\(aqindex\(aq: \(aq1\(aq, \(aqservers\(aq: [{\(aqcurrentUri\(aq: \(aqhttp://example.org/dl/file\(aq, \(aqdownloadSpeed\(aq: \(aq20285\(aq, \(aquri\(aq: \(aqhttp://example.org/file\(aq}]}] .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.tellActive([keys]) This method returns the list of active downloads. The response is of type array and its element is the same struct returned by \fI\%aria2.tellStatus()\fP method. For \fIkeys\fP parameter, please refer to \fI\%aria2.tellStatus()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.tellWaiting(offset, num[, keys]) This method returns the list of waiting download, including paused downloads. \fIoffset\fP is of type integer and specifies the offset from the download waiting at the front. \fInum\fP is of type integer and specifies the number of downloads to be returned. For \fIkeys\fP parameter, please refer to \fI\%aria2.tellStatus()\fP method. .sp If \fIoffset\fP is a positive integer, this method returns downloads in the range of [\fIoffset\fP, \fIoffset\fP + \fInum\fP). .sp \fIoffset\fP can be a negative integer. \fIoffset\fP == \-1 points last download in the waiting queue and \fIoffset\fP == \-2 points the download before the last download, and so on. The downloads in the response are in reversed order. .sp 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"]. .sp The response is of type array and its element is the same struct returned by \fI\%aria2.tellStatus()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.tellStopped(offset, num[, keys]) This method returns the list of stopped download. \fIoffset\fP is of type integer and specifies the offset from the oldest download. \fInum\fP is of type integer and specifies the number of downloads to be returned. For \fIkeys\fP parameter, please refer to \fI\%aria2.tellStatus()\fP method. .sp \fIoffset\fP and \fInum\fP have the same semantics as \fI\%aria2.tellWaiting()\fP method. .sp The response is of type array and its element is the same struct returned by \fI\%aria2.tellStatus()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.changePosition(gid, pos, how) This method changes the position of the download denoted by \fIgid\fP. \fIpos\fP is of type integer. \fIhow\fP is of type string. If \fIhow\fP is \fB"POS_SET"\fP, it moves the download to a position relative to the beginning of the queue. If \fIhow\fP is \fB"POS_CUR"\fP, it moves the download to a position relative to the current position. If \fIhow\fP is \fB"POS_END"\fP, 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. .sp For example, if GID#1 is placed in position 3, \fBaria2.changePosition(\(aq1\(aq, \-1, \(aqPOS_CUR\(aq)\fP will change its position to 2. Additional \fBaria2.changePosition(\(aq1\(aq, 0, \(aqPOS_SET\(aq)\fP will change its position to 0(the beginning of the queue). .sp \fBJSON\-RPC Example\fP .sp The following example moves the download whose GID is "3" to the front of the waiting queue: .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.changePosition\(aq, \&... \(aqparams\(aq:[\(aq3\(aq, 0, \(aqPOS_SET\(aq]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: 0} .ft P .fi .sp \fBXML\-RPC Example\fP .sp The following example moves the download whose GID is "3" to the front of the waiting queue: .sp .nf .ft C >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.changePosition(\(aq3\(aq, 0, \(aqPOS_SET\(aq) 0 .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.changeUri(gid, fileIndex, delUris, addUris[, position]) This method removes URIs in \fIdelUris\fP from and appends URIs in \fIaddUris\fP to download denoted by \fIgid\fP. \fIdelUris\fP and \fIaddUris\fP are list of string. A download can contain multiple files and URIs are attached to each file. \fIfileIndex\fP is used to select which file to remove/attach given URIs. \fIfileIndex\fP is 1\-based. \fIposition\fP is used to specify where URIs are inserted in the existing waiting URI list. \fIposition\fP is 0\-based. When \fIposition\fP is omitted, URIs are appended to the back of the list. This method first execute removal and then addition. \fIposition\fP 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\fP. In other words, there are three URIs \fBhttp://example.org/aria2\fP and you want remove them all, you have to specify (at least) 3 \fBhttp://example.org/aria2\fP in \fIdelUris\fP. 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. .sp \fBJSON\-RPC Example\fP .sp 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": .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.changeUri\(aq, \&... \(aqparams\(aq:[\(aq2\(aq, 1, [], [\(aqhttp://example.org/file\(aq]]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: [0, 1]} .ft P .fi .sp \fBXML\-RPC Example\fP .sp 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": .sp .nf .ft C >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.changeUri(\(aq2\(aq, 1, [], [\(aqhttp://example.org/file\(aq]) [0, 1] .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.getOption(gid) This method returns options of the download denoted by \fIgid\fP. The response is of type struct. Its key is the name of option. The value type is string. Note that this method does not return options which have no default value and have not been set by the command\-line options, configuration files or RPC methods. .sp \fBJSON\-RPC Example\fP .sp The following example gets options of the download whose GID is "1": .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.getOption\(aq, \(aqparams\(aq:[\(aq1\(aq]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: {u\(aqallow\-overwrite\(aq: u\(aqfalse\(aq, u\(aqallow\-piece\-length\-change\(aq: u\(aqfalse\(aq, u\(aqalways\-resume\(aq: u\(aqtrue\(aq, u\(aqasync\-dns\(aq: u\(aqtrue\(aq, ... .ft P .fi .sp \fBXML\-RPC Example\fP .sp The following example gets options of the download whose GID is "1": .sp .nf .ft C >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.getOption(\(aq1\(aq) >>> pprint(r) {\(aqallow\-overwrite\(aq: \(aqfalse\(aq, \(aqallow\-piece\-length\-change\(aq: \(aqfalse\(aq, \(aqalways\-resume\(aq: \(aqtrue\(aq, \(aqasync\-dns\(aq: \(aqtrue\(aq, .... .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.changeOption(gid, options) This method changes options of the download denoted by \fIgid\fP dynamically. \fIgid\fP is of type string. \fIoptions\fP is of type struct. The following options are available for active downloads: .INDENT 7.0 .IP \(bu 2 \fI\%bt-max-peers\fP .IP \(bu 2 \fI\%bt-request-peer-speed-limit\fP .IP \(bu 2 \fI\%bt-remove-unselected-file\fP .IP \(bu 2 \fI\%max-download-limit\fP .IP \(bu 2 \fI\%max-upload-limit\fP .UNINDENT .sp For waiting or paused downloads, in addition to the above options, options listed in \fI\%Input File\fP subsection are available, except for following options: \fI\%dry-run\fP, \fI\%metalink-base-uri\fP, \fI\%parameterized-uri\fP, \fI\%pause\fP and \fI\%piece-length\fP. This method returns \fB"OK"\fP for success. .sp \fBJSON\-RPC Example\fP .sp The following example sets \fI\%max-download-limit\fP option to \fB"20K"\fP for the download whose GID is "1": .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.changeOption\(aq, \&... \(aqparams\(aq:[\(aq1\(aq, {\(aqmax\-download\-limit\(aq:\(aq10K\(aq}]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aqOK\(aq} .ft P .fi .sp \fBXML\-RPC Example\fP .sp The following example sets \fI\%max-download-limit\fP option to \fB"20K"\fP for the download whose GID is "1": .sp .nf .ft C >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.changeOption(\(aq1\(aq, {\(aqmax\-download\-limit\(aq:\(aq20K\(aq}) \(aqOK\(aq .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.getGlobalOption() This method returns global options. The response is of type struct. Its key is the name of option. The value type is string. Note that this method does not return options which have no default value and have not been set by the command\-line options, configuration files or RPC methods. Because global options are used as a template for the options of newly added download, the response contains keys returned by \fI\%aria2.getOption()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.changeGlobalOption(options) This method changes global options dynamically. \fIoptions\fP is of type struct. The following options are available: .INDENT 7.0 .IP \(bu 2 \fI\%download-result\fP .IP \(bu 2 \fI\%log\fP .IP \(bu 2 \fI\%log-level\fP .IP \(bu 2 \fI\%max-concurrent-downloads\fP .IP \(bu 2 \fI\%max-download-result\fP .IP \(bu 2 \fI\%max-overall-download-limit\fP .IP \(bu 2 \fI\%max-overall-upload-limit\fP .IP \(bu 2 \fI\%save-cookies\fP .IP \(bu 2 \fI\%save-session\fP .IP \(bu 2 \fI\%server-stat-of\fP .UNINDENT .sp In addition to them, options listed in \fI\%Input File\fP subsection are available, except for following options: \fI\%checksum\fP, \fI\%index-out\fP, \fI\%out\fP, \fI\%pause\fP and \fI\%select-file\fP. .sp Using \fI\%log\fP 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 \fB"OK"\fP for success. .UNINDENT .INDENT 0.0 .TP .B aria2.getGlobalStat() This method returns global statistics such as overall download and upload speed. The response is of type struct and contains following keys. The value type is string. .INDENT 7.0 .TP .B \fBdownloadSpeed\fP Overall download speed (byte/sec). .TP .B \fBuploadSpeed\fP Overall upload speed(byte/sec). .TP .B \fBnumActive\fP The number of active downloads. .TP .B \fBnumWaiting\fP The number of waiting downloads. .TP .B \fBnumStopped\fP The number of stopped downloads. .UNINDENT .sp \fBJSON\-RPC Example\fP .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.getGlobalStat\(aq}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: {u\(aqdownloadSpeed\(aq: u\(aq21846\(aq, u\(aqnumActive\(aq: u\(aq2\(aq, u\(aqnumStopped\(aq: u\(aq0\(aq, u\(aqnumWaiting\(aq: u\(aq0\(aq, u\(aquploadSpeed\(aq: u\(aq0\(aq}} .ft P .fi .sp \fBXML\-RPC Example\fP .sp .nf .ft C >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.getGlobalStat() >>> pprint(r) {\(aqdownloadSpeed\(aq: \(aq23136\(aq, \(aqnumActive\(aq: \(aq2\(aq, \(aqnumStopped\(aq: \(aq0\(aq, \(aqnumWaiting\(aq: \(aq0\(aq, \(aquploadSpeed\(aq: \(aq0\(aq} .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.purgeDownloadResult() This method purges completed/error/removed downloads to free memory. This method returns \fB"OK"\fP. .UNINDENT .INDENT 0.0 .TP .B aria2.removeDownloadResult(gid) This method removes completed/error/removed download denoted by \fIgid\fP from memory. This method returns \fB"OK"\fP for success. .sp \fBJSON\-RPC Example\fP .sp The following example removes the download result of the download whose GID is "1": .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.removeDownloadResult\(aq, \&... \(aqparams\(aq:[\(aq1\(aq]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aqOK\(aq} .ft P .fi .sp \fBXML\-RPC Example\fP .sp The following example removes the download result of the download whose GID is "1": .sp .nf .ft C >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.removeDownloadResult(\(aq1\(aq) \(aqOK\(aq .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.getVersion() This method returns version of the program and the list of enabled features. The response is of type struct and contains following keys. .INDENT 7.0 .TP .B \fBversion\fP Version number of the program in string. .TP .B \fBenabledFeatures\fP List of enabled features. Each feature name is of type string. .UNINDENT .sp \fBJSON\-RPC Example\fP .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.getVersion\(aq}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: {u\(aqenabledFeatures\(aq: [u\(aqAsync DNS\(aq, u\(aqBitTorrent\(aq, u\(aqFirefox3 Cookie\(aq, u\(aqGZip\(aq, u\(aqHTTPS\(aq, u\(aqMessage Digest\(aq, u\(aqMetalink\(aq, u\(aqXML\-RPC\(aq], u\(aqversion\(aq: u\(aq1.11.0\(aq}} .ft P .fi .sp \fBXML\-RPC Example\fP .sp .nf .ft C >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.getVersion() >>> pprint(r) {\(aqenabledFeatures\(aq: [\(aqAsync DNS\(aq, \(aqBitTorrent\(aq, \(aqFirefox3 Cookie\(aq, \(aqGZip\(aq, \(aqHTTPS\(aq, \(aqMessage Digest\(aq, \(aqMetalink\(aq, \(aqXML\-RPC\(aq], \(aqversion\(aq: \(aq1.11.0\(aq} .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.getSessionInfo() This method returns session information. The response is of type struct and contains following key. .INDENT 7.0 .TP .B \fBsessionId\fP Session ID, which is generated each time when aria2 is invoked. .UNINDENT .sp \fBJSON\-RPC Example\fP .sp .nf .ft C >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.getSessionInfo\(aq}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: {u\(aqsessionId\(aq: u\(aqcd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9\(aq}} .ft P .fi .sp \fBXML\-RPC Example\fP .sp .nf .ft C >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.getSessionInfo() {\(aqsessionId\(aq: \(aqcd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9\(aq} .ft P .fi .UNINDENT .INDENT 0.0 .TP .B aria2.shutdown() This method shutdowns aria2. This method returns \fB"OK"\fP. .UNINDENT .INDENT 0.0 .TP .B aria2.forceShutdown() This method shutdowns \fBaria2. This method behaves like aria2.shutdown()\fP except that any actions which takes time such as contacting BitTorrent tracker are skipped. This method returns \fB"OK"\fP. .UNINDENT .INDENT 0.0 .TP .B system.multicall(methods) This methods encapsulates multiple method calls in a single request. \fImethods\fP is of type array and its element is struct. The struct contains two keys: \fBmethodName\fP and \fBparams\fP. \fBmethodName\fP is the method name to call and \fBparams\fP 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. .sp \fBJSON\-RPC Example\fP .sp In the following example, we add 2 downloads. First one is http://example.org/file and second one is file.torrent: .sp .nf .ft C >>> import urllib2, json, base64 >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqsystem.multicall\(aq, \&... \(aqparams\(aq:[[{\(aqmethodName\(aq:\(aqaria2.addUri\(aq, \&... \(aqparams\(aq:[[\(aqhttp://example.org\(aq]]}, \&... {\(aqmethodName\(aq:\(aqaria2.addTorrent\(aq, \&... \(aqparams\(aq:[base64.b64encode(open(\(aqfile.torrent\(aq).read())]}]]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) {u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: [[u\(aq1\(aq], [u\(aq2\(aq]]} .ft P .fi .sp JSON\-RPC also supports Batch request described in JSON\-RPC 2.0 Specification: .sp .nf .ft C >>> jsonreq = json.dumps([{\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.addUri\(aq, \&... \(aqparams\(aq:[[\(aqhttp://example.org\(aq]]}, \&... {\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqasdf\(aq, \&... \(aqmethod\(aq:\(aqaria2.addTorrent\(aq, \&... \(aqparams\(aq:[base64.b64encode(open(\(aqfile.torrent\(aq).read())]}]) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> pprint(json.loads(c.read())) [{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aq1\(aq}, {u\(aqid\(aq: u\(aqasdf\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aq2\(aq}] .ft P .fi .sp \fBXML\-RPC Example\fP .sp In the following example, we add 2 downloads. First one is http://example.org/file and second one is file.torrent: .sp .nf .ft C >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> mc = xmlrpclib.MultiCall(s) >>> mc.aria2.addUri([\(aqhttp://example.org/file\(aq]) >>> mc.aria2.addTorrent(xmlrpclib.Binary(open(\(aqfile.torrent\(aq).read())) >>> r = mc() >>> tuple(r) (\(aq2\(aq, \(aq3\(aq) .ft P .fi .UNINDENT .SS Error Handling .sp In JSON\-RPC, aria2 returns JSON object which contains error code in code and the error message in message. .sp In XML\-RPC, aria2 returns faultCode=1 and the error message in faultString. .SS Options .sp Same options for \fI\%--input-file\fP list are available. See \fI\%Input File\fP subsection for complete list of options. .sp In the option struct, name element is option name(without preceding \fB\-\-\fP) and value element is argument as string. .SS JSON\-RPC Example .sp .nf .ft C {\(aqsplit\(aq:\(aq1\(aq, \(aqhttp\-proxy\(aq:\(aqhttp://proxy/\(aq} .ft P .fi .SS XML\-RPC Example .sp .nf .ft C split 1 http\-proxy http://proxy/ .ft P .fi .sp \fI\%header\fP and \fI\%index-out\fP option are allowed multiple times in command\-line. Since name should be unique in struct(many XML\-RPC library implementation uses hash or dict for struct), single string is not enough. To overcome this situation, they can take array as value as well as string. .SS JSON\-RPC Example .sp .nf .ft C {\(aqheader\(aq:[\(aqAccept\-Language: ja\(aq, \(aqAccept\-Charset: utf\-8\(aq]} .ft P .fi .SS XML\-RPC Example .sp .nf .ft C header Accept\-Language: ja Accept\-Charset: utf\-8 .ft P .fi .sp Following example adds a download with 2 options: dir and header. header option has 2 values, so it uses a list: .sp .nf .ft C >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> opts = dict(dir=\(aq/tmp\(aq, \&... header=[\(aqAccept\-Language: ja\(aq, \&... \(aqAccept\-Charset: utf\-8\(aq]) >>> s.aria2.addUri([\(aqhttp://example.org/file\(aq], opts) \(aq1\(aq .ft P .fi .SS JSON\-RPC using HTTP GET .sp The JSON\-RPC interface also supports request via HTTP GET. The encoding scheme in GET parameters is based on JSON\-RPC over HTTP Specification [2008\-1\-15(RC1)]. The encoding of GET parameters are follows: .sp .nf .ft C /jsonrpc?method=METHOD_NAME&id=ID¶ms=BASE64_ENCODED_PARAMS .ft P .fi .sp The \fBmethod\fP and \fBid\fP are always treated as JSON string and their encoding must be UTF\-8. .sp For example, The encoded string of aria2.tellStatus(\(aq3\(aq) with id=\(aqfoo\(aq looks like this: .sp .nf .ft C /jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIzIl0%3D .ft P .fi .sp The \fBparams\fP parameter is Base64\-encoded JSON array which usually appears in \fBparams\fP attribute in JSON\-RPC request object. In the above example, the params is [\(aq3\(aq], therefore: .sp .nf .ft C [\(aq3\(aq] \-\-(Base64)\-\-> WyIzIl0= \-\-(Percent Encode)\-\-> WyIzIl0%3D .ft P .fi .sp The JSON\-RPC interface supports JSONP. You can specify the callback function in \(aqjsoncallback\(aq parameter: .sp .nf .ft C /jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIzIl0%3D&jsoncallback=cb .ft P .fi .sp For Batch request, \fBmethod\fP and \fBid\fP parameter must not be specified. Whole request must be specified in \fBparams\fP parameter. For example, Batch request: .sp .nf .ft C [{\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \(aqmethod\(aq:\(aqaria2.getVersion\(aq}, {\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqasdf\(aq, \(aqmethod\(aq:\(aqaria2.tellActive\(aq}] .ft P .fi .sp will be encoded like this: .sp .nf .ft C /jsonrpc?params=W3sianNvbnJwYyI6ICIyLjAiLCAiaWQiOiAicXdlciIsICJtZXRob2QiOiAiYXJpYTIuZ2V0VmVyc2lvbiJ9LCB7Impzb25ycGMiOiAiMi4wIiwgImlkIjogImFzZGYiLCAibWV0aG9kIjogImFyaWEyLnRlbGxBY3RpdmUifV0%3D .ft P .fi .SS JSON\-RPC over WebSocket .sp JSON\-RPC over WebSocket uses same method signatures and response format with JSON\-RPC over HTTP. The supported WebSocket version is 13 which is detailed in \fI\%RFC 6455\fP. .sp To send a RPC request to the RPC server, send serialized JSON string in Text frame. The response from the RPC server is delivered also in Text frame. .sp The RPC server will send the notification to the client. The notification is unidirectional, therefore the client which received the notification must not respond to it. The method signature of notification is much like a normal method request but lacks id key. The value associated by the params key is the data which this notification carries. The format of this value varies depending on the notification method. Following notification methods are defined. .INDENT 0.0 .TP .B aria2.onDownloadStart(event) This notification will be sent if a download is started. The \fIevent\fP is of type struct and it contains following keys. The value type is string. .INDENT 7.0 .TP .B \fBgid\fP GID of the download. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.onDownloadPause(event) This notification will be sent if a download is paused. The \fIevent\fP is the same struct of the \fIevent\fP argument of \fI\%aria2.onDownloadStart()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.onDownloadStop(event) This notification will be sent if a download is stopped by the user. The \fIevent\fP is the same struct of the \fIevent\fP argument of \fI\%aria2.onDownloadStart()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.onDownloadComplete(event) This notification will be sent if a download is completed. In BitTorrent downloads, this notification is sent when the download is completed and seeding is over. The \fIevent\fP is the same struct of the \fIevent\fP argument of \fI\%aria2.onDownloadStart()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.onDownloadError(event) This notification will be sent if a download is stopped due to error. The \fIevent\fP is the same struct of the \fIevent\fP argument of \fI\%aria2.onDownloadStart()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.onBtDownloadComplete(event) This notification will be sent if a download is completed in BitTorrent (but seeding may not be over). The \fIevent\fP is the same struct of the \fIevent\fP argument of \fI\%aria2.onDownloadStart()\fP method. .UNINDENT .SS Sample XML\-RPC Client Code .sp The following Ruby script adds \fBhttp://localhost/aria2.tar.bz2\fP to aria2c operated on localhost with option \fI\%--dir=/downloads\fP and prints its reponse: .sp .nf .ft C #!/usr/bin/env ruby require \(aqxmlrpc/client\(aq require \(aqpp\(aq client=XMLRPC::Client.new2("http://localhost:6800/rpc") options={ "dir" => "/downloads" } result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options) pp result .ft P .fi .sp If you are a Python lover, you can use xmlrpclib(for Python3.x, use xmlrpc.client instead) to interact with aria2: .sp .nf .ft C 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) .ft P .fi .SH EXAMPLE .SS HTTP/FTP Segmented Download .SS Download a file .sp .nf .ft C $ aria2c "http://host/file.zip" .ft P .fi .IP Note To stop a download, press \fBCtrl\-C\fP. You can resume the transfer by running aria2c with the same argument in the same directory. You can change URIs as long as they are pointing to the same file. .RE .SS Download a file from 2 different HTTP servers .sp .nf .ft C $ aria2c "http://host/file.zip" "http://mirror/file.zip" .ft P .fi .SS Download a file from 1 host using 2 connections .sp .nf .ft C $ aria2c \-x2 \-k1M "http://host/file.zip" .ft P .fi .SS Download a file from HTTP and FTP servers .sp .nf .ft C $ aria2c "http://host1/file.zip" "ftp://host2/file.zip" .ft P .fi .SS Download files listed in a text file concurrently .sp .nf .ft C $ aria2c \-ifiles.txt \-j2 .ft P .fi .IP Note \-j option specifies the number of parallel downloads. .RE .SS Using proxy .sp For HTTP: .sp .nf .ft C $ aria2c \-\-http\-proxy="http://proxy:8080" "http://host/file" .ft P .fi .sp .nf .ft C $ aria2c \-\-http\-proxy="http://proxy:8080" \-\-no\-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://host/file" .ft P .fi .sp For FTP: .sp .nf .ft C $ aria2c \-\-ftp\-proxy="http://proxy:8080" "ftp://host/file" .ft P .fi .IP Note See \fI\%--http-proxy\fP, \fI\%--https-proxy\fP, \fI\%--ftp-proxy\fP, \fI\%--all-proxy\fP and \fI\%--no-proxy\fP for details. You can specify proxy in the environment variables. See \fI\%ENVIRONMENT\fP section. .RE .SS Proxy with authorization .sp .nf .ft C $ aria2c \-\-http\-proxy="http://username:password@proxy:8080" "http://host/file" .ft P .fi .sp .nf .ft C $ aria2c \-\-http\-proxy="http://proxy:8080" \-\-http\-proxy\-user="username" \-\-http\-proxy\-passwd="password" "http://host/file" .ft P .fi .SS Metalink Download .SS Download files with remote Metalink .sp .nf .ft C $ aria2c \-\-follow\-metalink=mem "http://host/file.metalink" .ft P .fi .SS Download using a local metalink file .sp .nf .ft C $ aria2c \-p \-\-lowest\-speed\-limit=4000 file.metalink .ft P .fi .IP Note To stop a download, press \fBCtrl\-C\fP. You can resume the transfer by running aria2c with the same argument in the same directory. .RE .SS Download several local metalink files .sp .nf .ft C $ aria2c \-j2 file1.metalink file2.metalink .ft P .fi .SS Download only selected files using index .sp .nf .ft C $ aria2c \-\-select\-file=1\-4,8 file.metalink .ft P .fi .IP Note The index is printed to the console using \-S option. .RE .SS Download a file using a local .metalink file with user preference .sp .nf .ft C $ aria2c \-\-metalink\-location=jp,us \-\-metalink\-version=1.1 \-\-metalink\-language=en\-US file.metalink .ft P .fi .SS BitTorrent Download .SS Download files from remote BitTorrent file .sp .nf .ft C $ aria2c \-\-follow\-torrent=mem "http://host/file.torrent" .ft P .fi .SS Download using a local torrent file .sp .nf .ft C $ aria2c \-\-max\-upload\-limit=40K file.torrent .ft P .fi .IP Note \-\-max\-upload\-limit specifies the max of upload rate. .RE .IP Note To stop a download, press \fBCtrl\-C\fP. You can resume the transfer by running aria2c with the same argument in the same directory. .RE .SS Download using BitTorrent Magnet URI .sp .nf .ft C $ aria2c "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C&dn=aria2" .ft P .fi .IP Note Don\(aqt forget to quote BitTorrent Magnet URI which includes \fB&\fP character with single(\fB\(aq\fP) or double(\fB"\fP) quotation. .RE .SS Download 2 torrents .sp .nf .ft C $ aria2c \-j2 file1.torrent file2.torrent .ft P .fi .SS Download a file using torrent and HTTP/FTP server .sp .nf .ft C $ aria2c \-Ttest.torrent "http://host1/file" "ftp://host2/file" .ft P .fi .IP Note Downloading multi file torrent with HTTP/FTP is not supported. .RE .SS Download only selected files using index(usually called "selectable download") .sp .nf .ft C $ aria2c \-\-select\-file=1\-4,8 file.torrent .ft P .fi .IP Note The index is printed to the console using \-S option. .RE .SS Specify output filename .sp To specify output filename for BitTorrent downloads, you need to know the index of file in torrent file using \fI\%--show-files\fP option. For example, the output looks like this: .sp .nf .ft C idx|path/length ===+====================== 1|dist/base\-2.6.18.iso |99.9MiB \-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 2|dist/driver\-2.6.18.iso |169.0MiB \-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .ft P .fi .sp To save \(aqdist/base\-2.6.18.iso\(aq in \(aq/tmp/mydir/base.iso\(aq and \(aqdist/driver\-2.6.18.iso\(aq in \(aq/tmp/dir/driver.iso\(aq, use the following command: .sp .nf .ft C $ aria2c \-\-dir=/tmp \-\-index\-out=1=mydir/base.iso \-\-index\-out=2=dir/driver.iso file.torrent .ft P .fi .SS Change the listening port for incoming peer .sp .nf .ft C $ aria2c \-\-listen\-port=7000\-7001,8000 file.torrent .ft P .fi .IP Note Since aria2 doesn\(aqt configure firewall or router for port forwarding, it\(aqs up to you to do it manually. .RE .SS Specify the condition to stop program after torrent download finished .sp .nf .ft C $ aria2c \-\-seed\-time=120 \-\-seed\-ratio=1.0 file.torrent .ft P .fi .IP Note In the above example, the program exits when the 120 minutes has elapsed since download completed or seed ratio reaches 1.0. .RE .SS Throttle upload speed .sp .nf .ft C $ aria2c \-\-max\-upload\-limit=100K file.torrent .ft P .fi .SS Enable IPv4 DHT .sp .nf .ft C $ aria2c \-\-enable\-dht \-\-dht\-listen\-port=6881 file.torrent .ft P .fi .IP Note DHT uses udp port. Since aria2 doesn\(aqt configure firewall or router for port forwarding, it\(aqs up to you to do it manually. .RE .SS Enable IPv6 DHT .sp .nf .ft C $ aria2c \-\-enable\-dht6 \-\-dht\-listen\-port=6881 \-\-dht\-listen\-addr6=YOUR_GLOBAL_UNICAST_IPV6_ADDR \-\-enable\-async\-dns6 .ft P .fi .IP Note If aria2c is not built with c\-ares, \fI\%--enable-async-dns6\fP is unnecessary. aria2 shares same port between IPv4 and IPv6 DHT. .RE .SS Add and remove tracker URI .sp Removes all tracker announce URIs described in file.torrent and use \fBhttp://tracker1/announce\fP and \fBhttp://tracker2/announce\fP instead: .sp .nf .ft C $ aria2c \-\-bt\-exclude\-tracker="*" \-\-bt\-tracker="http://tracker1/announce,http://tracker2/announce" file.torrent .ft P .fi .SS More advanced HTTP features .SS Load cookies .sp .nf .ft C $ aria2c \-\-load\-cookies=cookies.txt "http://host/file.zip" .ft P .fi .IP Note You can use Firefox/Mozilla/Chromium\(aqs cookie file without modification. .RE .SS Resume download started by web browsers or another programs .sp .nf .ft C $ aria2c \-c \-s2 "http://host/partiallydownloadedfile.zip" .ft P .fi .SS Client certificate authorization for SSL/TLS .sp .nf .ft C $ aria2c \-\-certificate=/path/to/mycert.pem \-\-private\-key=/path/to/mykey.pem https://host/file .ft P .fi .IP Note The file specified in \fI\%--private-key\fP must be decrypted. The behavior when encrypted one is given is undefined. .RE .SS Verify peer in SSL/TLS using given CA certificates .sp .nf .ft C $ aria2c \-\-ca\-certificate=/path/to/ca\-certificates.crt \-\-check\-certificate https://host/file .ft P .fi .SS And more advanced features .SS Throttle download speed .sp .nf .ft C $ aria2c \-\-max\-download\-limit=100K file.metalink .ft P .fi .SS Repair a damaged download .sp .nf .ft C $ aria2c \-V file.metalink .ft P .fi .IP Note Repairing damaged downloads can be done efficiently when used with BitTorrent or Metalink with chunk checksums. .RE .SS Drop connection if download speed is lower than specified value .sp .nf .ft C $ aria2c \-\-lowest\-speed\-limit=10K file.metalink .ft P .fi .SS Parameterized URI support .sp You can specify set of parts: .sp .nf .ft C $ aria2c \-P "http://{host1,host2,host3}/file.iso" .ft P .fi .sp You can specify numeric sequence: .sp .nf .ft C $ aria2c \-Z \-P "http://host/image[000\-100].png" .ft P .fi .IP Note \-Z option is required if the all URIs don\(aqt point to the same file, such as the above example. .RE .sp You can specify step counter: .sp .nf .ft C $ aria2c \-Z \-P "http://host/image[A\-Z:2].png" .ft P .fi .SS Verify checksum .sp .nf .ft C $ aria2c \-\-checksum=sha\-1=0192ba11326fe2298c8cb4de616f4d4140213837 http://example.org/file .ft P .fi .SS Parallel downloads of arbitrary number of URI,metalink,torrent .sp .nf .ft C $ aria2c \-j3 \-Z "http://host/file1" file2.torrent file3.metalink .ft P .fi .SS BitTorrent Encryption .sp Encrypt whole payload using ARC4: .sp .nf .ft C $ aria2c \-\-bt\-min\-crypto\-level=arc4 \-\-bt\-require\-crypto=true file.torrent .ft P .fi .SH SEE ALSO .sp Project Web Site: \fI\%http://aria2.sourceforge.net/\fP .sp aria2 Wiki: \fI\%http://sourceforge.net/apps/trac/aria2/wiki\fP .sp Metalink Homepage: \fI\%http://www.metalinker.org/\fP .sp The Metalink Download Description Format: \fI\%RFC 5854\fP .SH COPYRIGHT .sp Copyright (C) 2006, 2011 Tatsuhiro Tsujikawa .sp This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .sp This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .sp You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110\-1301 USA .sp In addition, as a special exception, the copyright holders give permission to link the code of portions of this program with the OpenSSL library under certain conditions as described in each individual source file, and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than OpenSSL. If you modify file(s) with this exception, you may extend this exception to your version of the file(s), but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. If you delete this exception statement from all source files in the program, then also delete it here. .\" Generated by docutils manpage writer. .\" .