ARIA2C(1)
ARIA2C(1) β aria2c, the ultra fast download utility πβ¨
πΈ NAME
aria2c - The ultra fast download utility. That's the whole vibe, bestie. π
β¨ SYNOPSIS
aria2c [<OPTIONS>] [<URI>|<MAGNET>|<TORRENT_FILE>|<METALINK_FILE>] ...
π« DESCRIPTION
okay so aria2 is literally 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. No cap. π¦
π OPTIONS
NOTE: Most FTP related options are applicable to SFTP as well. Some options are not effective against SFTP (e.g., --ftp-pasv). Not me finding that out the hard way, but okay. π
π Basic Options
-d,--dir=<DIR>β The directory to store the downloaded file. Basically where your treasure goes. π΄β οΈ-i,--input-file=<FILE>β Downloads the URIs listed inFILE. You can specify multiple sources for a single entity by putting multiple URIs on a single line separated by the TAB character. Additionally, options can be specified after each URI line. Option lines must start with one or more white space characters (SPACE or TAB) and must only contain one option per line. Input files can use gzip compression. WhenFILEis specified as-, aria2 will read the input from stdin. See the Input File subsection for details. See also the--deferred-inputoption. See also the--save-sessionoption. Obsessed with the flexibility. π-l,--log=<LOG>β The file name of the log file. If-is specified, log is written to stdout. If empty string("") is specified, or this option is omitted, no log is written to disk at all. So if you're a no-log girlie, that's valid. π-j,--max-concurrent-downloads=<N>β Set the maximum number of parallel downloads for every queue item. See also the--splitoption. Default:5
NOTE:--max-concurrent-downloadslimits the number of items which are downloaded concurrently.--splitand--min-split-sizeaffect the number of connections inside each item. Imagine that you have an input file (see--input-fileoption) like this:
http://example.com/foo
http://example.com/bar
Here is 2 download items. aria2 can download these items concurrently if the value more than or equal 2 is given to--max-concurrent-downloads. In each download item, you can configure the number of connections using--splitand/or--min-split-size, etc.
-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--checksumoption. 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:false-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. Main character energy for resuming. π«Ά-h,--help[=<TAG>|<KEYWORD>]β The help messages are classified with tags. A tag starts with#. For example, type--help=#httpto get the usage for the options tagged with#http. If non-tag word is given, print the usage for the options whose name includes that word. Available Values:#basic,#advanced,#http,#https,#ftp,#metalink,#bittorrent,#cookie,#hook,#file,#rpc,#checksum,#experimental,#deprecated,#help,#allDefault:#basic
π HTTP/FTP/SFTP Options
--all-proxy=<PROXY>β Use a proxy server for all protocols. To override a previously defined proxy, use"". You also can override this setting and specify a proxy server for a particular protocol using--http-proxy,--https-proxyand--ftp-proxyoptions. This affects all downloads. The format ofPROXYis[http://][USER:PASSWORD@]HOST[:PORT]. See also ENVIRONMENT section.
NOTE: If user and password are embedded in proxy URI and they are also specified by--{http,https,ftp,all}-proxy-{user,passwd}options, those specified later override prior options. For example, if you specifiedhttp-proxy-user=myname,http-proxy-passwd=mypassinaria2.confand you specified--http-proxy="http://proxy"on the command-line, then you'd get HTTP proxyhttp://proxywith usermynameand passwordmypass. Another example: if you specified on the command-line--http-proxy="http://user:pass@proxy"--http-proxy-user="myname"--http-proxy-passwd="mypass", then you'd get HTTP proxyhttp://proxywith usermynameand passwordmypass. One more example: if you specified in command-line--http-proxy-user="myname"--http-proxy-passwd="mypass"--http-proxy="http://user:pass@proxy", then you'd get HTTP proxyhttp://proxywith useruserand passwordpass.
--all-proxy-passwd=<PASSWD>β Set password for--all-proxyoption.--all-proxy-user=<USER>β Set user for--all-proxyoption.--checksum=<TYPE>=<DIGEST>β Set checksum.TYPEis hash type. The supported hash type is listed in Hash Algorithms inaria2c -v.DIGESTis hex digest. For example, setting sha-1 digest looks like this:sha-1=0192ba11326fe2298c8cb4de616f4d4140213838This option applies only to HTTP(S)/FTP downloads.--connect-timeout=<SEC>β 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--timeoutoption is used instead. Default:60--dry-run [true|false]β Iftrueis given, aria2 just checks whether the remote file is available and doesn't download data. This option has effect on HTTP/FTP download. BitTorrent downloads are canceled iftrueis specified. Default:false--lowest-speed-limit=<SPEED>β Close connection if download speed is lower than or equal to this value(bytes per sec).0means aria2 does not have a lowest speed limit. You can appendKorM(1K = 1024,1M = 1024K). This option does not affect BitTorrent downloads. Default:0-x,--max-connection-per-server=<NUM>β The maximum number of connections to one server for each download. Default:1--max-file-not-found=<NUM>β If aria2 receives "file not found" status from the remote HTTP/FTP serversNUMtimes without getting a single byte, then force the download to fail. Specify0to disable this option. This options is effective only when using HTTP/FTP servers. The number of retry attempt is counted toward--max-tries, so it should be configured too.
Default: 0
-m,--max-tries=<N>β Set number of tries.0means unlimited. See also--retry-wait. Default:5-k,--min-split-size=<SIZE>β aria2 does not split less than2*SIZEbyte range. For example, let's consider downloading 20MiB file. IfSIZEis10M, aria2 can split file into 2 range[0-10MiB)and[10MiB-20MiB)and download it using 2 sources(if--split >= 2, of course). IfSIZEis15M, since2*15M > 20MiB, aria2 does not split file and download it using 1 source. You can appendKorM(1K = 1024,1M = 1024K). Possible Values:1M -1024MDefault:20M--netrc-path=<FILE>β Specify the path to the netrc file. Default:$(HOME)/.netrc
NOTE: Permission of the.netrcfile must be600. Otherwise, the file will be ignored.
-n,--no-netrc [true|false]β Disables netrc support. netrc support is enabled by default.
NOTE: netrc file is only read at the startup if--no-netrcis false. So if--no-netrcis true at the startup, no netrc is available throughout the session. You cannot get netrc enabled even if you send--no-netrc=falseusingaria2.changeGlobalOption().
--no-proxy=<DOMAINS>β Specify a comma separated list of host names, domains and network addresses with or without a subnet mask where no proxy should be used.
NOTE: 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 --no-proxy. So it is only effective if URI has numeric IP addresses.
-o,--out=<FILE>β The file name of the downloaded file. It is always relative to the directory given in--diroption. When the--force-sequentialoption is used, this option is ignored.
NOTE: 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--input-file,--force-sequentialoption. Example:
$ aria2c -o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip"
--proxy-method=<METHOD>β Set the method to use in proxy request.METHODis eithergetortunnel. HTTPS downloads always usetunnelregardless of this option. Default:get-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:false--reuse-uri [true|false]β Reuse already used URIs if no unused URIs are left. Default:true--retry-wait=<SEC>β Set the seconds to wait between retries. WhenSEC > 0, aria2 will retry downloads when the HTTP server returns a 503 response. Default:0--server-stat-of=<FILE>β Okay bestie, this is where you tell aria2 to save the server performance receipts. Specify the file name to which the performance profile of the servers is saved. You can load that saved data later using the--server-stat-ifoption. The file format? It's in the Server Performance Profile subsection below, iykyk. πΎβ¨--server-stat-if=<FILE>β Load up the performance profile of the servers from this file. The loaded data gets used in some URI selectors likefeedback. Peep the--uri-selectoroption too. File format is in the Server Performance Profile subsection below. ππ¦--server-stat-timeout=<SEC>β Sets a timeout in seconds to invalidate the performance profile of the servers since the last contact to them. Default:86400(that's 24 hours, no cap). β°π-s, --split=<N>β Download a file usingNconnections. If more thanNURIs are given, the firstNURIs are used and the remaining URIs are used for backup. If less thanNURIs are given, those URIs are used more than once so thatNconnections total are made simultaneously. The number of connections to the same host is restricted by the--max-connection-per-serveroption. See also the--min-split-sizeoption. Default:5. π
NOTE: Some Metalinks regulate the number of servers to connect. aria2 strictly respects them. This means that if Metalink defines themaxconnectionsattribute lower thanN, then aria2 uses the value of this lower value instead ofN. ππ
--stream-piece-selector=<SELECTOR>β Specify the 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:default. π§©defaultβ Select a piece to reduce the number of connections established. This is reasonable default behavior because establishing a connection is an expensive operation. πΈinorderβ Select a piece closest to the beginning of the file. This is useful for viewing movies while downloading.--enable-http-pipeliningoption may be useful to reduce re-connection overhead. Note that aria2 honors--min-split-sizeoption, so it will be necessary to specify a reasonable value to--min-split-sizeoption. π¬randomβ Select a piece randomly. Likeinorder,--min-split-sizeoption is honored. π²geomβ When starting to download a file, select a piece closest to the beginning of the file likeinorder, 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. π
-t, --timeout=<SEC>β Set timeout in seconds. Default:60. β³--uri-selector=<SELECTOR>β Specify URI selection algorithm. The possible values areinorder,feedback, andadaptive. Ifinorderis given, URI is tried in the order appeared in the URI list. Iffeedbackis given, aria2 uses download speed observed in the previous downloads and chooses the 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--server-stat-ofand--server-stat-ifoptions. Ifadaptiveis 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't select anymore mirrors. Likefeedback, it uses a performance profile of servers. Default:feedback. πβ¨
HTTP Specific Options ππ
--ca-certificate=<FILE>β Use the certificate authorities inFILEto verify the peers. The certificate file must be in PEM format and can contain multiple CA certificates. Use--check-certificateoption to enable verification. π
NOTE: If you build with OpenSSL or the recent version of GnuTLS which has gnutls_certificate_set_x509_system_trust() function and the library is properly configured to locate the system-wide CA certificates store, aria2 will automatically load those certificates at the startup. π οΈ
NOTE: WinTLS and AppleTLS do not support this option. Instead you will have to import the certificate into the OS trust store. π«
--certificate=<FILE>β Use the client certificate inFILE. The certificate must be either in PKCS12 (.p12,.pfx) or in PEM format. 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! When using PEM, you have to specify the private key via--private-keyas well. πͺͺ
NOTE: WinTLS does not support PEM files at the moment. Users have to use PKCS12 files. π
NOTE: AppleTLS 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 startaria2cuse--certificate=<SHA-1>. Alternatively PKCS12 files are also supported. PEM files, however, are not supported. π
--check-certificate [true|false]β Verify the peer using certificates specified in--ca-certificateoption. Default:true. β--http-accept-gzip [true|false]β SendAccept-Encoding: deflate, gziprequest header and inflate response if remote server responds withContent-Encoding: gziporContent-Encoding: deflate. Default:false. ποΈ
NOTE: Some server responds with Content-Encoding: gzip for files which itself is gzipped file. aria2 inflates them anyway because of the response header. π
--http-auth-challenge [true|false]β Send HTTP authorization header only when it is requested by the server. Iffalseis 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:false. π--http-no-cache [true|false]β SendCache-Control: no-cacheandPragma: no-cacheheader to avoid cached content. Iffalseis given, these headers are not sent and you can addCache-Controlheader with a directive you like using--headeroption. Default:false. π«--http-user=<USER>β Set HTTP user. This affects all URIs. π€--http-passwd=<PASSWD>β Set HTTP password. This affects all URIs. π--http-proxy=<PROXY>β Use a proxy server for HTTP. To override a previously defined proxy, use"". See also the--all-proxyoption. This affects all http downloads. The format ofPROXYis[http://][USER:PASSWORD@]HOST[:PORT]. π--http-proxy-passwd=<PASSWD>β Set password for--http-proxy. π--http-proxy-user=<USER>β Set user for--http-proxy. π€--https-proxy=<PROXY>β Use a proxy server for HTTPS. To override a previously defined proxy, use"". See also the--all-proxyoption. This affects all https download. The format ofPROXYis[http://][USER:PASSWORD@]HOST[:PORT]. π--https-proxy-passwd=<PASSWD>β Set password for--https-proxy. π--https-proxy-user=<USER>β Set user for--https-proxy. π€--private-key=<FILE>β Use the private key inFILE. The private key must be decrypted and in PEM format. An encrypted key may cause undefined behavior. See also--certificateoption. π--referer=<REFERER>β Set an http referrer (Referer). This affects all http/https downloads. If*is given, the download URI is also used as the referrer. This may be useful when used together with the--parameterized-urioption. π΅οΈ--enable-http-keep-alive [true|false]β Enable HTTP/1.1 persistent connection. Default:true. π--enable-http-pipelining [true|false]β Enable HTTP/1.1 pipelining. Default:false. π
NOTE: There is usually no performance gain from enabling this option. π
--header=<HEADER>β AppendHEADERto HTTP request header. You can use this option repeatedly to specify more than one header:
$ aria2c --header="X-A: b78" --header="X-B: 9J1" "http://host/file"
--load-cookies=<FILE>β Load Cookies fromFILEusing the Firefox3 format (SQLite3), Chromium/Google Chrome (SQLite3) and the Mozilla/Firefox(1.x/2.x)/Netscape format. πͺ
NOTE: If aria2 is built without libsqlite3, then it doesn't support Firefox3 and Chromium/Google Chrome cookie format. π’
--save-cookies=<FILE>β Save Cookies toFILEin Mozilla/Firefox(1.x/2.x)/Netscape format. IfFILEalready exists, it is overwritten. Session Cookies are also saved and their expiry values are treated as0. Possible Values:/path/to/file. πΎ--use-head [true|false]β Use HEAD method for the first request to the HTTP server. Default:false. π‘--no-want-digest-header [true|false]β Whether to disable Want-Digest header when doing requests. Default:false. π«-U, --user-agent=<USER_AGENT>β Set user agent for HTTP(S) downloads. Default:aria2/$VERSION,$VERSIONis replaced by package version. πΆοΈ
FTP/SFTP Specific Options πβ¨
--ftp-user=<USER>β Set FTP user. This affects all URIs. Default:anonymous. π€--ftp-passwd=<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:ARIA2USER@. π-p, --ftp-pasv [true|false]β Use the passive mode in FTP. Iffalseis given, the active mode will be used. Default:true. π
NOTE: This option is ignored for SFTP transfer. π«
--ftp-proxy=<PROXY>β route your FTP downloads through a proxy server, bestie. Wanna nuke a proxy you set earlier? Just throw""at it. Also peep--all-proxyif you're feeling thorough. This one hits every single FTP download, no exceptions. The shape ofPROXYis:
[http://][USER:PASSWORD@]HOST[:PORT]
--ftp-proxy-passwd=<PASSWD>β sets the password for whatever you put in--ftp-proxy. That's it, that's the whole job. π--ftp-proxy-user=<USER>β sets the user for--ftp-proxy. Matching set, slay.--ftp-type=<TYPE>β picks your FTP transfer type.TYPEis eitherbinaryorascii. Default:binary. πΈ
NOTE: this option gets completely ignored for SFTP transfers. Not "kinda ignored", ignored ignored. π
--ftp-reuse-connection [true|false]β reuse the connection in FTP. Default:true. Recycling is iconic, we love her. β»οΈ--ssh-host-key-md=<TYPE>=<DIGEST>β sets a checksum for the SSH host public key, so you can actually validate the server's public key when SFTP is in play.TYPEis the hash type, and the supported hash types aresha-1ormd5.DIGESTis the hex digest. Like, for example:
sha-1=b030503d4de4539dc7885e6f0f5e256704edf4c3
And here's the tea: if you don't set this option (which is the default), then no validation takes place. At all. Just so you know. π
π BitTorrent/Metalink Options π
--select-file=<INDEX>...β hand-pick which file you want by its index, no cap. Find that index with the--show-filesoption. Wanna grab a bunch? Separate them with,, like3,6. Wanna grab a whole range? Use-, like1-5. And yes,,and-can vibe together:1-5,8,9. When you're rolling with the-Moption, the index may shift depending on the query (go read the--metalink-*options for the full lore).
NOTE: in a multi-file torrent, the neighboring files around the one you picked might also get downloaded. That is by design, not a bug β say it with me. A single piece can span several files or just parts of files, and aria2 writes that piece to the appropriate files. It's giving teamwork. π«Ά
-S,--show-files [true|false]β prints out the file listing of.torrent,.meta4and.metalinkfiles, then dips (exits). And for.torrentfiles specifically, you also get the bonus info β infohash, piece length, all that good stuff. β¨
π₯ BitTorrent Specific Options π₯
--bt-detach-seed-only [true|false]β kicks seed-only downloads out of the concurrent active download count (that's the-joption, bestie). So picture this: you gave-j3, this option is on, and you've got 3 downloads active β then one of them enters seed mode. Boom, it's excluded from the active count (so now it's 2), and the next download chilling in the queue gets to start. But β and this is important β that seeding item is still recognized as an active download in the RPC method. So don't get it twisted. Default:false--bt-enable-hook-after-hash-check [true|false]β lets the hook command get invoked after a hash check (see the-Voption) in a BitTorrent download. By default, when the hash check succeeds, whatever command you gave--on-bt-download-completeruns. Wanna shut that down? Hand this option afalse. Default:true--bt-enable-lpd [true|false]β turns on Local Peer Discovery, cute. But heads up: if a torrent has the private flag set, aria2 won't use this feature for that download β even if you gave ittrue. Rules are rules. Default:false--bt-exclude-tracker=<URI>[,...]β a comma-separated list of BitTorrent tracker announce URIs you want removed. There's a special value*that matches all URIs, so it nukes every announce URI in sight. Oh, and when you're putting*on a shell command-line, do not forget to escape or quote it, or your shell will have opinions. See also the--bt-trackeroption.--bt-external-ip=<IPADDRESS>β sets the external IP address to use for BitTorrent download and DHT. It may get sent to the BitTorrent tracker. For DHT, you should set this so it reports that your local node is downloading a particular torrent β and honestly this is critical if you wanna use DHT in a private network. And even though the name says "external", it'll accept any kind of IP address you throw at it. Flexible queen. π--bt-force-encryption [true|false]β demands BitTorrent message payload encryption with arc4. It's just shorthand for:
--bt-require-crypto --bt-min-crypto-level=arc4
Note: this option does not change the option value of those two β it just acts like them. If you give it true, it denies the legacy BitTorrent handshake and only uses the Obfuscation handshake, and always encrypts the message payload. Default: false
--bt-hash-check-seed [true|false]β if you give ittrue, then after the hash check (using the--check-integrityoption) and the file turns out complete, it keeps seeding that file. If your vibe is "check it and only download when it's damaged or incomplete", then set this bad boy tofalse. Heads up: this option only does anything on BitTorrent downloads. Default:true--bt-load-saved-metadata [true|false]β when you're downloading with a magnet link, before it goes off to get torrent metadata from DHT, it first tries to read a file saved by the--bt-save-metadataoption. If that works out, it skips the whole DHT metadata download. Efficiency, we love to see it. Default:false--bt-lpd-interface=<INTERFACE>β uses the given interface for Local Peer Discovery. If you don't specify this option, the default interface gets chosen for you. You can specify an interface name or an IP address. Possible Values:interface,IP address--bt-max-open-files=<NUM>β the maximum number of files to open in multi-file BitTorrent/Metalink download, globally. Default:100--bt-max-peers=<NUM>β the maximum number of peers per torrent.0means unlimited, go wild. See also the--bt-request-peer-speed-limitoption. Default:55--bt-metadata-only [true|false]β downloads the metadata only. The file(s) described in that metadata will not be downloaded. This option only has an effect when a BitTorrent Magnet URI is used. See also the--bt-save-metadataoption. Default:false--bt-min-crypto-level=plain|arc4β sets the minimum level of encryption method. If a peer offers several encryption methods, aria2 picks the lowest one that still satisfies the level you gave. Default:plain--bt-prioritize-piece=head[=<SIZE>],tail[=<SIZE>]β tries to download the first and last pieces of each file first. Super useful for previewing files, ngl. The argument can contain 2 keywords:headandtail. To include both, separate them with a comma. Each keyword can take one parameter,SIZE. So if you sayhead=<SIZE>, the pieces in the range of the firstSIZEbytes of each file get higher priority.tail=<SIZE>means the range of the lastSIZEbytes of each file.SIZEcan includeKorM(1K = 1024, 1M = 1024K). IfSIZEis omitted,SIZE=1Mis used.--bt-remove-unselected-file [true|false]β removes the unselected files when the download completes in BitTorrent. To select files, use the--select-fileoption. If you don't use it, all files are assumed to be selected.
Please use this option with care, bestie, because it will literally remove files from your disk. Like, actually delete them. For real. π
Default: false
--bt-require-crypto [true|false]β if you give ittrue, aria2 refuses to accept and establish a connection with the legacy BitTorrent handshake (\19BitTorrent protocol). So aria2 always uses the Obfuscation handshake. No negotiating. Default:false--bt-request-peer-speed-limit=<SPEED>β if the whole download speed of every torrent is lower thanSPEED, aria2 temporarily bumps up the number of peers to chase more download speed. Configuring this with your preferred download speed can boost your speeds in some cases, fr fr. You can appendKorM(1K = 1024, 1M = 1024K). Default:50K--bt-save-metadata [true|false]β saves the metadata as a.torrentfile. Only has an effect when a BitTorrent Magnet URI is used. The file name is the hex encoded info hash with the suffix.torrent, and it saves to the same directory where the download file is saved. If the same file already exists, the metadata is not saved β no overwriting, no drama. See also the--bt-metadata-onlyoption. Default:false--bt-seed-unverified [true|false]β seeds previously downloaded files without verifying piece hashes. Living dangerously, respect. Default:false--bt-stop-timeout=<SEC>β stops the BitTorrent download if the download speed is 0 forSECconsecutive seconds. If you give it0, this whole feature is disabled. Default:0--bt-tracker=<URI>[,...]β a comma-separated list of additional BitTorrent tracker announce URIs. These URIs are not affected by the--bt-exclude-trackeroption, because they get added after the URIs in--bt-exclude-trackerare removed. Order of operations, iykyk.--bt-tracker-connect-timeout=<SEC>β sets the connect timeout in seconds for establishing a connection to the tracker. Once the connection is established, this option does nothing anymore, and the--bt-tracker-timeoutoption takes over instead. Default:60--bt-tracker-interval=<SEC>β sets the interval in seconds between tracker requests. This completely overrides the interval value β aria2 just uses this value and ignores both the min interval and the interval value in the tracker's response. If you set it to0, aria2 figures out the interval based on the tracker's response and the download progress. Default:0--bt-tracker-timeout=<SEC>β sets the timeout in seconds. Default:60--dht-entry-point=<HOST>:<PORT>β sets the host and port as an entry point to the IPv4 DHT network. πͺ--dht-entry-point6=<HOST>:<PORT>β same energy, but for the IPv6 DHT network. π--dht-file-path=<PATH>β changes the IPv4 DHT routing table file toPATH. Default:$HOME/.aria2/dht.datif present, otherwise$XDG_CACHE_HOME/aria2/dht.dat.--dht-file-path6=<PATH>β changes the IPv6 DHT routing table file toPATH. Default:$HOME/.aria2/dht6.datif present, otherwise$XDG_CACHE_HOME/aria2/dht6.dat.--dht-listen-addr6=<ADDR>β specifies the address to bind the socket for IPv6 DHT. It should be a global unicast IPv6 address of the host, so no funny business with local ones.--dht-listen-port=<PORT>...β sets the UDP listening port used by DHT (IPv4, IPv6) and the UDP tracker. You can specify multiple ports using,, for example6881,6885. You can also use-for a range:6881-6999. And yes,,and-can be used together. Default:6881-6999
NOTE: make sure those specified ports are open for incoming UDP traffic. Do the port-forwarding homework, bestie. π§
--dht-message-timeout=<SEC>β sets the timeout in seconds. Default:10--enable-dht [true|false]β turns on IPv4 DHT π« and guess what, it also switches on UDP tracker support while it's at it. BUT if a torrent has the private flag set, aria2 straight up will not use DHT for that download, even if you saidtrue. Default:true--enable-dht6 [true|false]β turns on IPv6 DHT β¨ same deal with the private flag: private torrent = no DHT for it, even withtrue. Wanna pick the port it listens on? That's--dht-listen-port's job. Also go peek at--dht-listen-addr6π--enable-peer-exchange [true|false]β enables the Peer Exchange extension π«Ά and yeah, private flag in a torrent disables this for that download too, even if you passedtrue. Default:true--follow-torrent=true|false|memβ okay so: if you saytrueormem, then whenever a file with suffix.torrentor content typeapplication/x-bittorrentgets downloaded, aria2 parses it as a torrent file and downloads the files inside it π₯. Saymemand the torrent file never touches your disk, it just vibes in memory π§ . Sayfalseand the.torrentfile gets downloaded to disk but is not parsed as a torrent and its contents are not downloaded. Default:true-O,--index-out=<INDEX>=<PATH>β sets the file path for the file withindex=INDEXπ. Wanna know the index? Use--show-files, bestie.PATHis a relative path to whatever--dirsays. You can stack this option multiple times. And yes, this is how you name your BitTorrent output files π--listen-port=<PORT>...β sets the TCP port number for BitTorrent downloads. Multiple ports? Separate them with,like6881,6885π. You can also use-for a range:6881-6999. And you can mix,and-together:6881-6889,6999. Default:6881-6999
NOTE: make sure those ports are actually open for incoming TCP traffic, okay?? πͺβ¨
--max-overall-upload-limit=<SPEED>β caps your overall upload speed in bytes/sec.0means unrestricted, go wild π. You can tack onKorM(1K = 1024,1M = 1024K). Per-torrent limit? That's--max-upload-limit. Default:0-u,--max-upload-limit=<SPEED>β caps upload speed per each torrent, in bytes/sec.0means unrestricted π¦. SameK/Mdeal (1K = 1024,1M = 1024K). For the overall cap use--max-overall-upload-limit. Default:0--peer-id-prefix=<PEER_ID_PREFIX>β sets the prefix of the peer ID π. A BitTorrent peer ID is exactly 20 bytes long. Give more than 20 bytes and only the first 20 get used. Give less than 20 and random byte data gets padded on until it hits 20 bytes.
Default: A2-$MAJOR-$MINOR-$PATCH-, where $MAJOR, $MINOR and $PATCH get swapped for the major, minor and patch version numbers respectively. So like, aria2 version 1.18.8 has prefix ID A2-1-18-8- π«
--peer-agent=<PEER_AGENT>β sets the string used during the BitTorrent extended handshake for the peer's client version πΈ.
Default: aria2/$MAJOR.$MINOR.$PATCH, where $MAJOR, $MINOR and $PATCH are replaced by major, minor and patch version number respectively. For instance, aria2 version 1.18.8 has peer agent aria2/1.18.8.
--seed-ratio=<RATIO>β sets the share ratio π. Completed torrents keep seeding until the share ratio hitsRATIO. Strongly encouraged to put1.0or more here, bestie. Put0.0if you plan to seed forever regardless of ratio, main character behaviour honestly π. If you also pass--seed-time, seeding stops as soon as at least one of the two conditions is satisfied. Default:1.0--seed-time=<MINUTES>β sets seeding time in (fractional) minutes β³. Also go look at--seed-ratio.
NOTE: --seed-time=0 disables seeding after the download completes. Zero. None. Bye π
-T,--torrent-file=<TORRENT_FILE>β the path to the.torrentfile π. Honestly you don't even need this option, because you can just pass.torrentfiles directly without--torrent-file. Iconic.
π Metalink Specific Options π
--follow-metalink=true|false|memβ iftrueormem, then when a file with suffix.meta4or.metalink, or content typeapplication/metalink4+xmlorapplication/metalink+xml, gets downloaded, aria2 parses it as a metalink file and downloads the files mentioned in it β¨. Withmem, the metalink file isn't written to disk, it's just kept in memory π§ . Withfalse, the.metalinkfile is downloaded to disk but is not parsed as a metalink file and its contents are not downloaded. Default:true--metalink-base-uri=<URI>β sets the base URI used to resolve relative URIs in themetalink:urlandmetalink:metaurlelements in a metalink file stored on your local disk π¦. IfURIpoints to a directory, it must end with/. Periodt.-M,--metalink-file=<METALINK_FILE>β the file path to a.meta4and.metalinkfile π. Reads input from stdin when-is specified. You don't need this option either, since you can specify.metalinkfiles without--metalink-file. Slay.--metalink-language=<LANGUAGE>β the language of the file to download πΈ--metalink-location=<LOCATION>[,...]β the location of the preferred server. A comma-delimited list of locations is acceptable, for examplejp,usπΊοΈ--metalink-os=<OS>β the operating system of the file to download π»--metalink-version=<VERSION>β the version of the file to download π--metalink-preferred-protocol=<PROTO>β sets the preferred protocol. Possible values arehttp,https,ftpandnone. Saynoneto disable this feature entirely. Default:none--metalink-enable-unique-protocol [true|false]β iftrue, and a mirror in a metalink file has several protocols available, aria2 uses one of them π. Use--metalink-preferred-protocolto say which one you prefer. Default:true
π RPC Options π
--enable-rpc [true|false]β enables the JSON-RPC/XML-RPC server π₯. Strongly recommended to set a secret authorization token with--rpc-secret. Also see--rpc-listen-port. Default:false--pause [true|false]β pauses the download after it's added. Only does anything when--enable-rpc=trueis given β. Default:false--pause-metadata [true|false]β pauses downloads created as a result of metadata download π§ . There are 3 types of metadata downloads in aria2: (1) downloading a.torrentfile. (2) downloading torrent metadata using a magnet link. (3) downloading a metalink file. These metadata downloads generate downloads using their metadata, and this option pauses those follow-up downloads. Only effective when--enable-rpc=trueis given. Default:false--rpc-allow-origin-all [true|false]β adds theAccess-Control-Allow-Originheader field with value*to the RPC response π. Default:false--rpc-certificate=<FILE>β uses the certificate inFILEfor the RPC server π. The certificate has to be either PKCS12 (.p12,.pfx) or PEM format.
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! Like, only those.
When using PEM, you also have to specify the private key via --rpc-private-key. Use --rpc-secure to enable encryption.
NOTE: WinTLS does not support PEM files at the moment. Users have to use PKCS12 files. Sorry bestie π
NOTE: AppleTLS 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 startaria2cwith--rpc-secure, use--rpc-certificate=<SHA-1>. Alternatively PKCS12 files are also supported. PEM files, however, are not supported. ππ
--rpc-listen-all [true|false]β listens for incoming JSON-RPC/XML-RPC requests on all network interfaces π. Iffalse, it only listens on the local loopback interface. Default:false--rpc-listen-port=<PORT>β sets a port number for the JSON-RPC/XML-RPC server to listen to. Possible Values:1024-65535. Default:6800--rpc-max-request-size=<SIZE>β sets the max size of a JSON-RPC/XML-RPC request. If aria2 sees the request is more thanSIZEbytes, it drops the connection π. Default:2M--rpc-passwd=<PASSWD>β sets the JSON-RPC/XML-RPC password π
WARNING:--rpc-passwdwill be deprecated in a future release. Migrate to--rpc-secretas soon as possible, bestie, fr fr π
--rpc-private-key=<FILE>β uses the private key inFILEfor the RPC server π. The private key must be decrypted and in PEM format. Use--rpc-secureto enable encryption. See also--rpc-certificate.--rpc-save-upload-metadata [true|false]β saves the uploaded torrent or metalink metadata in the directory specified by--dirπΎ. The file name is the SHA-1 hash hex string of the metadata plus an extension. For torrent, the extension is.torrent. For metalink, it's.meta4. Iffalseis given, the downloads added byaria2.addTorrent()oraria2.addMetalink()will not be saved by--save-session. Default:true--rpc-secret=<TOKEN>β sets the RPC secret authorization token π. Read "RPC authorization secret token" to know how this option value is used.--rpc-secure [true|false]β RPC transport gets encrypted by SSL/TLS π. The RPC clients must use thehttpsscheme to reach the server. For WebSocket clients, use thewssscheme. Use--rpc-certificateand--rpc-private-keyto specify the server certificate and private key.--rpc-user=<USER>β sets the JSON-RPC/XML-RPC user π
WARNING:--rpc-userwill be deprecated in a future release. Migrate to--rpc-secretas soon as possible π«Ά
β Advanced Options β
--allow-overwrite [true|false]β restarts the download from scratch if the corresponding control file doesn't exist π. See also--auto-file-renaming. Default:false
--allow-piece-length-change[true|false]β okay so if you passfalse, aria2 straight up aborts the download when the piece length doesn't match the one in the control file. Give ittrueand you can keep going, but bestie, you will lose some download progress. Default:falseπ--always-resume[true|false]β the "we don't give up" button π«Άtruemeans aria2 always tries to resume, and if resuming isn't possible, it aborts.falsemeans: when every URI you gave doesn't support resume, or aria2 runs intoNURIs that don't support resume (Nbeing whatever you set with--max-resume-failure-tries), it just downloads the file from scratch. Peep--max-resume-failure-triesfor that. Default:true--async-dns[true|false]β turn on asynchronous DNS. Default:trueβ¨--async-dns-server=<IPADDRESS>[,...]β a comma-separated list of DNS server addresses for the async DNS resolver to use. Normally the async resolver reads its DNS server addresses from/etc/resolv.conf, but when you use this option it uses your list instead of the ones in that file. Both IPv4 and IPv6 addresses are welcome. This one's a lifesaver when your system has no/etc/resolv.confand you don't have permission to create one. π--auto-file-renaming[true|false]β renames the file if a file with the same name already exists. Heads up: this only works for HTTP(S)/FTP downloads. The new name gets a dot and a number (1..9999) tacked on after the name, but before the file extension if there is one. Default:trueπΈ--auto-save-interval=<SEC>β saves a control file (*.aria2) everySECseconds. If you give it0, no control file gets saved during the download β but aria2 still saves one when it stops, no matter what value you picked. Possible values live between0to600. Default:60β°--conditional-get[true|false]β only download the file when your local copy is older than the remote one. This works with HTTP(S) downloads only. It does not work if a file size is specified in Metalink, and it also ignores theContent-Dispositionheader. If a control file exists, this option gets ignored entirely. It uses theIf-Modified-Sinceheader to conditionally grab only newer files. When it checks the modification time of the local file, it uses the file name you supplied (see--out) or the file name part in the URI if--outisn't specified. To overwrite an existing file, you need--allow-overwrite. Default:falseπ--conf-path=<PATH>β change the config file path to PATH. Default:$HOME/.aria2/aria2.confif present, otherwise$XDG_CONFIG_HOME/aria2/aria2.conf. π--console-log-level=<LEVEL>β sets the log level for console output. LEVEL is eitherdebug,info,notice,warnorerror. Default:noticeπ--content-disposition-default-utf8[true|false]β treats the quoted string in theContent-Dispositionheader as UTF-8 instead of ISO-8859-1 β think thefilenameparameter β but not the extended versionfilename*. Default:false-D,--daemon[true|false]β run as a daemon π The current working directory gets changed to/, and standard input, standard output and standard error all get redirected to/dev/null. Default:false--deferred-input[true|false]β withtrue, aria2 does not read all the URIs and options from the file you specified with--input-fileat startup. Instead it reads them one by one, later, whenever it needs them. This can lower memory usage if your input file is stacked with URIs to download. Withfalse, aria2 reads all URIs and options at startup. Default:false
WARNING: π¨--deferred-inputgets disabled when--save-sessionis used together with it. No cap.
--disable-ipv6[true|false]β disables IPv6. Super useful if you're stuck with broken DNS and want to dodge that painfully slow AAAA record lookup. Default:falseπ--disk-cache=<SIZE>β enables the disk cache. If SIZE is0, the disk cache is off. This feature caches downloaded data in memory, growing to at most SIZE bytes. The cache storage is made per aria2 instance and shared across all downloads. The glow-up here? It reduces disk I/O because data gets written in bigger units and reordered by the file offset. And if hash checking is involved and the data's already cached in memory, we don't have to read it from disk at all. β¨ SIZE can includeKorM(1K=1024,1M=1024K). Default:16M--download-result=<OPT>β changes how Download Results gets formatted. If OPT isdefault, it prints GID, status, average download speed and path/URI. When multiple files are involved, only the path/URI of the first requested file is printed and the rest get omitted. If OPT isfull, it prints GID, status, average download speed, percentage of progress and path/URI β with the percentage of progress and path/URI printed for each requested file in each row. If OPT ishide, Download Results is hidden. Default:defaultπ--dscp=<DSCP>β sets the DSCP value in outgoing IP packets of BitTorrent traffic, for QoS. It only sets the DSCP bits in the TOS field of IP packets, not the whole field. Careful here: if you're pulling values from/usr/include/netinet/ip.h, divide them by4(otherwise your values come out wrong β like, your CS1 class would turn into CS4 π). If you're taking commonly used values from RFC, network vendors' documentation, Wikipedia or anywhere else, use them as they are.--rlimit-nofile=<NUM>β sets the soft limit of open file descriptors. This will only actually do anything when:- a. The system supports it (posix)
- b. The limit does not exceed the hard limit.
- c. The specified limit is larger than the current soft limit.
It's equivalent to setting nofile via ulimit, except it will never decrease the limit. This option is only available on systems supporting the rlimit API. π§
--enable-color[true|false]β enables color output for a terminal. Default:trueπ--enable-mmap[true|false]β maps files into memory. Heads up: this may not work if the file space isn't pre-allocated β see--file-allocation. Default:false--event-poll=<POLL>β picks the method for polling events. Possible values areepoll,kqueue,port,pollandselect. Each ofepoll,kqueue,portandpollis available if your system supports it.epollis available on recent Linux.kqueueis available on various *BSD systems, Mac OS X included.portis available on Open Solaris. The default value may vary depending on the system you use. π¦--file-allocation=<METHOD>β picks the file allocation method.nonedoesn't pre-allocate file space.preallocpre-allocates file space before the download begins, which may take some time depending on the file size. If you're on newer file systems likeext4(with extents support),btrfs,xfsorNTFS(MinGW build only),fallocis your best choice β it allocates large (few GiB) files almost instantly. Do not usefallocwith legacy file systems likeext3andFAT32, because it takes almost the same time aspreallocand it blocks aria2 entirely until allocation finishes. Also,fallocmay not be available if your system doesn't have theposix_fallocate(3)function.truncuses theftruncate(2)system call or a platform-specific counterpart to truncate a file to a specified length.
Possible Values: none, prealloc, trunc, falloc Default: prealloc
WARNING: β οΈ Using trunc seemingly allocates disk space super fast, but what it's actually doing is setting the file length metadata in the file system β it does not allocate disk space at all. Which means it does not help you avoid fragmentation. Periodt.
NOTE: π In multi file torrent downloads, the files adjacent forward to the specified files are also allocated if they share the same piece.
--force-save[true|false]β saves the download with the--save-sessionoption even if the download is completed or removed. This option also saves the control file in those situations. Handy for saving BitTorrent seeding, which gets recognized as a completed state. Default:falseπΎ--save-not-found[true|false]β saves the download with the--save-sessionoption even if the file was not found on the server. This option also saves the control file in those situations. Default:true--gid=<GID>β sets the GID manually. aria2 identifies each download by an ID called the GID. The GID must be a hex string of16characters, so[0-9a-fA-F]are allowed and leading zeros must not be stripped. The GID of all0is reserved and must not be used. The GID must be unique β otherwise an error is reported and the download isn't added. This option is useful when restoring sessions saved with--save-session. If you don't use this option, aria2 generates a new GID for you. π--hash-check-only[true|false]β iftrue, after the hash check using the--check-integrityoption, abort the download whether or not the download is complete. Default:false--human-readable[true|false]β prints sizes and speed in human readable format (like1.2Ki,3.4Mi) in the console readout. Default:trueπΈ--interface=<INTERFACE>β binds sockets to a given interface. You can specify an interface name, IP address or host name. Possible Values:interface,IP address,host name
NOTE: π If an interface has multiple addresses, it is highly recommended to specify the IP address explicitly. See also--disable-ipv6. And if your system doesn't havegetifaddrs(3), this option doesn't accept an interface name.
--keep-unfinished-download-result[true|false]β keeps unfinished download results even if doing so pushes past--max-download-result. This is useful when all unfinished downloads must be saved in the session file (see the--save-sessionoption). Please keep in mind there is no upper bound to the number of unfinished download results it keeps π³ β if that's not the vibe you want, turn this option off. Default:true--max-download-result=<NUM>β sets the max number of download results kept in memory, bestie. Download results = completed / error / removed downloads, all of it. They live in a FIFO queue and it can hold at mostNUMof them. When the queue is full and a new download result shows up, the oldest one gets yeeted from the front and the new one gets pushed to the back. π« Heads up: setting a big number here may result in high memory consumption after thousands of downloads, so likeβ¦ be mindful. Specifying0means no download result is kept at all. Note that unfinished downloads are kept in memory regardless of this option value β see--keep-unfinished-download-resultfor that. Default:1000--max-mmap-limit=<SIZE>β sets the maximum file size that can enable mmap (peep the--enable-mmapoption π ). The file size here = the sum of all files contained in one download. So like, if a download contains 5 files, then file size is the total size of those files. If the file size is strictly greater than the size you put in this option, mmap gets disabled. Default:9223372036854775807--max-resume-failure-tries=<N>β when used with--always-resume=false, aria2 downloads the file from scratch when it detectsNnumber of URIs that don't support resume. IfNis0, aria2 downloads from scratch when all given URIs don't support resume. See the--always-resumeoption. Default:0--min-tls-version=<VERSION>β specify the minimum SSL/TLS version to enable. Possible Values:TLSv1.1,TLSv1.2,TLSv1.3Default:TLSv1.2--multiple-interface=<INTERFACES>β a comma separated list of interfaces to bind sockets to. Requests get split among the interfaces to achieve link aggregation (slay). You can specify interface name, IP address and hostname. If--interfaceis used, this option will be ignored. Possible Values:interface,IP address,hostname--log-level=<LEVEL>β set the log level to output.LEVELis eitherdebug,info,notice,warnorerror. Default:debug--on-bt-download-complete=<COMMAND>β for BitTorrent, a command specified in--on-download-completeis called after download completed and seeding is over. On the other hand, this option sets the command to be executed after download completed but before seeding. See Event Hook for more details aboutCOMMAND. Possible Values:/path/to/command--on-download-complete=<COMMAND>β set the command to be executed after download completed. See Event Hook for more details aboutCOMMAND. See also--on-download-stop. Possible Values:/path/to/command--on-download-error=<COMMAND>β set the command to be executed after download aborted due to error. π See Event Hook for more details aboutCOMMAND. See also--on-download-stop. Possible Values:/path/to/command--on-download-pause=<COMMAND>β set the command to be executed after download was paused. See Event Hook for more details aboutCOMMAND. Possible Values:/path/to/command--on-download-start=<COMMAND>β set the command to be executed after download got started. See Event Hook for more details aboutCOMMAND. Possible Values:/path/to/command--on-download-stop=<COMMAND>β set the command to be executed after download stopped. You can override the command for a particular download result using--on-download-completeand--on-download-error. If they are specified, the command specified in this option is not executed. See Event Hook for more details aboutCOMMAND. Possible Values:/path/to/command--optimize-concurrent-downloads [true|false|<A>:<B>]β optimizes the number of concurrent downloads according to the bandwidth available. aria2 uses the download speed observed in previous downloads to adapt the number of downloads launched in parallel according to the ruleN = A + B Log10(speed in Mbps). The coefficientsAandBcan be customized in the option arguments withAandBseparated 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 stays constrained under the maximum defined by the--max-concurrent-downloadsparameter. Default:false--piece-length=<LENGTH>β set a piece length for HTTP/FTP downloads. This is the boundary when aria2 splits a file, and all splits occur at multiples of this length. This option will be ignored in BitTorrent downloads. It will also be ignored if the Metalink file contains piece hashes. Default:1M
NOTE: The possible use case of--piece-lengthis changing the request range in one HTTP pipelined request. To enable HTTP pipelining use--enable-http-pipelining.
--show-console-readout [true|false]β show console readout. Default:true--stderr [true|false]β redirect all console output that would otherwise be printed in stdout to stderr. Default:false--summary-interval=<SEC>β set the interval in seconds to output download progress summary. Setting0suppresses the output. Default:60-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:false--max-overall-download-limit=<SPEED>β set max overall download speed in bytes/sec.0means unrestricted. You can appendKorM(1K=1024,1M=1024K). To limit the download speed per download, use--max-download-limit. Default:0--max-download-limit=<SPEED>β set max download speed per each download in bytes/sec.0means unrestricted. You can appendKorM(1K=1024,1M=1024K). To limit the overall download speed, use--max-overall-download-limit. Default:0--no-conf [true|false]β disable loading thearia2.conffile.--no-file-allocation-limit=<SIZE>β no file allocation is made for files whose size is smaller thanSIZE. You can appendKorM(1K=1024,1M=1024K). Default:5M-P,--parameterized-uri [true|false]β enable parameterized URI support. You can specify a set of parts:http://{sv1,sv2,sv3}/foo.iso. Also you can specify numeric sequences with a step counter:http://host/image[000-100:2].img. A step counter can be omitted. If all URIs do not point to the same file, such as the second example above, the-Zoption is required. Default:false-q,--quiet [true|false]β make aria2 quiet (no console output). Default:false--realtime-chunk-checksum [true|false]β validate a chunk of data by calculating checksum while downloading a file, if chunk checksums are provided. Default:true--remove-control-file [true|false]β remove the control file before download. Using with--allow-overwrite=true, download always starts from scratch. This will be useful for users behind a proxy server which disables resume. π«Ά--save-session=<FILE>β save error/unfinished downloads toFILEon exit. You can pass this output file toaria2cwith the--input-fileoption on restart. If you like the output to be gzipped, append a.gzextension to the file name. Please note that downloads added byaria2.addTorrent()andaria2.addMetalink()RPC method and whose metadata could not be saved as a file are not saved. Downloads removed usingaria2.remove()andaria2.forceRemove()will not be saved. GID is also saved with gid, but there are some restrictions β see below. π
NOTE: 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. - magnet URI, and followed by torrent download β GID of BitTorrent metadata download is saved. - URI to torrent file, and followed by torrent download β GID of torrent file download is saved. - URI to metalink file, and followed by file downloads described in metalink file β GID of metalink file download is saved. - local torrent file β GID of torrent download is saved. - local metalink file β any meaningful GID is not saved.
--save-session-interval=<SEC>β save error/unfinished downloads to a file specified by--save-sessioneverySECseconds. If0is given, the file will be saved only when aria2 exits. Default:0--socket-recv-buffer-size=<SIZE>β set the maximum socket receive buffer in bytes. Specifying0will disable this option. This value will be set to the socket file descriptor using theSO_RCVBUFsocket option with asetsockopt()call. Default:0--stop=<SEC>β stop application afterSECseconds has passed. If0is given, this feature is disabled. Default:0--stop-with-process=<PID>β stop application when processPIDis not running. This is useful if the aria2 process is forked from a parent process. The parent process can fork aria2 with its own pid, and when the parent process exits for some reason, aria2 can detect it and shut itself down. π--truncate-console-readout [true|false]β truncate console readout to fit in a single line. Default:true-v,--versionβ print the version number, copyright and the configuration information and exit. π
π Notes for Options π
Optional arguments β¨
The options that have their argument surrounded by square brackets ([]) take an optional argument. Usually, omitting the argument is evaluated to true. If you use the short form of these options (such as -V) and give an argument, then the option name and its argument should be concatenated (e.g. -Vfalse). If any spaces are inserted between the option name and the argument, the argument will be treated as a URI β and usually that is not what you expect. π
Units (K and M) π
Some options take K and M to conveniently represent 1024 and 1048576 respectively. aria2 detects these characters in a case-insensitive way. In other words, k and m can be used as well as K and M respectively. πΈ
β¨ URI, MAGNET, TORRENT_FILE, METALINK_FILE β¨
okay so bestie, you can just. pile URIs onto the command line. multiple. as many as you want. BUT π unless you pass --force-sequential, every single URI has to point at the same file, or the whole download just dies. no cap.
You can also throw in an arbitrary number of BitTorrent Magnet URIs π§² β but heads up, they are always treated as a separate download. Both hex encoded 40 characters Info Hash and Base32 encoded 32 characters Info Hash are supported, because we're generous like that. Multiple tr parameters? Supported. And since a BitTorrent Magnet URI is likely to contain a & character, it is highly recommended to always quote the URI with single(') or double(") quotation. Also strongly recommended: turn on DHT, especially when the tr parameter is missing. Want the full lore? It's at http://www.bittorrent.org/beps/bep_0009.html. iykyk π
You can also specify an arbitrary number of torrent files and Metalink documents stored on a local drive. same deal β always treated as a separate download. Both Metalink4 and Metalink version 3.0 are supported. iconic.
And here's the fun part π you can specify both a torrent file with -T and URIs. Do that and you're downloading a file from both the torrent swarm and an HTTP(S)/FTP/SFTP server at the same time, while the data from HTTP(S)/FTP/SFTP gets uploaded to the torrent swarm. teamwork!! For single file torrents, the URI can be a complete URI pointing to the resource, or if the URI ends with /, the name in the torrent file is added. For multi-file torrents, the name and path are added to form a URI for each file. slay.
NOTE: make sure that URI is quoted with single(') or double(") quotation if it contains&or any characters that have special meaning in shell. shell will absolutely humble you otherwise π«Ά
π Resuming Download π
Usually? You just resume by issuing the same command again (aria2c URI) if the previous transfer was made by aria2. easy. no thoughts, head empty, it just works β¨
But if the previous transfer was made by a browser or a wget-like sequential download manager, then use --continue to continue the transfer. that's the one. don't forget it π
π¦ Event Hook π¦
aria2 lets you specify an arbitrary command to run after a specific event happens. it's giving automation. Currently these options are available:
--on-bt-download-complete--on-download-pause--on-download-complete--on-download-start--on-download-error--on-download-stop
When the command is executed, aria2 passes 3 arguments to it: GID, the number of files, and file path. For HTTP, FTP, and SFTP downloads, usually the number of files is 1. A BitTorrent download can contain multiple files though. If the number of files is more than one, the file path is the first one β in other words, this is the value of the path key of the first struct whose selected key is true in the response of the aria2.getFiles() RPC method. If you want to get all the file paths, consider using JSON-RPC/XML-RPC. Also please note that the file path may change during download in HTTP because of redirection or Content-Disposition header. π
Let's see an example of how arguments are passed to the command:
$ cat hook.sh
#!/bin/sh
echo "Called with [$1] [$2] [$3]"
$ aria2c --on-download-complete hook.sh http://example.org/file.iso
Called with [1] [1] [/path/to/file.iso]
look at her go π
π₯ EXIT STATUS π₯
Because aria2 can handle multiple downloads at once, it encounters lots of errors in a session (living that chaotic main character life π). aria2 returns the following exit status based on the last error encountered.
0β If all downloads were successful. π1β If an unknown error occurred.2β If time out occurred.3β If a resource was not found.4β If aria2 saw the specified number of "resource not found" error. See--max-file-not-foundoption.5β If a download aborted because download speed was too slow. See--lowest-speed-limitoption.6β If network problem occurred.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 Ctrl-C by an user or sending TERM or INT signal.8β If remote server did not support resume when resume was required to complete download.9β If there was not enough disk space available.10β If piece length was different from one in.aria2control file. See--allow-piece-length-changeoption.11β If aria2 was downloading same file at that moment.12β If aria2 was downloading same info hash torrent at that moment.13β If file already existed. See--allow-overwriteoption.14β If renaming file failed. See--auto-file-renamingoption.15β If aria2 could not open existing file.16β If aria2 could not create new file or truncate existing file.17β If file I/O error occurred.18β If aria2 could not create directory.19β If name resolution failed.20β If aria2 could not parse Metalink document.21β If FTP command failed.22β If HTTP response header was bad or unexpected.23β If too many redirects occurred.24β If HTTP authorization failed.25β If aria2 could not parse bencoded file (usually.torrentfile).26β If.torrentfile was corrupted or missing information that aria2 needed.27β If Magnet URI was bad.28β If bad/unrecognized option was given or unexpected option argument was given.29β If the remote server was unable to handle the request due to a temporary overloading or maintenance.30β If aria2 could not parse JSON-RPC request.31β Reserved. Not used.32β If checksum validation failed.
NOTE: an error occurred in a finished download will not be reported as exit status. so don't come for her about it π
πΈ ENVIRONMENT πΈ
aria2 recognizes the following environment variables. put them in your shell rc and never think about them again bestie β¨
http_proxy[http://][USER:PASSWORD@]HOST[:PORT]β Specify proxy server for use in HTTP. Overrideshttp-proxyvalue in configuration file. The command-line option--http-proxyoverrides this value.https_proxy[http://][USER:PASSWORD@]HOST[:PORT]β Specify proxy server for use in HTTPS. Overrideshttps-proxyvalue in configuration file. The command-line option--https-proxyoverrides this value.ftp_proxy[http://][USER:PASSWORD@]HOST[:PORT]β Specify proxy server for use in FTP. Overridesftp-proxyvalue in configuration file. The command-line option--ftp-proxyoverrides this value.all_proxy[http://][USER:PASSWORD@]HOST[:PORT]β Specify proxy server for use if no protocol-specific proxy is specified. Overridesall-proxyvalue in configuration file. The command-line option--all-proxyoverrides this value.
NOTE: although aria2 acceptsftp://andhttps://scheme in proxy URI, it simply assumes thathttp://is specified and does not change its behavior based on the specified scheme. she's got one vibe and she's sticking to it π
no_proxy[DOMAIN,...]β 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 theno-proxyvalue in configuration file. The command-line option--no-proxyoverrides this value.
π FILES π
πΈ aria2.conf
okay so by default aria2 goes looking for its config in the legacy spot first: if $HOME/.aria2/aria2.conf is there, that's the one it uses. If it's not there, it parses $XDG_CONFIG_HOME/aria2/aria2.conf as the config file instead. You can point it wherever you want with the --conf-path option. And if you're in your no-config era? Use --no-conf. π
The config file is just a text file, one option per line, and each line is a NAME=VALUE pair where name is the long command-line option name with the -- prefix stripped off. Same syntax works for command-line options too, btw. Any line starting with # is a comment:
# sample configuration file for aria2c
listen-port=60000
dht-listen-port=60000
seed-ratio=1.0
max-upload-limit=50K
ftp-pasv=true
NOTE: bestie, your user/password and other confidential info might literally be sitting in this file. It is recommended to change the file mode bits of the config file (like, chmod 600 aria2.conf) so nobody else can peek at your contents. π
Environment variables like ${HOME} get expanded by the shell, which means variables written inside the config file do not get expanded by the shell. BUT β and this is the cute part β it's genuinely useful to write ${HOME} in the config file when you're specifying file paths, so aria2 itself expands ${HOME} found in the following option values into your home directory:
ca-certificatecertificatedht-file-pathdht-file-path6dirinput-fileload-cookieslogmetalink-filenetrc-pathon-bt-download-completeon-download-completeon-download-erroron-download-starton-download-stopon-download-pauseoutprivate-keyrpc-certificaterpc-private-keysave-cookiessave-sessionserver-stat-ifserver-stat-oftorrent-file
β οΈ Heads up: this expansion happens even if you use those options on the command-line. Which means expansion can happen twice β first the shell, then aria2c. Double the vibes, double the carefulness.
π¦ dht.dat
Unless the legacy paths $HOME/.aria2/dht.dat and $HOME/.aria2/dht6.dat are already pointing at existing files, the IPv4 DHT routing table gets saved to $XDG_CACHE_HOME/aria2/dht.dat and the IPv6 DHT routing table gets saved to $XDG_CACHE_HOME/aria2/dht6.dat. πΊοΈ
π Netrc
Netrc support is on by default for HTTP(S)/FTP/SFTP. Wanna turn it off? Pass --no-netrc. Your .netrc file should have the correct permissions (600), no cap. π
If the machine name starts with ., aria2 does a domain-match instead of an exact match β that's an aria2 extension, not standard. Example of a domain match, imagine this .netrc entry:
machine .example.org login myid password mypasswd
So aria2.example.org domain-matches .example.org and uses myid and mypasswd. β¨
Some more domain-match examples so you're not confused: example.net does not domain-match .example.org. And example.org does not domain-match .example.org because of that leading .. If you want to match example.org, then just write example.org. Periodt. π
π Control File
aria2 keeps a control file to track download progress. It lives in the same directory as the file you're downloading, and its name is the downloading file's name with .aria2 stuck on the end. So if you're downloading file.zip, the control file is file.zip.aria2. π«Ά
(One exception to this naming convention: if you're downloading a multi torrent, the control file is the "top directory" name of the torrent with.aria2appended. That "top directory" name is the value of the"name"key in the"info"directory in a torrent file.)
Usually the control file gets deleted once the download finishes. And if aria2 decides the download can't be resumed (like, downloading from a HTTP server that doesn't support resume), no control file gets created at all. π
Normally if you lose a control file, you can't resume. BUT if you have a torrent or metalink with chunk checksums for the file, you can resume without a control file by giving the -V option to aria2c on the command-line. Slay. π₯
π Input File
The input file can hold a list of URIs for aria2 to download. And you can specify multiple URIs for a single entity β just separate them on a single line using the TAB character.
Each line is treated like it was given as a command-line argument, so they're affected by --force-sequential and --parameterized-uri.
Since URIs in the input file are read directly by aria2, they must not be quoted with single (') or double (") quotation marks. π
Lines starting with # are comments and get skipped.
Bonus: after each line of URIs you can specify the following options. These optional lines must start with white space(s):
all-proxyall-proxy-passwdall-proxy-userallow-overwriteallow-piece-length-changealways-resumeasync-dnsauto-file-renamingbt-enable-hook-after-hash-checkbt-enable-lpdbt-exclude-trackerbt-external-ipbt-force-encryptionbt-hash-check-seedbt-load-saved-metadatabt-max-peersbt-metadata-onlybt-min-crypto-levelbt-prioritize-piecebt-remove-unselected-filebt-request-peer-speed-limitbt-require-cryptobt-save-metadatabt-seed-unverifiedbt-stop-timeoutbt-trackerbt-tracker-connect-timeoutbt-tracker-intervalbt-tracker-timeoutcheck-integritychecksumconditional-getconnect-timeoutcontent-disposition-default-utf8continuedirdry-runenable-http-keep-aliveenable-http-pipeliningenable-mmapenable-peer-exchangefile-allocationfollow-metalinkfollow-torrentforce-saveftp-passwdftp-pasvftp-proxyftp-proxy-passwdftp-proxy-userftp-reuse-connectionftp-typeftp-usergidhash-check-onlyheaderhttp-accept-gziphttp-auth-challengehttp-no-cachehttp-passwdhttp-proxyhttp-proxy-passwdhttp-proxy-userhttp-userhttps-proxyhttps-proxy-passwdhttps-proxy-userindex-outlowest-speed-limitmax-connection-per-servermax-download-limitmax-file-not-foundmax-mmap-limitmax-resume-failure-triesmax-triesmax-upload-limitmetalink-base-urimetalink-enable-unique-protocolmetalink-languagemetalink-locationmetalink-osmetalink-preferred-protocolmetalink-versionmin-split-sizeno-file-allocation-limitno-netrcno-proxyoutparameterized-uripausepause-metadatapiece-lengthproxy-methodrealtime-chunk-checksumrefererremote-timeremove-control-fileretry-waitreuse-urirpc-save-upload-metadataseed-ratioseed-timeselect-filesplitssh-host-key-mdstream-piece-selectortimeouturi-selectoruse-headuser-agent
These options mean exactly the same thing as the command-line versions, they just apply to the URIs they belong to. But pls note: for options in the input file, the -- prefix must be stripped off. π§
Example time! Say the content of uri.txt is:
http://server/file.iso http://mirror/file.iso
dir=/iso_images
out=file.img
http://foo/bar
If aria2 runs with -i uri.txt -d /tmp options, then file.iso gets saved as /iso_images/file.img and it's downloaded from http://server/file.iso and http://mirror/file.iso. And bar is downloaded from http://foo/bar and saved as /tmp/bar. π
In some cases, the out parameter has no effect β see the note on the --out option for those restrictions.
β Server Performance Profile β
This section is all about the format of the server performance profile. The file is plain text and every line has several NAME=VALUE pairs separated by commas. Currently these NAMEs are recognized:
hostβ Host name of the server. Required.protocolβ Protocol for this profile, likeftp,http. Required.dl_speedβ The average download speed observed in the previous download, in bytes per sec. Required.sc_avg_speedβ The average download speed observed in the previous download, in bytes per sec. This value is only updated if the download was done in a single connection environment and is only used byAdaptiveURISelector. Optional.mc_avg_speedβ The average download speed observed in the previous download, in bytes per sec. This value is only updated if the download was done in a multi connection environment and is only used byAdaptiveURISelector. Optional.counterβ How many times the server is used. Currently this value is only used byAdaptiveURISelector. Optional.last_updatedβ Last contact time in GMT with this server, specified in seconds since the Epoch (00:00:00 on January 1, 1970, UTC). Required.statusβERRORis set when the server can't be reached, or is out-of-service, or a timeout occurred. Otherwise,OKis set.
Those fields all have to exist on one line. The order of fields doesn't matter, and you can put pairs other than the ones above β they're just simply ignored. π
An example follows:
host=localhost, protocol=http, dl_speed=32000, last_updated=1222491640, status=OK
host=localhost, protocol=ftp, dl_speed=0, last_updated=1222491632, status=ERROR
π°οΈ RPC INTERFACE π°οΈ
aria2 serves up JSON-RPC over HTTP and XML-RPC over HTTP interfaces that basically do the same stuff. It also provides JSON-RPC over WebSocket. That one uses the exact same method signatures and response format as JSON-RPC over HTTP, but on top of that it also gives you server-initiated notifications. See the JSON-RPC over WebSocket section for more. π
okay so the request path for the JSON-RPC interface β and this is true for BOTH the HTTP version and the WebSocket version, bestie, they share β is /jsonrpc. π«Ά The XML-RPC interface lives at /rpc, its own lil address.
The WebSocket URI for JSON-RPC over WebSocket is ws://HOST:PORT/jsonrpc. And if you flipped on SSL/TLS encryption? Then it's wss://HOST:PORT/jsonrpc instead. π
(just swap the ws for wss, that's the whole vibe)
The JSON-RPC we implemented is based on JSON-RPC 2.0 <http://jsonrpc.org/specification>, and it supports HTTP POST and GET (that's the JSONP situation). The WebSocket transport? That's an aria2 extension, so it's our little thing. β¨
Now listen: 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. And the character encoding must be UTF-8. No exceptions, no cap. π
When you're reading the JSON-RPC docs that follow, interpret structs as JSON objects. (struct = JSON object, that's the translation, periodt.)
πΈ Terminology πΈ
π GID π
The GID (or gid) is a key to manage each download. Every single download gets assigned a unique GID. Inside aria2, the GID is stored as a 64-bit binary value. For RPC access though, it's represented as a hex string of 16 characters β like 2089b05ecca3d829. π
Normally, aria2 generates this GID for each download, but you can specify GIDs manually using the --gid option. And here's the cute part: when you're querying downloads by GID, you can specify only the prefix of a GID β as long as that prefix is unique among the others. Short-king GIDs, we love to see it. π¦
π RPC authorization secret token π
As of 1.18.4, in addition to HTTP basic authorization, aria2 provides RPC method-level authorization. And heads up, bestie: in a future release, HTTP basic authorization will be removed and RPC method-level authorization will become mandatory. π So get comfy with it now.
To use RPC method-level authorization, you have to specify an RPC secret authorization token using the --rpc-secret option. For each RPC method call, the caller has to include the token prefixed with token:. And even when the --rpc-secret option is not used β if the first parameter in the RPC method is a string and starts with token:, it will be removed from the parameter list before the request is being processed. π§
For example, if the RPC secret authorization token is $$secret$$, calling the aria2.addUri RPC method would have to look like this:
aria2.addUri("token:$$secret$$", ["http://example.org/file"])
The system.multicall RPC method is treated specially. Since the XML-RPC specification only allows a single array as a parameter for this method, we don't specify the token in the call. Instead, each nested method call has to provide the token as the first parameter as described above. π
NOTE: 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. So it's recommended to prefer Batch orsystem.multicallrequests when appropriate. (protect the vibes, protect the token π‘οΈ)system.listMethodsandsystem.listNotificationscan be executed without token. Since they just return available methods/notifications, they do not alter anything β they're safe without a secret token. π«Ά
β¨ Methods β¨
All the code examples are compatible with the Python 2.7 interpreter. For info on the secret parameter, go peek at RPC authorization secret token up above. β¬οΈ
π aria2.addUri([secret], uris[, options[, position]])
This method adds a new download. uris is an array of HTTP/FTP/SFTP/BitTorrent URIs (strings) pointing to the same resource. And listen β if you mix URIs pointing to different resources, then the download may fail or be corrupted without aria2 complaining. It won't warn you, it'll just quietly do the wrong thing. π So don't do that.
When adding BitTorrent Magnet URIs, uris must have only one element, and it should be a BitTorrent Magnet URI. options is a struct and its members are pairs of option name and value. See Options below for more details. If position is given, it must be an integer starting from 0. The new download will be inserted at position in the waiting queue. If position is omitted, or position 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. π
JSON-RPC Example
The following example adds http://example.org/file:
>>> import urllib2, json
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.addUri',
... 'params':[['http://example.org/file']]})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> c.read()
'{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}'
XML-RPC Example
The following example adds http://example.org/file:
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> s.aria2.addUri(['http://example.org/file'])
'2089b05ecca3d829'
The following example adds a new download with two sources and some options:
>>> s.aria2.addUri(['http://example.org/file', 'http://mirror/file'],
dict(dir="/tmp"))
'd2703803b52216d1'
The following example adds a download and inserts it to the front of the queue:
>>> s.aria2.addUri(['http://example.org/file'], {}, 0)
'ca3d829cee549a4d'
π¦ aria2.addTorrent([secret], torrent[, uris[, options[, position]]])
This method adds a BitTorrent download by uploading a ".torrent" file. If you wanna add a BitTorrent Magnet URI, use the aria2.addUri() method instead. torrent must be a base64-encoded string containing the contents of the ".torrent" file. π§
uris is an array of URIs (string). uris is used for Web-seeding. For single file torrents, the URI can be a complete URI pointing to the resource; if the URI ends with /, name in the torrent file is added. For multi-file torrents, name and path in the torrent are added to form a URI for each file. options is a struct and its members are pairs of option name and value. See Options below for more details. If position is given, it must be an integer starting from 0. The new download will be inserted at position in the waiting queue. If position is omitted, or position 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 --rpc-save-upload-metadata is true, the uploaded data is saved as a file named as the hex string of the SHA-1 hash of the data plus ".torrent" in the directory specified by the --dir option. E.g. a file name might be 0a3893293e27ac0490424c06de4d09242215f0a6.torrent. And if a file with the same name already exists β it is overwritten! π
If the file cannot be saved successfully, or --rpc-save-upload-metadata is false, the downloads added by this method are not saved by --save-session.
The following examples add the local file file.torrent.
JSON-RPC Example
>>> import urllib2, json, base64
>>> torrent = base64.b64encode(open('file.torrent').read())
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'asdf',
... 'method':'aria2.addTorrent', 'params':[torrent]})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> c.read()
'{"id":"asdf","jsonrpc":"2.0","result":"2089b05ecca3d829"}'
XML-RPC Example
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> s.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent', mode='rb').read()))
'2089b05ecca3d829'
π aria2.addMetalink([secret], metalink[, options[, position]])
This method adds a Metalink download by uploading a ".metalink" file. metalink is a base64-encoded string which contains the contents of the ".metalink" file. options is a struct and its members are pairs of option name and value. See Options below for more details. If position is given, it must be an integer starting from 0. The new download will be inserted at position in the waiting queue. If position is omitted, or position 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. (yes, plural, it can spawn a whole squad π)
If --rpc-save-upload-metadata is true, the uploaded data is saved as a file named hex string of SHA-1 hash of the data plus ".metalink" in the directory specified by the --dir option. E.g. a file name might be 0a3893293e27ac0490424c06de4d09242215f0a6.metalink. And if a file with the same name already exists β it is overwritten! π
If the file cannot be saved successfully, or --rpc-save-upload-metadata is false, the downloads added by this method are not saved by --save-session.
The following examples add the local file file.meta4.
JSON-RPC Example
>>> import urllib2, json, base64
>>> metalink = base64.b64encode(open('file.meta4').read())
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.addMetalink',
... 'params':[metalink]})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> c.read()
'{"id":"qwer","jsonrpc":"2.0","result":["2089b05ecca3d829"]}'
XML-RPC Example
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> s.aria2.addMetalink(xmlrpclib.Binary(open('file.meta4', mode='rb').read()))
['2089b05ecca3d829']
π
aria2.remove([secret], gid)
This method removes the download denoted by gid (string). If the specified download is in progress, it is first stopped. The status of the removed download becomes removed. This method returns the GID of the removed download. π«Ά
The following examples remove a download with GID 2089b05ecca3d829.
JSON-RPC Example
>>> import urllib2, json
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.remove',
... 'params':['2089b05ecca3d829']})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> c.read()
'{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}'
XML-RPC Example
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> s.aria2.remove('2089b05ecca3d829')
'2089b05ecca3d829'
π
aria2.forceRemove([secret], gid)
okay so this one removes the download with the gid you hand it, and it works exactly like aria2.remove() except β and this is the whole point β it does the removal without doing any of the slow stuff first, like contacting BitTorrent trackers to unregister the download. so it's the instant version, no waiting around. π₯
π aria2.pause([secret], gid)
pauses the download with that gid (it's a string, bestie). the status of a paused download becomes paused. if the download was active, it gets bumped to the front of the waiting queue β yes, it cuts the line, main character energy fr. while the status is paused, the download is not started. wanna flip it back to waiting? use the aria2.unpause() method. and this method returns the GID of the paused download. β¨
π«Ά aria2.pauseAll([secret])
this is literally the same as calling aria2.pause() for every single active/waiting download. and it returns OK. that's it, that's the method. π
π₯ aria2.forcePause([secret], gid)
pauses the download with that gid, and it behaves just like aria2.pause() except it skips all the actions that take time β like contacting BitTorrent trackers to unregister the download first. so, pause but make it fast. β‘
π₯ aria2.forcePauseAll([secret])
same as calling aria2.forcePause() for every active/waiting download. returns OK. slay. π
βΆοΈ aria2.unpause([secret], gid)
this flips the status of the download with that gid (string!) from paused to waiting, which makes the download eligible to be restarted. it returns the GID of the unpaused download. we love a comeback arc. π¦
π aria2.unpauseAll([secret])
same as calling aria2.unpause() for every paused download. returns OK. group un-pause, iconic. π
π aria2.tellStatus([secret], gid[, keys])
this returns the progress of the download denoted by gid (a string, keep up). keys is an array of strings β if you specify it, the response contains only the keys in the keys array. if keys is empty or omitted, you get every key. this is highkey useful when you just want specific keys and wanna avoid unnecessary transfers.
for example, aria2.tellStatus("2089b05ecca3d829", ["gid", "status"]) returns the gid and status keys only. periodt. β¨
the response is a struct and contains the following keys. values are strings. π
gidβ GID of the download.statusβactivefor currently downloading/seeding downloads.waitingfor downloads in the queue; download is not started.pausedfor paused downloads.errorfor downloads that were stopped because of error.completefor stopped and completed downloads.removedfor the downloads removed by user.totalLengthβ total length of the download in bytes.completedLengthβ completed length of the download in bytes.uploadLengthβ uploaded length of the download in bytes.bitfieldβ 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.downloadSpeedβ download speed of this download, measured in bytes/sec.uploadSpeedβ upload speed of this download, measured in bytes/sec.infoHashβ InfoHash. BitTorrent only.numSeedersβ the number of seeders aria2 has connected to. BitTorrent only.seederβtrueif the local endpoint is a seeder. otherwisefalse. BitTorrent only.pieceLengthβ piece length in bytes.numPiecesβ the number of pieces.connectionsβ the number of peers/servers aria2 has connected to.errorCodeβ the code of the last error for this item, if any. the value is a string. the error codes are defined in the EXIT STATUS section. this value is only available for stopped/completed downloads.errorMessageβ the (hopefully) human readable error message associated toerrorCode.followedByβ 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--follow-metalinkoption). this value is useful to track auto-generated downloads. if there are no such downloads, this key will not be included in the response.followingβ the reverse link forfollowedBy. a download included infollowedByhas this object's GID in itsfollowingvalue.belongsToβ 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.torrentfiles are parts of that parent. if this download has no parent, this key will not be included in the response.dirβ directory to save files.filesβ returns the list of files. the elements of this list are the same structs used in thearia2.getFiles()method.bittorrentβ struct which contains information retrieved from the.torrent(file). BitTorrent only. it contains the following keys:announceListβ list of lists of announce URIs. if the torrent containsannounceand noannounce-list,announceis converted to theannounce-listformat.commentβ the comment of the torrent.comment.utf-8is used if available.creationDateβ the creation time of the torrent. the value is an integer since the epoch, measured in seconds.modeβ file mode of the torrent. the value is eithersingleormulti.infoβ struct which contains data from the Info dictionary. it contains the following keys:nameβnamein the info dictionary.name.utf-8is used if available.
verifiedLengthβ 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.verifyIntegrityPendingβtrueif this download is waiting for the hash check in a queue. this key exists only when this download is in the queue.
π JSON-RPC Example
the following example gets information about a download with GID#2089b05ecca3d829:
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.tellStatus',
... 'params':['2089b05ecca3d829']})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer',
u'jsonrpc': u'2.0',
u'result': {u'bitfield': u'0000000000',
u'completedLength': u'901120',
u'connections': u'1',
u'dir': u'/downloads',
u'downloadSpeed': u'15158',
u'files': [{u'index': u'1',
u'length': u'34896138',
u'completedLength': u'34896138',
u'path': u'/downloads/file',
u'selected': u'true',
u'uris': [{u'status': u'used',
u'uri': u'http://example.org/file'}]}],
u'gid': u'2089b05ecca3d829',
u'numPieces': u'34',
u'pieceLength': u'1048576',
u'status': u'active',
u'totalLength': u'34896138',
u'uploadLength': u'0',
u'uploadSpeed': u'0'}}
the following example gets only specific keys:
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.tellStatus',
... 'params':['2089b05ecca3d829',
... ['gid',
... 'totalLength',
... 'completedLength']]})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer',
u'jsonrpc': u'2.0',
u'result': {u'completedLength': u'5701632',
u'gid': u'2089b05ecca3d829',
u'totalLength': u'34896138'}}
π XML-RPC Example
the following example gets information about a download with GID#2089b05ecca3d829:
>>> import xmlrpclib
>>> from pprint import pprint
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> r = s.aria2.tellStatus('2089b05ecca3d829')
>>> pprint(r)
{'bitfield': 'ffff80',
'completedLength': '34896138',
'connections': '0',
'dir': '/downloads',
'downloadSpeed': '0',
'errorCode': '0',
'files': [{'index': '1',
'length': '34896138',
'completedLength': '34896138',
'path': '/downloads/file',
'selected': 'true',
'uris': [{'status': 'used',
'uri': 'http://example.org/file'}]}],
'gid': '2089b05ecca3d829',
'numPieces': '17',
'pieceLength': '2097152',
'status': 'complete',
'totalLength': '34896138',
'uploadLength': '0',
'uploadSpeed': '0'}
okay and if you only want some of the keys and not the whole entire buffet, you just pass the ones you want as a list β watch:
The following example gets only specific keys:
>>> r = s.aria2.tellStatus('2089b05ecca3d829', ['gid', 'totalLength', 'completedLength'])
>>> pprint(r)
{'completedLength': '34896138', 'gid': '2089b05ecca3d829', 'totalLength': '34896138'}
see? chef's kiss. you asked for three things, you got three things. π
π¦ aria2.getUris([secret], gid) π¦
bestie this one hands you back the URIs that the download with that gid (a string, always a string) is working with. the response is an array of structs, and every value inside is a string. each struct has these keys:
uriβ the URI itself. literally the address. πstatusβ'used'if the URI is currently in use.'waiting'if the URI is still chilling in the queue, not called up yet.
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.getUris',
... 'params':['2089b05ecca3d829']})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer',
u'jsonrpc': u'2.0',
u'result': [{u'status': u'used',
u'uri': u'http://example.org/file'}]}
XML-RPC Example
>>> import xmlrpclib
>>> from pprint import pprint
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> r = s.aria2.getUris('2089b05ecca3d829')
>>> pprint(r)
[{'status': 'used', 'uri': 'http://example.org/file'}]
π aria2.getFiles([secret], gid) π
this one gives you the file list for the download with that gid (string). you get back an array of structs, and again, the values are strings. the keys are:
indexβ the index of the file, starting at1, in the same order the files appear in the multi-file torrent. no zero-indexing here, we're not animals. π’pathβ the file path. where it lives. πlengthβ file size in bytes.completedLengthβ how many bytes of this file are done. β οΈ okay important heads up: it is possible that the sum ofcompletedLengthis less than thecompletedLengththataria2.tellStatus()hands back. why? becausecompletedLengthinaria2.getFiles()only counts completed pieces. meanwhilecompletedLengthinaria2.tellStatus()also counts partially completed pieces. so like, same name, different vibe. don't get got. πselectedβtrueif this file is selected by the--select-fileoption. if--select-fileisn't specified, OR this is a single-file torrent, OR it's not a torrent download at all, then this value is alwaystrue. otherwise it'sfalse.urisβ a list of URIs for this file. the element type is the exact same struct used in thearia2.getUris()method (souri+status, you already know the drill).
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.getFiles',
... 'params':['2089b05ecca3d829']})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer',
u'jsonrpc': u'2.0',
u'result': [{u'index': u'1',
u'length': u'34896138',
u'completedLength': u'34896138',
u'path': u'/downloads/file',
u'selected': u'true',
u'uris': [{u'status': u'used',
u'uri': u'http://example.org/file'}]}]}
XML-RPC Example
>>> import xmlrpclib
>>> from pprint import pprint
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> r = s.aria2.getFiles('2089b05ecca3d829')
>>> pprint(r)
[{'index': '1',
'length': '34896138',
'completedLength': '34896138',
'path': '/downloads/file',
'selected': 'true',
'uris': [{'status': 'used',
'uri': 'http://example.org/file'}]}]
π aria2.getPeers([secret], gid) π
okay so this one returns a list of peers for the download with that gid (string). β οΈ BitTorrent only β if you're not doing torrent stuff, this is not your moment. the response is an array of structs with these keys, values are strings:
peerIdβ the peer ID, percent-encoded. πipβ the IP address of the peer.portβ the port number of the peer.bitfieldβ hex representation of that peer's download progress. the highest bit corresponds to the piece at index0. set bits mean the piece is available, unset bits mean the piece is missing. any spare bits at the end get set to zero.amChokingβtrueif aria2 is choking the peer. otherwisefalse. (yes it's giving toxic but it's just protocol bestie π«Ά)peerChokingβtrueif the peer is choking aria2. otherwisefalse.downloadSpeedβ download speed (byte/sec) that this client gets from the peer. π₯uploadSpeedβ upload speed (byte/sec) that this client uploads to the peer. π€seederβtrueif this peer is a seeder. otherwisefalse. π±
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.getPeers',
... 'params':['2089b05ecca3d829']})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer',
u'jsonrpc': u'2.0',
u'result': [{u'amChoking': u'true',
u'bitfield': u'ffffffffffffffffffffffffffffffffffffffff',
u'downloadSpeed': u'10602',
u'ip': u'10.0.0.9',
u'peerChoking': u'false',
u'peerId': u'aria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6',
u'port': u'6881',
u'seeder': u'true',
u'uploadSpeed': u'0'},
{u'amChoking': u'false',
u'bitfield': u'ffffeff0fffffffbfffffff9fffffcfff7f4ffff',
u'downloadSpeed': u'8654',
u'ip': u'10.0.0.30',
u'peerChoking': u'false',
u'peerId': u'bittorrent client758',
u'port': u'37842',
u'seeder': u'false',
u'uploadSpeed': u'6890'}]}
XML-RPC Example
>>> import xmlrpclib
>>> from pprint import pprint
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> r = s.aria2.getPeers('2089b05ecca3d829')
>>> pprint(r)
[{'amChoking': 'true',
'bitfield': 'ffffffffffffffffffffffffffffffffffffffff',
'downloadSpeed': '10602',
'ip': '10.0.0.9',
'peerChoking': 'false',
'peerId': 'aria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6',
'port': '6881',
'seeder': 'true',
'uploadSpeed': '0'},
{'amChoking': 'false',
'bitfield': 'ffffeff0fffffffbfffffff9fffffcfff7f4ffff',
'downloadSpeed': '8654',
'ip': '10.0.0.30',
'peerChoking': 'false',
'peerId': 'bittorrent client758',
'port': '37842',
'seeder': 'false,
'uploadSpeed': '6890'}]
π aria2.getServers([secret], gid) π
and finally for this batch β this one returns the currently connected HTTP(S)/FTP/SFTP servers for the download with that gid (string). response is an array of structs, values are strings, keys go like this:
indexβ the index of the file, starting at1, in the same order the files appear in the multi-file metalink. π’serversβ a list of structs that contain the following keys:uriβ the original URI. π§currentUriβ the URI currently being used for downloading. heads up: if redirection is involved,currentUriandurimay differ. so don't assume they're the same bestie, that's how you get confused.downloadSpeedβ download speed (byte/sec). β‘
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.getServers',
... 'params':['2089b05ecca3d829']})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer',
u'jsonrpc': u'2.0',
u'result': [{u'index': u'1',
u'servers': [{u'currentUri': u'http://example.org/file',
u'downloadSpeed': u'10467',
u'uri': u'http://example.org/file'}]}]}
XML-RPC Example
>>> import xmlrpclib
>>> from pprint import pprint
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> r = s.aria2.getServers('2089b05ecca3d829')
>>> pprint(r)
[{'index': '1',
'servers': [{'currentUri': 'http://example.org/dl/file',
'downloadSpeed': '20285',
'uri': 'http://example.org/file'}]}]
and that output? chef's kiss, the servers list is giving exactly what you asked for π
aria2.tellActive([secret][, keys])
okay so this one hands you back a list of active downloads β¨ The response is an array of the exact same structs that aria2.tellStatus() returns β same shape, no surprises. And for the keys parameter? Bestie, go read the aria2.tellStatus() method, it's all explained there π«Ά
aria2.tellWaiting([secret], offset, num[, keys])
this returns a list of waiting downloads β including paused ones π offset is an integer and it specifies the offset from the download waiting at the front. num is an integer and it specifies the max. number of downloads to be returned. And keys? Again, aria2.tellStatus() method, go look π
If offset is a positive integer, this method returns downloads in the range of [offset, offset + num).
But here's where it gets spicy π₯ β offset can be a negative integer. offset == -1 points last download in the waiting queue and offset == -2 points the download before the last download, and so on. Downloads in the response are in reversed order then. Iconic behaviour tbh.
For example, imagine three downloads "A", "B" and "C" are waiting in this order.
aria2.tellWaiting(0, 1)returns["A"].aria2.tellWaiting(1, 2)returns["B", "C"].aria2.tellWaiting(-1, 2)returns["C", "B"].
The response is an array of the same structs as returned by aria2.tellStatus() method.
aria2.tellStopped([secret], offset, num[, keys])
list of stopped downloads coming right up π offset is an integer and it specifies the offset from the least recently stopped download. num is an integer and it specifies the max. number of downloads to be returned. For the keys parameter, please refer to the aria2.tellStatus() method (you know the drill by now, bestie π).
offset and num have the same semantics as described in the aria2.tellWaiting() method.
The response is an array of the same structs as returned by the aria2.tellStatus() method.
aria2.changePosition([secret], gid, pos, how)
this method changes the position of the download denoted by gid in the queue π― pos is an integer. how is a string. And the how values are:
- If
howisPOS_SET, it moves the download to a position relative to the beginning of the queue. - If
howisPOS_CUR, it moves the download to a position relative to the current position. - If
howisPOS_END, it moves the download to a position relative to the end of the queue.
If the destination position is less than 0 or beyond the end of the queue, it moves the download to the beginning or the end of the queue respectively. The response is an integer denoting the resulting position π
For example, if GID#2089b05ecca3d829 is currently in position 3, aria2.changePosition('2089b05ecca3d829', -1, 'POS_CUR') will change its position to 2. Additionally aria2.changePosition('2089b05ecca3d829', 0, 'POS_SET') will change its position to 0 (the beginning of the queue).
The following examples move the download GID#2089b05ecca3d829 to the front of the queue.
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.changePosition',
... 'params':['2089b05ecca3d829', 0, 'POS_SET']})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer', u'jsonrpc': u'2.0', u'result': 0}
XML-RPC Example
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> s.aria2.changePosition('2089b05ecca3d829', 0, 'POS_SET')
0
aria2.changeUri([secret], gid, fileIndex, delUris, addUris[, position])
this method removes the URIs in delUris from and appends the URIs in addUris to download denoted by gid πΈ delUris and addUris are lists of strings. A download can contain multiple files and URIs are attached to each file. fileIndex is used to select which file to remove/attach given URIs. fileIndex is 1-based. position is used to specify where URIs are inserted in the existing waiting URI list. position is 0-based. When position is omitted, URIs are appended to the back of the list.
bestie, listen: this method first executes the removal and then the addition. So position is the position after URIs are removed, not the position when this method is called. Don't get caught out π
When removing an URI, if the same URIs exist in download, only one of them is removed for each URI in delUris. In other words, if there are three URIs http://example.org/aria2 and you want remove them all, you have to specify (at least) 3 http://example.org/aria2 in delUris.
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.
The following examples add the URI http://example.org/file to the file whose index is 1 and belongs to the download GID#2089b05ecca3d829.
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.changeUri',
... 'params':['2089b05ecca3d829', 1, [],
... ['http://example.org/file']]})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [0, 1]}
XML-RPC Example
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> s.aria2.changeUri('2089b05ecca3d829', 1, [],
['http://example.org/file'])
[0, 1]
aria2.getOption([secret], gid)
gives you back the options of the download denoted by gid π The response is a struct where keys are the names of options. The values are strings.
heads up, no cap: 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. So don't be shocked when something's missing π
The following examples get options of the download GID#2089b05ecca3d829.
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.getOption',
... 'params':['2089b05ecca3d829']})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer',
u'jsonrpc': u'2.0',
u'result': {u'allow-overwrite': u'false',
u'allow-piece-length-change': u'false',
u'always-resume': u'true',
u'async-dns': u'true',
...
XML-RPC Example
>>> import xmlrpclib
>>> from pprint import pprint
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> r = s.aria2.getOption('2089b05ecca3d829')
>>> pprint(r)
{'allow-overwrite': 'false',
'allow-piece-length-change': 'false',
'always-resume': 'true',
'async-dns': 'true',
....
aria2.changeOption([secret], gid, options)
this one changes options of the download denoted by gid (string) dynamically π« options is a struct. The options listed in Input File subsection are available, except for following options:
dry-runmetalink-base-uriparameterized-uripausepiece-lengthrpc-save-upload-metadata
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 β so like, don't panic, she's got this π):
bt-max-peersbt-request-peer-speed-limitbt-remove-unselected-fileforce-savemax-download-limitmax-upload-limit
This method returns OK for success.
The following examples set the max-download-limit option to 20K for the download GID#2089b05ecca3d829.
π«Ά side note: the JSON-RPC example below literally shows10Kand the XML-RPC one shows20Kβ that's just how the page has it, fr fr.
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.changeOption',
... 'params':['2089b05ecca3d829',
... {'max-download-limit':'10K'}]})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'OK'}
XML-RPC Example
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> s.aria2.changeOption('2089b05ecca3d829', {'max-download-limit':'20K'})
'OK'
aria2.getGlobalOption([secret])
returns the global options π The response is a struct. Its keys are the names of options. Values are strings.
same energy as before, bestie: 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 aria2.getOption() method. cute, right? π¦
aria2.changeGlobalOption([secret], options)
changes global options dynamically β¨ options is a struct. The following options are available:
bt-max-open-filesdownload-resultkeep-unfinished-download-resultloglog-levelmax-concurrent-downloadsmax-download-resultmax-overall-download-limitmax-overall-upload-limitoptimize-concurrent-downloadssave-cookiessave-sessionserver-stat-of
Plus, bestie, the options listed in the Input File subsection are also up for grabs β except for these five: checksum, index-out, out, pause and select-file. Not those. Hands off. π
ββοΈ
And with the log option you can dynamically start logging or swap the log file mid-flight, which is iconic of it honestly. Wanna stop logging? Just pass an empty string ("") as the parameter value and it's done, no notes. But heads up: the log file is always opened in append mode β it never overwrites, it just keeps adding. This method returns OK when it works. β¨
aria2.getGlobalStat([secret])
This one gives you the global receipts β the overall download and upload speeds, all of it. The response is a struct, and it's got these keys. Values are strings, always strings, no cap.
downloadSpeedβ overall download speed (byte/sec). πββοΈuploadSpeedβ overall upload speed (byte/sec).numActiveβ how many downloads are active right now.numWaitingβ how many downloads are waiting.numStoppedβ how many downloads stopped in the current session. This value is capped by the--max-download-resultoption.numStoppedTotalβ how many downloads stopped in the current session, and this one is NOT capped by the--max-download-resultoption. The truth, the whole truth. π
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.getGlobalStat'})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer',
u'jsonrpc': u'2.0',
u'result': {u'downloadSpeed': u'21846',
u'numActive': u'2',
u'numStopped': u'0',
u'numWaiting': u'0',
u'uploadSpeed': u'0'}}
XML-RPC Example
>>> import xmlrpclib
>>> from pprint import pprint
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> r = s.aria2.getGlobalStat()
>>> pprint(r)
{'downloadSpeed': '23136',
'numActive': '2',
'numStopped': '0',
'numWaiting': '0',
'uploadSpeed': '0'}
aria2.purgeDownloadResult([secret])
This one purges</purge> all those completed / error / removed downloads so you free up memory. Marie Kondo that download list. π§Ή This method returns OK.
aria2.removeDownloadResult([secret], gid)
Removes a single completed / error / removed download β the one denoted by gid β from memory. Returns OK for success. Bye girl, we won't miss you. π
The following examples remove the download result of the download GID 2089b05ecca3d829.
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.removeDownloadResult',
... 'params':['2089b05ecca3d829']})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'OK'}
XML-RPC Example
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> s.aria2.removeDownloadResult('2089b05ecca3d829')
'OK'
aria2.getVersion([secret])
Tells you the version of aria2 and the list of enabled features. Response is a struct with these keys:
versionβ version number of aria2, as a string.enabledFeaturesβ list of enabled features. Each feature is given as a string.
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.getVersion'})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer',
u'jsonrpc': u'2.0',
u'result': {u'enabledFeatures': [u'Async DNS',
u'BitTorrent',
u'Firefox3 Cookie',
u'GZip',
u'HTTPS',
u'Message Digest',
u'Metalink',
u'XML-RPC'],
u'version': u'1.11.0'}}
XML-RPC Example
>>> import xmlrpclib
>>> from pprint import pprint
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> r = s.aria2.getVersion()
>>> pprint(r)
{'enabledFeatures': ['Async DNS',
'BitTorrent',
'Firefox3 Cookie',
'GZip',
'HTTPS',
'Message Digest',
'Metalink',
'XML-RPC'],
'version': '1.11.0'}
aria2.getSessionInfo([secret])
Returns session info. The response is a struct with this one key:
sessionIdβ the session ID, which is generated each time aria2 is invoked. Fresh every run, like a new manicure. π
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.getSessionInfo'})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer',
u'jsonrpc': u'2.0',
u'result': {u'sessionId': u'cd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9'}}
XML-RPC Example
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> s.aria2.getSessionInfo()
{'sessionId': 'cd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9'}
aria2.shutdown([secret])
Shuts down aria2. That's it, that's the method. Returns OK. π΄
aria2.forceShutdown([secret])
Shuts down aria2(). This method behaves like :func:'aria2.shutdown` without performing any actions which take time, such as contacting BitTorrent trackers to unregister downloads first. So it's the no-thoughts-just-leave version. This method returns OK.
aria2.saveSession([secret])
Saves the current session to a file specified by the --save-session option. This method returns OK if it succeeds. Snapshot the whole vibe, bestie. πΈ
system.multicall(methods)
This method encapsulates multiple method calls in a single request β bulk order, one delivery. β¨ methods is an array of structs. The structs contain two keys: methodName and params. methodName is the method name to call, and params is the array containing parameters for that 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.
In the following examples, we add 2 downloads. The first one is http://example.org/file and the second one is file.torrent.
JSON-RPC Example
>>> import urllib2, json, base64
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'system.multicall',
... 'params':[[{'methodName':'aria2.addUri',
... 'params':[['http://example.org']]},
... {'methodName':'aria2.addTorrent',
... 'params':[base64.b64encode(open('file.torrent').read())]}]]})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer', u'jsonrpc': u'2.0', u'result': [[u'2089b05ecca3d829'], [u'd2703803b52216d1']]}
JSON-RPC additionally supports Batch requests as described in the JSON-RPC 2.0 Specification:
>>> jsonreq = json.dumps([{'jsonrpc':'2.0', 'id':'qwer',
... 'method':'aria2.addUri',
... 'params':[['http://example.org']]},
... {'jsonrpc':'2.0', 'id':'asdf',
... 'method':'aria2.addTorrent',
... 'params':[base64.b64encode(open('file.torrent').read())]}])
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
[{u'id': u'qwer', u'jsonrpc': u'2.0', u'result': u'2089b05ecca3d829'},
{u'id': u'asdf', u'jsonrpc': u'2.0', u'result': u'd2703803b52216d1'}]
XML-RPC Example
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> mc = xmlrpclib.MultiCall(s)
>>> mc.aria2.addUri(['http://example.org/file'])
>>> mc.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent', mode='rb').read()))
>>> r = mc()
>>> tuple(r)
('2089b05ecca3d829', 'd2703803b52216d1')
system.listMethods()
Returns all the available RPC methods in an array of string. And here's the slay part: unlike the other methods, this one does NOT require a secret token. That's safe, because this method literally just returns the available method names β it's not out here leaking anything. π«Ά
JSON-RPC Example
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'system.listMethods'})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer',
u'jsonrpc': u'2.0',
u'result': [u'aria2.addUri',
u'aria2.addTorrent',
...
and here's the same vibe but make it XML-RPC:
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> s.system.listMethods()
['aria2.addUri', 'aria2.addTorrent', ...
π system.listNotifications() π
okay so this one hands you all the available RPC notifications, delivered as an array of string. And the plot twist? Unlike basically every other method, this one does not need a secret token. Which is fine, actually, because it literally just returns the names of the notifications that exist β nothing spicy, nothing private. safe queen behavior π«Ά
β¨ JSON-RPC Example β¨
>>> import urllib2, json
>>> from pprint import pprint
>>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer',
... 'method':'system.listNotifications'})
>>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq)
>>> pprint(json.loads(c.read()))
{u'id': u'qwer',
u'jsonrpc': u'2.0',
u'result': [u'aria2.onDownloadStart',
u'aria2.onDownloadPause',
...
β¨ XML-RPC Example β¨
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> s.system.listNotifications()
['aria2.onDownloadStart', 'aria2.onDownloadPause', ...
π Error Handling π
so when things go sideways (and bestie, sometimes they do):
- Over JSON-RPC, aria2 sends back a JSON object β the error code lives in
code, and the error message lives inmessage. - Over XML-RPC, aria2 returns
faultCode=1and drops the error message intofaultString.
π Options π
The same options as for --input-file are available. See the Input File subsection for the complete list β no skimming, go read it π
Inside the option struct:
nameis the option name (without the--in front, okay? it's giving minimal)valueis the argument, as a string
π JSON-RPC Example π
{'split':'1', 'http-proxy':'http://proxy/'}
π XML-RPC Example π
<struct>
<member>
<name>split</name>
<value><string>1</string></value>
</member>
<member>
<name>http-proxy</name>
<value><string>http://proxy/</string></value>
</member>
</struct>
okay so here's a lil β¨situationβ¨: the header and index-out options are allowed multiple times on the command-line. But since the name should be unique inside a struct β and many XML-RPC library implementations use a hash or dict for struct β a single string is just not enough. Not the move. To get around this limitation, you can use an array as the value, as well as a string. problem solved, slay π
π JSON-RPC Example π
{'header':['Accept-Language: ja', 'Accept-Charset: utf-8']}
π XML-RPC Example π
<struct>
<member>
<name>header</name>
<value>
<array>
<data>
<value><string>Accept-Language: ja</string></value>
<value><string>Accept-Charset: utf-8</string></value>
</data>
</array>
</value>
</member>
</struct>
and here's a lil demo, bestie β it adds a download with two options: dir and header. The header option needs two values, so it uses a list:
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> opts = dict(dir='/tmp',
... header=['Accept-Language: ja',
... 'Accept-Charset: utf-8'])
>>> s.aria2.addUri(['http://example.org/file'], opts)
'1'
π JSON-RPC using HTTP GET π
plot twist! 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 the GET parameters goes like this:
/jsonrpc?method=METHOD_NAME&id=ID¶ms=BASE64_ENCODED_PARAMS
The method and id are always treated as a JSON string, and their encoding must be UTF-8.
For example, the encoded string of aria2.tellStatus('2089b05ecca3d829') with id='foo' looks like this:
/jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D
The params parameter is a Base64-encoded JSON array, which usually shows up in the params attribute of the JSON-RPC request object. In the example above, the params is ["2089b05ecca3d829"], therefore:
["2089b05ecca3d829"] --(Base64)--> WyIyMDg5YjA1ZWNjYTNkODI5Il0=
--(Percent Encode)--> WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D
and there's more β¨ The JSON-RPC interface also supports JSONP. You can specify the callback function in the jsoncallback parameter:
/jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D&jsoncallback=cb
β οΈ for Batch requests, themethodandidparameters must not be specified. The whole request has to go in theparamsparameter. no exceptions, bestie.
For example, a Batch request:
[{'jsonrpc':'2.0', 'id':'qwer', 'method':'aria2.getVersion'},
{'jsonrpc':'2.0', 'id':'asdf', 'method':'aria2.tellActive'}]
must be encoded like this:
/jsonrpc?params=W3sianNvbnJwYyI6ICIyLjAiLCAiaWQiOiAicXdlciIsICJtZXRob2QiOiAiYXJpYTIuZ2V0VmVyc2lvbiJ9LCB7Impzb25ycGMiOiAiMi4wIiwgImlkIjogImFzZGYiLCAibWV0aG9kIjogImFyaWEyLnRlbGxBY3RpdmUifV0%3D
π¦ JSON-RPC over WebSocket π¦
JSON-RPC over WebSocket uses the same method signatures and response format as JSON-RPC over HTTP. The supported WebSocket version is 13, which is detailed in RFC 6455. iykyk π
To send an 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. clean, simple, iconic.
π Notifications π
The RPC server might send notifications to the client. Notifications are unidirectional, therefore the client that receives a notification must not respond to it. don't do it. it's not the vibe.
The method signature of a notification is much like a normal method request, but it lacks the id key. The value of the params key is the data this notification carries. The format of that value varies depending on the notification method. Following notification methods are defined:
aria2.onDownloadStart(event)
This notification gets sent when a download is started. The event is of type struct and it contains the following keys. The value type is string.
gidβ GID of the download.
aria2.onDownloadPause(event)
This notification gets sent when a download is paused. The event is the same struct as the event argument of the aria2.onDownloadStart() method.
aria2.onDownloadStop(event)
This notification gets sent when a download is stopped by the user. The event is the same struct as the event argument of the aria2.onDownloadStart() method.
aria2.onDownloadComplete(event)
This notification gets sent when a download is complete. For BitTorrent downloads, this notification is sent when the download is complete and seeding is over. The event is the same struct of the event argument of the aria2.onDownloadStart() method.
aria2.onDownloadError(event)
This notification gets sent when a download is stopped due to an error. The event is the same struct as the event argument of the aria2.onDownloadStart() method.
aria2.onBtDownloadComplete(event)
This notification gets sent when a torrent download is complete but seeding is still going on. The event is the same struct as the event argument of the aria2.onDownloadStart() method.
π§ Sample XML-RPC Client Code π§
okay bestie, real code time. The following Ruby script adds http://localhost/aria2.tar.bz2 to aria2c (running on localhost) with the option --dir=/downloads and prints the RPC response:
#!/usr/bin/env ruby
require 'xmlrpc/client'
require 'pp'
client=XMLRPC::Client.new2("http://localhost:6800/rpc")
options={ "dir" => "/downloads" }
result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options)
pp result
If you are a Python lover, you can use xmlrpclib (Python3 uses xmlrpc.client instead) to interact with aria2:
import xmlrpclib
from pprint import pprint
s = xmlrpclib.ServerProxy("http://localhost:6800/rpc")
r = s.aria2.addUri(["http://localhost/aria2.tar.bz2"], {"dir":"/downloads"})
pprint(r)
π MISC π
π Console Readout π
While downloading files, aria2 prints a readout to the console to show the progress of the downloads. The console readout looks like this:
[#2089b0 400.0KiB/33.2MiB(1%) CN:1 DL:115.7KiB ETA:4m51s]
okay so this section is literally just me decoding what all these numbers and strings mean π
#NNNNNNβ the first 6 characters of the GID as a hex string. The GID is a unique ID for each download, internal to aria2. It's particularly useful when you're interacting with aria2 using the RPC interface.X/Y(Z%)β completed length, the total file length, and its progress. If--select-fileis used, this is the sum of selected files.SEEDβ share ratio when aria2 is seeding a finished torrent.CNβ the number of connections aria2 has established.SDβ the number of seeders aria2 is connected to.DLβ download speed (bytes per second).ULβ upload speed (bytes per second) and the number of uploaded bytes.ETAβ expected time to finish the download.
When more than one download is in progress, some of the information described above gets omitted, so that information for several downloads can be shown. And the overall download and upload speeds get shown at the beginning of the line. multi-tasking queen β¨
When aria2 is allocating file space or validating checksums, it additionally prints the progress of these operations:
FileAllocβ GID, already allocated length and total length in bytes.Checksumβ GID, already validated length and total length in bytes.
π EXAMPLE π
bestie this is the part where it all comes together, the demo reel, the highlight tape π every single one of these is a real command you can paste and run fr fr.
π HTTP/FTP Segmented Downloads
π Download a file
$ aria2c "http://host/file.zip"
NOTE: to stop a download, hit Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory. And yes you can swap out the URIs, as long as they're all pointing to the same file. π«Ά
π Download a file from two different HTTP servers
$ aria2c "http://host/file.zip" "http://mirror/file.zip"
β¨ Download a file from one host using multiple connections
$ aria2c -x2 -k1M "http://host/file.zip"
NOTE: the-xoption sets the number of allowed connections, while-ksets the size of the chunks. two little flags doing big things π
π¦ Download a file from HTTP and FTP servers at the same time
$ aria2c "http://host1/file.zip" "ftp://host2/file.zip"
π Download files listed in a text file concurrently
$ aria2c -ifiles.txt -j2
NOTE: -j sets the number of parallel downloads. multitasking queen π
πΈ Using a proxy
For HTTP:
$ aria2c --http-proxy="http://proxy:8080" "http://host/file"
$ aria2c --http-proxy="http://proxy:8080" --no-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://host/file"
For FTP:
$ aria2c --ftp-proxy="http://proxy:8080" "ftp://host/file"
NOTE: peep--http-proxy,--https-proxy,--ftp-proxy,--all-proxyand--no-proxyfor the details. You can also specify proxy in the environment variables β go look at the ENVIRONMENT section. π
π Using a Proxy with authorization
$ aria2c --http-proxy="http://username:password@proxy:8080" "http://host/file"
$ aria2c --http-proxy="http://proxy:8080" --http-proxy-user="username" --http-proxy-passwd="password" "http://host/file"
π Metalink Download
π« Download files with remote Metalink
$ aria2c --follow-metalink=mem "http://host/file.metalink"
π§ Download using a local metalink file
$ aria2c -p --lowest-speed-limit=4000 file.metalink
NOTE: to stop a download, press Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory. β¨
π Download several local metalink files
$ aria2c -j2 file1.metalink file2.metalink
π Download only selected files
$ aria2c --select-file=1-4,8 file.metalink
NOTE: the index gets printed to the console using the -S option. π₯
π¦ Download a file using a local metalink file with user preference
$ aria2c --metalink-location=jp,us --metalink-version=1.1 --metalink-language=en-US file.metalink
π BitTorrent Download
β Download files using a remote BitTorrent file
$ aria2c --follow-torrent=mem "http://host/file.torrent"
π Download using a local torrent file
$ aria2c --max-upload-limit=40K file.torrent
NOTE: --max-upload-limit specifies the max of upload rate. πΆ
NOTE: to stop a download, press Ctrl-C. You can resume the transfer later by running aria2c with the same argument in the same directory. π«Ά
πΈ Download using BitTorrent Magnet URI
$ aria2c "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C&dn=aria2"
NOTE: do NOT forget to quote BitTorrent Magnet URIs which include&characters, with single (') or double (") quotes, when you're specifying URIs on the command-line. the shell will absolutely eat that ampersand otherwise and you'll be so confused π
π« Download 2 torrents
$ aria2c -j2 file1.torrent file2.torrent
π Download a file via torrent and HTTP/FTP server in parallel
$ aria2c -Ttest.torrent "http://host1/file" "ftp://host2/file"
β¨ Only download specific files (usually called "selected download")
$ aria2c --select-file=1-4,8 file.torrent
NOTE: the index gets printed to the console using the -S option. π
π Download a .torrent file, but do not download the torrent
$ aria2c --follow-torrent=false "http://host/file.torrent"
π Specify the output file name
To specify the output file name for BitTorrent downloads, you need to know the index of the file in the torrent (see --show-files). For example, the output looks like this:
idx|path/length
===+======================
1|dist/base-2.6.18.iso
|99.9MiB
---+----------------------
2|dist/driver-2.6.18.iso
|169.0MiB
---+----------------------
To save 'dist/base-2.6.18.iso' in '/tmp/mydir/base.iso' and 'dist/driver-2.6.18.iso' in '/tmp/dir/driver.iso', use the following command:
$ aria2c --dir=/tmp --index-out=1=mydir/base.iso --index-out=2=dir/driver.iso file.torrent
π§ Change the listening ports for incoming peer connections
$ aria2c --listen-port=7000-7001,8000 file.torrent
NOTE: since aria2 doesn't configure firewalls or routers for port forwarding, it's up to you to do so manually. it's giving DIY main character energy, no cap π§
π«Ά Specify conditions to stop seeding after torrent downloads finish
$ aria2c --seed-time=120 --seed-ratio=1.0 file.torrent
NOTE: in the above example, the program stops seeding after 120 minutes since download completed, or once the seed ratio reaches 1.0. whichever comes first bestie β°
π Throttle upload speed
$ aria2c --max-upload-limit=100K file.torrent
π Enable IPv4 DHT
$ aria2c --enable-dht --dht-listen-port=6881 file.torrent
NOTE: DHT uses UDP. Since aria2 doesn't configure firewalls or routers for port forwarding, it's up to you to do it manually. π οΈ
β Enable IPv6 DHT
$ aria2c --enable-dht6 --dht-listen-port=6881 --dht-listen-addr6=YOUR_GLOBAL_UNICAST_IPV6_ADDR
NOTE: aria2 uses the same ports as IPv4 for IPv6. iykyk π
π Add and remove tracker URIs
Ignore all tracker announce URIs defined in file.torrent and use http://tracker1/announce and http://tracker2/announce instead:
$ aria2c --bt-exclude-tracker="*" --bt-tracker="http://tracker1/announce,http://tracker2/announce" file.torrent
π More advanced HTTP features
π Load cookies
$ aria2c --load-cookies=cookies.txt "http://host/file.zip"
NOTE: you can use Firefox/Mozilla/Chromium's cookie files without modification. no conversion arc, we love a plug-and-play moment π
π¦ Resume download started by web browsers or other programs
$ aria2c -c -s2 "http://host/partiallydownloadedfile.zip"
NOTE: this will only work when the initial download was not multi-segmented. important detail bestie, don't skip it π
π Client certificate authorization for SSL/TLS
Specify a PKCS12 file as follows:
$ aria2c --certificate=/path/to/mycert.p12
NOTE: the file specified in --certificate must be contain one PKCS12 encoded certificate and key. The password must be blank. β¨
Alternatively, if PEM files are supported, use a command like the following:
$ aria2c --certificate=/path/to/mycert.pem --private-key=/path/to/mykey.pem https://host/file
NOTE: the file specified in --private-key must be decrypted; an encrypted key may cause undefined behavior. like actually undefined, not a vibe π
πΈ Verify SSL/TLS servers using given CA certificates
$ aria2c --ca-certificate=/path/to/ca-certificates.crt --check-certificate https://host/file
NOTE: 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 --ca-certificate, install the certificate in that store. ποΈ
π RPC
π« Encrypt RPC traffic with SSL/TLS
Specify a server PKC12 file:
$ aria2c --enable-rpc --rpc-certificate=/path/to/server.p12 --rpc-secure
NOTE: the file specified in --rpc-certificate must be contain one PKCS12 encoded certificate and key. The password must be blank. π
Alternatively, when PEM files are supported (GnuTLS and OpenSSL), specify the server certificate file and private key file as follows:
$ aria2c --enable-rpc --rpc-certificate=/path/to/server.crt --rpc-private-key=/path/to/server.key --rpc-secure
β¨ And more advanced features
π Throttle the download speed
Per-download:
$ aria2c --max-download-limit=100K file.metalink
Overall:
$ aria2c --max-overall-download-limit=100K file.metalink
π§ Repair a damaged download
$ aria2c -V file.metalink
NOTE: repairing damaged downloads can be done efficiently when used with BitTorrent or Metalink with chunk checksums. glow-up via verification π©Ήβ¨
β Drop connections if download speed is lower than a specified limit
$ aria2c --lowest-speed-limit=10K file.metalink
π Parameterized URI support
You can specify set of parts:
$ aria2c -P "http://{host1,host2,host3}/file.iso"
You can specify numeric sequence:
$ aria2c -Z -P "http://host/image[000-100].png"
NOTE: the -Z option is required if the URIs don't point to the same file, such as in the above example. π¨
You can specify step counter:
$ aria2c -Z -P "http://host/image[A-Z:2].png"
π Verifying checksums
$ aria2c --checksum=sha-1=0192ba11326fe2298c8cb4de616f4d4140213837 http://example.org/file
π Parallel downloads of an arbitrary number of URIs, metalink, torrent
$ aria2c -j3 -Z "http://host/file1" file2.torrent file3.metalink
π BitTorrent Encryption
Encrypt the whole payload using ARC4 (obfuscation):
$ aria2c --bt-min-crypto-level=arc4 --bt-require-crypto=true file.torrent
π SEE ALSO π
- Project Web Site:
https://aria2.github.io/ - Metalink Homepage:
http://www.metalinker.org/ - The Metalink Download Description Format:
RFC 5854
π COPYRIGHT π
Copyright (C) 2006, 2015 Tatsuhiro Tsujikawa
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.
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.
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
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.
and that's the whole page bestie, we did it π this version is from aria2 1.37.0, dated Nov 15, 2023, and it lives under the name ARIA2C(1). go forth and download literally everything, responsibly, with the correct number of connections π
πβ¨
π¦ where this page comes from
- alpine 3.24: aria2-doc 1.37.0-r2 Β· GPL-2.0-or-later
- arch rolling: aria2 1.37.0-3 Β· GPL-2.0-only
- epel 10: aria2 1.37.0-6.el10_1 Β· LicenseRef-Callaway-GPLv2+-with-exceptions
- fedora 43: aria2 1.37.0-7.fc43 Β· LicenseRef-Callaway-GPLv2+-with-exceptions
- fedora 44: aria2 1.37.0-9.fc44 Β· LicenseRef-Callaway-GPLv2+-with-exceptions
- opensuse-leap 16.0: aria2 1.37.0-bp160.2.1 Β· LicenseRef-SUSE-GPL-2.0-with-openssl-exception
- opensuse-leap 16.0: aria2 1.37.0-bp160.2.1 Β· LicenseRef-SUSE-GPL-2.0-with-openssl-exception
- opensuse-leap 16.0: aria2 1.37.0-bp160.2.1 Β· LicenseRef-SUSE-GPL-2.0-with-openssl-exception
- opensuse-leap 16.0: aria2 1.37.0-bp160.2.1 Β· LicenseRef-SUSE-GPL-2.0-with-openssl-exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms