.\" Man page generated from reStructuredText. . . .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 .. .TH "ARIA2C" "1" "Nov 15, 2023" "1.37.0" "aria2" .SH NAME aria2c \- The ultra fast download utility .SH SYNOPSIS .sp \fBaria2c\fP [] [|||] ... .SH DESCRIPTION .sp aria2 is a utility for downloading files. The supported protocols are HTTP(S), FTP, SFTP, 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 /SFTP and BitTorrent at the same time, while the data downloaded from HTTP(S)/FTP/SFTP is uploaded to the BitTorrent swarm. Using Metalink chunk checksums, aria2 automatically validates chunks of data while downloading a file. .SH OPTIONS .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Most FTP related options are applicable to SFTP as well. Some options are not effective against SFTP (e.g., \fI\%\-\-ftp\-pasv\fP) .UNINDENT .UNINDENT .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 the URIs listed in \fBFILE\fP\&. You can specify multiple sources for a single entity by putting multiple URIs on a single line separated by the \fBTAB\fP character. Additionally, options can be specified after each URI line. Option lines must start with one or more white space characters (\fBSPACE\fP or \fBTAB\fP) and must only contain one option per line. Input files can use gzip compression. When \fBFILE\fP is specified as \fB\-\fP, aria2 will read the input from \fBstdin\fP\&. See the \fI\%Input File\fP subsection for details. See also the \fI\%\-\-deferred\-input\fP option. See also the \fI\%\-\-save\-session\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 \fBstdout\fP\&. If empty string(\(dq\(dq) is specified, or this option is omitted, no log is written to disk at all. .UNINDENT .INDENT 0.0 .TP .B \-j, \-\-max\-concurrent\-downloads= Set the maximum number of parallel downloads for every queue item. See also the \fI\%\-\-split\fP option. Default: \fB5\fP .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 \fI\%\-\-max\-concurrent\-downloads\fP limits the number of items which are downloaded concurrently. \fI\%\-\-split\fP and \fI\%\-\-min\-split\-size\fP affect the number of connections inside each item. Imagine that you have an input file (see \fI\%\-\-input\-file\fP option) like this: .INDENT 0.0 .INDENT 3.5 .sp .EX http://example.com/foo http://example.com/bar .EE .UNINDENT .UNINDENT .sp Here is 2 download items. aria2 can download these items concurrently if the value more than or equal 2 is given to \fI\%\-\-max\-concurrent\-downloads\fP\&. In each download item, you can configure the number of connections using \fI\%\-\-split\fP and/or \fI\%\-\-min\-split\-size\fP, etc. .UNINDENT .UNINDENT .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/SFTP Options .INDENT 0.0 .TP .B \-\-all\-proxy= Use a proxy server for all protocols. To override a previously defined proxy, use \(dq\(dq. You also 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 downloads. The format of PROXY is \fB[http://][USER:PASSWORD@]HOST[:PORT]\fP\&. See also \fI\%ENVIRONMENT\fP section. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 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 specified later override prior options. For example, if you specified \fBhttp\-proxy\-user=myname\fP, \fBhttp\-proxy\-passwd=mypass\fP in aria2.conf and you specified \fB\-\-http\-proxy=\(dqhttp://proxy\(dq\fP on the command\-line, then you\(aqd get HTTP proxy \fBhttp://proxy\fP with user \fBmyname\fP and password \fBmypass\fP\&. .sp Another example: if you specified on the command\-line \fB\-\-http\-proxy=\(dqhttp://user:pass@proxy\(dq \-\-http\-proxy\-user=\(dqmyname\(dq \-\-http\-proxy\-passwd=\(dqmypass\(dq\fP, then you\(aqd 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=\(dqmyname\(dq \-\-http\-proxy\-passwd=\(dqmypass\(dq \-\-http\-proxy=\(dqhttp://user:pass@proxy\(dq\fP, then you\(aqd get HTTP proxy \fBhttp://proxy\fP with user \fBuser\fP and password \fBpass\fP\&. .UNINDENT .UNINDENT .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 \(dqfile not found\(dq 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. The number of retry attempt is counted toward \fI\%\-\-max\-tries\fP, so it should be configured too. .sp 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 \-\-netrc\-path= Specify the path to the netrc file. Default: \fB$(HOME)/.netrc\fP .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 Permission of the .netrc file must be 600. Otherwise, the file will be ignored. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-n, \-\-no\-netrc [true|false] Disables netrc support. netrc support is enabled by default. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 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\&. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-no\-proxy= Specify a comma separated list of host names, domains and network addresses with or without a subnet mask where no proxy should be used. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 For network addresses with a subnet mask, both IPv4 and IPv6 addresses work. The current implementation does not resolve the host name in an URI to compare network addresses specified in \fI\%\-\-no\-proxy\fP\&. So it is only effective if URI has numeric IP addresses. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-o, \-\-out= The file name of the downloaded file. It is always relative to the directory given in \fI\%\-\-dir\fP option. When the \fI\%\-\-force\-sequential\fP option is used, this option is ignored. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 You cannot specify a file name for Metalink or BitTorrent downloads. The file name specified here is only used when the URIs fed to aria2 are given on the command line directly, but not when using \fI\%\-\-input\-file\fP, \fI\%\-\-force\-sequential\fP option. .sp Example: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-o myfile.zip \(dqhttp://mirror1/file.zip\(dq \(dqhttp://mirror2/file.zip\(dq .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .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. When \fBSEC > 0\fP, aria2 will retry downloads when the HTTP server returns a 503 response. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-\-server\-stat\-of= Specify the file name 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 file name 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 the \fI\%\-\-max\-connection\-per\-server\fP option. See also the \fI\%\-\-min\-split\-size\fP option. Default: \fB5\fP .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 Some Metalinks regulate the number of servers to connect. aria2 strictly respects them. This means that if Metalink defines the \fBmaxconnections\fP attribute lower than N, then aria2 uses the value of this lower value instead of N. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-stream\-piece\-selector= Specify piece selection algorithm used in HTTP/FTP download. A piece is a fixed length segment which is downloaded in parallel in a segmented download. Default: \fBdefault\fP\&. .INDENT 7.0 .TP .B default Select a piece to reduce the number of connections established. This is reasonable default behavior because establishing a connection is an expensive operation. .TP .B inorder Select a piece closest to the beginning of the file. This is useful for viewing movies while downloading. \fI\%\-\-enable\-http\-pipelining\fP option may be useful to reduce re\-connection overhead. 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. .TP .B random Select a piece randomly. Like \fBinorder\fP, \fI\%\-\-min\-split\-size\fP option is honored. .TP .B geom When starting to download a file, select a piece closest to the beginning of the file like \fBinorder\fP, but then exponentially increases space between pieces. This reduces the number of connections established, while at the same time downloads the beginning part of the file first. This is useful for viewing movies while downloading. .UNINDENT .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. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 If you build with OpenSSL or the recent version of GnuTLS which has \fBgnutls_certificate_set_x509_system_trust()\fP function and the library is properly configured to locate the system\-wide CA certificates store, aria2 will automatically load those certificates at the startup. .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 \fIWinTLS\fP and \fIAppleTLS\fP do not support this option. Instead you will have to import the certificate into the OS trust store. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-certificate= Use the client certificate in FILE. The certificate must be either in PKCS12 (.p12, .pfx) or in PEM format. .sp PKCS12 files must contain the certificate, a key and optionally a chain of additional certificates. Only PKCS12 files with a blank import password can be opened! .sp When using PEM, you have to specify the private key via \fI\%\-\-private\-key\fP as well. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 \fIWinTLS\fP does not support PEM files at the moment. Users have to use PKCS12 files. .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 \fIAppleTLS\fP users should use the KeyChain Access utility to import the client certificate and get the SHA\-1 fingerprint from the Information dialog corresponding to that certificate. To start aria2c use \fI\-\-certificate=\fP\&. Alternatively PKCS12 files are also supported. PEM files, however, are not supported. .UNINDENT .UNINDENT .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\-Encoding: 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 .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 Some server responds with \fBContent\-Encoding: gzip\fP for files which itself is gzipped file. aria2 inflates them anyway because of the response header. .UNINDENT .UNINDENT .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 user name 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 \fBCache\-Control: no\-cache\fP and \fBPragma: no\-cache\fP 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: \fBfalse\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 a proxy server for HTTP. To override a previously defined proxy, use \(dq\(dq. See also the \fI\%\-\-all\-proxy\fP option. This affects all http downloads. 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\&. .UNINDENT .INDENT 0.0 .TP .B \-\-http\-proxy\-user= Set user for \fI\%\-\-http\-proxy\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-\-https\-proxy= Use a proxy server for HTTPS. To override a previously defined proxy, use \(dq\(dq. See also the \fI\%\-\-all\-proxy\fP option. This affects all https download. 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\&. .UNINDENT .INDENT 0.0 .TP .B \-\-https\-proxy\-user= Set user for \fI\%\-\-https\-proxy\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-\-private\-key= Use the private key in FILE. The private key must be decrypted and in PEM format. An encrypted key may cause undefined behavior. See also \fI\%\-\-certificate\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-referer= Set an http referrer (Referer). This affects all http/https downloads. If \fB*\fP is given, the download URI is also used as the referrer. This may be useful when used together with the \fI\%\-\-parameterized\-uri\fP option. .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 .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 There is usually no performance gain from enabling this option. .UNINDENT .UNINDENT .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: .INDENT 7.0 .INDENT 3.5 .sp .EX $ aria2c \-\-header=\(dqX\-A: b78\(dq \-\-header=\(dqX\-B: 9J1\(dq \(dqhttp://host/file\(dq .EE .UNINDENT .UNINDENT .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. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 If aria2 is built without libsqlite3, then it doesn\(aqt support Firefox3 and Chromium/Google Chrome cookie format. .UNINDENT .UNINDENT .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 \-\-no\-want\-digest\-header [true|false] Whether to disable Want\-Digest header when doing requests. 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/SFTP 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 .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This option is ignored for SFTP transfer. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-ftp\-proxy= Use a proxy server for FTP. To override a previously defined proxy, use \(dq\(dq. See also the \fI\%\-\-all\-proxy\fP option. This affects all ftp downloads. 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 .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This option is ignored for SFTP transfer. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-ftp\-reuse\-connection [true|false] Reuse connection in FTP. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-ssh\-host\-key\-md== Set checksum for SSH host public key. TYPE is hash type. The supported hash type is \fBsha\-1\fP or \fBmd5\fP\&. DIGEST is hex digest. For example: \fBsha\-1=b030503d4de4539dc7885e6f0f5e256704edf4c3\fP\&. This option can be used to validate server\(aqs public key when SFTP is used. If this option is not set, which is default, no validation takes place. .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). .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 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. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-S, \-\-show\-files [true|false] Print file listing of \(dq.torrent\(dq, \(dq.meta4\(dq and \(dq.metalink\(dq file and exit. In case of \(dq.torrent\(dq file, additional information (infohash, piece length, etc) is also printed. .UNINDENT .SS BitTorrent Specific Options .INDENT 0.0 .TP .B \-\-bt\-detach\-seed\-only [true|false] Exclude seed only downloads when counting concurrent active downloads (See \fI\%\-j\fP option). This means that if \fB\-j3\fP is given and this option is turned on and 3 downloads are active and one of those enters seed mode, then it is excluded from active download count (thus it becomes 2), and the next download waiting in queue gets started. But be aware that seeding item is still recognized as active download in RPC method. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-enable\-hook\-after\-hash\-check [true|false] Allow hook command invocation after hash check (see \fI\%\-V\fP option) in BitTorrent download. By default, when hash check succeeds, the command given by \fI\%\-\-on\-bt\-download\-complete\fP is executed. To disable this action, give \fBfalse\fP to this option. Default: \fBtrue\fP .UNINDENT .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 use in BitTorrent download and DHT. It may be sent to BitTorrent tracker. For DHT, this option should be set to report that local node is downloading a particular torrent. This is critical to use DHT in a private network. Although this function is named \fBexternal\fP, it can accept any kind of IP addresses. .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-force\-encryption [true|false] Requires BitTorrent message payload encryption with arc4. This is a shorthand of \fI\%\-\-bt\-require\-crypto\fP \fI\%\-\-bt\-min\-crypto\-level\fP=arc4. This option does not change the option value of those options. If \fBtrue\fP is given, deny legacy BitTorrent handshake and only use Obfuscation handshake and always encrypt message payload. Default: \fBfalse\fP .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\-load\-saved\-metadata [true|false] Before getting torrent metadata from DHT when downloading with magnet link, first try to read file saved by \fI\%\-\-bt\-save\-metadata\fP option. If it is successful, then skip downloading metadata from DHT. Default: \fBfalse\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 address .UNINDENT .INDENT 0.0 .TP .B \-\-bt\-max\-open\-files= Specify maximum number of files to open in multi\-file BitTorrent/Metalink download globally. 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 \fBtrue\fP is given, aria2 doesn\(aqt accept and establish connection with legacy BitTorrent handshake(\e19BitTorrent 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 \(dq.torrent\(dq file. This option has effect only when BitTorrent Magnet URI is used. The file name is hex encoded info hash with suffix \(dq.torrent\(dq. 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 if present, otherwise \fB$XDG_CACHE_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 if present, otherwise \fB$XDG_CACHE_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 used by DHT(IPv4, IPv6) and UDP tracker. 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 .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 Make sure that the specified ports are open for incoming UDP traffic. .UNINDENT .UNINDENT .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. It also enables UDP tracker support. 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 \fB\&.torrent\fP file is downloaded to the disk, but is not parsed as a torrent and its contents are not downloaded. 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 file names 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 .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 Make sure that the specified ports are open for incoming TCP traffic. .UNINDENT .UNINDENT .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. .sp Default: \fBA2\-$MAJOR\-$MINOR\-$PATCH\-\fP, $MAJOR, $MINOR and $PATCH are replaced by major, minor and patch version number respectively. For instance, aria2 version 1.18.8 has prefix ID \fBA2\-1\-18\-8\-\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-\-peer\-agent= Specify the string used during the bitorrent extended handshake for the peer\(aqs client version. .sp Default: \fBaria2/$MAJOR.$MINOR.$PATCH\fP, $MAJOR, $MINOR and $PATCH are replaced by major, minor and patch version number respectively. For instance, aria2 version 1.18.8 has peer agent \fBaria2/1.18.8\fP\&. .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 (fractional) minutes. Also see the \fI\%\-\-seed\-ratio\fP option. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 Specifying \fI\%\-\-seed\-time=0\fP disables seeding after download completed. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-T, \-\-torrent\-file= The path to the \(dq.torrent\(dq file. You are not required to use this option because you can specify \(dq.torrent\(dq 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 \fB\&.metalink\fP file is downloaded to the disk, but is not parsed as a metalink file and its contents are not downloaded. 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 \(dq.meta4\(dq and \(dq.metalink\(dq file. Reads input from \fBstdin\fP when \fB\-\fP is specified. You are not required to use this option because you can specify \(dq.metalink\(dq 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 secret authorization token using \fI\%\-\-rpc\-secret\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 \-\-pause\-metadata [true|false] Pause downloads created as a result of metadata download. There are 3 types of metadata downloads in aria2: (1) downloading .torrent file. (2) downloading torrent metadata using magnet link. (3) downloading metalink file. These metadata downloads will generate downloads using their metadata. This option pauses these subsequent downloads. 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\-certificate= Use the certificate in FILE for RPC server. The certificate must be either in PKCS12 (.p12, .pfx) or in PEM format. .sp PKCS12 files must contain the certificate, a key and optionally a chain of additional certificates. Only PKCS12 files with a blank import password can be opened! .sp When using PEM, you have to specify the private key via \fI\%\-\-rpc\-private\-key\fP as well. Use \fI\%\-\-rpc\-secure\fP option to enable encryption. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 \fIWinTLS\fP does not support PEM files at the moment. Users have to use PKCS12 files. .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 \fIAppleTLS\fP users should use the KeyChain Access utility to first generate a self\-signed SSL\-Server certificate, e.g. using the wizard, and get the SHA\-1 fingerprint from the Information dialog corresponding to that new certificate. To start aria2c with \fI\%\-\-rpc\-secure\fP use \fI\-\-rpc\-certificate=\fP\&. Alternatively PKCS12 files are also supported. PEM files, however, are not supported. .UNINDENT .UNINDENT .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. .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 \fI\%\-\-rpc\-passwd\fP option will be deprecated in the future release. Migrate to \fI\%\-\-rpc\-secret\fP option as soon as possible. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-rpc\-private\-key= Use the private key in FILE for RPC server. The private key must be decrypted and in PEM format. Use \fI\%\-\-rpc\-secure\fP option to enable encryption. See also \fI\%\-\-rpc\-certificate\fP option. .UNINDENT .INDENT 0.0 .TP .B \-\-rpc\-save\-upload\-metadata [true|false] Save the uploaded torrent or metalink metadata in the directory specified by \fI\%\-\-dir\fP option. The file name consists of SHA\-1 hash hex string of metadata plus extension. For torrent, the extension is \(aq.torrent\(aq. For metalink, it is \(aq.meta4\(aq. If false is given to this option, the downloads added by \fI\%aria2.addTorrent()\fP or \fI\%aria2.addMetalink()\fP will not be saved by \fI\%\-\-save\-session\fP option. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-rpc\-secret= Set RPC secret authorization token. Read \fI\%RPC authorization secret token\fP to know how this option value is used. .UNINDENT .INDENT 0.0 .TP .B \-\-rpc\-secure [true|false] RPC transport will be encrypted by SSL/TLS. The RPC clients must use https scheme to access the server. For WebSocket client, use wss scheme. Use \fI\%\-\-rpc\-certificate\fP and \fI\%\-\-rpc\-private\-key\fP options to specify the server certificate and private key. .UNINDENT .INDENT 0.0 .TP .B \-\-rpc\-user= Set JSON\-RPC/XML\-RPC user. .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 \fI\%\-\-rpc\-user\fP option will be deprecated in the future release. Migrate to \fI\%\-\-rpc\-secret\fP option as soon as possible. .UNINDENT .UNINDENT .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 after the name, but before the file extension, if any. 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 file name (see \fI\%\-\-out\fP option) or file name 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 if present, otherwise \fB$XDG_CONFIG_HOME/aria2/aria2.conf\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-\-console\-log\-level= Set log level to output to console. LEVEL is either \fBdebug\fP, \fBinfo\fP, \fBnotice\fP, \fBwarn\fP or \fBerror\fP\&. Default: \fBnotice\fP .UNINDENT .INDENT 0.0 .TP .B \-\-content\-disposition\-default\-utf8 [true|false] Handle quoted string in Content\-Disposition header as UTF\-8 instead of ISO\-8859\-1, for example, the filename parameter, but not the extended version filename*. Default: \fBfalse\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 .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 \fI\%\-\-deferred\-input\fP option will be disabled when \fI\%\-\-save\-session\fP is used together. .UNINDENT .UNINDENT .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 \-\-disk\-cache= Enable disk cache. If SIZE is \fB0\fP, the disk cache is disabled. This feature caches the downloaded data in memory, which grows to at most SIZE bytes. The cache storage is created for aria2 instance and shared by all downloads. The one advantage of the disk cache is reduce the disk I/O because the data are written in larger unit and it is reordered by the offset of the file. If hash checking is involved and the data are cached in memory, we don\(aqt need to read them from the disk. SIZE can include \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). Default: \fB16M\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. If OPT is \fBhide\fP, \fBDownload Results\fP is hidden. Default: \fBdefault\fP .UNINDENT .INDENT 0.0 .TP .B \-\-dscp= Set DSCP value in outgoing IP packets of BitTorrent traffic for QoS. This parameter sets only DSCP bits in TOS field of IP packets, not the whole field. If you take values from \fI/usr/include/netinet/ip.h\fP divide them by 4 (otherwise values would be incorrect, e.g. your \fBCS1\fP class would turn into \fBCS4\fP). If you take commonly used values from RFC, network vendors\(aq documentation, Wikipedia or any other source, use them as they are. .UNINDENT .INDENT 0.0 .TP .B \-\-rlimit\-nofile= Set the soft limit of open file descriptors. This open will only have effect when: .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .IP a. 3 The system supports it (posix) .IP b. 3 The limit does not exceed the hard limit. .IP c. 3 The specified limit is larger than the current soft limit. .UNINDENT .UNINDENT .UNINDENT .sp This is equivalent to setting nofile via ulimit, except that it will never decrease the limit. .sp This option is only available on systems supporting the rlimit API. .UNINDENT .INDENT 0.0 .TP .B \-\-enable\-color [true|false] Enable color output for a terminal. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-enable\-mmap [true|false] Map files into memory. This option may not work if the file space is not pre\-allocated. See \fI\%\-\-file\-allocation\fP\&. .sp 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 the 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 \fBposix_fallocate(3)\fP function. \fBtrunc\fP uses \fBftruncate(2)\fP system call or platform\-specific counterpart to truncate a file to a specified length. .sp Possible Values: \fBnone\fP, \fBprealloc\fP, \fBtrunc\fP, \fBfalloc\fP Default: \fBprealloc\fP .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 Using \fBtrunc\fP seemingly allocates disk space very quickly, but what it actually does is that it sets file length metadata in file system, and does not allocate disk space at all. This means that it does not help avoiding fragmentation. .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 In multi file torrent downloads, the files adjacent forward to the specified files are also allocated if they share the same piece. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-force\-save [true|false] Save download with \fI\%\-\-save\-session\fP option even if the download is completed or removed. This option also saves control file in that situations. This may be useful to save BitTorrent seeding which is recognized as completed state. Default: \fBfalse\fP .UNINDENT .INDENT 0.0 .TP .B \-\-save\-not\-found [true|false] Save download with \fI\%\-\-save\-session\fP option even if the file was not found on the server. This option also saves control file in that situations. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-gid= Set GID manually. aria2 identifies each download by the ID called GID. The GID must be hex string of 16 characters, thus [0\-9a\-fA\-F] are allowed and leading zeros must not be stripped. The GID all 0 is reserved and must not be used. The GID must be unique, otherwise error is reported and the download is not added. This option is useful when restoring the sessions saved using \fI\%\-\-save\-session\fP option. If this option is not used, new GID is generated by aria2. .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 host name. Possible Values: interface, IP address, host name .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 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 \fBgetifaddrs(3)\fP, this option doesn\(aqt accept interface name. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-keep\-unfinished\-download\-result [true|false] Keep unfinished download results even if doing so exceeds \fI\%\-\-max\-download\-result\fP\&. This is useful if all unfinished downloads must be saved in session file (see \fI\%\-\-save\-session\fP option). Please keep in mind that there is no upper bound to the number of unfinished download result to keep. If that is undesirable, turn this option off. Default: \fBtrue\fP .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. Note that unfinished downloads are kept in memory regardless of this option value. See \fI\%\-\-keep\-unfinished\-download\-result\fP option. Default: \fB1000\fP .UNINDENT .INDENT 0.0 .TP .B \-\-max\-mmap\-limit= Set the maximum file size to enable mmap (see \fI\%\-\-enable\-mmap\fP option). The file size is determined by the sum of all files contained in one download. For example, if a download contains 5 files, then file size is the total size of those files. If file size is strictly greater than the size specified in this option, mmap will be disabled. Default: \fB9223372036854775807\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 \-\-min\-tls\-version= Specify minimum SSL/TLS version to enable. Possible Values: \fBTLSv1.1\fP, \fBTLSv1.2\fP, \fBTLSv1.3\fP Default: \fBTLSv1.2\fP .UNINDENT .INDENT 0.0 .TP .B \-\-multiple\-interface= Comma separated list of interfaces to bind sockets to. Requests will be split among the interfaces to achieve link aggregation. You can specify interface name, IP address and hostname. If \fI\%\-\-interface\fP is used, this option will be ignored. Possible Values: interface, IP address, hostname .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 \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 \-\-optimize\-concurrent\-downloads [true|false|:] Optimizes the number of concurrent downloads according to the bandwidth available. aria2 uses the download speed observed in the previous downloads to adapt the number of downloads launched in parallel according to the rule N = A + B Log10(speed in Mbps). The coefficients A and B can be customized in the option arguments with A and B separated by a colon. The default values (A=5, B=25) lead to using typically 5 parallel downloads on 1Mbps networks and above 50 on 100Mbps networks. The number of parallel downloads remains constrained under the maximum defined by the \fI\%\-\-max\-concurrent\-downloads\fP parameter. Default: \fBfalse\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 .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 The possible use case 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\&. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-show\-console\-readout [true|false] Show console readout. Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \-\-stderr [true|false] Redirect all console output that would be otherwise printed in stdout to stderr. Default: \fBfalse\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 .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. If you like the output to be gzipped append a .gz extension to the file name. 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. GID is also saved with \fI\%gid\fP, but there are some restrictions, see below. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 Normally, GID of the download itself is saved. But some downloads use metadata (e.g., BitTorrent and Metalink). In this case, there are some restrictions. .INDENT 0.0 .TP .B magnet URI, and followed by torrent download GID of BitTorrent metadata download is saved. .TP .B URI to torrent file, and followed by torrent download GID of torrent file download is saved. .TP .B URI to metalink file, and followed by file downloads described in metalink file GID of metalink file download is saved. .TP .B local torrent file GID of torrent download is saved. .TP .B local metalink file Any meaningful GID is not saved. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-save\-session\-interval= Save error/unfinished downloads to a file specified by \fI\%\-\-save\-session\fP option every SEC seconds. If \fB0\fP is given, file will be saved only when aria2 exits. Default: \fB0\fP .UNINDENT .INDENT 0.0 .TP .B \-\-socket\-recv\-buffer\-size= Set the maximum socket receive buffer in bytes. Specifying \fB0\fP will disable this option. This value will be set to socket file descriptor using \fBSO_RCVBUF\fP socket option with \fBsetsockopt()\fP call. Default: \fB0\fP .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 Notes for Options .SS Optional arguments .sp The options that have its argument surrounded by square brackets([]) take an optional argument. Usually omitting 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 Units (K and M) .sp Some options takes \fBK\fP and \fBM\fP to conveniently represent 1024 and 1048576 respectively. aria2 detects these characters in case\-insensitive way. In other words, \fBk\fP and \fBm\fP can be used as well as \fBK\fP and \fBM\fP respectively. .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\(dq\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/SFTP server at the same time, while the data from HTTP(S)/FTP/SFTP 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. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Make sure that URI is quoted with single(\fB\(aq\fP) or double(\fB\(dq\fP) quotation if it contains \fB&\fP or any characters that have special meaning in shell. .UNINDENT .UNINDENT .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, and SFTP 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: .INDENT 0.0 .INDENT 3.5 .sp .EX $ cat hook.sh #!/bin/sh echo \(dqCalled with [$1] [$2] [$3]\(dq $ aria2c \-\-on\-download\-complete hook.sh http://example.org/file.iso Called with [1] [1] [/path/to/file.iso] .EE .UNINDENT .UNINDENT .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 specified number of \(dqresource not found\(dq 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 redirects occurred. .TP .B 24 If HTTP authorization failed. .TP .B 25 If aria2 could not parse bencoded file (usually \(dq.torrent\(dq file). .TP .B 26 If \(dq.torrent\(dq 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. .TP .B 31 Reserved. Not used. .TP .B 32 If checksum validation failed. .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 An error occurred in a finished download will not be reported as exit status. .UNINDENT .UNINDENT .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 .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 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. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fBno_proxy [DOMAIN,...]\fP Specify a comma\-separated list of host names, domains and network addresses with or without a subnet mask where no proxy should be used. Overrides the \fIno\-proxy\fP 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 checks whether the legacy path \fB$HOME/.aria2/aria2.conf\fP is present, otherwise it parses \fB$XDG_CONFIG_HOME/aria2/aria2.conf\fP as its configuration file. You can specify the path to configuration file using \fI\%\-\-conf\-path\fP option. If you don\(aqt want to use the configuration 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: .INDENT 0.0 .INDENT 3.5 .sp .EX # sample configuration file for aria2c listen\-port=60000 dht\-listen\-port=60000 seed\-ratio=1.0 max\-upload\-limit=50K ftp\-pasv=true .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The confidential information such as user/password might be included in the configuration file. It is recommended to change file mode bits of the configuration file (e.g., \fBchmod 600 aria2.conf\fP), so that other user cannot see the contents of the file. .UNINDENT .UNINDENT .sp The environment variables, such as \fB${HOME}\fP, are expanded by shell. This means that those variables used in configuration file are not expanded. However, it is useful to \fB${HOME}\fP to refer user\(aqs home directory in configuration file to specify file paths. Therefore, aria2 expands \fB${HOME}\fP found in the following option values to user\(aqs home directory: .INDENT 0.0 .IP \(bu 2 \fI\%ca\-certificate\fP .IP \(bu 2 \fI\%certificate\fP .IP \(bu 2 \fI\%dht\-file\-path\fP .IP \(bu 2 \fI\%dht\-file\-path6\fP .IP \(bu 2 \fI\%dir\fP .IP \(bu 2 \fI\%input\-file\fP .IP \(bu 2 \fI\%load\-cookies\fP .IP \(bu 2 \fI\%log\fP .IP \(bu 2 \fI\%metalink\-file\fP .IP \(bu 2 \fI\%netrc\-path\fP .IP \(bu 2 \fI\%on\-bt\-download\-complete\fP .IP \(bu 2 \fI\%on\-download\-complete\fP .IP \(bu 2 \fI\%on\-download\-error\fP .IP \(bu 2 \fI\%on\-download\-start\fP .IP \(bu 2 \fI\%on\-download\-stop\fP .IP \(bu 2 \fI\%on\-download\-pause\fP .IP \(bu 2 \fI\%out\fP .IP \(bu 2 \fI\%private\-key\fP .IP \(bu 2 \fI\%rpc\-certificate\fP .IP \(bu 2 \fI\%rpc\-private\-key\fP .IP \(bu 2 \fI\%save\-cookies\fP .IP \(bu 2 \fI\%save\-session\fP .IP \(bu 2 \fI\%server\-stat\-if\fP .IP \(bu 2 \fI\%server\-stat\-of\fP .IP \(bu 2 \fI\%torrent\-file\fP .UNINDENT .sp Note that this expansion occurs even if the above options are used in the command\-line. This means that expansion may occur 2 times: first, shell and then aria2c. .SS dht.dat .sp Unless the legacy file paths \fB$HOME/.aria2/dht.dat\fP and \fB$HOME/.aria2/dht6.dat\fP are pointing to existing files, the routing table of IPv4 DHT is saved to the path \fB$XDG_CACHE_HOME/aria2/dht.dat\fP and the routing table of IPv6 DHT is saved to the path \fB$XDG_CACHE_HOME/aria2/dht6.dat\fP\&. .SS Netrc .sp Netrc support is enabled by default for HTTP(S)/FTP/SFTP. 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: .INDENT 0.0 .INDENT 3.5 .sp .EX machine .example.org login myid password mypasswd .EE .UNINDENT .UNINDENT .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 file name is the file name 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 \(dqtop directory\(dq name of the torrent with \fB\&.aria2\fP appended. The \(dqtop directory\(dq name is a value of \(dqname\(dq key in \(dqinfo\(dq 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\(dq\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\-hook\-after\-hash\-check\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\-force\-encryption\fP .IP \(bu 2 \fI\%bt\-hash\-check\-seed\fP .IP \(bu 2 \fI\%bt\-load\-saved\-metadata\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\-remove\-unselected\-file\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\%check\-integrity\fP .IP \(bu 2 \fI\%checksum\fP .IP \(bu 2 \fI\%conditional\-get\fP .IP \(bu 2 \fI\%connect\-timeout\fP .IP \(bu 2 \fI\%content\-disposition\-default\-utf8\fP .IP \(bu 2 \fI\%continue\fP .IP \(bu 2 \fI\%dir\fP .IP \(bu 2 \fI\%dry\-run\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\-mmap\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\%force\-save\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\%gid\fP .IP \(bu 2 \fI\%hash\-check\-only\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\-mmap\-limit\fP .IP \(bu 2 \fI\%max\-resume\-failure\-tries\fP .UNINDENT .INDENT 2.0 .IP \(bu 2 \fI\%max\-tries\fP .IP \(bu 2 \fI\%max\-upload\-limit\fP .IP \(bu 2 \fI\%metalink\-base\-uri\fP .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\%pause\fP .IP \(bu 2 \fI\%pause\-metadata\fP .IP \(bu 2 \fI\%piece\-length\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\%retry\-wait\fP .IP \(bu 2 \fI\%reuse\-uri\fP .IP \(bu 2 \fI\%rpc\-save\-upload\-metadata\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\%ssh\-host\-key\-md\fP .IP \(bu 2 \fI\%stream\-piece\-selector\fP .IP \(bu 2 \fI\%timeout\fP .IP \(bu 2 \fI\%uri\-selector\fP .IP \(bu 2 \fI\%use\-head\fP .IP \(bu 2 \fI\%user\-agent\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: .INDENT 0.0 .INDENT 3.5 .sp .EX http://server/file.iso http://mirror/file.iso dir=/iso_images out=file.img http://foo/bar .EE .UNINDENT .UNINDENT .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 \fBhttp://server/file.iso\fP and \fBhttp://mirror/file.iso\fP\&. The file \fBbar\fP is downloaded from \fBhttp://foo/bar\fP 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 Host name 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: .INDENT 0.0 .INDENT 3.5 .sp .EX host=localhost, protocol=http, dl_speed=32000, last_updated=1222491640, status=OK host=localhost, protocol=ftp, dl_speed=0, last_updated=1222491632, status=ERROR .EE .UNINDENT .UNINDENT .SH RPC INTERFACE .sp aria2 provides JSON\-RPC over HTTP and XML\-RPC over HTTP interfaces that offer basically the same functionality. aria2 also provides JSON\-RPC over WebSocket. JSON\-RPC over WebSocket uses the same method signatures and response format as JSON\-RPC over HTTP, but additionally provides server\-initiated notifications. See \fI\%JSON\-RPC over WebSocket\fP section for more information. .sp The request path of the JSON\-RPC interface (for both over HTTP and over WebSocket) is \fB/jsonrpc\fP\&. The request path of the XML\-RPC interface is \fB/rpc\fP\&. .sp The WebSocket URI for JSON\-RPC over WebSocket is \fBws://HOST:PORT/jsonrpc\fP\&. If you enabled SSL/TLS encryption, use \fBwss://HOST:PORT/jsonrpc\fP instead. .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). The WebSocket transport is an aria2 extension. .sp The JSON\-RPC interface does not support notifications over HTTP, but the RPC server will send notifications over WebSocket. It also does not support floating point numbers. The character encoding must be UTF\-8. .sp When reading the following documentation for JSON\-RPC, interpret structs as JSON objects. .SS Terminology .sp GID .INDENT 0.0 .INDENT 3.5 The GID (or gid) is a key to manage each download. Each download will be assigned a unique GID. The GID is stored as 64\-bit binary value in aria2. For RPC access, it is represented as a hex string of 16 characters (e.g., \fB2089b05ecca3d829\fP). Normally, aria2 generates this GID for each download, but the user can specify GIDs manually using the \fI\%\-\-gid\fP option. When querying downloads by GID, you can specify only the prefix of a GID as long as it is unique among others. .UNINDENT .UNINDENT .SS RPC authorization secret token .sp As of 1.18.4, in addition to HTTP basic authorization, aria2 provides RPC method\-level authorization. In a future release, HTTP basic authorization will be removed and RPC method\-level authorization will become mandatory. .sp To use RPC method\-level authorization, the user has to specify an RPC secret authorization token using the \fI\%\-\-rpc\-secret\fP option. For each RPC method call, the caller has to include the token prefixed with \fBtoken:\fP\&. Even when the \fI\%\-\-rpc\-secret\fP option is not used, if the first parameter in the RPC method is a string and starts with \fBtoken:\fP, it will removed from the parameter list before the request is being processed. .sp For example, if the RPC secret authorization token is \fB$$secret$$\fP, calling \fIaria2.addUri\fP RPC method would have to look like this: .INDENT 0.0 .INDENT 3.5 .sp .EX aria2.addUri(\(dqtoken:$$secret$$\(dq, [\(dqhttp://example.org/file\(dq]) .EE .UNINDENT .UNINDENT .sp The \fIsystem.multicall\fP RPC method is treated specially. Since the XML\-RPC specification only allows a single array as a parameter for this method, we don\(aqt specify the token in the call. Instead, each nested method call has to provide the token as the first parameter as described above. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The secret token validation in aria2 is designed to take at least a certain amount of time to mitigate brute\-force/dictionary attacks against the RPC interface. Therefore it is recommended to prefer Batch or \fIsystem.multicall\fP requests when appropriate. .sp \fIsystem.listMethods\fP and \fIsystem.listNotifications\fP can be executed without token. Since they just return available methods/notifications, they do not alter anything, they\(aqre safe without secret token. .UNINDENT .UNINDENT .SS Methods .sp All code examples are compatible with the Python 2.7 interpreter. For information on the \fIsecret\fP parameter, see \fI\%RPC authorization secret token\fP\&. .INDENT 0.0 .TP .B aria2.addUri([secret], uris[, options[, position]]) This method adds a new download. \fIuris\fP is an array of HTTP/FTP/SFTP/BitTorrent URIs (strings) pointing to the same resource. If you mix URIs pointing to different resources, then the download may fail or be corrupted without aria2 complaining. When adding BitTorrent Magnet URIs, \fIuris\fP must have only one element and it should be BitTorrent Magnet URI. \fIoptions\fP is a struct and its members are pairs of option name and value. See \fI\%Options\fP below for more details. If \fIposition\fP is given, it must be an integer starting from 0. The new download will be inserted at \fIposition\fP in the waiting queue. If \fIposition\fP is omitted or \fIposition\fP is larger than the current size of the queue, the new download is appended to the end of the queue. This method returns the GID of the newly registered download. .sp \fBJSON\-RPC Example\fP .sp The following example adds \fBhttp://example.org/file\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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{\(dqid\(dq:\(dqqwer\(dq,\(dqjsonrpc\(dq:\(dq2.0\(dq,\(dqresult\(dq:\(dq2089b05ecca3d829\(dq}\(aq .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .sp The following example adds \fBhttp://example.org/file\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.addUri([\(aqhttp://example.org/file\(aq]) \(aq2089b05ecca3d829\(aq .EE .UNINDENT .UNINDENT .sp The following example adds a new download with two sources and some options: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> s.aria2.addUri([\(aqhttp://example.org/file\(aq, \(aqhttp://mirror/file\(aq], dict(dir=\(dq/tmp\(dq)) \(aqd2703803b52216d1\(aq .EE .UNINDENT .UNINDENT .sp The following example adds a download and inserts it to the front of the queue: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> s.aria2.addUri([\(aqhttp://example.org/file\(aq], {}, 0) \(aqca3d829cee549a4d\(aq .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.addTorrent([secret], torrent[, uris[, options[, position]]]) This method adds a BitTorrent download by uploading a \(dq.torrent\(dq file. If you want to add a BitTorrent Magnet URI, use the \fI\%aria2.addUri()\fP method instead. \fItorrent\fP must be a base64\-encoded string containing the contents of the \(dq.torrent\(dq file. \fIuris\fP is an array of URIs (string). \fIuris\fP is used for Web\-seeding. For single file torrents, the URI can be a complete URI pointing to the resource; 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 a struct and its members are pairs of option name and value. See \fI\%Options\fP below for more details. If \fIposition\fP is given, it must be an integer starting from 0. The new download will be inserted at \fIposition\fP in the waiting queue. If \fIposition\fP is omitted or \fIposition\fP is larger than the current size of the queue, the new download is appended to the end of the queue. This method returns the GID of the newly registered download. If \fI\%\-\-rpc\-save\-upload\-metadata\fP is \fBtrue\fP, the uploaded data is saved as a file named as the hex string of SHA\-1 hash of data plus \(dq.torrent\(dq in the directory specified by \fI\%\-\-dir\fP option. E.g. a file name might be \fB0a3893293e27ac0490424c06de4d09242215f0a6.torrent\fP\&. If a file with the same name already exists, it is overwritten! If the file cannot be saved successfully or \fI\%\-\-rpc\-save\-upload\-metadata\fP is \fBfalse\fP, the downloads added by this method are not saved by \fI\%\-\-save\-session\fP\&. .sp The following examples add local file \fBfile.torrent\fP\&. .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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{\(dqid\(dq:\(dqasdf\(dq,\(dqjsonrpc\(dq:\(dq2.0\(dq,\(dqresult\(dq:\(dq2089b05ecca3d829\(dq}\(aq .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.addTorrent(xmlrpclib.Binary(open(\(aqfile.torrent\(aq, mode=\(aqrb\(aq).read())) \(aq2089b05ecca3d829\(aq .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.addMetalink([secret], metalink[, options[, position]]) This method adds a Metalink download by uploading a \(dq.metalink\(dq file. \fImetalink\fP is a base64\-encoded string which contains the contents of the \(dq.metalink\(dq file. \fIoptions\fP is a struct and its members are pairs of option name and value. See \fI\%Options\fP below for more details. If \fIposition\fP is given, it must be an integer starting from 0. The new download will be inserted at \fIposition\fP in the waiting queue. If \fIposition\fP is omitted or \fIposition\fP is larger than the current size of the queue, the new download is appended to the end of the queue. This method returns an array of GIDs of newly registered downloads. If \fI\%\-\-rpc\-save\-upload\-metadata\fP is \fBtrue\fP, the uploaded data is saved as a file named hex string of SHA\-1 hash of data plus \(dq.metalink\(dq in the directory specified by \fI\%\-\-dir\fP option. E.g. a file name might be \fB0a3893293e27ac0490424c06de4d09242215f0a6.metalink\fP\&. If a file with the same name already exists, it is overwritten! If the file cannot be saved successfully or \fI\%\-\-rpc\-save\-upload\-metadata\fP is \fBfalse\fP, the downloads added by this method are not saved by \fI\%\-\-save\-session\fP\&. .sp The following examples add local file file.meta4. .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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{\(dqid\(dq:\(dqqwer\(dq,\(dqjsonrpc\(dq:\(dq2.0\(dq,\(dqresult\(dq:[\(dq2089b05ecca3d829\(dq]}\(aq .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.addMetalink(xmlrpclib.Binary(open(\(aqfile.meta4\(aq, mode=\(aqrb\(aq).read())) [\(aq2089b05ecca3d829\(aq] .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.remove([secret], gid) This method removes the download denoted by \fIgid\fP (string). If the specified download is in progress, it is first stopped. The status of the removed download becomes \fBremoved\fP\&. This method returns GID of removed download. .sp The following examples remove a download with GID#2089b05ecca3d829. .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import urllib2, json >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.remove\(aq, \&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) >>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) >>> c.read() \(aq{\(dqid\(dq:\(dqqwer\(dq,\(dqjsonrpc\(dq:\(dq2.0\(dq,\(dqresult\(dq:\(dq2089b05ecca3d829\(dq}\(aq .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.remove(\(aq2089b05ecca3d829\(aq) \(aq2089b05ecca3d829\(aq .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.forceRemove([secret], gid) This method removes the download denoted by \fIgid\fP\&. This method behaves just like \fI\%aria2.remove()\fP except that this method removes the download without performing any actions which take time, such as contacting BitTorrent trackers to unregister the download first. .UNINDENT .INDENT 0.0 .TP .B aria2.pause([secret], gid) This method pauses the download denoted by \fIgid\fP (string). The status of paused download becomes \fBpaused\fP\&. If the download was active, the download is placed in the front of waiting queue. While the status is \fBpaused\fP, the download is not started. To change status to \fBwaiting\fP, use the \fI\%aria2.unpause()\fP method. This method returns GID of paused download. .UNINDENT .INDENT 0.0 .TP .B aria2.pauseAll([secret]) This method is equal to calling \fI\%aria2.pause()\fP for every active/waiting download. This methods returns \fBOK\fP\&. .UNINDENT .INDENT 0.0 .TP .B aria2.forcePause([secret], gid) This method pauses the download denoted by \fIgid\fP\&. This method behaves just like \fI\%aria2.pause()\fP except that this method pauses downloads without performing any actions which take time, such as contacting BitTorrent trackers to unregister the download first. .UNINDENT .INDENT 0.0 .TP .B aria2.forcePauseAll([secret]) This method is equal to calling \fI\%aria2.forcePause()\fP for every active/waiting download. This methods returns \fBOK\fP\&. .UNINDENT .INDENT 0.0 .TP .B aria2.unpause([secret], gid) This method changes the status of the download denoted by \fIgid\fP (string) from \fBpaused\fP to \fBwaiting\fP, making the download eligible to be restarted. This method returns the GID of the unpaused download. .UNINDENT .INDENT 0.0 .TP .B aria2.unpauseAll([secret]) This method is equal to calling \fI\%aria2.unpause()\fP for every paused download. This methods returns \fBOK\fP\&. .UNINDENT .INDENT 0.0 .TP .B aria2.tellStatus([secret], gid[, keys]) This method returns the progress of the download denoted by \fIgid\fP (string). \fIkeys\fP is an array of strings. If specified, the response contains only keys in the \fIkeys\fP array. If \fIkeys\fP is empty or omitted, the response contains all keys. This is useful when you just want specific keys and avoid unnecessary transfers. For example, \fBaria2.tellStatus(\(dq2089b05ecca3d829\(dq, [\(dqgid\(dq, \(dqstatus\(dq])\fP returns the \fIgid\fP and \fIstatus\fP keys only. The response is a struct and contains following keys. Values are strings. .INDENT 7.0 .TP .B \fBgid\fP GID of the download. .TP .B \fBstatus\fP \fBactive\fP for currently downloading/seeding downloads. \fBwaiting\fP for downloads in the queue; download is not started. \fBpaused\fP for paused downloads. \fBerror\fP for downloads that were stopped because of error. \fBcomplete\fP for stopped and completed downloads. \fBremoved\fP for the downloads removed by user. .TP .B \fBtotalLength\fP Total length of the download in bytes. .TP .B \fBcompletedLength\fP Completed length of the download in bytes. .TP .B \fBuploadLength\fP Uploaded length of the download in bytes. .TP .B \fBbitfield\fP Hexadecimal representation of the download progress. The highest bit corresponds to the piece at index 0. Any set bits indicate loaded pieces, while unset bits indicate not yet loaded and/or missing pieces. Any overflow bits at the end are set to zero. When the download was 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 aria2 has connected to. BitTorrent only. .TP .B \fBseeder\fP \fBtrue\fP if the local endpoint is a seeder. Otherwise \fBfalse\fP\&. 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 aria2 has connected to. .TP .B \fBerrorCode\fP The code of the last error for this item, if any. The value is a string. The error codes are defined in the \fI\%EXIT STATUS\fP section. This value is only available for stopped/completed downloads. .TP .B \fBerrorMessage\fP The (hopefully) human readable error message associated to \fBerrorCode\fP\&. .TP .B \fBfollowedBy\fP List of GIDs which are generated as the result of this download. For example, when aria2 downloads a Metalink file, it generates downloads described in the Metalink (see the \fI\%\-\-follow\-metalink\fP option). This value is useful to track auto\-generated downloads. If there are no such downloads, this key will not be included in the response. .TP .B \fBfollowing\fP The reverse link for \fBfollowedBy\fP\&. A download included in \fBfollowedBy\fP has this object\(aqs GID in its \fBfollowing\fP value. .TP .B \fBbelongsTo\fP GID of a parent download. Some downloads are a part of another download. For example, if a file in a Metalink has BitTorrent resources, the downloads of \(dq.torrent\(dq files are parts of that parent. If this download has no parent, this key will not be included in the response. .TP .B \fBdir\fP Directory to save files. .TP .B \fBfiles\fP Returns the list of files. The elements of this list are the same structs used in \fI\%aria2.getFiles()\fP method. .TP .B \fBbittorrent\fP Struct which contains information retrieved from the .torrent (file). BitTorrent only. It contains following keys. .INDENT 7.0 .TP .B \fBannounceList\fP List of lists of announce URIs. If the torrent contains \fBannounce\fP and no \fBannounce\-list\fP, \fBannounce\fP is converted to the \fBannounce\-list\fP format. .TP .B \fBcomment\fP The comment of the torrent. \fBcomment.utf\-8\fP 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 \fBsingle\fP or \fBmulti\fP\&. .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. \fBname.utf\-8\fP is used if available. .UNINDENT .UNINDENT .TP .B \fBverifiedLength\fP The number of verified number of bytes while the files are being hash checked. This key exists only when this download is being hash checked. .TP .B \fBverifyIntegrityPending\fP \fBtrue\fP if this download is waiting for the hash check in a queue. This key exists only when this download is in the queue. .UNINDENT .sp \fBJSON\-RPC Example\fP .sp The following example gets information about a download with GID#2089b05ecca3d829: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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:[\(aq2089b05ecca3d829\(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\(aq2089b05ecca3d829\(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}} .EE .UNINDENT .UNINDENT .sp The following example gets only specific keys: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqaria2.tellStatus\(aq, \&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(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\(aq2089b05ecca3d829\(aq, u\(aqtotalLength\(aq: u\(aq34896138\(aq}} .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .sp The following example gets information about a download with GID#2089b05ecca3d829: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.tellStatus(\(aq2089b05ecca3d829\(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: \(aq2089b05ecca3d829\(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} .EE .UNINDENT .UNINDENT .sp The following example gets only specific keys: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> r = s.aria2.tellStatus(\(aq2089b05ecca3d829\(aq, [\(aqgid\(aq, \(aqtotalLength\(aq, \(aqcompletedLength\(aq]) >>> pprint(r) {\(aqcompletedLength\(aq: \(aq34896138\(aq, \(aqgid\(aq: \(aq2089b05ecca3d829\(aq, \(aqtotalLength\(aq: \(aq34896138\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.getUris([secret], gid) This method returns the URIs used in the download denoted by \fIgid\fP (string). The response is an array of structs and it contains following keys. Values are string. .INDENT 7.0 .TP .B \fBuri\fP URI .TP .B \fBstatus\fP \(aqused\(aq if the URI is in use. \(aqwaiting\(aq if the URI is still waiting in the queue. .UNINDENT .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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:[\(aq2089b05ecca3d829\(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}]} .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.getUris(\(aq2089b05ecca3d829\(aq) >>> pprint(r) [{\(aqstatus\(aq: \(aqused\(aq, \(aquri\(aq: \(aqhttp://example.org/file\(aq}] .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.getFiles([secret], gid) This method returns the file list of the download denoted by \fIgid\fP (string). The response is an array of structs which contain following keys. Values are strings. .INDENT 7.0 .TP .B \fBindex\fP Index of the file, starting at 1, in the same order as files appear in the 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 \fBcompletedLength\fP is less than the \fBcompletedLength\fP returned by the \fI\%aria2.tellStatus()\fP method. This is because \fBcompletedLength\fP in \fI\%aria2.getFiles()\fP only includes completed pieces. On the other hand, \fBcompletedLength\fP in \fI\%aria2.tellStatus()\fP also includes partially completed pieces. .TP .B \fBselected\fP \fBtrue\fP if this file is selected by \fI\%\-\-select\-file\fP option. If \fI\%\-\-select\-file\fP is not specified or this is single\-file torrent or not a torrent download at all, this value is always \fBtrue\fP\&. Otherwise \fBfalse\fP\&. .TP .B \fBuris\fP Returns a list of URIs for this file. The element type is the same struct used in the \fI\%aria2.getUris()\fP method. .UNINDENT .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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:[\(aq2089b05ecca3d829\(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}]}]} .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.getFiles(\(aq2089b05ecca3d829\(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}]}] .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.getPeers([secret], gid) This method returns a list peers of the download denoted by \fIgid\fP (string). This method is for BitTorrent only. The response is an array of structs and contains the following keys. Values are strings. .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 the piece at index 0. Set bits indicate the piece is available and unset bits indicate the piece is missing. Any spare bits at the end are set to zero. .TP .B \fBamChoking\fP \fBtrue\fP if aria2 is choking the peer. Otherwise \fBfalse\fP\&. .TP .B \fBpeerChoking\fP \fBtrue\fP if the peer is choking aria2. Otherwise \fBfalse\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 \fBtrue\fP if this peer is a seeder. Otherwise \fBfalse\fP\&. .UNINDENT .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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:[\(aq2089b05ecca3d829\(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}]} .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.getPeers(\(aq2089b05ecca3d829\(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}] .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.getServers([secret], gid) This method returns currently connected HTTP(S)/FTP/SFTP servers of the download denoted by \fIgid\fP (string). The response is an array of structs and contains the following keys. Values are strings. .INDENT 7.0 .TP .B \fBindex\fP Index of the file, starting at 1, in the same order as files appear in the multi\-file metalink. .TP .B \fBservers\fP A list of structs which contain the following keys. .INDENT 7.0 .TP .B \fBuri\fP Original URI. .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 .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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:[\(aq2089b05ecca3d829\(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}]}]} .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.getServers(\(aq2089b05ecca3d829\(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}]}] .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.tellActive([secret][, keys]) This method returns a list of active downloads. The response is an array of the same structs as returned by the \fI\%aria2.tellStatus()\fP method. For the \fIkeys\fP parameter, please refer to the \fI\%aria2.tellStatus()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.tellWaiting([secret], offset, num[, keys]) This method returns a list of waiting downloads, including paused ones. \fIoffset\fP is an integer and specifies the offset from the download waiting at the front. \fInum\fP is an integer and specifies the max. number of downloads to be returned. For the \fIkeys\fP parameter, please refer to the \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. Downloads in the response are in reversed order then. .sp For example, imagine three downloads \(dqA\(dq,\(dqB\(dq and \(dqC\(dq are waiting in this order. \fBaria2.tellWaiting(0, 1)\fP returns \fB[\(dqA\(dq]\fP\&. \fBaria2.tellWaiting(1, 2)\fP returns \fB[\(dqB\(dq, \(dqC\(dq]\fP\&. \fBaria2.tellWaiting(\-1, 2)\fP returns \fB[\(dqC\(dq, \(dqB\(dq]\fP\&. .sp The response is an array of the same structs as returned by \fI\%aria2.tellStatus()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.tellStopped([secret], offset, num[, keys]) This method returns a list of stopped downloads. \fIoffset\fP is an integer and specifies the offset from the least recently stopped download. \fInum\fP is an integer and specifies the max. number of downloads to be returned. For the \fIkeys\fP parameter, please refer to the \fI\%aria2.tellStatus()\fP method. .sp \fIoffset\fP and \fInum\fP have the same semantics as described in the \fI\%aria2.tellWaiting()\fP method. .sp The response is an array of the same structs as returned by the \fI\%aria2.tellStatus()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.changePosition([secret], gid, pos, how) This method changes the position of the download denoted by \fIgid\fP in the queue. \fIpos\fP is an integer. \fIhow\fP is a string. If \fIhow\fP is \fBPOS_SET\fP, it moves the download to a position relative to the beginning of the queue. If \fIhow\fP is \fBPOS_CUR\fP, it moves the download to a position relative to the current position. If \fIhow\fP is \fBPOS_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 an integer denoting the resulting position. .sp For example, if GID#2089b05ecca3d829 is currently in position 3, \fBaria2.changePosition(\(aq2089b05ecca3d829\(aq, \-1, \(aqPOS_CUR\(aq)\fP will change its position to 2. Additionally \fBaria2.changePosition(\(aq2089b05ecca3d829\(aq, 0, \(aqPOS_SET\(aq)\fP will change its position to 0 (the beginning of the queue). .sp The following examples move the download GID#2089b05ecca3d829 to the front of the queue. .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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:[\(aq2089b05ecca3d829\(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} .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.changePosition(\(aq2089b05ecca3d829\(aq, 0, \(aqPOS_SET\(aq) 0 .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.changeUri([secret], gid, fileIndex, delUris, addUris[, position]) This method removes the URIs in \fIdelUris\fP from and appends the URIs in \fIaddUris\fP to download denoted by \fIgid\fP\&. \fIdelUris\fP and \fIaddUris\fP are lists of strings. 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 executes the removal and then the addition. \fIposition\fP is the position after URIs are removed, not the position when this method is called. When removing an URI, if the same URIs exist in download, only one of them is removed for each URI in \fIdelUris\fP\&. In other words, if 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 two integers. The first integer is the number of URIs deleted. The second integer is the number of URIs added. .sp The following examples add the URI \fBhttp://example.org/file\fP to the file whose index is \fB1\fP and belongs to the download GID#2089b05ecca3d829. .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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:[\(aq2089b05ecca3d829\(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]} .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.changeUri(\(aq2089b05ecca3d829\(aq, 1, [], [\(aqhttp://example.org/file\(aq]) [0, 1] .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.getOption([secret], gid) This method returns options of the download denoted by \fIgid\fP\&. The response is a struct where keys are the names of options. The values are strings. Note that this method does not return options which have no default value and have not been set on the command\-line, in configuration files or RPC methods. .sp The following examples get options of the download GID#2089b05ecca3d829. .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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:[\(aq2089b05ecca3d829\(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, ... .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> from pprint import pprint >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> r = s.aria2.getOption(\(aq2089b05ecca3d829\(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, .... .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.changeOption([secret], gid, options) This method changes options of the download denoted by \fIgid\fP (string) dynamically. \fIoptions\fP is a struct. The options listed in \fI\%Input File\fP subsection are available, \fBexcept\fP for following options: .INDENT 7.0 .IP \(bu 2 \fI\%dry\-run\fP .IP \(bu 2 \fI\%metalink\-base\-uri\fP .IP \(bu 2 \fI\%parameterized\-uri\fP .IP \(bu 2 \fI\%pause\fP .IP \(bu 2 \fI\%piece\-length\fP .IP \(bu 2 \fI\%rpc\-save\-upload\-metadata\fP .UNINDENT .sp Except for the following options, changing the other options of active download makes it restart (restart itself is managed by aria2, and no user intervention is required): .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\%force\-save\fP .IP \(bu 2 \fI\%max\-download\-limit\fP .IP \(bu 2 \fI\%max\-upload\-limit\fP .UNINDENT .sp This method returns \fBOK\fP for success. .sp The following examples set the \fI\%max\-download\-limit\fP option to \fB20K\fP for the download GID#2089b05ecca3d829. .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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:[\(aq2089b05ecca3d829\(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} .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.changeOption(\(aq2089b05ecca3d829\(aq, {\(aqmax\-download\-limit\(aq:\(aq20K\(aq}) \(aqOK\(aq .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.getGlobalOption([secret]) This method returns the global options. The response is a struct. Its keys are the names of options. Values are strings. Note that this method does not return options which have no default value and have not been set on the command\-line, in configuration files or RPC methods. Because global options are used as a template for the options of newly added downloads, the response contains keys returned by the \fI\%aria2.getOption()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.changeGlobalOption([secret], options) This method changes global options dynamically. \fIoptions\fP is a struct. The following options are available: .INDENT 7.0 .IP \(bu 2 \fI\%bt\-max\-open\-files\fP .IP \(bu 2 \fI\%download\-result\fP .IP \(bu 2 \fI\%keep\-unfinished\-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\%optimize\-concurrent\-downloads\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, options listed in the \fI\%Input File\fP subsection are available, \fBexcept\fP for following options: \fI\%checksum\fP, \fI\%index\-out\fP, \fI\%out\fP, \fI\%pause\fP and \fI\%select\-file\fP\&. .sp With the \fI\%log\fP option, you can dynamically start logging or change log file. To stop logging, specify an empty string(\(dq\(dq) as the parameter value. Note that log file is always opened in append mode. This method returns \fBOK\fP for success. .UNINDENT .INDENT 0.0 .TP .B aria2.getGlobalStat([secret]) This method returns global statistics such as the overall download and upload speeds. The response is a struct and contains the following keys. Values are strings. .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 in the current session. This value is capped by the \fI\%\-\-max\-download\-result\fP option. .TP .B \fBnumStoppedTotal\fP The number of stopped downloads in the current session and \fInot\fP capped by the \fI\%\-\-max\-download\-result\fP option. .UNINDENT .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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}} .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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} .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.purgeDownloadResult([secret]) This method purges completed/error/removed downloads to free memory. This method returns \fBOK\fP\&. .UNINDENT .INDENT 0.0 .TP .B aria2.removeDownloadResult([secret], gid) This method removes a completed/error/removed download denoted by \fIgid\fP from memory. This method returns \fBOK\fP for success. .sp The following examples remove the download result of the download GID#2089b05ecca3d829. .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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:[\(aq2089b05ecca3d829\(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} .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.removeDownloadResult(\(aq2089b05ecca3d829\(aq) \(aqOK\(aq .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.getVersion([secret]) This method returns the version of aria2 and the list of enabled features. The response is a struct and contains following keys. .INDENT 7.0 .TP .B \fBversion\fP Version number of aria2 as a string. .TP .B \fBenabledFeatures\fP List of enabled features. Each feature is given as a string. .UNINDENT .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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}} .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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} .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.getSessionInfo([secret]) This method returns session information. The response is a 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 .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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}} .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.aria2.getSessionInfo() {\(aqsessionId\(aq: \(aqcd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B aria2.shutdown([secret]) This method shuts down aria2. This method returns \fBOK\fP\&. .UNINDENT .INDENT 0.0 .TP .B aria2.forceShutdown([secret]) This method shuts down \fBaria2()\fP\&. This method behaves like :func:\(aqaria2.shutdown\(ga without performing any actions which take time, such as contacting BitTorrent trackers to unregister downloads first. This method returns \fBOK\fP\&. .UNINDENT .INDENT 0.0 .TP .B aria2.saveSession([secret]) This method saves the current session to a file specified by the \fI\%\-\-save\-session\fP option. This method returns \fBOK\fP if it succeeds. .UNINDENT .INDENT 0.0 .TP .B system.multicall(methods) This methods encapsulates multiple method calls in a single request. \fImethods\fP is an array of structs. The structs contain 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 call. This method returns an array of responses. The elements will be either a one\-item array containing the return value of the method call or a struct of fault element if an encapsulated method call fails. .sp In the following examples, we add 2 downloads. The first one is \fBhttp://example.org/file\fP and the second one is \fBfile.torrent\fP\&. .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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\(aq2089b05ecca3d829\(aq], [u\(aqd2703803b52216d1\(aq]]} .EE .UNINDENT .UNINDENT .sp JSON\-RPC additionally supports Batch requests as described in the JSON\-RPC 2.0 Specification: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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\(aq2089b05ecca3d829\(aq}, {u\(aqid\(aq: u\(aqasdf\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aqd2703803b52216d1\(aq}] .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> 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, mode=\(aqrb\(aq).read())) >>> r = mc() >>> tuple(r) (\(aq2089b05ecca3d829\(aq, \(aqd2703803b52216d1\(aq) .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B system.listMethods() This method returns all the available RPC methods in an array of string. Unlike other methods, this method does not require secret token. This is safe because this method just returns the available method names. .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqsystem.listMethods\(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\(aqaria2.addUri\(aq, u\(aqaria2.addTorrent\(aq, \&... .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.system.listMethods() [\(aqaria2.addUri\(aq, \(aqaria2.addTorrent\(aq, ... .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B system.listNotifications() This method returns all the available RPC notifications in an array of string. Unlike other methods, this method does not require secret token. This is safe because this method just returns the available notifications names. .sp \fBJSON\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import urllib2, json >>> from pprint import pprint >>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \&... \(aqmethod\(aq:\(aqsystem.listNotifications\(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\(aqaria2.onDownloadStart\(aq, u\(aqaria2.onDownloadPause\(aq, \&... .EE .UNINDENT .UNINDENT .sp \fBXML\-RPC Example\fP .INDENT 7.0 .INDENT 3.5 .sp .EX >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) >>> s.system.listNotifications() [\(aqaria2.onDownloadStart\(aq, \(aqaria2.onDownloadPause\(aq, ... .EE .UNINDENT .UNINDENT .UNINDENT .SS Error Handling .sp Over JSON\-RPC, aria2 returns a JSON object which contains an error code in \fBcode\fP and the error message in \fBmessage\fP\&. .sp Over XML\-RPC, aria2 returns \fBfaultCode=1\fP and the error message in \fBfaultString\fP\&. .SS Options .sp The same options as for \fI\%\-\-input\-file\fP are available. See the \fI\%Input File\fP subsection for a complete list of options. .sp In the option struct, the name element is the option name (without the preceding \fB\-\-\fP) and the value element is the argument as a string. .SS JSON\-RPC Example .INDENT 0.0 .INDENT 3.5 .sp .EX {\(aqsplit\(aq:\(aq1\(aq, \(aqhttp\-proxy\(aq:\(aqhttp://proxy/\(aq} .EE .UNINDENT .UNINDENT .SS XML\-RPC Example .INDENT 0.0 .INDENT 3.5 .sp .EX split 1 http\-proxy http://proxy/ .EE .UNINDENT .UNINDENT .sp The \fI\%header\fP and \fI\%index\-out\fP options are allowed multiple times on the command\-line. Since the name should be unique in a struct (many XML\-RPC library implementations use a hash or dict for struct), a single string is not enough. To overcome this limitation, you may use an array as the value as well as a string. .SS JSON\-RPC Example .INDENT 0.0 .INDENT 3.5 .sp .EX {\(aqheader\(aq:[\(aqAccept\-Language: ja\(aq, \(aqAccept\-Charset: utf\-8\(aq]} .EE .UNINDENT .UNINDENT .SS XML\-RPC Example .INDENT 0.0 .INDENT 3.5 .sp .EX header Accept\-Language: ja Accept\-Charset: utf\-8 .EE .UNINDENT .UNINDENT .sp The following example adds a download with two options: \fBdir\fP and \fBheader\fP\&. The \fBheader\fP option requires two values, so it uses a list: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> 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 .EE .UNINDENT .UNINDENT .SS JSON\-RPC using HTTP GET .sp The JSON\-RPC interface also supports requests 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: .INDENT 0.0 .INDENT 3.5 .sp .EX /jsonrpc?method=METHOD_NAME&id=ID¶ms=BASE64_ENCODED_PARAMS .EE .UNINDENT .UNINDENT .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 \fBaria2.tellStatus(\(aq2089b05ecca3d829\(aq)\fP with \fBid=\(aqfoo\(aq\fP looks like this: .INDENT 0.0 .INDENT 3.5 .sp .EX /jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D .EE .UNINDENT .UNINDENT .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 \fB[\(dq2089b05ecca3d829\(dq]\fP, therefore: .INDENT 0.0 .INDENT 3.5 .sp .EX [\(dq2089b05ecca3d829\(dq] \-\-(Base64)\-\-> WyIyMDg5YjA1ZWNjYTNkODI5Il0= \-\-(Percent Encode)\-\-> WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D .EE .UNINDENT .UNINDENT .sp The JSON\-RPC interface also supports JSONP. You can specify the callback function in the \fBjsoncallback\fP parameter: .INDENT 0.0 .INDENT 3.5 .sp .EX /jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D&jsoncallback=cb .EE .UNINDENT .UNINDENT .sp For Batch requests, the \fBmethod\fP and \fBid\fP parameters must not be specified. The whole request must be specified in the \fBparams\fP parameter. For example, a Batch request: .INDENT 0.0 .INDENT 3.5 .sp .EX [{\(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}] .EE .UNINDENT .UNINDENT .sp must be encoded like this: .INDENT 0.0 .INDENT 3.5 .sp .EX /jsonrpc?params=W3sianNvbnJwYyI6ICIyLjAiLCAiaWQiOiAicXdlciIsICJtZXRob2QiOiAiYXJpYTIuZ2V0VmVyc2lvbiJ9LCB7Impzb25ycGMiOiAiMi4wIiwgImlkIjogImFzZGYiLCAibWV0aG9kIjogImFyaWEyLnRlbGxBY3RpdmUifV0%3D .EE .UNINDENT .UNINDENT .SS JSON\-RPC over WebSocket .sp JSON\-RPC over WebSocket uses same method signatures and response format as 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 a serialized JSON string in a Text frame. The response from the RPC server is delivered also in a Text frame. .SS Notifications .sp The RPC server might send notifications to the client. Notifications is unidirectional, therefore the client which receives the notification must not respond to it. The method signature of a notification is much like a normal method request but lacks the id key. The value of the params key is the data which this notification carries. The format of the 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 when 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 when a download is paused. The \fIevent\fP is the same struct as the \fIevent\fP argument of \fI\%aria2.onDownloadStart()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.onDownloadStop(event) This notification will be sent when a download is stopped by the user. The \fIevent\fP is the same struct as the \fIevent\fP argument of \fI\%aria2.onDownloadStart()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.onDownloadComplete(event) This notification will be sent when a download is complete. For BitTorrent downloads, this notification is sent when the download is complete 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 when a download is stopped due to an error. The \fIevent\fP is the same struct as the \fIevent\fP argument of \fI\%aria2.onDownloadStart()\fP method. .UNINDENT .INDENT 0.0 .TP .B aria2.onBtDownloadComplete(event) This notification will be sent when a torrent download is complete but seeding is still going on. The \fIevent\fP is the same struct as 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 (running on localhost) with option \fI\%\-\-dir=/downloads\fP and prints the RPC response: .INDENT 0.0 .INDENT 3.5 .sp .EX #!/usr/bin/env ruby require \(aqxmlrpc/client\(aq require \(aqpp\(aq client=XMLRPC::Client.new2(\(dqhttp://localhost:6800/rpc\(dq) options={ \(dqdir\(dq => \(dq/downloads\(dq } result=client.call(\(dqaria2.addUri\(dq, [ \(dqhttp://localhost/aria2.tar.bz2\(dq ], options) pp result .EE .UNINDENT .UNINDENT .sp If you are a Python lover, you can use xmlrpclib (Python3 uses xmlrpc.client instead) to interact with aria2: .INDENT 0.0 .INDENT 3.5 .sp .EX import xmlrpclib from pprint import pprint s = xmlrpclib.ServerProxy(\(dqhttp://localhost:6800/rpc\(dq) r = s.aria2.addUri([\(dqhttp://localhost/aria2.tar.bz2\(dq], {\(dqdir\(dq:\(dq/downloads\(dq}) pprint(r) .EE .UNINDENT .UNINDENT .SH MISC .SS Console Readout .sp While downloading files, aria2 prints a readout to the console to show the progress of the downloads. The console readout looks like this: .INDENT 0.0 .INDENT 3.5 .sp .EX [#2089b0 400.0KiB/33.2MiB(1%) CN:1 DL:115.7KiB ETA:4m51s] .EE .UNINDENT .UNINDENT .sp This section describes what these numbers and strings mean. .INDENT 0.0 .TP .B \fB#NNNNNN\fP The first 6 characters of the GID as a hex string. The GID is an unique ID for each download, internal to aria2. The GID is particularly useful when interacting with aria2 using the RPC interface. .TP .B \fBX/Y(Z%)\fP Completed length, the total file length and its progress. If \fI\%\-\-select\-file\fP is used, this is the sum of selected files. .TP .B \fBSEED\fP Share ratio when the aria2 is seeding a finished torrent. .TP .B \fBCN\fP The number of connections aria2 has established. .TP .B \fBSD\fP The number of seeders aria2 is connected to. .TP .B \fBDL\fP Download speed (bytes per second). .TP .B \fBUL\fP Upload speed (bytes per second) and the number of uploaded bytes. .TP .B \fBETA\fP Expected time to finish the download. .UNINDENT .sp When more than one download is in progress, some of the information described above will be omitted in order to show information for several downloads. And the overall download and upload speeds are shown at the beginning of the line. .sp When aria2 is allocating file space or validating checksums, it additionally prints the progress of these operations: .INDENT 0.0 .TP .B FileAlloc GID, already allocated length and total length in bytes. .TP .B Checksum GID, already validated length and total length in bytes. .UNINDENT .SH EXAMPLE .SS HTTP/FTP Segmented Downloads .SS Download a file .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \(dqhttp://host/file.zip\(dq .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 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. .UNINDENT .UNINDENT .SS Download a file from two different HTTP servers .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \(dqhttp://host/file.zip\(dq \(dqhttp://mirror/file.zip\(dq .EE .UNINDENT .UNINDENT .SS Download a file from one host using multiple connections .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-x2 \-k1M \(dqhttp://host/file.zip\(dq .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The \-x option specified the number of allowed connections, while the \-k option specified the size of chunks. .UNINDENT .UNINDENT .SS Download a file from HTTP and FTP servers at the same time .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \(dqhttp://host1/file.zip\(dq \(dqftp://host2/file.zip\(dq .EE .UNINDENT .UNINDENT .SS Download files listed in a text file concurrently .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-ifiles.txt \-j2 .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 \-j option specifies the number of parallel downloads. .UNINDENT .UNINDENT .SS Using a proxy .sp For HTTP: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-http\-proxy=\(dqhttp://proxy:8080\(dq \(dqhttp://host/file\(dq .EE .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-http\-proxy=\(dqhttp://proxy:8080\(dq \-\-no\-proxy=\(dqlocalhost,127.0.0.1,192.168.0.0/16\(dq \(dqhttp://host/file\(dq .EE .UNINDENT .UNINDENT .sp For FTP: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-ftp\-proxy=\(dqhttp://proxy:8080\(dq \(dqftp://host/file\(dq .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 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. .UNINDENT .UNINDENT .SS Using a Proxy with authorization .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-http\-proxy=\(dqhttp://username:password@proxy:8080\(dq \(dqhttp://host/file\(dq .EE .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-http\-proxy=\(dqhttp://proxy:8080\(dq \-\-http\-proxy\-user=\(dqusername\(dq \-\-http\-proxy\-passwd=\(dqpassword\(dq \(dqhttp://host/file\(dq .EE .UNINDENT .UNINDENT .SS Metalink Download .SS Download files with remote Metalink .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-follow\-metalink=mem \(dqhttp://host/file.metalink\(dq .EE .UNINDENT .UNINDENT .SS Download using a local metalink file .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-p \-\-lowest\-speed\-limit=4000 file.metalink .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 To stop a download, press \fBCtrl\-C\fP\&. You can resume the transfer by running aria2c with the same argument in the same directory. .UNINDENT .UNINDENT .SS Download several local metalink files .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-j2 file1.metalink file2.metalink .EE .UNINDENT .UNINDENT .SS Download only selected files .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-select\-file=1\-4,8 file.metalink .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The index is printed to the console using \-S option. .UNINDENT .UNINDENT .SS Download a file using a local metalink file with user preference .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-metalink\-location=jp,us \-\-metalink\-version=1.1 \-\-metalink\-language=en\-US file.metalink .EE .UNINDENT .UNINDENT .SS BitTorrent Download .SS Download files using a remote BitTorrent file .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-follow\-torrent=mem \(dqhttp://host/file.torrent\(dq .EE .UNINDENT .UNINDENT .SS Download using a local torrent file .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-max\-upload\-limit=40K file.torrent .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 \-\-max\-upload\-limit specifies the max of upload rate. .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 To stop a download, press \fBCtrl\-C\fP\&. You can resume the transfer later by running aria2c with the same argument in the same directory. .UNINDENT .UNINDENT .SS Download using BitTorrent Magnet URI .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \(dqmagnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C&dn=aria2\(dq .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Don\(aqt forget to quote BitTorrent Magnet URIs which include \fB&\fP characters with single(\fB\(aq\fP) or double(\fB\(dq\fP) quotes when specifying URIs on the command\-line. .UNINDENT .UNINDENT .SS Download 2 torrents .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-j2 file1.torrent file2.torrent .EE .UNINDENT .UNINDENT .SS Download a file via torrent and HTTP/FTP server in parallel .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-Ttest.torrent \(dqhttp://host1/file\(dq \(dqftp://host2/file\(dq .EE .UNINDENT .UNINDENT .SS Only download specific files (usually called \(dqselected download\(dq) .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-select\-file=1\-4,8 file.torrent .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The index is printed to the console using \-S option. .UNINDENT .UNINDENT .SS Download a .torrent file, but do not download the torrent .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-follow\-torrent=false \(dqhttp://host/file.torrent\(dq .EE .UNINDENT .UNINDENT .SS Specify the output file name .sp To specify the output file name for BitTorrent downloads, you need to know the index of file in the torrent (see \fI\%\-\-show\-files\fP). For example, the output looks like this: .INDENT 0.0 .INDENT 3.5 .sp .EX idx|path/length ===+====================== 1|dist/base\-2.6.18.iso |99.9MiB \-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 2|dist/driver\-2.6.18.iso |169.0MiB \-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .EE .UNINDENT .UNINDENT .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: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-dir=/tmp \-\-index\-out=1=mydir/base.iso \-\-index\-out=2=dir/driver.iso file.torrent .EE .UNINDENT .UNINDENT .SS Change the listening ports for incoming peer connections .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-listen\-port=7000\-7001,8000 file.torrent .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Since aria2 doesn\(aqt configure firewalls or routers for port forwarding, it\(aqs up to you to do so manually. .UNINDENT .UNINDENT .SS Specify conditions to stop seeding after torrent downloads finish .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-seed\-time=120 \-\-seed\-ratio=1.0 file.torrent .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 In the above example, the program stops seeding after 120 minutes since download completed or seed ratio reaches 1.0. .UNINDENT .UNINDENT .SS Throttle upload speed .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-max\-upload\-limit=100K file.torrent .EE .UNINDENT .UNINDENT .SS Enable IPv4 DHT .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-enable\-dht \-\-dht\-listen\-port=6881 file.torrent .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 DHT uses UDP. Since aria2 doesn\(aqt configure firewalls or routers for port forwarding, it\(aqs up to you to do it manually. .UNINDENT .UNINDENT .SS Enable IPv6 DHT .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-enable\-dht6 \-\-dht\-listen\-port=6881 \-\-dht\-listen\-addr6=YOUR_GLOBAL_UNICAST_IPV6_ADDR .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 aria2 uses the same ports as IPv4 for IPv6. .UNINDENT .UNINDENT .SS Add and remove tracker URIs .sp Ignore all tracker announce URIs defined in file.torrent and use \fBhttp://tracker1/announce\fP and \fBhttp://tracker2/announce\fP instead: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-bt\-exclude\-tracker=\(dq*\(dq \-\-bt\-tracker=\(dqhttp://tracker1/announce,http://tracker2/announce\(dq file.torrent .EE .UNINDENT .UNINDENT .SS More advanced HTTP features .SS Load cookies .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-load\-cookies=cookies.txt \(dqhttp://host/file.zip\(dq .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 You can use Firefox/Mozilla/Chromium\(aqs cookie files without modification. .UNINDENT .UNINDENT .SS Resume download started by web browsers or other programs .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-c \-s2 \(dqhttp://host/partiallydownloadedfile.zip\(dq .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 This will only work when the initial download was not multi\-segmented. .UNINDENT .UNINDENT .SS Client certificate authorization for SSL/TLS .sp Specify a PKCS12 file as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-certificate=/path/to/mycert.p12 .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The file specified in \fI\%\-\-certificate\fP must be contain one PKCS12 encoded certificate and key. The password must be blank. .UNINDENT .UNINDENT .sp Alternatively, if PEM files are supported, use a command like the following: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-certificate=/path/to/mycert.pem \-\-private\-key=/path/to/mykey.pem https://host/file .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The file specified in \fI\%\-\-private\-key\fP must be decrypted; an encrypted key may cause undefined behavior. .UNINDENT .UNINDENT .SS Verify SSL/TLS servers using given CA certificates .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-ca\-certificate=/path/to/ca\-certificates.crt \-\-check\-certificate https://host/file .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 This option is only available when aria2 was compiled against GnuTLS or OpenSSL. WinTLS and AppleTLS will always use the system certificate store. Instead of \fB\(ga\-\-ca\-certificate\fP install the certificate in that store. .UNINDENT .UNINDENT .SS RPC .SS Encrypt RPC traffic with SSL/TLS .sp Specify a server PKC12 file: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-enable\-rpc \-\-rpc\-certificate=/path/to/server.p12 \-\-rpc\-secure .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The file specified in \fI\%\-\-rpc\-certificate\fP must be contain one PKCS12 encoded certificate and key. The password must be blank. .UNINDENT .UNINDENT .sp Alternatively, when PEM files are supported (GnuTLS and OpenSSL), specify the server certificate file and private key file as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-enable\-rpc \-\-rpc\-certificate=/path/to/server.crt \-\-rpc\-private\-key=/path/to/server.key \-\-rpc\-secure .EE .UNINDENT .UNINDENT .SS And more advanced features .SS Throttle the download speed .sp Per\-download: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-max\-download\-limit=100K file.metalink .EE .UNINDENT .UNINDENT .sp Overall: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-max\-overall\-download\-limit=100K file.metalink .EE .UNINDENT .UNINDENT .SS Repair a damaged download .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-V file.metalink .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Repairing damaged downloads can be done efficiently when used with BitTorrent or Metalink with chunk checksums. .UNINDENT .UNINDENT .SS Drop connections if download speed is lower than a specified limit .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-lowest\-speed\-limit=10K file.metalink .EE .UNINDENT .UNINDENT .SS Parameterized URI support .sp You can specify set of parts: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-P \(dqhttp://{host1,host2,host3}/file.iso\(dq .EE .UNINDENT .UNINDENT .sp You can specify numeric sequence: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-Z \-P \(dqhttp://host/image[000\-100].png\(dq .EE .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The \-Z option is required if the URIs don\(aqt point to the same file, such as in the above example. .UNINDENT .UNINDENT .sp You can specify step counter: .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-Z \-P \(dqhttp://host/image[A\-Z:2].png\(dq .EE .UNINDENT .UNINDENT .SS Verifying checksums .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-checksum=sha\-1=0192ba11326fe2298c8cb4de616f4d4140213837 http://example.org/file .EE .UNINDENT .UNINDENT .SS Parallel downloads of an arbitrary number of URIs, metalink, torrent .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-j3 \-Z \(dqhttp://host/file1\(dq file2.torrent file3.metalink .EE .UNINDENT .UNINDENT .SS BitTorrent Encryption .sp Encrypt the whole payload using ARC4 (obfuscation): .INDENT 0.0 .INDENT 3.5 .sp .EX $ aria2c \-\-bt\-min\-crypto\-level=arc4 \-\-bt\-require\-crypto=true file.torrent .EE .UNINDENT .UNINDENT .SH SEE ALSO .sp Project Web Site: \fI\%https://aria2.github.io/\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, 2015 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. .