diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..04ed6d5d3d0ef87d61cd3b7923843b65437c651a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +bin/aria2c filter=lfs diff=lfs merge=lfs -text diff --git a/bin/aria2c b/bin/aria2c new file mode 100644 index 0000000000000000000000000000000000000000..fffdb542fd4503a5c6782009a5283ac6cd0f9b69 --- /dev/null +++ b/bin/aria2c @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ff1c2ec1b4be76ebf602969a4416b7b6e6ae30955ef9d2bfea579330421d55a +size 82219952 diff --git a/share/doc/aria2/README b/share/doc/aria2/README new file mode 100644 index 0000000000000000000000000000000000000000..5ccc0ea36b545a93108ee0fed380bcefc5ec921e --- /dev/null +++ b/share/doc/aria2/README @@ -0,0 +1 @@ +See README.rst diff --git a/share/doc/aria2/README.html b/share/doc/aria2/README.html new file mode 100644 index 0000000000000000000000000000000000000000..8689e0f2479721802eae454731522a01912a62e2 --- /dev/null +++ b/share/doc/aria2/README.html @@ -0,0 +1,904 @@ + + + + + + +aria2 - The ultra fast download utility + + + +
+

aria2 - The ultra fast download utility

+ +
+

Disclaimer

+

This program comes with no warranty. +You must use this program at your own risk.

+
+
+

Introduction

+

aria2 is a utility for downloading files. The supported protocols are +HTTP(S), FTP, SFTP, BitTorrent, and Metalink. aria2 can download a +file from multiple sources/protocols and tries to utilize your maximum +download bandwidth. It supports downloading a file from +HTTP(S)/FTP/SFTP and BitTorrent at the same time, while the data +downloaded from HTTP(S)/FTP/SFTP is uploaded to the BitTorrent +swarm. Using Metalink's chunk checksums, aria2 automatically validates +chunks of data while downloading a file like BitTorrent.

+

The project page is located at https://aria2.github.io/.

+

See aria2 Online Manual (Russian translation, Portuguese +translation) to learn +how to use aria2.

+
+
+

Features

+

Here is a list of features:

+ +
+
+

Versioning and release schedule

+

We use 3 numbers for aria2 version: MAJOR.MINOR.PATCH. We will ship +MINOR update on 15th of every month. We may skip a release if we have +no changes since the last release. The feature and documentation +freeze happens 10 days before the release day (5th day of the month) +for translation teams. We will raise an issue about the upcoming +release around that day.

+

We may release PATCH releases between regular releases if we have +security issues.

+

MAJOR version will stay at 1 for the time being.

+
+
+

How to get source code

+

We maintain the source code at Github: +https://github.com/aria2/aria2

+

To get the latest source code, run following command:

+
+$ git clone https://github.com/aria2/aria2.git
+
+

This will create aria2 directory in your current directory and source +files are stored there.

+
+
+

Dependency

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
featuresdependency
HTTPSOSX or GnuTLS or OpenSSL or Windows
SFTPlibssh2
BitTorrentNone. Optional: libnettle+libgmp or libgcrypt +or OpenSSL (see note)
Metalinklibxml2 or Expat.
ChecksumNone. Optional: OSX or libnettle or libgcrypt +or OpenSSL or Windows (see note)
gzip, deflate in HTTPzlib
Async DNSC-Ares
Firefox3/Chromium cookielibsqlite3
XML-RPClibxml2 or Expat.
JSON-RPC over WebSocketlibnettle or libgcrypt or OpenSSL
+
+

Note

+

libxml2 has precedence over Expat if both libraries are installed. +If you prefer Expat, run configure with --without-libxml2.

+
+
+

Note

+

On Apple OSX the OS-level SSL/TLS support will be preferred. Hence +neither GnuTLS nor OpenSSL are required on that platform. If you'd +like to disable this behavior, run configure with +--without-appletls.

+

GnuTLS has precedence over OpenSSL if both libraries are installed. +If you prefer OpenSSL, run configure with --without-gnutls +--with-openssl.

+

On Windows there is SSL implementation available that is based on +the native Windows SSL capabilities (Schannel) and it will be +preferred. Hence neither GnuTLS nor OpenSSL are required on that +platform. If you'd like to disable this behavior, run configure +with --without-wintls.

+
+
+

Note

+

On Apple OSX the OS-level checksum support will be preferred, +unless aria2 is configured with --without-appletls.

+

libnettle has precedence over libgcrypt if both libraries are +installed. If you prefer libgcrypt, run configure with +--without-libnettle --with-libgcrypt. If OpenSSL is selected over +GnuTLS, neither libnettle nor libgcrypt will be used.

+

If none of the optional dependencies are installed, an internal +implementation that only supports md5 and sha1 will be used.

+

On Windows there is SSL implementation available that is based on +the native Windows capabilities and it will be preferred, unless +aria2 is configured with --without-wintls.

+
+

A user can have one of the following configurations for SSL and crypto +libraries:

+ +

You can disable BitTorrent and Metalink support by providing +--disable-bittorrent and --disable-metalink to the configure +script respectively.

+

In order to enable async DNS support, you need c-ares.

+ +
+
+

How to build

+

aria2 is primarily written in C++. Initially it was written based on +C++98/C++03 standard features. We are now migrating aria2 to C++11 +standard. The current source code requires C++11 aware compiler. For +well-known compilers, such as g++ and clang, the -std=c++11 or +-std=c++0x flag must be supported.

+

In order to build aria2 from the source package, you need following +development packages (package name may vary depending on the +distribution you use):

+ +

You can use libgcrypt-dev instead of nettle-dev and libgmp-dev:

+ +

You can use libssl-dev instead of +libgnutls-dev, nettle-dev, libgmp-dev, libgpg-error-dev and libgcrypt-dev:

+ +

You can use libexpat1-dev instead of libxml2-dev:

+ +

On Fedora you need the following packages: gcc, gcc-c++, kernel-devel, +libgcrypt-devel, libxml2-devel, openssl-devel, gettext-devel, cppunit

+

If you downloaded source code from git repository, you have to install +following packages to get autoconf macros:

+ +

And run following command to generate configure script and other files +necessary to build the program:

+
+$ autoreconf -i
+
+

Also you need Sphinx to build man page.

+

If you are building aria2 for Mac OS X, take a look at +the makerelease-osx.mk GNU Make makefile.

+

The quickest way to build aria2 is first run configure script:

+
+$ ./configure
+
+

To build statically linked aria2, use ARIA2_STATIC=yes +command-line option:

+
+$ ./configure ARIA2_STATIC=yes
+
+

After configuration is done, run make to compile the program:

+
+$ make
+
+

See Cross-compiling Windows binary to create a Windows binary. +See Cross-compiling Android binary to create an Android binary.

+

The configure script checks available libraries and enables as many +features as possible except for experimental features not enabled by +default.

+

Since 1.1.0, aria2 checks the certificate of HTTPS servers by default. +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. If it is not the case, I recommend to supply the path +to the CA bundle file. For example, in Debian the path to CA bundle +file is '/etc/ssl/certs/ca-certificates.crt' (in ca-certificates +package). This may vary depending on your distribution. You can give +it to configure script using --with-ca-bundle option:

+
+$ ./configure --with-ca-bundle='/etc/ssl/certs/ca-certificates.crt'
+$ make
+
+

Without --with-ca-bundle option, you will encounter the error when +accessing HTTPS servers because the certificate cannot be verified +without CA bundle. In such case, you can specify the CA bundle file +using aria2's --ca-certificate option. If you don't have CA bundle +file installed, then the last resort is disable the certificate +validation using --check-certificate=false.

+

Using the native OSX (AppleTLS) and/or Windows (WinTLS) implementation +will automatically use the system certificate store, so +--with-ca-bundle is not necessary and will be ignored when using +these implementations.

+

By default, the bash_completion file named aria2c is installed to +the directory $prefix/share/doc/aria2/bash_completion. To change +the install directory of the file, use --with-bashcompletiondir +option.

+

After a make the executable is located at src/aria2c.

+

aria2 uses CppUnit for automated unit testing. To run the unit test:

+
+$ make check
+
+
+
+

Cross-compiling Windows binary

+

In this section, we describe how to build a Windows binary using a +mingw-w64 (http://mingw-w64.org/doku.php) cross-compiler on Debian +Linux. The MinGW (http://www.mingw.org/) may not be able to build +aria2.

+

The easiest way to build Windows binary is use Dockerfile.mingw. See +Dockerfile.mingw how to build binary. If you cannot use Dockerfile, +then continue to read following paragraphs.

+

Basically, after compiling and installing depended libraries, you can +do cross-compile just passing appropriate --host option and +specifying CPPFLAGS, LDFLAGS and PKG_CONFIG_LIBDIR +variables to configure. For convenience and lowering our own +development cost, we provide easier way to configure the build +settings.

+

mingw-config script is a configure script wrapper for mingw-w64. +We use it to create official Windows build. This script assumes +following libraries have been built for cross-compile:

+ +

Some environment variables can be adjusted to change build settings:

+
+
HOST
+
cross-compile to build programs to run on HOST. It defaults to +i686-w64-mingw32. To build 64bit binary, specify +x86_64-w64-mingw32.
+
PREFIX
+
Prefix to the directory where dependent libraries are installed. It +defaults to /usr/local/$HOST. -I$PREFIX/include will be +added to CPPFLAGS. -L$PREFIX/lib will be added to +LDFLAGS. $PREFIX/lib/pkgconfig will be set to +PKG_CONFIG_LIBDIR.
+
+

For example, to build 64bit binary do this:

+
+$ HOST=x86_64-w64-mingw32 ./mingw-config
+
+

If you want libaria2 dll with --enable-libaria2, then don't use +ARIA2_STATIC=yes and prepare the DLL version of external +libraries.

+
+
+

Cross-compiling Android binary

+

In this section, we describe how to build Android binary using Android +NDK cross-compiler on Debian Linux.

+

At the time of this writing, Android NDK r21e should compile aria2 +without errors.

+

android-config script is a configure script wrapper for Android +build. We use it to create official Android build. This script +assumes the following libraries have been built for cross-compile:

+ +

When building the above libraries, make sure that disable shared +library and enable only static library. We are going to link those +libraries statically.

+

android-config assumes that $ANDROID_HOME and $NDK +environment variables are defined.

+

We currently use Android NDK r21e. $NDK should point to the +directory to Anroid NDK. The build tools will be found under +$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/.

+

All the dependent libraries must be installed under +$ANDROID_HOME/usr/local.

+

After android-config, run make to compile sources.

+
+
+

Building documentation

+

Sphinx is used to build the +documentation. aria2 man pages will be build when you run make if +they are not up-to-date. You can also build HTML version of aria2 man +page by make html. The HTML version manual is also available at +online (Russian +translation, Portuguese +translation).

+
+
+

BitTorrent

+
+

About file names

+

The file name of the downloaded file is determined as follows:

+
+
single-file mode
+
If "name" key is present in .torrent file, file name is the value +of "name" key. Otherwise, file name is the base name of .torrent +file appended by ".file". For example, .torrent file is +"test.torrent", then file name is "test.torrent.file". The +directory to store the downloaded file can be specified by -d +option.
+
multi-file mode
+
The complete directory/file structure mentioned in .torrent file +is created. The directory to store the top directory of +downloaded files can be specified by -d option.
+
+

Before download starts, a complete directory structure is created if +needed. By default, aria2 opens at most 100 files mentioned in +.torrent file, and directly writes to and reads from these files. +The number of files to open simultaneously can be controlled by +--bt-max-open-files option.

+
+
+

DHT

+

aria2 supports mainline compatible DHT. By default, the routing table +for IPv4 DHT is saved to $XDG_CACHE_HOME/aria2/dht.dat and the +routing table for IPv6 DHT is saved to +$XDG_CACHE_HOME/aria2/dht6.dat unless files exist at +$HOME/.aria2/dht.dat or $HOME/.aria2/dht6.dat. aria2 uses same +port number to listen on for both IPv4 and IPv6 DHT.

+
+
+

UDP tracker

+

UDP tracker support is enabled when IPv4 DHT is enabled. The port +number of UDP tracker is shared with DHT. Use --dht-listen-port +option to change the port number.

+
+
+

Other things should be noted

+
    +
  • -o option is used to change the file name of .torrent file itself, +not a file name of a file in .torrent file. For this purpose, use +--index-out option instead.
  • +
  • The port numbers that aria2 uses by default are 6881-6999 for TCP +and UDP.
  • +
  • aria2 doesn't configure port-forwarding automatically. Please +configure your router or firewall manually.
  • +
  • The maximum number of peers is 55. This limit may be exceeded when +download rate is low. This download rate can be adjusted using +--bt-request-peer-speed-limit option.
  • +
  • As of release 0.10.0, aria2 stops sending request message after +selective download completes.
  • +
+
+
+ + +
+

netrc

+

netrc support is enabled by default for HTTP(S)/FTP/SFTP. To disable +netrc support, specify -n command-line option. Your .netrc file +should have correct permissions(600).

+
+
+

WebSocket

+

The WebSocket server embedded in aria2 implements the specification +defined in RFC 6455. The supported protocol version is 13.

+
+
+

libaria2

+

The libaria2 is a C++ library which offers aria2 functionality to the +client code. Currently, libaria2 is not built by default. To enable +libaria2, use --enable-libaria2 configure option. By default, +only the shared library is built. To build static library, use +--enable-static configure option as well. See libaria2 +documentation to know how to use API.

+
+
+

References

+ +
+
+ + diff --git a/share/doc/aria2/README.rst b/share/doc/aria2/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..dc9233eddb70b841ffb16b535d85cbd4cc900569 --- /dev/null +++ b/share/doc/aria2/README.rst @@ -0,0 +1,565 @@ +aria2 - The ultra fast download utility +======================================= + +Disclaimer +---------- +This program comes with no warranty. +You must use this program at your own risk. + +Introduction +------------ + +aria2 is a utility for downloading files. The supported protocols are +HTTP(S), FTP, SFTP, BitTorrent, and Metalink. aria2 can download a +file from multiple sources/protocols and tries to utilize your maximum +download bandwidth. It supports downloading a file from +HTTP(S)/FTP/SFTP and BitTorrent at the same time, while the data +downloaded from HTTP(S)/FTP/SFTP is uploaded to the BitTorrent +swarm. Using Metalink's chunk checksums, aria2 automatically validates +chunks of data while downloading a file like BitTorrent. + +The project page is located at https://aria2.github.io/. + +See `aria2 Online Manual +`_ (`Russian translation +`_, `Portuguese +translation `_) to learn +how to use aria2. + +Features +-------- + +Here is a list of features: + +* Command-line interface +* Download files through HTTP(S)/FTP/SFTP/BitTorrent +* Segmented downloading +* Metalink version 4 (RFC 5854) support(HTTP/FTP/SFTP/BitTorrent) +* Metalink version 3.0 support(HTTP/FTP/SFTP/BitTorrent) +* Metalink/HTTP (RFC 6249) support +* HTTP/1.1 implementation +* HTTP Proxy support +* HTTP BASIC authentication support +* HTTP Proxy authentication support +* Well-known environment variables for proxy: ``http_proxy``, + ``https_proxy``, ``ftp_proxy``, ``all_proxy`` and ``no_proxy`` +* HTTP gzip, deflate content encoding support +* Verify peer using given trusted CA certificate in HTTPS +* Client certificate authentication in HTTPS +* Chunked transfer encoding support +* Load Cookies from file using the Firefox3 format, Chromium/Google Chrome + and the Mozilla/Firefox + (1.x/2.x)/Netscape format. +* Save Cookies in the Mozilla/Firefox (1.x/2.x)/Netscape format. +* Custom HTTP Header support +* Persistent Connections support +* FTP/SFTP through HTTP Proxy +* Download/Upload speed throttling +* BitTorrent extensions: Fast extension, DHT, PEX, MSE/PSE, + Multi-Tracker, UDP tracker +* BitTorrent `WEB-Seeding `_. + aria2 requests chunks more than piece size to reduce the request + overhead. It also supports pipelined requests with piece size. +* BitTorrent Local Peer Discovery +* Rename/change the directory structure of BitTorrent downloads + completely +* JSON-RPC (over HTTP and WebSocket)/XML-RPC interface +* Run as a daemon process +* Selective download in multi-file torrent/Metalink +* Chunk checksum validation in Metalink +* Can disable segmented downloading in Metalink +* Netrc support +* Configuration file support +* Download URIs found in a text file or stdin and the destination + directory and output file name can be specified optionally +* Parameterized URI support +* IPv6 support with Happy Eyeballs +* Disk cache to reduce disk activity + + +Versioning and release schedule +------------------------------- + +We use 3 numbers for aria2 version: MAJOR.MINOR.PATCH. We will ship +MINOR update on 15th of every month. We may skip a release if we have +no changes since the last release. The feature and documentation +freeze happens 10 days before the release day (5th day of the month) +for translation teams. We will raise an issue about the upcoming +release around that day. + +We may release PATCH releases between regular releases if we have +security issues. + +MAJOR version will stay at 1 for the time being. + +How to get source code +---------------------- + +We maintain the source code at Github: +https://github.com/aria2/aria2 + +To get the latest source code, run following command:: + + $ git clone https://github.com/aria2/aria2.git + +This will create aria2 directory in your current directory and source +files are stored there. + +Dependency +---------- + + +======================== ======================================== +features dependency +======================== ======================================== +HTTPS OSX or GnuTLS or OpenSSL or Windows +SFTP libssh2 +BitTorrent None. Optional: libnettle+libgmp or libgcrypt + or OpenSSL (see note) +Metalink libxml2 or Expat. +Checksum None. Optional: OSX or libnettle or libgcrypt + or OpenSSL or Windows (see note) +gzip, deflate in HTTP zlib +Async DNS C-Ares +Firefox3/Chromium cookie libsqlite3 +XML-RPC libxml2 or Expat. +JSON-RPC over WebSocket libnettle or libgcrypt or OpenSSL +======================== ======================================== + + +.. note:: + + libxml2 has precedence over Expat if both libraries are installed. + If you prefer Expat, run configure with ``--without-libxml2``. + +.. note:: + + On Apple OSX the OS-level SSL/TLS support will be preferred. Hence + neither GnuTLS nor OpenSSL are required on that platform. If you'd + like to disable this behavior, run configure with + ``--without-appletls``. + + GnuTLS has precedence over OpenSSL if both libraries are installed. + If you prefer OpenSSL, run configure with ``--without-gnutls`` + ``--with-openssl``. + + On Windows there is SSL implementation available that is based on + the native Windows SSL capabilities (Schannel) and it will be + preferred. Hence neither GnuTLS nor OpenSSL are required on that + platform. If you'd like to disable this behavior, run configure + with ``--without-wintls``. + +.. note:: + + On Apple OSX the OS-level checksum support will be preferred, + unless aria2 is configured with ``--without-appletls``. + + libnettle has precedence over libgcrypt if both libraries are + installed. If you prefer libgcrypt, run configure with + ``--without-libnettle --with-libgcrypt``. If OpenSSL is selected over + GnuTLS, neither libnettle nor libgcrypt will be used. + + If none of the optional dependencies are installed, an internal + implementation that only supports md5 and sha1 will be used. + + On Windows there is SSL implementation available that is based on + the native Windows capabilities and it will be preferred, unless + aria2 is configured with ``--without-wintls``. + +A user can have one of the following configurations for SSL and crypto +libraries: + +* OpenSSL +* GnuTLS + libgcrypt +* GnuTLS + libnettle +* Apple TLS (OSX only) +* Windows TLS (Windows only) + +You can disable BitTorrent and Metalink support by providing +``--disable-bittorrent`` and ``--disable-metalink`` to the configure +script respectively. + +In order to enable async DNS support, you need c-ares. + +* c-ares: http://c-ares.haxx.se/ + +How to build +------------ + +aria2 is primarily written in C++. Initially it was written based on +C++98/C++03 standard features. We are now migrating aria2 to C++11 +standard. The current source code requires C++11 aware compiler. For +well-known compilers, such as g++ and clang, the ``-std=c++11`` or +``-std=c++0x`` flag must be supported. + +In order to build aria2 from the source package, you need following +development packages (package name may vary depending on the +distribution you use): + +* libgnutls-dev (Required for HTTPS, BitTorrent, Checksum support) +* nettle-dev (Required for BitTorrent, Checksum support) +* libgmp-dev (Required for BitTorrent) +* libssh2-1-dev (Required for SFTP support) +* libc-ares-dev (Required for async DNS support) +* libxml2-dev (Required for Metalink support) +* zlib1g-dev (Required for gzip, deflate decoding support in HTTP) +* libsqlite3-dev (Required for Firefox3/Chromium cookie support) +* pkg-config (Required to detect installed libraries) + +You can use libgcrypt-dev instead of nettle-dev and libgmp-dev: + +* libgpg-error-dev (Required for BitTorrent, Checksum support) +* libgcrypt-dev (Required for BitTorrent, Checksum support) + +You can use libssl-dev instead of +libgnutls-dev, nettle-dev, libgmp-dev, libgpg-error-dev and libgcrypt-dev: + +* libssl-dev (Required for HTTPS, BitTorrent, Checksum support) + +You can use libexpat1-dev instead of libxml2-dev: + +* libexpat1-dev (Required for Metalink support) + +On Fedora you need the following packages: gcc, gcc-c++, kernel-devel, +libgcrypt-devel, libxml2-devel, openssl-devel, gettext-devel, cppunit + +If you downloaded source code from git repository, you have to install +following packages to get autoconf macros: + +* libxml2-dev +* libcppunit-dev +* autoconf +* automake +* autotools-dev +* autopoint +* libtool + +And run following command to generate configure script and other files +necessary to build the program:: + + $ autoreconf -i + +Also you need `Sphinx `_ to build man page. + +If you are building aria2 for Mac OS X, take a look at +the makerelease-osx.mk GNU Make makefile. + +The quickest way to build aria2 is first run configure script:: + + $ ./configure + +To build statically linked aria2, use ``ARIA2_STATIC=yes`` +command-line option:: + + $ ./configure ARIA2_STATIC=yes + +After configuration is done, run ``make`` to compile the program:: + + $ make + +See `Cross-compiling Windows binary`_ to create a Windows binary. +See `Cross-compiling Android binary`_ to create an Android binary. + +The configure script checks available libraries and enables as many +features as possible except for experimental features not enabled by +default. + +Since 1.1.0, aria2 checks the certificate of HTTPS servers by default. +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. If it is not the case, I recommend to supply the path +to the CA bundle file. For example, in Debian the path to CA bundle +file is '/etc/ssl/certs/ca-certificates.crt' (in ca-certificates +package). This may vary depending on your distribution. You can give +it to configure script using ``--with-ca-bundle option``:: + + $ ./configure --with-ca-bundle='/etc/ssl/certs/ca-certificates.crt' + $ make + +Without ``--with-ca-bundle`` option, you will encounter the error when +accessing HTTPS servers because the certificate cannot be verified +without CA bundle. In such case, you can specify the CA bundle file +using aria2's ``--ca-certificate`` option. If you don't have CA bundle +file installed, then the last resort is disable the certificate +validation using ``--check-certificate=false``. + +Using the native OSX (AppleTLS) and/or Windows (WinTLS) implementation +will automatically use the system certificate store, so +``--with-ca-bundle`` is not necessary and will be ignored when using +these implementations. + +By default, the bash_completion file named ``aria2c`` is installed to +the directory ``$prefix/share/doc/aria2/bash_completion``. To change +the install directory of the file, use ``--with-bashcompletiondir`` +option. + +After a ``make`` the executable is located at ``src/aria2c``. + +aria2 uses CppUnit for automated unit testing. To run the unit test:: + + $ make check + +Cross-compiling Windows binary +------------------------------ + +In this section, we describe how to build a Windows binary using a +mingw-w64 (http://mingw-w64.org/doku.php) cross-compiler on Debian +Linux. The MinGW (http://www.mingw.org/) may not be able to build +aria2. + +The easiest way to build Windows binary is use Dockerfile.mingw. See +Dockerfile.mingw how to build binary. If you cannot use Dockerfile, +then continue to read following paragraphs. + +Basically, after compiling and installing depended libraries, you can +do cross-compile just passing appropriate ``--host`` option and +specifying ``CPPFLAGS``, ``LDFLAGS`` and ``PKG_CONFIG_LIBDIR`` +variables to configure. For convenience and lowering our own +development cost, we provide easier way to configure the build +settings. + +``mingw-config`` script is a configure script wrapper for mingw-w64. +We use it to create official Windows build. This script assumes +following libraries have been built for cross-compile: + +* c-ares +* expat +* sqlite3 +* zlib +* libssh2 +* cppunit + +Some environment variables can be adjusted to change build settings: + +``HOST`` + cross-compile to build programs to run on ``HOST``. It defaults to + ``i686-w64-mingw32``. To build 64bit binary, specify + ``x86_64-w64-mingw32``. + +``PREFIX`` + Prefix to the directory where dependent libraries are installed. It + defaults to ``/usr/local/$HOST``. ``-I$PREFIX/include`` will be + added to ``CPPFLAGS``. ``-L$PREFIX/lib`` will be added to + ``LDFLAGS``. ``$PREFIX/lib/pkgconfig`` will be set to + ``PKG_CONFIG_LIBDIR``. + +For example, to build 64bit binary do this:: + + $ HOST=x86_64-w64-mingw32 ./mingw-config + +If you want libaria2 dll with ``--enable-libaria2``, then don't use +``ARIA2_STATIC=yes`` and prepare the DLL version of external +libraries. + +Cross-compiling Android binary +------------------------------ + +In this section, we describe how to build Android binary using Android +NDK cross-compiler on Debian Linux. + +At the time of this writing, Android NDK r21e should compile aria2 +without errors. + +``android-config`` script is a configure script wrapper for Android +build. We use it to create official Android build. This script +assumes the following libraries have been built for cross-compile: + +* c-ares +* openssl +* expat +* zlib +* libssh2 + +When building the above libraries, make sure that disable shared +library and enable only static library. We are going to link those +libraries statically. + +``android-config`` assumes that ``$ANDROID_HOME`` and ``$NDK`` +environment variables are defined. + +We currently use Android NDK r21e. ``$NDK`` should point to the +directory to Anroid NDK. The build tools will be found under +``$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/``. + +All the dependent libraries must be installed under +``$ANDROID_HOME/usr/local``. + +After ``android-config``, run ``make`` to compile sources. + +Building documentation +---------------------- + +`Sphinx `_ is used to build the +documentation. aria2 man pages will be build when you run ``make`` if +they are not up-to-date. You can also build HTML version of aria2 man +page by ``make html``. The HTML version manual is also available at +`online `_ (`Russian +translation `_, `Portuguese +translation `_). + +BitTorrent +----------- + +About file names +~~~~~~~~~~~~~~~~ +The file name of the downloaded file is determined as follows: + +single-file mode + If "name" key is present in .torrent file, file name is the value + of "name" key. Otherwise, file name is the base name of .torrent + file appended by ".file". For example, .torrent file is + "test.torrent", then file name is "test.torrent.file". The + directory to store the downloaded file can be specified by -d + option. + +multi-file mode + The complete directory/file structure mentioned in .torrent file + is created. The directory to store the top directory of + downloaded files can be specified by -d option. + +Before download starts, a complete directory structure is created if +needed. By default, aria2 opens at most 100 files mentioned in +.torrent file, and directly writes to and reads from these files. +The number of files to open simultaneously can be controlled by +``--bt-max-open-files`` option. + +DHT +~~~ + +aria2 supports mainline compatible DHT. By default, the routing table +for IPv4 DHT is saved to ``$XDG_CACHE_HOME/aria2/dht.dat`` and the +routing table for IPv6 DHT is saved to +``$XDG_CACHE_HOME/aria2/dht6.dat`` unless files exist at +``$HOME/.aria2/dht.dat`` or ``$HOME/.aria2/dht6.dat``. aria2 uses same +port number to listen on for both IPv4 and IPv6 DHT. + +UDP tracker +~~~~~~~~~~~ + +UDP tracker support is enabled when IPv4 DHT is enabled. The port +number of UDP tracker is shared with DHT. Use ``--dht-listen-port`` +option to change the port number. + +Other things should be noted +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* ``-o`` option is used to change the file name of .torrent file itself, + not a file name of a file in .torrent file. For this purpose, use + ``--index-out`` option instead. +* The port numbers that aria2 uses by default are 6881-6999 for TCP + and UDP. +* aria2 doesn't configure port-forwarding automatically. Please + configure your router or firewall manually. +* The maximum number of peers is 55. This limit may be exceeded when + download rate is low. This download rate can be adjusted using + ``--bt-request-peer-speed-limit`` option. +* As of release 0.10.0, aria2 stops sending request message after + selective download completes. + +Metalink +-------- + +The current implementation supports HTTP(S)/FTP/SFTP/BitTorrent. The +other P2P protocols are ignored. Both Metalink4 (RFC 5854) and +Metalink version 3.0 documents are supported. + +For checksum verification, md5, sha-1, sha-224, sha-256, sha-384 and +sha-512 are supported. If multiple hash algorithms are provided, aria2 +uses stronger one. If whole file checksum verification fails, aria2 +doesn't retry the download and just exits with non-zero return code. + +The supported user preferences are version, language, location, +protocol and os. + +If chunk checksums are provided in Metalink file, aria2 automatically +validates chunks of data during download. This behavior can be turned +off by a command-line option. + +If signature is included in a Metalink file, aria2 saves it as a file +after the completion of the download. The file name is download +file name + ".sig". If same file already exists, the signature file is +not saved. + +In Metalink4, multi-file torrent could appear in metalink:metaurl +element. Since aria2 cannot download 2 same torrents at the same +time, aria2 groups files in metalink:file element which has same +BitTorrent metaurl and downloads them from a single BitTorrent swarm. +This is basically multi-file torrent download with file selection, so +the adjacent files which is not in Metalink document but shares same +piece with selected file are also created. + +If relative URI is specified in metalink:url or metalink:metaurl +element, aria2 uses the URI of Metalink file as base URI to resolve +the relative URI. If relative URI is found in Metalink file which is +read from local disk, aria2 uses the value of ``--metalink-base-uri`` +option as base URI. If this option is not specified, the relative URI +will be ignored. + +Metalink/HTTP +------------- + +The current implementation only uses rel=duplicate links only. aria2 +understands Digest header fields and check whether it matches the +digest value from other sources. If it differs, drop connection. +aria2 also uses this digest value to perform checksum verification +after download finished. aria2 recognizes geo value. To tell aria2 +which location you prefer, you can use ``--metalink-location`` option. + +netrc +----- + +netrc support is enabled by default for HTTP(S)/FTP/SFTP. To disable +netrc support, specify -n command-line option. Your .netrc file +should have correct permissions(600). + +WebSocket +--------- + +The WebSocket server embedded in aria2 implements the specification +defined in RFC 6455. The supported protocol version is 13. + +libaria2 +-------- + +The libaria2 is a C++ library which offers aria2 functionality to the +client code. Currently, libaria2 is not built by default. To enable +libaria2, use ``--enable-libaria2`` configure option. By default, +only the shared library is built. To build static library, use +``--enable-static`` configure option as well. See libaria2 +documentation to know how to use API. + +References +---------- + +* `aria2 Online Manual `_ +* https://aria2.github.io/ +* `RFC 959 FILE TRANSFER PROTOCOL (FTP) `_ +* `RFC 1738 Uniform Resource Locators (URL) `_ +* `RFC 2428 FTP Extensions for IPv6 and NATs `_ +* `RFC 2616 Hypertext Transfer Protocol -- HTTP/1.1 `_ +* `RFC 3659 Extensions to FTP `_ +* `RFC 3986 Uniform Resource Identifier (URI): Generic Syntax `_ +* `RFC 4038 Application Aspects of IPv6 Transition `_ +* `RFC 5854 The Metalink Download Description Format `_ +* `RFC 6249 Metalink/HTTP: Mirrors and Hashes `_ +* `RFC 6265 HTTP State Management Mechanism `_ +* `RFC 6266 Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP) `_ +* `RFC 6455 The WebSocket Protocol `_ +* `RFC 6555 Happy Eyeballs: Success with Dual-Stack Hosts `_ + +* `The BitTorrent Protocol Specification `_ +* `BitTorrent: DHT Protocol `_ +* `BitTorrent: Fast Extension `_ +* `BitTorrent: IPv6 Tracker Extension `_ +* `BitTorrent: Extension for Peers to Send Metadata Files `_ +* `BitTorrent: Extension Protocol `_ +* `BitTorrent: Multitracker Metadata Extension `_ +* `BitTorrent: UDP Tracker Protocol for BitTorrent `_ + and `BitTorrent udp-tracker protocol specification `_. +* `BitTorrent: WebSeed - HTTP/FTP Seeding (GetRight style) `_ +* `BitTorrent: Private Torrents `_ +* `BitTorrent: BitTorrent DHT Extensions for IPv6 `_ +* `BitTorrent: Message Stream Encryption `_ +* `Kademlia: A Peer-to-peer Information System Based on the XOR Metric `_ diff --git a/share/doc/aria2/bash_completion/README.txt b/share/doc/aria2/bash_completion/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..785029c173ba58d80c89a8d701e67c1753ad7b16 --- /dev/null +++ b/share/doc/aria2/bash_completion/README.txt @@ -0,0 +1,11 @@ +Bash_completion for aria2c +========================== + +Install +------- + +Copy 'aria2c' to the directory where bash_completion searches +completion files. For Debian and Ubuntu, copy 'aria2c' to +'/etc/bash_completion.d/' and run + +. /etc/bash_completion diff --git a/share/doc/aria2/bash_completion/aria2c b/share/doc/aria2/bash_completion/aria2c new file mode 100644 index 0000000000000000000000000000000000000000..9ab3ed02f387ab26955fdbc112373733362b3ce4 --- /dev/null +++ b/share/doc/aria2/bash_completion/aria2c @@ -0,0 +1,90 @@ +_aria2c() +{ + local cur prev split=false + COMPREPLY=() + COMP_WORDBREAKS=${COMP_WORDBREAKS//=} + + cmd=${COMP_WORDS[0]} + _get_comp_words_by_ref cur prev + case $prev in + --ftp-type) + COMPREPLY=( $( compgen -W 'binary ascii' -- "$cur" ) ) + return 0 + ;; + --proxy-method) + COMPREPLY=( $( compgen -W 'get tunnel' -- "$cur" ) ) + return 0 + ;; + --metalink-preferred-protocol) + COMPREPLY=( $( compgen -W 'http https ftp none' -- "$cur" ) ) + return 0 + ;; + --bt-min-crypto-level) + COMPREPLY=( $( compgen -W 'plain arc4' -- "$cur" ) ) + return 0 + ;; + --follow-metalink) + COMPREPLY=( $( compgen -W 'true mem false' -- "$cur" ) ) + return 0 + ;; + --file-allocation) + COMPREPLY=( $( compgen -W 'none prealloc trunc falloc' -- "$cur" ) ) + return 0 + ;; + --log-level) + COMPREPLY=( $( compgen -W 'debug info notice warn error' -- "$cur" ) ) + return 0 + ;; + --uri-selector) + COMPREPLY=( $( compgen -W 'inorder feedback adaptive' -- "$cur" ) ) + return 0 + ;; + --event-poll) + COMPREPLY=( $( compgen -W 'epoll poll select' -- "$cur" ) ) + return 0 + ;; + --follow-torrent) + COMPREPLY=( $( compgen -W 'true mem false' -- "$cur" ) ) + return 0 + ;; + --stream-piece-selector) + COMPREPLY=( $( compgen -W 'default inorder random geom' -- "$cur" ) ) + return 0 + ;; + --download-result) + COMPREPLY=( $( compgen -W 'default full hide' -- "$cur" ) ) + return 0 + ;; + --min-tls-version) + COMPREPLY=( $( compgen -W 'TLSv1.1 TLSv1.2 TLSv1.3' -- "$cur" ) ) + return 0 + ;; + --console-log-level) + COMPREPLY=( $( compgen -W 'debug info notice warn error' -- "$cur" ) ) + return 0 + ;; + --dir) + _filedir -d + return 0 + ;; + --torrent-file) + _filedir '@(torrent)' + return 0 + ;; + --metalink-file) + _filedir '@(meta4|metalink)' + return 0 + ;; + esac + case $cur in + -*) + COMPREPLY=( $( compgen -W '--rpc-save-upload-metadata --rpc-save-upload-metadata=false --on-download-start --metalink-language --rpc-secret --torrent-file --enable-peer-exchange --enable-peer-exchange=false --http-proxy-passwd --bt-tracker-timeout --ftp-type --seed-time --keep-unfinished-download-result --keep-unfinished-download-result=false --bt-tracker-connect-timeout --bt-max-open-files --no-netrc --no-netrc=false --force-sequential --force-sequential=false --metalink-base-uri --private-key --ftp-passwd --allow-overwrite --allow-overwrite=false --rpc-allow-origin-all --rpc-allow-origin-all=false --bt-detach-seed-only --bt-detach-seed-only=false --dht-entry-point6 --summary-interval --lowest-speed-limit --bt-tracker-interval --proxy-method --metalink-preferred-protocol --enable-http-keep-alive --enable-http-keep-alive=false --metalink-version --stderr --stderr=false --bt-lpd-interface --force-save --force-save=false --rpc-secure --rpc-secure=false --listen-port --rpc-private-key --server-stat-of --server-stat-timeout --bt-load-saved-metadata --bt-load-saved-metadata=false --https-proxy-user --piece-length --dry-run --dry-run=false --truncate-console-readout --truncate-console-readout=false --save-not-found --save-not-found=false --async-dns-server --bt-max-peers --max-overall-upload-limit --rpc-user --optimize-concurrent-downloads --optimize-concurrent-downloads=true --optimize-concurrent-downloads=false --optimize-concurrent-downloads=A:B --dir --split --on-download-pause --auto-file-renaming --auto-file-renaming=false --http-proxy --save-session-interval --daemon --daemon=false --https-proxy --min-tls-version --save-cookies --out --rlimit-nofile --max-file-not-found --on-download-stop --certificate --bt-min-crypto-level --remove-control-file --remove-control-file=false --enable-dht --enable-dht=false --file-allocation --follow-metalink --on-bt-download-complete --ftp-proxy --show-files --show-files=false --timeout --bt-hash-check-seed --bt-hash-check-seed=false --ftp-pasv --ftp-pasv=false --check-certificate --check-certificate=false --always-resume --always-resume=false --load-cookies --bt-remove-unselected-file --bt-remove-unselected-file=false --bt-stop-timeout --version --max-concurrent-downloads --quiet --quiet=false --max-download-result --content-disposition-default-utf8 --content-disposition-default-utf8=false --max-resume-failure-tries --header --rpc-listen-all --rpc-listen-all=false --all-proxy-user --server-stat-if --dht-file-path6 --save-session --bt-external-ip --max-tries --conditional-get --conditional-get=false --ftp-reuse-connection --ftp-reuse-connection=false --gid --dscp --max-download-limit --bt-prioritize-piece --check-integrity --check-integrity=false --log-level --remote-time --remote-time=false --uri-selector --rpc-listen-port --index-out --bt-tracker --referer --ssh-host-key-md --console-log-level --connect-timeout --stream-piece-selector --dht-message-timeout --select-file --download-result --disable-ipv6 --disable-ipv6=false --rpc-max-request-size --rpc-passwd --stop-with-process --https-proxy-passwd --continue --continue=false --no-file-allocation-limit --netrc-path --ftp-proxy-user --enable-color --enable-color=false --metalink-location --allow-piece-length-change --allow-piece-length-change=false --max-connection-per-server --no-conf --no-conf=false --rpc-certificate --metalink-os --enable-http-pipelining --enable-http-pipelining=false --http-passwd --user-agent --enable-dht6 --enable-dht6=false --dht-file-path --http-auth-challenge --http-auth-challenge=false --bt-enable-hook-after-hash-check --bt-enable-hook-after-hash-check=false --peer-id-prefix --max-mmap-limit --enable-mmap --enable-mmap=false --use-head --use-head=false --bt-require-crypto --bt-require-crypto=false --show-console-readout --show-console-readout=false --conf-path --log --no-proxy --dht-entry-point --dht-listen-port --http-user --retry-wait --on-download-complete --help --help=#basic --help=#advanced --help=#http --help=#https --help=#ftp --help=#metalink --help=#bittorrent --help=#cookie --help=#hook --help=#file --help=#rpc --help=#checksum --help=#experimental --help=#deprecated --help=#help --help=#all --max-overall-download-limit --event-poll --http-accept-gzip --http-accept-gzip=false --metalink-file --all-proxy --disk-cache --hash-check-only --hash-check-only=false --dht-listen-addr6 --human-readable --human-readable=false --ftp-user --all-proxy-passwd --bt-exclude-tracker --pause-metadata --pause-metadata=false --http-proxy-user --deferred-input --deferred-input=false --metalink-enable-unique-protocol --metalink-enable-unique-protocol=false --stop --peer-agent --max-upload-limit --multiple-interface --realtime-chunk-checksum --realtime-chunk-checksum=false --http-no-cache --http-no-cache=false --ca-certificate --bt-force-encryption --bt-force-encryption=false --bt-save-metadata --bt-save-metadata=false --seed-ratio --follow-torrent --pause --pause=false --checksum --auto-save-interval --async-dns --async-dns=false --bt-enable-lpd --bt-enable-lpd=false --parameterized-uri --parameterized-uri=false --ftp-proxy-passwd --enable-rpc --enable-rpc=false --min-split-size --bt-seed-unverified --bt-seed-unverified=false --input-file --interface --enable-async-dns6 --enable-async-dns6=false --reuse-uri --reuse-uri=false --socket-recv-buffer-size --bt-request-peer-speed-limit --on-download-error --bt-metadata-only --bt-metadata-only=false ' -- "$cur" ) ) + ;; + *) + _filedir '@(torrent|meta4|metalink|text|txt|list|lst)' + [ ${#COMPREPLY[@]} -eq 0 ] && _filedir + return 0 + esac + return 0 +} +complete -F _aria2c aria2c diff --git a/share/doc/aria2/xmlrpc/README.txt b/share/doc/aria2/xmlrpc/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..242b2364d00e399f218652d2ec098b26834b31c8 --- /dev/null +++ b/share/doc/aria2/xmlrpc/README.txt @@ -0,0 +1,3 @@ +This directory contains sample scripts to interact with aria2 via +XML-RPC. For more information, see +https://aria2.github.io/manual/en/html/aria2c.html#rpc-interface diff --git a/share/doc/aria2/xmlrpc/aria2mon b/share/doc/aria2/xmlrpc/aria2mon new file mode 100644 index 0000000000000000000000000000000000000000..e76ef0d2c4acdb2855afc6b886813eb614c55cf4 --- /dev/null +++ b/share/doc/aria2/xmlrpc/aria2mon @@ -0,0 +1,157 @@ +#!/usr/bin/env ruby +# The MIT License +# +# Copyright (c) 2009 Tatsuhiro Tsujikawa +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +require 'xmlrpc/client' +require 'optparse' + +program_name=File.basename($0) +options={} +args=nil +OptionParser.new do |opt| + opt.on("--server SERVER", "hostname of XML-RPC server. Default: localhost"){|val| options["server"]=val } + opt.on("--port PORT", "port of XML-RPC server. Default: 6800"){|val| options["port"]=val } + + opt.on("--user USERNAME", "XML-RPC username"){|val| options["user"]=val } + opt.on("--passwd PASSWORD", "XML-RPC password"){|val| options["passwd"]=val } + opt.on("--secret SECRET", "XML-RPC secret authorization token"){|val| options["secret"]=val } + + opt.banner=< 0 + result += "#{min}m" if min > 0 + result += "#{remsec}s" +end + +def abbrev value + n=value/1024.0 + if n < 1 then + return "#{value}" + end + value=n + n=value/1024.0 + if n < 1 then + return sprintf("%.1fKi", value) + else + return sprintf("%.1fMi", n) + end +end + +auth="" +if options.has_key?("user") then + auth=options["user"]+":"+options["passwd"]+"@" +end +if not options.has_key?("server") then + options["server"]="localhost" +end +if not options.has_key?("port") then + options["port"]="6800" +end +secret = if options.has_key?("secret") then "token:"+options["secret"] else nil end + +client=XMLRPC::Client.new3({:host => options["server"], + :port => options["port"], + :path => "/rpc", + :user => options["user"], + :password => options["passwd"]}) + +options.delete("server") +options.delete("port") +options.delete("user") +options.delete("passwd") +options.delete("secret") + +def client_call client, secret, method, *params + if secret.nil? + client.call(method, *params) + else + client.call(method, secret, *params) + end +end + +result=client_call(client, secret, "aria2.tellActive") + +print "-- Download Progress --\n" +result.each { |entry| + gid=entry['gid'] + total_length=entry['totalLength'].to_i + completed_length=entry['completedLength'].to_i + upload_length=entry['uploadLength'].to_i + download_speed=entry['downloadSpeed'].to_i + print "GID##{gid}" + if total_length == completed_length then + if entry.key? 'infoHash' then + # for BitTorrent print seed status + print " SEEDING" + if completed_length > 0 then + print "(#{upload_length*100/completed_length}%)" + end + end + else + print " SIZE:#{abbrev completed_length}B/#{abbrev total_length}B" + if total_length > 0 then + print "(#{completed_length*100/total_length}%)" + end + end + print " CN:#{entry['connections']}" + if entry.key? 'numSeeders' then + print " SEED:#{entry['numSeeders']}" + end + print " SPD:#{abbrev download_speed}B/s" + if entry.key? 'infoHash' + printf " UP:#{abbrev entry['uploadSpeed'].to_i}B/s(#{abbrev upload_length}B)" + end + print " ETA:#{compute_eta(download_speed, total_length-completed_length)}" + print "\n" + + if entry.key? 'infoHash' + print " InfoHash:#{entry['infoHash']}" + end + print "\n" + + files=client_call(client,secret,"aria2.getFiles",entry['gid']) + if files.length > 0 then + first_file=files.find{|file| file["selected"]=="true"} + if first_file != nil then + print " File:#{first_file['path']}" + count=0 + files.each {|file| count += 1 if file["selected"]=="true"} + if count > 1 then + print "(#{count-1}more)" + end + print "\n" + end + end + print "--------------------------------------------------------------------------------\n" +} diff --git a/share/doc/aria2/xmlrpc/aria2rpc b/share/doc/aria2/xmlrpc/aria2rpc new file mode 100644 index 0000000000000000000000000000000000000000..f52b7f6a028b9d9d4de40eec659b07bbbda806b3 --- /dev/null +++ b/share/doc/aria2/xmlrpc/aria2rpc @@ -0,0 +1,427 @@ +#!/usr/bin/env ruby +# The MIT License +# +# Copyright (c) 2009 Tatsuhiro Tsujikawa +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +require 'xmlrpc/client' +require 'pp' +require 'optparse' + +program_name=File.basename($0) +options={} +args=nil +OptionParser.new do |opt| + opt.on("-d","--dir DIR"){|val| options["dir"]=val} + opt.on("-V","--check-integrity [BOOL]", ["true","false"]){|val| + options["check-integrity"]= val||"true" + } + opt.on("-c","--continue [BOOL]",["true","false"]){|val| + options["continue"]=val||"true" + } + opt.on("--all-proxy PROXY"){|val| options["all-proxy"]=val} + opt.on("--all-proxy-user USER"){|val| options["all-proxy-user"]=val} + opt.on("--all-proxy-passwd PASSWD"){|val| options["all-proxy-passwd"]=val} + opt.on("--connect-timeout SEC"){|val| options["connect-timeout"]=val} + opt.on("--dry-run [BOOL]",["true","false"]){|val| + options["dry-run"]=val||"true" + } + opt.on("--lowest-speed-limit SPEED"){|val| options["lowest-speed-limit"]=val} + opt.on("--max-file-not-found NUM"){|val| options["max-file-not-found"]=val} + opt.on("-m","--max-tries N"){|val| options["max-tries"]=val} + opt.on("--no-proxy DOMAINS"){|val| options["no-proxy"]=val} + opt.on("-o","--out FILE"){|val| options["out"]=val} + opt.on("--proxy-method METHOD"){|val| options["proxy-method"]=val} + opt.on("-R","--remote-time [BOOL]",["true","false"]){|val| + options["remote-time"]=val||"true" + } + opt.on("-s","--split N"){|val| options["split"]=val} + opt.on("-t","--timeout SEC"){|val| options["timeout"]=val} + opt.on("--http-auth-challenge [BOOL]",["true","false"]){|val| + options["http-auth-challenge"]=val||"true" + } + opt.on("--http-no-cache [BOOL]",["true","false"]){|val| + options["http-no-cache"]=val||"true" + } + opt.on("--http-user USER"){|val| options["http-user"]=val} + opt.on("--http-passwd PASSWD"){|val| options["http-passwd"]=val} + opt.on("--http-proxy PROXY"){|val| options["http-proxy"]=val} + opt.on("--http-proxy-user USER"){|val| options["http-proxy-user"]=val} + opt.on("--http-proxy-passwd PASSWD"){|val| options["http-proxy-passwd"]=val} + opt.on("--https-proxy PROXY"){|val| options["https-proxy"]=val} + opt.on("--https-proxy-user USER"){|val| options["https-proxy-user"]=val} + opt.on("--https-proxy-passwd PASSWD"){|val| options["https-proxy-passwd"]=val} + opt.on("--referer REFERER"){|val| options["referer"]=val} + opt.on("--enable-http-keep-alive [BOOL]",["true","false"]){|val| + options["enable-http-keep-alive"]=val||"true" + } + opt.on("--enable-http-pipelining [BOOL]",["true","false"]){|val| + options["enable-http-pipelining"]=val||"true" + } + opt.on("--header HEADER"){|val| + options["header"] = [] if options["header"] == nil + options["header"] << val + } + opt.on("--use-head [BOOL]",["true","false"]){|val| + options["use-head"]=val||"true" + } + opt.on("-U","--user-agent USERAGENT"){|val| options["user-agent"]=val} + opt.on("--ftp-user USER"){|val| options["ftp-user"]=val} + opt.on("--ftp-passwd PASSWD"){|val| options["ftp-passwd"]=val} + opt.on("-p","--ftp-pasv [BOOL]",["true","false"]){|val| + options["ftp-pasv"]=val||"true" + } + opt.on("--ftp-proxy PROXY"){|val| options["ftp-proxy"]=val} + opt.on("--ftp-proxy-user USER"){|val| options["ftp-proxy-user"]=val} + opt.on("--ftp-proxy-passwd PASSWD"){|val| options["ftp-proxy-passwd"]=val} + opt.on("--ftp-type TYPE"){|val| options["ftp-type"]=val} + opt.on("--ftp-reuse-connection [BOOL]",["true","false"]){|val| + options["ftp-reuse-connection"]=val||"true" + } + opt.on("-n","--no-netrc [BOOL]",["true","false"]){|val| + options["no-netrc"]=val||"true" + } + opt.on("--reuse-uri [BOOL]",["true","false"]){|val| + options["reuse-uri"]=val||"true" + } + opt.on("--select-file INDEXES"){|val| options["select-file"]=val} + opt.on("--bt-enable-lpd [BOOL]",["true","false"]){|val| + options["bt-enable-lpd"]=val||"true" + } + opt.on("--bt-external-ip IPADDRESS"){|val| options["bt-external-ip"]=val} + opt.on("--bt-hash-check-seed [BOOL]",["true","false"]){|val| + options["bt-hash-check-seed"]=val||"true" + } + opt.on("--bt-max-open-files NUM"){|val| options["bt-max-open-files"]=val} + opt.on("--bt-max-peers NUM"){|val| options["bt-max-peers"]=val} + opt.on("--bt-metadata-only [BOOL]",["true","false"]){|val| + options["bt-metadata-only"]=val||"true" + } + opt.on("--bt-min-crypto-level LEVEL",["plain","arc4"]){|val| + options["bt-min-crypto-level"]=val + } + opt.on("--bt-prioritize-piece RANGE") {|val| + options["bt-prioritize-piece"]=val + } + opt.on("--bt-require-crypto [BOOL]",["true","false"]){|val| + options["bt-require-crypto"]=val||"true" + } + opt.on("--bt-request-peer-speed-limit SPEED"){|val| + options["bt-request-peer-speed-limit"]=val + } + opt.on("--bt-save-metadata [BOOL]",["true","false"]){|val| + options["bt-save-metadata"]=val||"true" + } + opt.on("--bt-seed-unverified [BOOL]",["true","false"]){|val| + options["bt-seed-unverified"]=val||"true" + } + opt.on("--bt-stop-timeout SEC"){|val| options["bt-stop-timeout"]=val} + opt.on("--bt-tracker-interval SEC"){|val| options["bt-tracker-interval"]=val} + opt.on("--bt-tracker-timeout SEC"){|val| options["bt-tracker-timeout"]=val} + opt.on("--bt-tracker-connect-timeout SEC"){|val| + options["bt-tracker-connect-timeout"]=val + } + opt.on("--enable-peer-exchange [BOOL]",["true","false"]){|val| + options["enable-peer-exchange"]=val||"true" + } + opt.on("--follow-torrent VALUE", ["true","false","mem"]){|val| + options["follow-torrent"]=val + } + opt.on("-O","--index-out INDEXPATH"){|val| + options["index-out"]=[] if options["index-out"] == nil + options["index-out"] << val + } + opt.on("-u","--max-upload-limit SPEED"){|val| options["max-upload-limit"]=val} + opt.on("--seed-ratio RATIO"){|val| options["seed-ratio"]=val} + opt.on("--seed-time MINUTES"){|val| options["seed-time"]=val} + opt.on("--follow-metalink VALUE", ["true","false","mem"]){|val| + options["follow-metalink"]=val + } + opt.on("-C","--metalink-servers NUM"){|val| options["metalink-servers"]=val} + opt.on("--metalink-language LANG"){|val| options["metalink-language"]=val} + opt.on("--metalink-location LOCS"){|val| options["metalink-location"]=val} + opt.on("--metalink-os OS"){|val| options["metalink-os"]=val} + opt.on("--metalink-version VERSION"){|val| options["metalink-version"]=val} + opt.on("--metalink-preferred-protocol PROTO"){|val| + options["metalink-preferred-protocol"]=val + } + opt.on("--metalink-enable-unique-protocol [BOOL]",["true","false"]){|val| + options["metalink-enable-unique-protocol"]=val||"true" + } + opt.on("--allow-overwrite [BOOL]",["true","false"]){|val| + options["allow-overwrite"]=val||"true" + } + opt.on("--allow-piece-length-change [BOOL]",["true","false"]){|val| + options["allow-piece-length-change"]=val||"true" + } + opt.on("--async-dns [BOOL]",["true","false"]){|val| + options["async-dns"]=val||"true" + } + opt.on("--auto-file-renaming [BOOL]",["true","false"]){|val| + options["auto-file-renaming"]=val||"true" + } + opt.on("--file-allocation METHOD",["none","prealloc","falloc"]){|val| + options["file-allocation"]=val + } + opt.on("--max-download-limit LIMIT"){|val| options["max-download-limit"]=val} + opt.on("--no-file-allocation-limit SIZE"){|val| + options["no-file-allocation-limit"]=val + } + opt.on("-P","--parameterized-uri [BOOL]",["true","false"]){|val| + options["parameterized-uri"]=val||"true" + } + opt.on("--realtime-chunk-checksum [BOOL]",["true","false"]){|val| + options["realtime-chunk-checksum"]=val||"true" + } + opt.on("--remove-control-file [BOOL]",["true","false"]){|val| + options["remove-control-file"]=val||"true" + } + opt.on("--always-resume [BOOL]",["true","false"]){|val| + options["always-resume"]=val||"true" + } + opt.on("--max-resume-failure-tries N"){|val| + options["max-resume-failure-tries"]=val + } + opt.on("--http-accept-gzip [BOOL]",["true","false"]){|val| + options["http-accept-gzip"]=val||"true" + } + opt.on("-x","--max-connection-per-server NUM"){|val| options["max-connection-per-server"]=val} + opt.on("-k","--min-split-size SIZE"){|val| options["min-split-size"]=val} + opt.on("--conditional-get [BOOL]",["true","false"]){|val| + options["conditional-get"]=val||"true" + } + opt.on("--enable-async-dns6 [BOOL]",["true","false"]){|val| + options["enable-async-dns6"]=val||"true" + } + opt.on("--bt-tracker URIS"){|val| options["bt-tracker"]=val} + opt.on("--bt-exclude-tracker URIS"){|val| options["bt-exclude-tracker"]=val} + opt.on("--retry-wait SEC"){|val| options["retry-wait"]=val} + opt.on("--metalink-base-uri URI"){|val| options["metalink-base-uri"]=val} + opt.on("--pause [BOOL]",["true","false"]){|val| options["pause"]=val||"true"} + opt.on("--stream-piece-selector SELECTOR"){|val| options["stream-piece-selector"]=val} + opt.on("--hash-check-only [BOOL]",["true","false"]){|val| + options["hash-check-only"]=val||"true" + } + opt.on("--checksum TYPE_DIGEST"){|val| options["checksum"]=val} + opt.on("--piece-length LENGTH"){|val| options["piece-length"]=val} + opt.on("--uri-selector SELECTOR"){|val| options["uri-selector"]=val} + + opt.on("--max-overall-download-limit LIMIT"){|val| options["max-overall-download-limit"]=val} + opt.on("--max-overall-upload-limit LIMIT"){|val| options["max-overall-upload-limit"]=val} + opt.on("-j","--max-concurrent-downloads N"){|val| options["max-concurrent-downloads"]=val} + opt.on("-l","--log FILE"){|val| options["log"]=val} + opt.on("--max-download-result NUM"){|val| options["max-download-result"]=val} + opt.on("--download-result OPT"){|val| options["download-result"]=val} + opt.on("--keep-unfinished-download-result [BOOL]",["true","false"]){|val| + options["keep-unfinished-download-result"]=val||"true" + } + opt.on("--save-session FILE"){|val| options["save-session"]=val} + opt.on("--server-stat-of FILE"){|val| options["server-stat-of"]=val} + opt.on("--save-cookies FILE"){|val| options["save-cookies"]=val} + opt.on("--gid GID"){|val| options["gid"]=val} + opt.on("--pause-metadata [BOOL]",["true","false"]){|val| options["pause-metadata"]=val||"true"} + + opt.on("--server SERVER", "hostname of XML-RPC server. Default: localhost"){|val| options["server"]=val } + opt.on("--port PORT", "port of XML-RPC server. Default: 6800"){|val| options["port"]=val } + + opt.on("--user USERNAME", "XML-RPC username"){|val| options["user"]=val } + opt.on("--passwd PASSWORD", "XML-RPC password"){|val| options["passwd"]=val } + opt.on("--secure [BOOL]",["true","false"]){|val| options["secure"]=val||"true" } + opt.on("--check-rpc-cert [BOOL]",["true","false"]){|val| options["check-rpc-cert"]=val||"true" } + + opt.on("--secret SECRET", "XML-RPC secret authorization token"){|val| options["secret"]=val } + + opt.banner=< options["server"], + :port => options["port"], + :path => "/rpc", + :user => options["user"], + :password => options["passwd"], + :use_ssl => options["secure"] == "true"}) + +if options["check-rpc-cert"] == "false" then + client.instance_variable_get(:@http).instance_variable_set(:@verify_mode, OpenSSL::SSL::VERIFY_NONE) +end + +options.delete("server") +options.delete("port") +options.delete("user") +options.delete("passwd") +options.delete("secret") +options.delete("secure") +options.delete("check-rpc-cert") + +def client_call client, secret, method, *params + if secret.nil? + client.call(method, *params) + else + client.call(method, secret, *params) + end +end + +if command == "addUri" then + result=client_call(client, secret, "aria2."+command, resources, options) +elsif command == "addTorrent" then + torrentData=IO.read(resources[0]) + result=client_call(client, secret, "aria2."+command, + XMLRPC::Base64.new(torrentData), resources[1..-1], options) +elsif command == "addMetalink" then + metalinkData=IO.read(resources[0]) + result=client_call(client, secret, "aria2."+command, + XMLRPC::Base64.new(metalinkData), options) +elsif command == "tellStatus" then + result=client_call(client, secret, "aria2."+command, + resources[0], resources[1..-1]) +elsif command == "tellActive" then + result=client_call(client, secret, "aria2."+command, resources[0..-1]) +elsif command == "tellWaiting" then + result=client_call(client, secret, "aria2."+command, resources[0].to_i(), + resources[1].to_i(), resources[2..-1]) +elsif command == "tellStopped" then + result=client_call(client, secret, "aria2."+command, resources[0].to_i(), + resources[1].to_i(), resources[2..-1]) +elsif command == "getOption" then + result=client_call(client, secret, "aria2."+command, resources[0]) +elsif command == "getGlobalOption" then + result=client_call(client, secret, "aria2."+command) +elsif command == "pause" then + result=client_call(client, secret, "aria2."+command, resources[0]) +elsif command == "pauseAll" then + result=client_call(client, secret, "aria2."+command) +elsif command == "forcePause" then + result=client_call(client, secret, "aria2."+command, resources[0]) +elsif command == "forcePauseAll" then + result=client_call(client, secret, "aria2."+command) +elsif command == "unpause" then + result=client_call(client, secret, "aria2."+command, resources[0]) +elsif command == "unpauseAll" then + result=client_call(client, secret, "aria2."+command) +elsif command == "remove" then + result=client_call(client, secret, "aria2."+command, resources[0]) +elsif command == "forceRemove" then + result=client_call(client, secret, "aria2."+command, resources[0]) +elsif command == "changePosition" then + result=client_call(client, secret, "aria2."+command, resources[0], + resources[1].to_i(), resources[2]) +elsif command == "getFiles" then + result=client_call(client, secret, "aria2."+command, resources[0]) +elsif command == "getUris" then + result=client_call(client, secret, "aria2."+command, resources[0]) +elsif command == "getPeers" then + result=client_call(client, secret, "aria2."+command, resources[0]) +elsif command == "getServers" then + result=client_call(client, secret, "aria2."+command, resources[0]) +elsif command == "purgeDownloadResult" then + result=client_call(client, secret, "aria2."+command) +elsif command == "removeDownloadResult" then + result=client_call(client, secret, "aria2."+command, resources[0]) +elsif command == "changeOption" then + result=client_call(client, secret, "aria2."+command, resources[0], options) +elsif command == "changeGlobalOption" then + result=client_call(client, secret, "aria2."+command, options) +elsif command == "getVersion" then + result=client_call(client, secret, "aria2."+command) +elsif command == "getSessionInfo" then + result=client_call(client, secret, "aria2."+command) +elsif command == "shutdown" then + result=client_call(client, secret, "aria2."+command) +elsif command == "forceShutdown" then + result=client_call(client, secret, "aria2."+command) +elsif command == "getGlobalStat" then + result=client_call(client, secret, "aria2."+command) +elsif command == "saveSession" then + result=client_call(client, secret, "aria2."+command) +elsif command == "appendUri" then + result=client_call(client, secret, "aria2.changeUri", resources[0], + resources[1].to_i(), [], resources[2..-1]) +else + puts "Command not recognized" + exit 1 +end + +pp result diff --git a/share/locale/ar/LC_MESSAGES/aria2.mo b/share/locale/ar/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..3419d0f7fde73290330e859ac67de699b0e34018 Binary files /dev/null and b/share/locale/ar/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/bg/LC_MESSAGES/aria2.mo b/share/locale/bg/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..1279a5b1c11ed0f83af2eda9dc46326c963429b1 Binary files /dev/null and b/share/locale/bg/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/bn/LC_MESSAGES/aria2.mo b/share/locale/bn/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..0123f89a3fcf961cdb7161e251b20f6417630a86 Binary files /dev/null and b/share/locale/bn/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/ca/LC_MESSAGES/aria2.mo b/share/locale/ca/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..e2d7af6cd78f46e192f7ee8988c9d1bea2270d45 Binary files /dev/null and b/share/locale/ca/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/da/LC_MESSAGES/aria2.mo b/share/locale/da/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..0e4657f68d1184299e2d5521605036b46b898770 Binary files /dev/null and b/share/locale/da/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/de/LC_MESSAGES/aria2.mo b/share/locale/de/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..d8facb6088b68f9fad66cd20ee468befb5aaa4df Binary files /dev/null and b/share/locale/de/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/el/LC_MESSAGES/aria2.mo b/share/locale/el/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..c24ff772546a75ee412c8f3c4582b0a8dae20250 Binary files /dev/null and b/share/locale/el/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/en@boldquot/LC_MESSAGES/aria2.mo b/share/locale/en@boldquot/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..315043333ded908f3a0ce876a3956ae584f80c73 Binary files /dev/null and b/share/locale/en@boldquot/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/en@quot/LC_MESSAGES/aria2.mo b/share/locale/en@quot/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..7b9c4769b6259a5aa8511b9886193b97d5a64404 Binary files /dev/null and b/share/locale/en@quot/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/es/LC_MESSAGES/aria2.mo b/share/locale/es/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..21b1a11b8a8f73aceb4bb2331fca67060bf581f6 Binary files /dev/null and b/share/locale/es/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/fa/LC_MESSAGES/aria2.mo b/share/locale/fa/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..025d6fba0725ade5818228e98152963ab4e120bd Binary files /dev/null and b/share/locale/fa/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/fi/LC_MESSAGES/aria2.mo b/share/locale/fi/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..d819bd8840b67fab47f4480ac298082c60c630d3 Binary files /dev/null and b/share/locale/fi/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/fil/LC_MESSAGES/aria2.mo b/share/locale/fil/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..e8ca7cdcdaa40e0dddb8757e59c936f0648616a4 Binary files /dev/null and b/share/locale/fil/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/fr/LC_MESSAGES/aria2.mo b/share/locale/fr/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..6b9acece457d91f1a4cb1638917d9d7380415252 Binary files /dev/null and b/share/locale/fr/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/he/LC_MESSAGES/aria2.mo b/share/locale/he/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..f6c96451fb81e5bd8df0d4c8ea0216795084e0cf Binary files /dev/null and b/share/locale/he/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/hr/LC_MESSAGES/aria2.mo b/share/locale/hr/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..d6adffda769048b0e9414cc5f0f5964129befa91 Binary files /dev/null and b/share/locale/hr/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/hu/LC_MESSAGES/aria2.mo b/share/locale/hu/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..db99b3941d0ad1cd7a9cd9de42c32c180e9510e3 Binary files /dev/null and b/share/locale/hu/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/id/LC_MESSAGES/aria2.mo b/share/locale/id/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..804b08e4fc3d3a0def2ad8e49118cfe9594cee99 Binary files /dev/null and b/share/locale/id/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/it/LC_MESSAGES/aria2.mo b/share/locale/it/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..936112e445618fd10a32d9471145c85a42acc8a8 Binary files /dev/null and b/share/locale/it/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/ja/LC_MESSAGES/aria2.mo b/share/locale/ja/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..4ec9adf0063551b02db3c1474f8155340daaeb32 Binary files /dev/null and b/share/locale/ja/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/kk/LC_MESSAGES/aria2.mo b/share/locale/kk/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..806725dd2980ff5f0091c6690a0efcef367d0f5c Binary files /dev/null and b/share/locale/kk/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/ko/LC_MESSAGES/aria2.mo b/share/locale/ko/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..3b3f0d97e066b03b96ed6024abf9ab2c20e6288c Binary files /dev/null and b/share/locale/ko/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/ms/LC_MESSAGES/aria2.mo b/share/locale/ms/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..bd36b9fc31fca623c2fb16effa8eb2eb9cc18276 Binary files /dev/null and b/share/locale/ms/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/nb/LC_MESSAGES/aria2.mo b/share/locale/nb/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..3855d13bcbf299d3cae0bfa77730d18518e7752a Binary files /dev/null and b/share/locale/nb/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/nl/LC_MESSAGES/aria2.mo b/share/locale/nl/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..c9552d6be728c18304ce73adbc42f320c1f383c8 Binary files /dev/null and b/share/locale/nl/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/nn/LC_MESSAGES/aria2.mo b/share/locale/nn/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..24e4b2fb174e7cc9dd92ba0d01f8addc93d834e9 Binary files /dev/null and b/share/locale/nn/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/oc/LC_MESSAGES/aria2.mo b/share/locale/oc/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..99271ca90fcdec181a5cd30d80989630a1bf579c Binary files /dev/null and b/share/locale/oc/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/pl/LC_MESSAGES/aria2.mo b/share/locale/pl/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..f58cad24730883f870fa9c66500938415810eebf Binary files /dev/null and b/share/locale/pl/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/pt/LC_MESSAGES/aria2.mo b/share/locale/pt/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..282a431f0919b00652c4c584a0cede2a92d6f09a Binary files /dev/null and b/share/locale/pt/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/pt_BR/LC_MESSAGES/aria2.mo b/share/locale/pt_BR/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..550daebad5768fa19b952c0f61403c06d87a9a42 Binary files /dev/null and b/share/locale/pt_BR/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/ro/LC_MESSAGES/aria2.mo b/share/locale/ro/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..62b574aef8622f4defd2f7f5bfb3a387ea3ba9aa Binary files /dev/null and b/share/locale/ro/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/ru/LC_MESSAGES/aria2.mo b/share/locale/ru/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..9bcaa2f419ebc1a9ecd3e5f78ef0ed28ea77995b Binary files /dev/null and b/share/locale/ru/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/sk/LC_MESSAGES/aria2.mo b/share/locale/sk/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..c91e2280fc6f4186868d4dd06452d3d93948c3b4 Binary files /dev/null and b/share/locale/sk/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/sr/LC_MESSAGES/aria2.mo b/share/locale/sr/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..6bff231add894cd6e060e432079654b367f7504b Binary files /dev/null and b/share/locale/sr/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/sv/LC_MESSAGES/aria2.mo b/share/locale/sv/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..27c14e41abcded0e2922554ac34d52d7a7691230 Binary files /dev/null and b/share/locale/sv/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/th/LC_MESSAGES/aria2.mo b/share/locale/th/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..d5b44c6a9f2189b393c5075da7956af0ece5df27 Binary files /dev/null and b/share/locale/th/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/tr/LC_MESSAGES/aria2.mo b/share/locale/tr/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..d9c7af1e3c4192826825004f90c14d5740b45b15 Binary files /dev/null and b/share/locale/tr/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/uk/LC_MESSAGES/aria2.mo b/share/locale/uk/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..70870a5f4db0bbcc7052a456422b4546ca70fd7b Binary files /dev/null and b/share/locale/uk/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/vi/LC_MESSAGES/aria2.mo b/share/locale/vi/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..77b93c081ba31045fc90f956a289a5e304cb9144 Binary files /dev/null and b/share/locale/vi/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/zh_CN/LC_MESSAGES/aria2.mo b/share/locale/zh_CN/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..49e6191fdf7e7aca74503f5e4aeac1dacd6d5b06 Binary files /dev/null and b/share/locale/zh_CN/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/zh_HK/LC_MESSAGES/aria2.mo b/share/locale/zh_HK/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..e5a38332b501dbbbba74be8bec2460c2263cb686 Binary files /dev/null and b/share/locale/zh_HK/LC_MESSAGES/aria2.mo differ diff --git a/share/locale/zh_TW/LC_MESSAGES/aria2.mo b/share/locale/zh_TW/LC_MESSAGES/aria2.mo new file mode 100644 index 0000000000000000000000000000000000000000..4b88ad9d7af91ab9b113d02e33f9a0a09122c667 Binary files /dev/null and b/share/locale/zh_TW/LC_MESSAGES/aria2.mo differ diff --git a/share/man/man1/aria2c.1 b/share/man/man1/aria2c.1 new file mode 100644 index 0000000000000000000000000000000000000000..d0840432099d9f902eec1ad1d41a50dc662c0e4d --- /dev/null +++ b/share/man/man1/aria2c.1 @@ -0,0 +1,5684 @@ +.\" Man page generated from reStructuredText. +. +.TH "ARIA2C" "1" "Aug 21, 2021" "1.36.0" "aria2" +.SH NAME +aria2c \- The ultra fast download utility +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.SH SYNOPSIS +.sp +\fBaria2c\fP [] [|||] ... +.SH DESCRIPTION +.sp +aria2 is a utility for downloading files. The supported protocols are +HTTP(S), FTP, SFTP, BitTorrent, and Metalink. aria2 can download a +file from multiple sources/protocols and tries to utilize your maximum +download bandwidth. It supports downloading a file from HTTP(S)/FTP +/SFTP and BitTorrent at the same time, while the data downloaded from +HTTP(S)/FTP/SFTP is uploaded to the BitTorrent swarm. Using Metalink +chunk checksums, aria2 automatically validates chunks of data while +downloading a file. +.SH OPTIONS +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +Most FTP related options are applicable to SFTP as well. +Some options are not effective against SFTP (e.g., \fI\%\-\-ftp\-pasv\fP) +.UNINDENT +.UNINDENT +.SS Basic Options +.INDENT 0.0 +.TP +.B \-d, \-\-dir= +The directory to store the downloaded file. +.UNINDENT +.INDENT 0.0 +.TP +.B \-i, \-\-input\-file= +Downloads the URIs listed in \fBFILE\fP\&. You can specify multiple sources for a +single entity by putting multiple URIs on a single line separated by the +\fBTAB\fP character. +Additionally, options can be specified after each URI line. Option lines +must start with one or more white space characters (\fBSPACE\fP or \fBTAB\fP) +and must only contain one option per line. +Input files can use gzip compression. +When \fBFILE\fP is specified as \fB\-\fP, aria2 will read the input from \fBstdin\fP\&. +See the \fI\%Input File\fP subsection for details. +See also the \fI\%\-\-deferred\-input\fP option. +See also the \fI\%\-\-save\-session\fP option. +.UNINDENT +.INDENT 0.0 +.TP +.B \-l, \-\-log= +The file name of the log file. If \fB\-\fP is specified, log is written to +\fBstdout\fP\&. If empty string("") is specified, or this option is omitted, +no log is written to disk at all. +.UNINDENT +.INDENT 0.0 +.TP +.B \-j, \-\-max\-concurrent\-downloads= +Set the maximum number of parallel downloads for every queue item. +See also the \fI\%\-\-split\fP option. +Default: \fB5\fP +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +\fI\%\-\-max\-concurrent\-downloads\fP limits the number of items +which are downloaded concurrently. \fI\%\-\-split\fP and +\fI\%\-\-min\-split\-size\fP affect the number of connections +inside each item. Imagine that you have an input file (see +\fI\%\-\-input\-file\fP option) like this: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +http://example.com/foo +http://example.com/bar +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Here is 2 download items. aria2 can download these items +concurrently if the value more than or equal 2 is given to +\fI\%\-\-max\-concurrent\-downloads\fP\&. In each download item, you +can configure the number of connections using \fI\%\-\-split\fP and/or \fI\%\-\-min\-split\-size\fP, etc. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-V, \-\-check\-integrity [true|false] +Check file integrity by validating piece hashes or a hash of entire +file. This option has effect only in BitTorrent, Metalink downloads +with checksums or HTTP(S)/FTP downloads with +\fI\%\-\-checksum\fP option. If +piece hashes are provided, this option can detect damaged portions +of a file and re\-download them. If a hash of entire file is +provided, hash check is only done when file has been already +download. This is determined by file length. If hash check fails, +file is re\-downloaded from scratch. If both piece hashes and a hash +of entire file are provided, only piece hashes are used. Default: +\fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-c, \-\-continue [true|false] +Continue downloading a partially downloaded file. +Use this option to resume a download started by a web browser or another +program which downloads files sequentially from the beginning. +Currently this option is only applicable to HTTP(S)/FTP downloads. +.UNINDENT +.INDENT 0.0 +.TP +.B \-h, \-\-help[=|] +The help messages are classified with tags. A tag starts with +\fB#\fP\&. For example, type \fB\-\-help=#http\fP to get the usage for the +options tagged with \fB#http\fP\&. If non\-tag word is given, print the +usage for the options whose name includes that word. Available +Values: \fB#basic\fP, \fB#advanced\fP, \fB#http\fP, \fB#https\fP, \fB#ftp\fP, +\fB#metalink\fP, \fB#bittorrent\fP, \fB#cookie\fP, \fB#hook\fP, \fB#file\fP, \fB#rpc\fP, +\fB#checksum\fP, \fB#experimental\fP, \fB#deprecated\fP, \fB#help\fP, \fB#all\fP +Default: \fB#basic\fP +.UNINDENT +.SS HTTP/FTP/SFTP Options +.INDENT 0.0 +.TP +.B \-\-all\-proxy= +Use a proxy server for all protocols. To override a previously +defined proxy, use "". You also can override this setting and specify a +proxy server for a particular protocol using \fI\%\-\-http\-proxy\fP, +\fI\%\-\-https\-proxy\fP and \fI\%\-\-ftp\-proxy\fP options. This affects all +downloads. +The format of PROXY is \fB[http://][USER:PASSWORD@]HOST[:PORT]\fP\&. +See also \fI\%ENVIRONMENT\fP section. +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +If user and password are embedded in proxy URI and they are also +specified by \fI\-\-{http,https,ftp,all}\-proxy\-{user,passwd}\fP options, +those specified later override prior options. For example, if you specified +\fBhttp\-proxy\-user=myname\fP, \fBhttp\-proxy\-passwd=mypass\fP in aria2.conf and +you specified \fB\-\-http\-proxy="http://proxy"\fP on the command\-line, then +you\(aqd get HTTP proxy \fBhttp://proxy\fP with user \fBmyname\fP and password +\fBmypass\fP\&. +.sp +Another example: if you specified on the command\-line +\fB\-\-http\-proxy="http://user:pass@proxy" \-\-http\-proxy\-user="myname" +\-\-http\-proxy\-passwd="mypass"\fP, then you\(aqd get HTTP proxy +\fBhttp://proxy\fP with user \fBmyname\fP and password \fBmypass\fP\&. +.sp +One more example: if you specified in command\-line \fB\-\-http\-proxy\-user="myname" +\-\-http\-proxy\-passwd="mypass" \-\-http\-proxy="http://user:pass@proxy"\fP, +then you\(aqd get HTTP proxy \fBhttp://proxy\fP with user \fBuser\fP and password +\fBpass\fP\&. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-all\-proxy\-passwd= +Set password for \fI\%\-\-all\-proxy\fP option. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-all\-proxy\-user= +Set user for \fI\%\-\-all\-proxy\fP option. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-checksum== +Set checksum. TYPE is hash type. The supported hash type is listed +in \fBHash Algorithms\fP in \fBaria2c \-v\fP\&. DIGEST is hex digest. For +example, setting sha\-1 digest looks like this: +\fBsha\-1=0192ba11326fe2298c8cb4de616f4d4140213838\fP This option applies +only to HTTP(S)/FTP downloads. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-connect\-timeout= +Set the connect timeout in seconds to establish connection to +HTTP/FTP/proxy server. After the connection is established, this +option makes no effect and \fI\%\-\-timeout\fP option is used instead. +Default: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dry\-run [true|false] +If \fBtrue\fP is given, aria2 just checks whether the remote file is +available and doesn\(aqt download data. This option has effect on +HTTP/FTP download. BitTorrent downloads are canceled if \fBtrue\fP is +specified. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-lowest\-speed\-limit= +Close connection if download speed is lower than or equal to this +value(bytes per sec). +\fB0\fP means aria2 does not have a lowest speed limit. +You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). +This option does not affect BitTorrent downloads. +Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-x, \-\-max\-connection\-per\-server= +The maximum number of connections to one server for each download. +Default: \fB1\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-file\-not\-found= +If aria2 receives "file not found" status from the remote HTTP/FTP +servers NUM times without getting a single byte, then force the +download to fail. Specify \fB0\fP to disable this option. This options +is effective only when using HTTP/FTP servers. The number of retry +attempt is counted toward \fI\%\-\-max\-tries\fP, so it should be +configured too. +.sp +Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-m, \-\-max\-tries= +Set number of tries. \fB0\fP means unlimited. +See also \fI\%\-\-retry\-wait\fP\&. +Default: \fB5\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-k, \-\-min\-split\-size= +aria2 does not split less than 2*SIZE byte range. For example, +let\(aqs consider downloading 20MiB file. If SIZE is 10M, aria2 can +split file into 2 range [0\-10MiB) and [10MiB\-20MiB) and download it +using 2 sources(if \fI\%\-\-split\fP >= 2, of course). If SIZE is 15M, +since 2*15M > 20MiB, aria2 does not split file and download it using +1 source. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). +Possible Values: \fB1M\fP \-\fB1024M\fP Default: \fB20M\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-netrc\-path= +Specify the path to the netrc file. +Default: \fB$(HOME)/.netrc\fP +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +Permission of the .netrc file must be 600. Otherwise, the file +will be ignored. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-n, \-\-no\-netrc [true|false] +Disables netrc support. netrc support is enabled by default. +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +netrc file is only read at the startup if +\fI\%\-\-no\-netrc\fP is \fBfalse\fP\&. +So if \fI\%\-\-no\-netrc\fP is \fBtrue\fP at the startup, +no netrc is available throughout the session. +You cannot get netrc enabled even if you send +\fI\%\-\-no\-netrc=false\fP using +\fI\%aria2.changeGlobalOption()\fP\&. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-proxy= +Specify a comma separated list of host names, domains and network addresses +with or without a subnet mask where no proxy should be used. +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +For network addresses with a subnet mask, both IPv4 and IPv6 addresses work. +The current implementation does not resolve the host name in an URI to compare +network addresses specified in \fI\%\-\-no\-proxy\fP\&. So it is only effective +if URI has numeric IP addresses. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-o, \-\-out= +The file name of the downloaded file. It is always relative to the +directory given in \fI\%\-\-dir\fP option. When the +\fI\%\-\-force\-sequential\fP option is used, this option is +ignored. +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +You cannot specify a file name for Metalink or BitTorrent downloads. +The file name specified here is only used when the URIs fed to aria2 +are given on the command line directly, but not when using +\fI\%\-\-input\-file\fP, \fI\%\-\-force\-sequential\fP option. +.sp +Example: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-proxy\-method= +Set the method to use in proxy request. METHOD is either \fBget\fP or +\fBtunnel\fP\&. HTTPS downloads always use \fBtunnel\fP regardless of this +option. +Default: \fBget\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-R, \-\-remote\-time [true|false] +Retrieve timestamp of the remote file from the remote HTTP/FTP +server and if it is available, apply it to the local file. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-reuse\-uri [true|false] +Reuse already used URIs if no unused URIs are left. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-retry\-wait= +Set the seconds to wait between retries. When \fBSEC > 0\fP, aria2 will +retry downloads when the HTTP server returns a 503 response. Default: +\fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-server\-stat\-of= +Specify the file name to which performance profile of the servers is +saved. You can load saved data using \fI\%\-\-server\-stat\-if\fP option. See +\fI\%Server Performance Profile\fP +subsection below for file format. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-server\-stat\-if= +Specify the file name to load performance profile of the servers. The +loaded data will be used in some URI selector such as \fBfeedback\fP\&. +See also \fI\%\-\-uri\-selector\fP option. See +\fI\%Server Performance Profile\fP +subsection below for file format. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-server\-stat\-timeout= +Specifies timeout in seconds to invalidate performance profile of +the servers since the last contact to them. +Default: \fB86400\fP (24hours) +.UNINDENT +.INDENT 0.0 +.TP +.B \-s, \-\-split= +Download a file using N connections. If more than N URIs are given, +first N URIs are used and remaining URIs are used for backup. If +less than N URIs are given, those URIs are used more than once so +that N connections total are made simultaneously. The number of +connections to the same host is restricted by the +\fI\%\-\-max\-connection\-per\-server\fP option. +See also the \fI\%\-\-min\-split\-size\fP option. +Default: \fB5\fP +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +Some Metalinks regulate the number of servers to connect. aria2 +strictly respects them. This means that if Metalink defines the +\fBmaxconnections\fP attribute lower than N, then aria2 uses the +value of this lower value instead of N. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stream\-piece\-selector= +Specify piece selection algorithm used in HTTP/FTP download. Piece +means fixed length segment which is downloaded in parallel in +segmented download. If \fBdefault\fP is given, aria2 selects piece so +that it reduces the number of establishing connection. This is +reasonable default behavior because establishing connection is an +expensive operation. If \fBinorder\fP is given, aria2 selects piece +which has minimum index. Index=0 means first of the file. This will +be useful to view movie while downloading it. +\fI\%\-\-enable\-http\-pipelining\fP option may +be useful to reduce re\-connection overhead. Please note that aria2 +honors +\fI\%\-\-min\-split\-size\fP option, +so it will be necessary to specify a reasonable value to +\fI\%\-\-min\-split\-size\fP option. +If \fBrandom\fP is given, aria2 selects piece randomly. Like +\fBinorder\fP, \fI\%\-\-min\-split\-size\fP option is honored. +If \fBgeom\fP is given, at the beginning aria2 selects piece which has +minimum index like \fBinorder\fP, but it exponentially increasingly +keeps space from previously selected piece. This will reduce the +number of establishing connection and at the same time it will +download the beginning part of the file first. This will be useful +to view movie while downloading it. +Default: \fBdefault\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-t, \-\-timeout= +Set timeout in seconds. +Default: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-uri\-selector= +Specify URI selection algorithm. The possible values are \fBinorder\fP, +\fBfeedback\fP and \fBadaptive\fP\&. If \fBinorder\fP is given, URI is tried in +the order appeared in the URI list. If \fBfeedback\fP is given, aria2 +uses download speed observed in the previous downloads and choose +fastest server in the URI list. This also effectively skips dead +mirrors. The observed download speed is a part of performance +profile of servers mentioned in \fI\%\-\-server\-stat\-of\fP and +\fI\%\-\-server\-stat\-if\fP options. If \fBadaptive\fP is given, selects one of +the best mirrors for the first and reserved connections. For +supplementary ones, it returns mirrors which has not been tested +yet, and if each of them has already been tested, returns mirrors +which has to be tested again. Otherwise, it doesn\(aqt select anymore +mirrors. Like \fBfeedback\fP, it uses a performance profile of servers. +Default: \fBfeedback\fP +.UNINDENT +.SS HTTP Specific Options +.INDENT 0.0 +.TP +.B \-\-ca\-certificate= +Use the certificate authorities in FILE to verify the peers. +The certificate file must be in PEM format and can contain multiple CA +certificates. +Use \fI\%\-\-check\-certificate\fP option to enable verification. +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +If you build with OpenSSL or the recent version of GnuTLS which +has \fBgnutls_certificate_set_x509_system_trust()\fP function and +the library is properly configured to locate the system\-wide CA +certificates store, aria2 will automatically load those +certificates at the startup. +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +\fIWinTLS\fP and \fIAppleTLS\fP do not support this option. Instead you will +have to import the certificate into the OS trust store. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-certificate= +Use the client certificate in FILE. The certificate must be +either in PKCS12 (.p12, .pfx) or in PEM format. +.sp +PKCS12 files must contain the certificate, a key and optionally a chain +of additional certificates. Only PKCS12 files with a blank import password +can be opened! +.sp +When using PEM, you have to specify the private key via \fI\%\-\-private\-key\fP +as well. +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +\fIWinTLS\fP does not support PEM files at the moment. Users have to use PKCS12 +files. +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +\fIAppleTLS\fP users should use the KeyChain Access utility to import the client +certificate and get the SHA\-1 fingerprint from the Information dialog +corresponding to that certificate. +To start aria2c use \fI\-\-certificate=\fP\&. +Alternatively PKCS12 files are also supported. PEM files, however, are not +supported. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-check\-certificate [true|false] +Verify the peer using certificates specified in \fI\%\-\-ca\-certificate\fP option. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-accept\-gzip [true|false] +Send \fBAccept: deflate, gzip\fP request header and inflate response if +remote server responds with \fBContent\-Encoding: gzip\fP or +\fBContent\-Encoding: deflate\fP\&. Default: \fBfalse\fP +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +Some server responds with \fBContent\-Encoding: gzip\fP for files which +itself is gzipped file. aria2 inflates them anyway because of the +response header. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-auth\-challenge [true|false] +Send HTTP authorization header only when it is requested by the +server. If \fBfalse\fP is set, then authorization header is always sent +to the server. There is an exception: if user name and password are +embedded in URI, authorization header is always sent to the server +regardless of this option. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-no\-cache [true|false] +Send \fBCache\-Control: no\-cache\fP and \fBPragma: no\-cache\fP header to avoid +cached content. If \fBfalse\fP is given, these headers are not sent +and you can add Cache\-Control header with a directive you like +using \fI\%\-\-header\fP option. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-user= +Set HTTP user. This affects all URIs. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-passwd= +Set HTTP password. This affects all URIs. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-proxy= +Use a proxy server for HTTP. To override a previously defined proxy, +use "". +See also the \fI\%\-\-all\-proxy\fP option. This affects all http downloads. +The format of PROXY is \fB[http://][USER:PASSWORD@]HOST[:PORT]\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-proxy\-passwd= +Set password for \fI\%\-\-http\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-proxy\-user= +Set user for \fI\%\-\-http\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-https\-proxy= +Use a proxy server for HTTPS. To override a previously defined proxy, +use "". +See also the \fI\%\-\-all\-proxy\fP option. This affects all https download. +The format of PROXY is \fB[http://][USER:PASSWORD@]HOST[:PORT]\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-https\-proxy\-passwd= +Set password for \fI\%\-\-https\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-https\-proxy\-user= +Set user for \fI\%\-\-https\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-private\-key= +Use the private key in FILE. +The private key must be decrypted and in PEM format. +The behavior when encrypted one is given is undefined. +See also \fI\%\-\-certificate\fP option. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-referer= +Set an http referrer (Referer). This affects all http/https downloads. +If \fB*\fP is given, the download URI is also used as the referrer. +This may be useful when used together with the +\fI\%\-\-parameterized\-uri\fP option. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-http\-keep\-alive [true|false] +Enable HTTP/1.1 persistent connection. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-http\-pipelining [true|false] +Enable HTTP/1.1 pipelining. +Default: \fBfalse\fP +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +In performance perspective, there is usually no advantage to enable +this option. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-header=
+Append HEADER to HTTP request header. +You can use this option repeatedly to specify more than one header: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-header="X\-A: b78" \-\-header="X\-B: 9J1" "http://host/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-load\-cookies= +Load Cookies from FILE using the Firefox3 format (SQLite3), +Chromium/Google Chrome (SQLite3) and the +Mozilla/Firefox(1.x/2.x)/Netscape format. +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +If aria2 is built without libsqlite3, then it doesn\(aqt support Firefox3 +and Chromium/Google Chrome cookie format. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-save\-cookies= +Save Cookies to FILE in Mozilla/Firefox(1.x/2.x)/ Netscape +format. If FILE already exists, it is overwritten. Session Cookies +are also saved and their expiry values are treated as 0. Possible +Values: \fB/path/to/file\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-use\-head [true|false] +Use HEAD method for the first request to the HTTP server. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-U, \-\-user\-agent= +Set user agent for HTTP(S) downloads. +Default: \fBaria2/$VERSION\fP, $VERSION is replaced by package version. +.UNINDENT +.SS FTP/SFTP Specific Options +.INDENT 0.0 +.TP +.B \-\-ftp\-user= +Set FTP user. This affects all URIs. +Default: \fBanonymous\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-passwd= +Set FTP password. This affects all URIs. +If user name is embedded but password is missing in URI, aria2 tries +to resolve password using .netrc. If password is found in .netrc, +then use it as password. If not, use the password specified in this +option. +Default: \fBARIA2USER@\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-p, \-\-ftp\-pasv [true|false] +Use the passive mode in FTP. +If \fBfalse\fP is given, the active mode will be used. +Default: \fBtrue\fP +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +This option is ignored for SFTP transfer. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-proxy= +Use a proxy server for FTP. To override a previously defined proxy, +use "". +See also the \fI\%\-\-all\-proxy\fP option. This affects all ftp downloads. +The format of PROXY is \fB[http://][USER:PASSWORD@]HOST[:PORT]\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-proxy\-passwd= +Set password for \fI\%\-\-ftp\-proxy\fP option. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-proxy\-user= +Set user for \fI\%\-\-ftp\-proxy\fP option. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-type= +Set FTP transfer type. TYPE is either \fBbinary\fP or \fBascii\fP\&. +Default: \fBbinary\fP +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +This option is ignored for SFTP transfer. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-reuse\-connection [true|false] +Reuse connection in FTP. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ssh\-host\-key\-md== +Set checksum for SSH host public key. TYPE is hash type. The +supported hash type is \fBsha\-1\fP or \fBmd5\fP\&. DIGEST is hex +digest. For example: +\fBsha\-1=b030503d4de4539dc7885e6f0f5e256704edf4c3\fP\&. This option can +be used to validate server\(aqs public key when SFTP is used. If this +option is not set, which is default, no validation takes place. +.UNINDENT +.SS BitTorrent/Metalink Options +.INDENT 0.0 +.TP +.B \-\-select\-file=... +Set file to download by specifying its index. +You can find the file index using the \fI\%\-\-show\-files\fP option. +Multiple indexes can be specified by using \fB,\fP, for example: \fB3,6\fP\&. +You can also use \fB\-\fP to specify a range: \fB1\-5\fP\&. +\fB,\fP and \fB\-\fP can be used together: \fB1\-5,8,9\fP\&. +When used with the \-M option, index may vary depending on the query +(see \fI\-\-metalink\-*\fP options). +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +In multi file torrent, the adjacent files specified by this option may +also be downloaded. This is by design, not a bug. +A single piece may include several files or part of files, and aria2 +writes the piece to the appropriate files. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-S, \-\-show\-files [true|false] +Print file listing of ".torrent", ".meta4" and ".metalink" file and exit. +In case of ".torrent" file, additional information +(infohash, piece length, etc) is also printed. +.UNINDENT +.SS BitTorrent Specific Options +.INDENT 0.0 +.TP +.B \-\-bt\-detach\-seed\-only [true|false] +Exclude seed only downloads when counting concurrent active +downloads (See \fI\%\-j\fP option). This means that if \fB\-j3\fP is +given and this option is turned on and 3 downloads are active and +one of those enters seed mode, then it is excluded from active +download count (thus it becomes 2), and the next download waiting in +queue gets started. But be aware that seeding item is still +recognized as active download in RPC method. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-enable\-hook\-after\-hash\-check [true|false] +Allow hook command invocation after hash check (see \fI\%\-V\fP +option) in BitTorrent download. By default, when hash check +succeeds, the command given by \fI\%\-\-on\-bt\-download\-complete\fP +is executed. To disable this action, give \fBfalse\fP to this option. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-enable\-lpd [true|false] +Enable Local Peer Discovery. If a private flag is set in a torrent, +aria2 doesn\(aqt use this feature for that download even if \fBtrue\fP is +given. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-exclude\-tracker=[,...] +Comma separated list of BitTorrent tracker\(aqs announce URI to +remove. You can use special value \fB*\fP which matches all URIs, thus +removes all announce URIs. When specifying \fB*\fP in shell +command\-line, don\(aqt forget to escape or quote it. See also +\fI\%\-\-bt\-tracker\fP option. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-external\-ip= +Specify the external IP address to use in BitTorrent download and DHT. +It may be sent to BitTorrent tracker. For DHT, this option should be +set to report that local node is downloading a particular torrent. +This is critical to use DHT in a private network. Although this +function is named \fBexternal\fP, it can accept any kind of IP +addresses. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-force\-encryption [true|false] +Requires BitTorrent message payload encryption with arc4. This is a +shorthand of \fI\%\-\-bt\-require\-crypto\fP +\fI\%\-\-bt\-min\-crypto\-level\fP=arc4. This option does not change +the option value of those options. If \fBtrue\fP is given, deny +legacy BitTorrent handshake and only use Obfuscation handshake and +always encrypt message payload. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-hash\-check\-seed [true|false] +If \fBtrue\fP is given, after hash check using \fI\%\-\-check\-integrity\fP option and +file is complete, continue to seed file. If you want to check file +and download it only when it is damaged or incomplete, set this +option to \fBfalse\fP\&. This option has effect only on BitTorrent download. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-load\-saved\-metadata [true|false] +Before getting torrent metadata from DHT when downloading with +magnet link, first try to read file saved by +\fI\%\-\-bt\-save\-metadata\fP option. If it is successful, then skip +downloading metadata from DHT. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-lpd\-interface= +Use given interface for Local Peer Discovery. If this option is not +specified, the default interface is chosen. You can specify +interface name and IP address. Possible Values: interface, IP +address +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-max\-open\-files= +Specify maximum number of files to open in multi\-file +BitTorrent/Metalink download globally. +Default: \fB100\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-max\-peers= +Specify the maximum number of peers per torrent. \fB0\fP means +unlimited. See also \fI\%\-\-bt\-request\-peer\-speed\-limit\fP option. +Default: \fB55\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-metadata\-only [true|false] +Download meta data only. The file(s) described in meta data will not +be downloaded. This option has effect only when BitTorrent Magnet +URI is used. See also \fI\%\-\-bt\-save\-metadata\fP option. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-min\-crypto\-level=plain|arc4 +Set minimum level of encryption method. +If several encryption methods are provided by a peer, aria2 chooses the lowest +one which satisfies the given level. +Default: \fBplain\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-prioritize\-piece=head[=],tail[=] +Try to download first and last pieces of each file first. This is +useful for previewing files. The argument can contain 2 keywords: +\fBhead\fP and \fBtail\fP\&. To include both keywords, they must be separated +by comma. These keywords can take one parameter, SIZE. For example, +if \fBhead=\fP is specified, pieces in the range of first SIZE bytes +of each file get higher priority. \fBtail=\fP means the range of +last SIZE bytes of each file. SIZE can include \fBK\fP or \fBM\fP (1K = 1024, +1M = 1024K). If SIZE is omitted, SIZE=1M is used. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-remove\-unselected\-file [true|false] +Removes the unselected files when download is completed in +BitTorrent. To select files, use +\fI\%\-\-select\-file\fP option. If it is +not used, all files are assumed to be selected. Please use this +option with care because it will actually remove files from your +disk. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-require\-crypto [true|false] +If \fBtrue\fP is given, aria2 doesn\(aqt accept and establish connection with legacy +BitTorrent handshake(\e19BitTorrent protocol). +Thus aria2 always uses Obfuscation handshake. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-request\-peer\-speed\-limit= +If the whole download speed of every torrent is lower than SPEED, +aria2 temporarily increases the number of peers to try for more +download speed. Configuring this option with your preferred download +speed can increase your download speed in some cases. +You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). +Default: \fB50K\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-save\-metadata [true|false] +Save meta data as ".torrent" file. This option has effect only when +BitTorrent Magnet URI is used. The file name is hex encoded info +hash with suffix ".torrent". The directory to be saved is the same +directory where download file is saved. If the same file already +exists, meta data is not saved. See also \fI\%\-\-bt\-metadata\-only\fP +option. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-seed\-unverified [true|false] +Seed previously downloaded files without verifying piece hashes. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-stop\-timeout= +Stop BitTorrent download if download speed is 0 in consecutive SEC +seconds. If \fB0\fP is given, this feature is disabled. Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-tracker=[,...] +Comma separated list of additional BitTorrent tracker\(aqs announce +URI. These URIs are not affected by \fI\%\-\-bt\-exclude\-tracker\fP option +because they are added after URIs in \fI\%\-\-bt\-exclude\-tracker\fP option are +removed. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-tracker\-connect\-timeout= +Set the connect timeout in seconds to establish connection to +tracker. After the connection is established, this option makes no +effect and \fI\%\-\-bt\-tracker\-timeout\fP option is used instead. Default: +\fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-tracker\-interval= +Set the interval in seconds between tracker requests. This +completely overrides interval value and aria2 just uses this value +and ignores the min interval and interval value in the response of +tracker. If \fB0\fP is set, aria2 determines interval based on the +response of tracker and the download progress. Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-tracker\-timeout= +Set timeout in seconds. Default: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-entry\-point=: +Set host and port as an entry point to IPv4 DHT network. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-entry\-point6=: +Set host and port as an entry point to IPv6 DHT network. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-file\-path= +Change the IPv4 DHT routing table file to PATH. +Default: \fB$HOME/.aria2/dht.dat\fP if present, otherwise +\fB$XDG_CACHE_HOME/aria2/dht.dat\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-file\-path6= +Change the IPv6 DHT routing table file to PATH. +Default: \fB$HOME/.aria2/dht6.dat\fP if present, otherwise +\fB$XDG_CACHE_HOME/aria2/dht6.dat\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-listen\-addr6= +Specify address to bind socket for IPv6 DHT. It should be a global +unicast IPv6 address of the host. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-listen\-port=... +Set UDP listening port used by DHT(IPv4, IPv6) and UDP tracker. +Multiple ports can be specified by using \fB,\fP, for example: +\fB6881,6885\fP\&. You can also use \fB\-\fP to specify a range: +\fB6881\-6999\fP\&. \fB,\fP and \fB\-\fP can be used together. +Default: \fB6881\-6999\fP +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +Make sure that the specified ports are open for incoming UDP traffic. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-message\-timeout= +Set timeout in seconds. Default: \fB10\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-dht [true|false] +Enable IPv4 DHT functionality. It also enables UDP tracker +support. If a private flag is set in a torrent, aria2 doesn\(aqt use +DHT for that download even if \fBtrue\fP is given. Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-dht6 [true|false] +Enable IPv6 DHT functionality. If a private flag is set in a +torrent, aria2 doesn\(aqt use DHT for that download even if \fBtrue\fP is +given. Use \fI\%\-\-dht\-listen\-port\fP option to specify port number to +listen on. See also \fI\%\-\-dht\-listen\-addr6\fP option. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-peer\-exchange [true|false] +Enable Peer Exchange extension. If a private flag is set in a torrent, this +feature is disabled for that download even if \fBtrue\fP is given. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-follow\-torrent=true|false|mem +If \fBtrue\fP or \fBmem\fP is specified, when a file whose suffix is \fB\&.torrent\fP or content +type is \fBapplication/x\-bittorrent\fP is downloaded, aria2 parses it as a torrent +file and downloads files mentioned in it. +If \fBmem\fP is specified, a torrent file is not written to the disk, but is just +kept in memory. +If \fBfalse\fP is specified, the \fB\&.torrent\fP file is downloaded to the disk, but +is not parsed as a torrent and its contents are not downloaded. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-O, \-\-index\-out== +Set file path for file with index=INDEX. You can find the file index +using the \fI\%\-\-show\-files\fP option. PATH is a relative path to the +path specified in \fI\%\-\-dir\fP option. You can use this option multiple +times. Using this option, you can specify the output file names of +BitTorrent downloads. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-listen\-port=... +Set TCP port number for BitTorrent downloads. +Multiple ports can be specified by using \fB,\fP, for example: \fB6881,6885\fP\&. +You can also use \fB\-\fP to specify a range: \fB6881\-6999\fP\&. +\fB,\fP and \fB\-\fP can be used together: \fB6881\-6889,6999\fP\&. +Default: \fB6881\-6999\fP +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +Make sure that the specified ports are open for incoming TCP traffic. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-overall\-upload\-limit= +Set max overall upload speed in bytes/sec. +\fB0\fP means unrestricted. +You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). +To limit the upload speed per torrent, use \fI\%\-\-max\-upload\-limit\fP option. +Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-u, \-\-max\-upload\-limit= +Set max upload speed per each torrent in bytes/sec. +\fB0\fP means unrestricted. +You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). +To limit the overall upload speed, use \fI\%\-\-max\-overall\-upload\-limit\fP option. +Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-peer\-id\-prefix= +Specify the prefix of peer ID. The peer ID in +BitTorrent is 20 byte length. If more than 20 +bytes are specified, only first 20 bytes are +used. If less than 20 bytes are specified, random +byte data are added to make its length 20 bytes. +.sp +Default: \fBA2\-$MAJOR\-$MINOR\-$PATCH\-\fP, $MAJOR, $MINOR and $PATCH are +replaced by major, minor and patch version number respectively. For +instance, aria2 version 1.18.8 has prefix ID \fBA2\-1\-18\-8\-\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-peer\-agent= +Specify the string used during the bitorrent extended handshake +for the peer\(aqs client version. +.sp +Default: \fBaria2/$MAJOR.$MINOR.$PATCH\fP, $MAJOR, $MINOR and $PATCH are +replaced by major, minor and patch version number respectively. For +instance, aria2 version 1.18.8 has peer agent \fBaria2/1.18.8\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-seed\-ratio= +Specify share ratio. Seed completed torrents until share ratio reaches +RATIO. +You are strongly encouraged to specify equals or more than \fB1.0\fP here. +Specify \fB0.0\fP if you intend to do seeding regardless of share ratio. +If \fI\%\-\-seed\-time\fP option is specified along with this option, seeding ends when +at least one of the conditions is satisfied. +Default: \fB1.0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-seed\-time= +Specify seeding time in (fractional) minutes. Also see the +\fI\%\-\-seed\-ratio\fP option. +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +Specifying \fI\%\-\-seed\-time=0\fP disables seeding after download completed. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-T, \-\-torrent\-file= +The path to the ".torrent" file. You are not required to use this +option because you can specify ".torrent" files without \fI\%\-\-torrent\-file\fP\&. +.UNINDENT +.SS Metalink Specific Options +.INDENT 0.0 +.TP +.B \-\-follow\-metalink=true|false|mem +If \fBtrue\fP or \fBmem\fP is specified, when a file whose suffix is \fB\&.meta4\fP or \fB\&.metalink\fP or content +type of \fBapplication/metalink4+xml\fP or \fBapplication/metalink+xml\fP is downloaded, aria2 parses it as a metalink +file and downloads files mentioned in it. +If \fBmem\fP is specified, a metalink file is not written to the disk, but is just +kept in memory. +If \fBfalse\fP is specified, the \fB\&.metalink\fP file is downloaded to +the disk, but is not parsed as a metalink file and its contents are not +downloaded. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-base\-uri= +Specify base URI to resolve relative URI in metalink:url and +metalink:metaurl element in a metalink file stored in local disk. If +URI points to a directory, URI must end with \fB/\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-M, \-\-metalink\-file= +The file path to ".meta4" and ".metalink" file. Reads input from \fBstdin\fP when \fB\-\fP is +specified. You are not required to use this option because you can +specify ".metalink" files without \fI\%\-\-metalink\-file\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-language= +The language of the file to download. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-location=[,...] +The location of the preferred server. +A comma\-delimited list of locations is acceptable, for example, \fBjp,us\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-os= +The operating system of the file to download. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-version= +The version of the file to download. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-preferred\-protocol= +Specify preferred protocol. +The possible values are \fBhttp\fP, \fBhttps\fP, \fBftp\fP and \fBnone\fP\&. +Specify \fBnone\fP to disable this feature. +Default: \fBnone\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-enable\-unique\-protocol [true|false] +If \fBtrue\fP is given and several protocols are available for a mirror in a +metalink file, aria2 uses one of them. +Use \fI\%\-\-metalink\-preferred\-protocol\fP option to specify the preference of +protocol. +Default: \fBtrue\fP +.UNINDENT +.SS RPC Options +.INDENT 0.0 +.TP +.B \-\-enable\-rpc [true|false] +Enable JSON\-RPC/XML\-RPC server. It is strongly recommended to set +secret authorization token using \fI\%\-\-rpc\-secret\fP option. See +also \fI\%\-\-rpc\-listen\-port\fP option. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-pause [true|false] +Pause download after added. This option is effective only when +\fI\%\-\-enable\-rpc=true\fP is given. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-pause\-metadata [true|false] +Pause downloads created as a result of metadata download. There are +3 types of metadata downloads in aria2: (1) downloading .torrent +file. (2) downloading torrent metadata using magnet link. (3) +downloading metalink file. These metadata downloads will generate +downloads using their metadata. This option pauses these subsequent +downloads. This option is effective only when +\fI\%\-\-enable\-rpc=true\fP is given. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-allow\-origin\-all [true|false] +Add Access\-Control\-Allow\-Origin header field with value \fB*\fP to the +RPC response. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-certificate= +Use the certificate in FILE for RPC server. The certificate must be +either in PKCS12 (.p12, .pfx) or in PEM format. +.sp +PKCS12 files must contain the certificate, a key and optionally a chain +of additional certificates. Only PKCS12 files with a blank import password +can be opened! +.sp +When using PEM, you have to specify the private key via \fI\%\-\-rpc\-private\-key\fP +as well. Use \fI\%\-\-rpc\-secure\fP option to enable encryption. +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +\fIWinTLS\fP does not support PEM files at the moment. Users have to use PKCS12 +files. +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +\fIAppleTLS\fP users should use the KeyChain Access utility to first generate a +self\-signed SSL\-Server certificate, e.g. using the wizard, and get the +SHA\-1 fingerprint from the Information dialog corresponding to that new +certificate. +To start aria2c with \fI\%\-\-rpc\-secure\fP use +\fI\-\-rpc\-certificate=\fP\&. +Alternatively PKCS12 files are also supported. PEM files, however, are not +supported. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-listen\-all [true|false] +Listen incoming JSON\-RPC/XML\-RPC requests on all network interfaces. If false +is given, listen only on local loopback interface. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-listen\-port= +Specify a port number for JSON\-RPC/XML\-RPC server to listen to. Possible +Values: \fB1024\fP \-\fB65535\fP Default: \fB6800\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-max\-request\-size= +Set max size of JSON\-RPC/XML\-RPC request. If aria2 detects the request is +more than SIZE bytes, it drops connection. Default: \fB2M\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-passwd= +Set JSON\-RPC/XML\-RPC password. +.sp +\fBWARNING:\fP +.INDENT 7.0 +.INDENT 3.5 +\fI\%\-\-rpc\-passwd\fP option will be deprecated in the future +release. Migrate to \fI\%\-\-rpc\-secret\fP option as soon as +possible. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-private\-key= +Use the private key in FILE for RPC server. The private key must be +decrypted and in PEM format. Use \fI\%\-\-rpc\-secure\fP option to +enable encryption. See also \fI\%\-\-rpc\-certificate\fP option. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-save\-upload\-metadata [true|false] +Save the uploaded torrent or metalink meta data in the directory +specified by \fI\%\-\-dir\fP option. The file name consists of SHA\-1 +hash hex string of meta data plus extension. For torrent, the +extension is \(aq.torrent\(aq. For metalink, it is \(aq.meta4\(aq. If false is +given to this option, the downloads added by +\fI\%aria2.addTorrent()\fP or \fI\%aria2.addMetalink()\fP will not be +saved by \fI\%\-\-save\-session\fP option. Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-secret= +Set RPC secret authorization token. Read \fI\%RPC authorization secret token\fP to know +how this option value is used. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-secure [true|false] +RPC transport will be encrypted by SSL/TLS. The RPC clients must +use https scheme to access the server. For WebSocket client, use wss +scheme. Use \fI\%\-\-rpc\-certificate\fP and +\fI\%\-\-rpc\-private\-key\fP options to specify the server +certificate and private key. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-user= +Set JSON\-RPC/XML\-RPC user. +.sp +\fBWARNING:\fP +.INDENT 7.0 +.INDENT 3.5 +\fI\%\-\-rpc\-user\fP option will be deprecated in the future +release. Migrate to \fI\%\-\-rpc\-secret\fP option as soon as +possible. +.UNINDENT +.UNINDENT +.UNINDENT +.SS Advanced Options +.INDENT 0.0 +.TP +.B \-\-allow\-overwrite [true|false] +Restart download from scratch if the corresponding control file +doesn\(aqt exist. See also \fI\%\-\-auto\-file\-renaming\fP option. Default: +\fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-allow\-piece\-length\-change [true|false] +If false is given, aria2 aborts download when a piece length is different +from one in a control file. +If true is given, you can proceed but some download progress will be lost. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-always\-resume [true|false] +Always resume download. If \fBtrue\fP is given, aria2 always tries to +resume download and if resume is not possible, aborts download. If +\fBfalse\fP is given, when all given URIs do not support resume or aria2 +encounters \fBN\fP URIs which does not support resume (\fBN\fP is the value +specified using \fI\%\-\-max\-resume\-failure\-tries\fP option), aria2 +downloads file from scratch. See \fI\%\-\-max\-resume\-failure\-tries\fP +option. Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-async\-dns [true|false] +Enable asynchronous DNS. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-async\-dns\-server=[,...] +Comma separated list of DNS server address used in asynchronous DNS +resolver. Usually asynchronous DNS resolver reads DNS server +addresses from \fB/etc/resolv.conf\fP\&. When this option is used, it uses +DNS servers specified in this option instead of ones in +\fB/etc/resolv.conf\fP\&. You can specify both IPv4 and IPv6 address. This +option is useful when the system does not have \fB/etc/resolv.conf\fP and +user does not have the permission to create it. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-auto\-file\-renaming [true|false] +Rename file name if the same file already exists. +This option works only in HTTP(S)/FTP download. +The new file name has a dot and a number(1..9999) appended after the +name, but before the file extension, if any. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-auto\-save\-interval= +Save a control file(*.aria2) every SEC seconds. +If \fB0\fP is given, a control file is not saved during download. aria2 saves a +control file when it stops regardless of the value. +The possible values are between \fB0\fP to \fB600\fP\&. +Default: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-conditional\-get [true|false] +Download file only when the local file is older than remote +file. This function only works with HTTP(S) downloads only. It does +not work if file size is specified in Metalink. It also ignores +Content\-Disposition header. If a control file exists, this option +will be ignored. This function uses If\-Modified\-Since header to get +only newer file conditionally. When getting modification time of +local file, it uses user supplied file name (see \fI\%\-\-out\fP option) or +file name part in URI if \fI\%\-\-out\fP is not specified. +To overwrite existing file, \fI\%\-\-allow\-overwrite\fP is required. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-conf\-path= +Change the configuration file path to PATH. +Default: \fB$HOME/.aria2/aria2.conf\fP if present, otherwise +\fB$XDG_CONFIG_HOME/aria2/aria2.conf\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-console\-log\-level= +Set log level to output to console. LEVEL is either \fBdebug\fP, +\fBinfo\fP, \fBnotice\fP, \fBwarn\fP or \fBerror\fP\&. Default: \fBnotice\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-content\-disposition\-default\-utf8 [true|false] +Handle quoted string in Content\-Disposition header as UTF\-8 instead +of ISO\-8859\-1, for example, the filename parameter, but not the +extended version filename*. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-D, \-\-daemon [true|false] +Run as daemon. The current working directory will be changed to \fB/\fP +and standard input, standard output and standard error will be +redirected to \fB/dev/null\fP\&. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-deferred\-input [true|false] +If \fBtrue\fP is given, aria2 does not read all URIs and options from file +specified by \fI\%\-\-input\-file\fP option at startup, +but it reads one by one when it +needs later. This may reduce memory usage if input file contains a +lot of URIs to download. If \fBfalse\fP is given, aria2 reads all URIs +and options at startup. +Default: \fBfalse\fP +.sp +\fBWARNING:\fP +.INDENT 7.0 +.INDENT 3.5 +\fI\%\-\-deferred\-input\fP option will be disabled when +\fI\%\-\-save\-session\fP is used together. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-disable\-ipv6 [true|false] +Disable IPv6. This is useful if you have to use broken DNS and want +to avoid terribly slow AAAA record lookup. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-disk\-cache= +Enable disk cache. If SIZE is \fB0\fP, the disk cache is +disabled. This feature caches the downloaded data in memory, which +grows to at most SIZE bytes. The cache storage is created for aria2 +instance and shared by all downloads. The one advantage of the disk +cache is reduce the disk I/O because the data are written in larger +unit and it is reordered by the offset of the file. If hash +checking is involved and the data are cached in memory, we don\(aqt +need to read them from the disk. SIZE can include \fBK\fP or \fBM\fP +(1K = 1024, 1M = 1024K). Default: \fB16M\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-download\-result= +This option changes the way \fBDownload Results\fP is formatted. If +OPT is \fBdefault\fP, print GID, status, average download speed and +path/URI. If multiple files are involved, path/URI of first +requested file is printed and remaining ones are omitted. If OPT is +\fBfull\fP, print GID, status, average download speed, percentage of +progress and path/URI. The percentage of progress and path/URI are +printed for each requested file in each row. If OPT is \fBhide\fP, +\fBDownload Results\fP is hidden. +Default: \fBdefault\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dscp= +Set DSCP value in outgoing IP packets of BitTorrent traffic for +QoS. This parameter sets only DSCP bits in TOS field of IP packets, +not the whole field. If you take values from +\fI/usr/include/netinet/ip.h\fP divide them by 4 (otherwise values would +be incorrect, e.g. your \fBCS1\fP class would turn into \fBCS4\fP). If +you take commonly used values from RFC, network vendors\(aq +documentation, Wikipedia or any other source, use them as they are. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rlimit\-nofile= +Set the soft limit of open file descriptors. +This open will only have effect when: +.INDENT 7.0 +.INDENT 3.5 +.INDENT 0.0 +.IP a. 3 +The system supports it (posix) +.IP b. 3 +The limit does not exceed the hard limit. +.IP c. 3 +The specified limit is larger than the current soft limit. +.UNINDENT +.UNINDENT +.UNINDENT +.sp +This is equivalent to setting nofile via ulimit, +except that it will never decrease the limit. +.sp +This option is only available on systems supporting the rlimit API. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-color [true|false] +Enable color output for a terminal. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-mmap [true|false] +Map files into memory. This option may not work if the file space +is not pre\-allocated. See \fI\%\-\-file\-allocation\fP\&. +.sp +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-event\-poll= +Specify the method for polling events. The possible values are +\fBepoll\fP, \fBkqueue\fP, \fBport\fP, \fBpoll\fP and \fBselect\fP\&. For each \fBepoll\fP, +\fBkqueue\fP, \fBport\fP and \fBpoll\fP, it is available if system supports it. +\fBepoll\fP is available on recent Linux. \fBkqueue\fP is available on +various *BSD systems including Mac OS X. \fBport\fP is available on Open +Solaris. The default value may vary depending on the system you use. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-file\-allocation= +Specify file allocation method. +\fBnone\fP doesn\(aqt pre\-allocate file space. \fBprealloc\fP pre\-allocates file space +before download begins. This may take some time depending on the size of the +file. +If you are using newer file systems such as ext4 +(with extents support), btrfs, xfs or NTFS(MinGW build only), \fBfalloc\fP is +your best choice. It allocates large(few GiB) +files almost instantly. Don\(aqt use \fBfalloc\fP with +legacy file systems such as ext3 and FAT32 because it takes +almost same time as \fBprealloc\fP and it blocks aria2 +entirely until allocation finishes. \fBfalloc\fP may +not be available if your system doesn\(aqt have +\fBposix_fallocate(3)\fP function. +\fBtrunc\fP uses \fBftruncate(2)\fP system call or +platform\-specific counterpart to truncate a file to a specified +length. +.sp +Possible Values: \fBnone\fP, \fBprealloc\fP, \fBtrunc\fP, \fBfalloc\fP +Default: \fBprealloc\fP +.sp +\fBWARNING:\fP +.INDENT 7.0 +.INDENT 3.5 +Using \fBtrunc\fP seemingly allocates disk space very quickly, but +what it actually does is that it sets file length metadata in +file system, and does not allocate disk space at all. This means +that it does not help avoiding fragmentation. +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +In multi file torrent downloads, the files adjacent forward to the specified files +are also allocated if they share the same piece. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-force\-save [true|false] +Save download with \fI\%\-\-save\-session\fP option +even if the download is completed or removed. This option also saves +control file in that situations. This may be useful to save +BitTorrent seeding which is recognized as completed state. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-save\-not\-found [true|false] +Save download with \fI\%\-\-save\-session\fP option +even if the file was not found on the server. This option also saves +control file in that situations. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-gid= +Set GID manually. aria2 identifies each download by the ID called +GID. The GID must be hex string of 16 characters, thus [0\-9a\-fA\-F] +are allowed and leading zeros must not be stripped. The GID all 0 is +reserved and must not be used. The GID must be unique, otherwise +error is reported and the download is not added. This option is +useful when restoring the sessions saved using +\fI\%\-\-save\-session\fP option. If this option is +not used, new GID is generated by aria2. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-hash\-check\-only [true|false] +If \fBtrue\fP is given, after hash check using +\fI\%\-\-check\-integrity\fP option, +abort download whether or not download is complete. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-human\-readable [true|false] +Print sizes and speed in human readable format (e.g., 1.2Ki, 3.4Mi) +in the console readout. Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-interface= +Bind sockets to given interface. You can specify interface name, IP +address and host name. +Possible Values: interface, IP address, host name +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +If an interface has multiple addresses, it is highly recommended to +specify IP address explicitly. See also \fI\%\-\-disable\-ipv6\fP\&. If your +system doesn\(aqt have \fBgetifaddrs(3)\fP, this option doesn\(aqt accept interface +name. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-keep\-unfinished\-download\-result [true|false] +Keep unfinished download results even if doing so exceeds +\fI\%\-\-max\-download\-result\fP\&. This is useful if all unfinished +downloads must be saved in session file (see +\fI\%\-\-save\-session\fP option). Please keep in mind that there is +no upper bound to the number of unfinished download result to keep. +If that is undesirable, turn this option off. Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-download\-result= +Set maximum number of download result kept in memory. The download +results are completed/error/removed downloads. The download results +are stored in FIFO queue and it can store at most NUM download +results. When queue is full and new download result is created, +oldest download result is removed from the front of the queue and +new one is pushed to the back. Setting big number in this option may +result high memory consumption after thousands of +downloads. Specifying 0 means no download result is kept. Note that +unfinished downloads are kept in memory regardless of this option +value. See \fI\%\-\-keep\-unfinished\-download\-result\fP option. +Default: \fB1000\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-mmap\-limit= +Set the maximum file size to enable mmap (see +\fI\%\-\-enable\-mmap\fP option). The file size is determined by the +sum of all files contained in one download. For example, if a +download contains 5 files, then file size is the total size of those +files. If file size is strictly greater than the size specified in +this option, mmap will be disabled. +Default: \fB9223372036854775807\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-resume\-failure\-tries= +When used with \fI\%\-\-always\-resume=false,\fP aria2 downloads file from +scratch when aria2 detects N number of URIs that does not support +resume. If N is \fB0\fP, aria2 downloads file from scratch when all +given URIs do not support resume. See \fI\%\-\-always\-resume\fP option. +Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-min\-tls\-version= +Specify minimum SSL/TLS version to enable. +Possible Values: \fBTLSv1.1\fP, \fBTLSv1.2\fP, \fBTLSv1.3\fP +Default: \fBTLSv1.2\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-multiple\-interface= +Comma separated list of interfaces to bind sockets to. Requests will +be splited among the interfaces to achieve link aggregation. You can +specify interface name, IP address and hostname. If +\fI\%\-\-interface\fP is used, this option will be ignored. +Possible Values: interface, IP address, hostname +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-log\-level= +Set log level to output. +LEVEL is either \fBdebug\fP, \fBinfo\fP, \fBnotice\fP, \fBwarn\fP or \fBerror\fP\&. +Default: \fBdebug\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-bt\-download\-complete= +For BitTorrent, a command specified in \fI\%\-\-on\-download\-complete\fP is +called after download completed and seeding is over. On the other +hand, this option set the command to be executed after download +completed but before seeding. +See \fI\%Event Hook\fP for more details about COMMAND. +Possible Values: \fB/path/to/command\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-complete= +Set the command to be executed after download completed. +See \fI\%Event Hook\fP for more details about COMMAND. +See also \fI\%\-\-on\-download\-stop\fP option. +Possible Values: \fB/path/to/command\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-error= +Set the command to be executed after download aborted due to error. +See \fI\%Event Hook\fP for more details about COMMAND. +See also \fI\%\-\-on\-download\-stop\fP option. Possible Values: +\fB/path/to/command\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-pause= +Set the command to be executed after download was paused. +See \fI\%Event Hook\fP for more details about COMMAND. +Possible Values: \fB/path/to/command\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-start= +Set the command to be executed after download got started. +See \fI\%Event Hook\fP for more details about COMMAND. +Possible Values: \fB/path/to/command\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-stop= +Set the command to be executed after download stopped. You can override +the command to be executed for particular download result using +\fI\%\-\-on\-download\-complete\fP and \fI\%\-\-on\-download\-error\fP\&. If they are +specified, command specified in this option is not executed. +See \fI\%Event Hook\fP for more details about COMMAND. +Possible Values: \fB/path/to/command\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-optimize\-concurrent\-downloads [true|false|:] +Optimizes the number of concurrent downloads according to the +bandwidth available. aria2 uses the download speed observed in the +previous downloads to adapt the number of downloads launched in +parallel according to the rule N = A + B Log10(speed in Mbps). The +coefficients A and B can be customized in the option arguments with +A and B separated by a colon. The default values (A=5, B=25) lead to +using typically 5 parallel downloads on 1Mbps networks and above 50 +on 100Mbps networks. The number of parallel downloads remains +constrained under the maximum defined by the +\fI\%\-\-max\-concurrent\-downloads\fP parameter. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-piece\-length= +Set a piece length for HTTP/FTP downloads. This is the boundary when +aria2 splits a file. All splits occur at multiple of this +length. This option will be ignored in BitTorrent downloads. It +will be also ignored if Metalink file contains piece hashes. +Default: \fB1M\fP +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +The possible use case of \fI\%\-\-piece\-length\fP +option is change the request range in one HTTP pipelined request. +To enable HTTP pipelining use +\fI\%\-\-enable\-http\-pipelining\fP\&. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-show\-console\-readout [true|false] +Show console readout. Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stderr [true|false] +Redirect all console output that would be otherwise printed in +stdout to stderr. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-summary\-interval= +Set interval in seconds to output download progress summary. +Setting \fB0\fP suppresses the output. +Default: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-Z, \-\-force\-sequential [true|false] +Fetch URIs in the command\-line sequentially and download each URI in a +separate session, like the usual command\-line download utilities. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-overall\-download\-limit= +Set max overall download speed in bytes/sec. \fB0\fP means +unrestricted. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). To +limit the download speed per download, use \fI\%\-\-max\-download\-limit\fP +option. Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-download\-limit= +Set max download speed per each download in bytes/sec. \fB0\fP means +unrestricted. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). To +limit the overall download speed, use \fI\%\-\-max\-overall\-download\-limit\fP +option. Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-conf [true|false] +Disable loading aria2.conf file. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-file\-allocation\-limit= +No file allocation is made for files whose size is smaller than SIZE. +You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). +Default: \fB5M\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-P, \-\-parameterized\-uri [true|false] +Enable parameterized URI support. +You can specify set of parts: \fBhttp://{sv1,sv2,sv3}/foo.iso\fP\&. +Also you can specify numeric sequences with step counter: +\fBhttp://host/image[000\-100:2].img\fP\&. +A step counter can be omitted. +If all URIs do not point to the same file, such as the second example above, +\-Z option is required. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-q, \-\-quiet [true|false] +Make aria2 quiet (no console output). +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-realtime\-chunk\-checksum [true|false] +Validate chunk of data by calculating checksum while downloading a file if +chunk checksums are provided. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-remove\-control\-file [true|false] +Remove control file before download. Using with +\fI\%\-\-allow\-overwrite=true,\fP download always starts from +scratch. This will be useful for users behind proxy server which +disables resume. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-save\-session= +Save error/unfinished downloads to FILE on exit. You can pass this +output file to aria2c with \fI\%\-\-input\-file\fP option on +restart. If you like the output to be gzipped append a .gz extension to +the file name. +Please note that downloads added by +\fI\%aria2.addTorrent()\fP and \fI\%aria2.addMetalink()\fP RPC method +and whose meta data could not be saved as a file are not saved. +Downloads removed using \fI\%aria2.remove()\fP and +\fI\%aria2.forceRemove()\fP will not be saved. GID is also saved with +\fI\%gid\fP, but there are some restrictions, see below. +.sp +\fBNOTE:\fP +.INDENT 7.0 +.INDENT 3.5 +Normally, GID of the download itself is saved. But some downloads +use meta data (e.g., BitTorrent and Metalink). In this case, there +are some restrictions. +.INDENT 0.0 +.TP +.B magnet URI, and followed by torrent download +GID of BitTorrent meta data download is saved. +.TP +.B URI to torrent file, and followed by torrent download +GID of torrent file download is saved. +.TP +.B URI to metalink file, and followed by file downloads described in metalink file +GID of metalink file download is saved. +.TP +.B local torrent file +GID of torrent download is saved. +.TP +.B local metalink file +Any meaningful GID is not saved. +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-save\-session\-interval= +Save error/unfinished downloads to a file specified by +\fI\%\-\-save\-session\fP option every SEC seconds. If \fB0\fP is +given, file will be saved only when aria2 exits. Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-socket\-recv\-buffer\-size= +Set the maximum socket receive buffer in bytes. Specifying \fB0\fP +will disable this option. This value will be set to socket file +descriptor using \fBSO_RCVBUF\fP socket option with \fBsetsockopt()\fP +call. Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stop= +Stop application after SEC seconds has passed. +If \fB0\fP is given, this feature is disabled. +Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stop\-with\-process= +Stop application when process PID is not running. This is useful if +aria2 process is forked from a parent process. The parent process +can fork aria2 with its own pid and when parent process exits for +some reason, aria2 can detect it and shutdown itself. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-truncate\-console\-readout [true|false] +Truncate console readout to fit in a single line. +Default: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-v, \-\-version +Print the version number, copyright and the configuration information and +exit. +.UNINDENT +.SS Notes for Options +.SS Optional arguments +.sp +The options that have its argument surrounded by square brackets([]) +take an optional argument. Usually omitting the argument is evaluated to \fBtrue\fP\&. +If you use short form of these options(such as \fB\-V\fP) and give +an argument, then the option name and its argument should be concatenated(e.g. +\fB\-Vfalse\fP). If any spaces are inserted between the option name and the argument, +the argument will be treated as URI and usually this is not what you expect. +.SS Units (K and M) +.sp +Some options takes \fBK\fP and \fBM\fP to conveniently represent 1024 and +1048576 respectively. aria2 detects these characters in +case\-insensitive way. In other words, \fBk\fP and \fBm\fP can be used as +well as \fBK\fP and \fBM\fP respectively. +.SS URI, MAGNET, TORRENT_FILE, METALINK_FILE +.sp +You can specify multiple URIs in command\-line. Unless you specify +\fI\%\-\-force\-sequential\fP option, all URIs must point to the same file or downloading will +fail. +.sp +You can specify arbitrary number of BitTorrent Magnet URI. Please note +that they are always treated as a separate download. Both hex encoded +40 characters Info Hash and Base32 encoded 32 characters Info Hash are +supported. The multiple \fBtr\fP parameters are supported. Because +BitTorrent Magnet URI is likely to contain \fB&\fP character, it is highly +recommended to always quote URI with single(\fB\(aq\fP) or double(\fB"\fP) quotation. +It is strongly recommended to enable DHT especially when \fBtr\fP +parameter is missing. See \fI\%http://www.bittorrent.org/beps/bep_0009.html\fP +for more details about BitTorrent Magnet URI. +.sp +You can also specify arbitrary number of torrent files and Metalink +documents stored on a local drive. Please note that they are always +treated as a separate download. Both Metalink4 and Metalink version +3.0 are supported. +.sp +You can specify both torrent file with \-T option and URIs. By doing +this, you can download a file from both torrent swarm and +HTTP(S)/FTP/SFTP server at the same time, while the data from +HTTP(S)/FTP/SFTP are uploaded to the torrent swarm. For single file +torrents, URI can be a complete URI pointing to the resource or if URI +ends with /, name in torrent file in torrent is added. For multi\-file +torrents, name and path are added to form a URI for each file. +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +Make sure that URI is quoted with single(\fB\(aq\fP) or double(\fB"\fP) quotation if it +contains \fB&\fP or any characters that have special meaning in shell. +.UNINDENT +.UNINDENT +.SS Resuming Download +.sp +Usually, you can resume transfer by just issuing same command (aria2c +URI) if the previous transfer is made by aria2. +.sp +If the previous transfer is made by a browser or wget like sequential +download manager, then use \fI\%\-\-continue\fP option to continue the +transfer. +.SS Event Hook +.sp +aria2 provides options to specify arbitrary command after specific event +occurred. Currently following options are available: +\fI\%\-\-on\-bt\-download\-complete\fP, +\fI\%\-\-on\-download\-pause\fP, +\fI\%\-\-on\-download\-complete\fP\&. +\fI\%\-\-on\-download\-start\fP, +\fI\%\-\-on\-download\-error\fP, +\fI\%\-\-on\-download\-stop\fP\&. +.sp +aria2 passes 3 arguments to specified command when it is executed. +These arguments are: GID, the number of files and file path. For +HTTP, FTP, and SFTP downloads, usually the number of files is 1. +BitTorrent download can contain multiple files. If number of files is +more than one, file path is first one. In other words, this is the +value of path key of first struct whose selected key is true in the +response of \fI\%aria2.getFiles()\fP RPC method. If you want to get all +file paths, consider to use JSON\-RPC/XML\-RPC. Please note that file +path may change during download in HTTP because of redirection or +Content\-Disposition header. +.sp +Let\(aqs see an example of how arguments are passed to command: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ cat hook.sh +#!/bin/sh +echo "Called with [$1] [$2] [$3]" +$ aria2c \-\-on\-download\-complete hook.sh http://example.org/file.iso +Called with [1] [1] [/path/to/file.iso] +.ft P +.fi +.UNINDENT +.UNINDENT +.SH EXIT STATUS +.sp +Because aria2 can handle multiple downloads at once, it encounters +lots of errors in a session. aria2 returns the following exit status +based on the last error encountered. +.INDENT 0.0 +.TP +.B 0 +If all downloads were successful. +.TP +.B 1 +If an unknown error occurred. +.TP +.B 2 +If time out occurred. +.TP +.B 3 +If a resource was not found. +.TP +.B 4 +If aria2 saw the specified number of "resource not found" error. +See \fI\%\-\-max\-file\-not\-found\fP option. +.TP +.B 5 +If a download aborted because download speed was too slow. +See \fI\%\-\-lowest\-speed\-limit\fP option. +.TP +.B 6 +If network problem occurred. +.TP +.B 7 +If there were unfinished downloads. This error is only reported if +all finished downloads were successful and there were unfinished +downloads in a queue when aria2 exited by pressing \fBCtrl\-C\fP by an user +or sending TERM or INT signal. +.TP +.B 8 +If remote server did not support resume when resume was required to +complete download. +.TP +.B 9 +If there was not enough disk space available. +.TP +.B 10 +If piece length was different from one in .aria2 control file. See +\fI\%\-\-allow\-piece\-length\-change\fP option. +.TP +.B 11 +If aria2 was downloading same file at that moment. +.TP +.B 12 +If aria2 was downloading same info hash torrent at that moment. +.TP +.B 13 +If file already existed. See \fI\%\-\-allow\-overwrite\fP option. +.TP +.B 14 +If renaming file failed. See \fI\%\-\-auto\-file\-renaming\fP option. +.TP +.B 15 +If aria2 could not open existing file. +.TP +.B 16 +If aria2 could not create new file or truncate existing file. +.TP +.B 17 +If file I/O error occurred. +.TP +.B 18 +If aria2 could not create directory. +.TP +.B 19 +If name resolution failed. +.TP +.B 20 +If aria2 could not parse Metalink document. +.TP +.B 21 +If FTP command failed. +.TP +.B 22 +If HTTP response header was bad or unexpected. +.TP +.B 23 +If too many redirects occurred. +.TP +.B 24 +If HTTP authorization failed. +.TP +.B 25 +If aria2 could not parse bencoded file (usually ".torrent" file). +.TP +.B 26 +If ".torrent" file was corrupted or missing information that aria2 needed. +.TP +.B 27 +If Magnet URI was bad. +.TP +.B 28 +If bad/unrecognized option was given or unexpected option argument +was given. +.TP +.B 29 +If the remote server was unable to handle the request due to a +temporary overloading or maintenance. +.TP +.B 30 +If aria2 could not parse JSON\-RPC request. +.TP +.B 31 +Reserved. Not used. +.TP +.B 32 +If checksum validation failed. +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +An error occurred in a finished download will not be reported +as exit status. +.UNINDENT +.UNINDENT +.SH ENVIRONMENT +.sp +aria2 recognizes the following environment variables. +.INDENT 0.0 +.TP +.B \fBhttp_proxy [http://][USER:PASSWORD@]HOST[:PORT]\fP +Specify proxy server for use in HTTP. +Overrides http\-proxy value in configuration file. +The command\-line option \fI\%\-\-http\-proxy\fP overrides this value. +.TP +.B \fBhttps_proxy [http://][USER:PASSWORD@]HOST[:PORT]\fP +Specify proxy server for use in HTTPS. +Overrides https\-proxy value in configuration file. +The command\-line option \fI\%\-\-https\-proxy\fP overrides this value. +.TP +.B \fBftp_proxy [http://][USER:PASSWORD@]HOST[:PORT]\fP +Specify proxy server for use in FTP. +Overrides ftp\-proxy value in configuration file. +The command\-line option \fI\%\-\-ftp\-proxy\fP overrides this value. +.TP +.B \fBall_proxy [http://][USER:PASSWORD@]HOST[:PORT]\fP +Specify proxy server for use if no protocol\-specific proxy is specified. +Overrides all\-proxy value in configuration file. +The command\-line option \fI\%\-\-all\-proxy\fP overrides this value. +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +Although aria2 accepts \fBftp://\fP and \fBhttps://\fP scheme in proxy URI, it +simply assumes that \fBhttp://\fP is specified and does not change its +behavior based on the specified scheme. +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \fBno_proxy [DOMAIN,...]\fP +Specify a comma\-separated list of host names, domains and network addresses +with or without a subnet mask where no proxy should be used. Overrides the +\fIno\-proxy\fP value in configuration file. The command\-line option +\fI\%\-\-no\-proxy\fP overrides this value. +.UNINDENT +.SH FILES +.SS aria2.conf +.sp +By default, aria2 checks whether the legacy path +\fB$HOME/.aria2/aria2.conf\fP is present, otherwise it parses +\fB$XDG_CONFIG_HOME/aria2/aria2.conf\fP as its configuration file. You +can specify the path to configuration file using \fI\%\-\-conf\-path\fP +option. If you don\(aqt want to use the configuration file, use +\fI\%\-\-no\-conf\fP option. +.sp +The configuration file is a text file and has 1 option per each +line. In each line, you can specify name\-value pair in the format: +\fBNAME=VALUE\fP, where name is the long command\-line option name without +\fB\-\-\fP prefix. You can use same syntax for the command\-line option. The +lines beginning \fB#\fP are treated as comments: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +# sample configuration file for aria2c +listen\-port=60000 +dht\-listen\-port=60000 +seed\-ratio=1.0 +max\-upload\-limit=50K +ftp\-pasv=true +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +The confidential information such as user/password might be included +in the configuration file. It is recommended to change file mode +bits of the configuration file (e.g., \fBchmod 600 aria2.conf\fP), so +that other user cannot see the contents of the file. +.UNINDENT +.UNINDENT +.sp +The environment variables, such as \fB${HOME}\fP, are expanded by shell. +This means that those variables used in configuration file are not +expanded. However, it is useful to \fB${HOME}\fP to refer user\(aqs home +directory in configuration file to specify file paths. Therefore, +aria2 expands \fB${HOME}\fP found in the following option values to +user\(aqs home directory: +.INDENT 0.0 +.IP \(bu 2 +\fI\%ca\-certificate\fP +.IP \(bu 2 +\fI\%certificate\fP +.IP \(bu 2 +\fI\%dht\-file\-path\fP +.IP \(bu 2 +\fI\%dht\-file\-path6\fP +.IP \(bu 2 +\fI\%dir\fP +.IP \(bu 2 +\fI\%input\-file\fP +.IP \(bu 2 +\fI\%load\-cookies\fP +.IP \(bu 2 +\fI\%log\fP +.IP \(bu 2 +\fI\%metalink\-file\fP +.IP \(bu 2 +\fI\%netrc\-path\fP +.IP \(bu 2 +\fI\%on\-bt\-download\-complete\fP +.IP \(bu 2 +\fI\%on\-download\-complete\fP +.IP \(bu 2 +\fI\%on\-download\-error\fP +.IP \(bu 2 +\fI\%on\-download\-start\fP +.IP \(bu 2 +\fI\%on\-download\-stop\fP +.IP \(bu 2 +\fI\%on\-download\-pause\fP +.IP \(bu 2 +\fI\%out\fP +.IP \(bu 2 +\fI\%private\-key\fP +.IP \(bu 2 +\fI\%rpc\-certificate\fP +.IP \(bu 2 +\fI\%rpc\-private\-key\fP +.IP \(bu 2 +\fI\%save\-cookies\fP +.IP \(bu 2 +\fI\%save\-session\fP +.IP \(bu 2 +\fI\%server\-stat\-if\fP +.IP \(bu 2 +\fI\%server\-stat\-of\fP +.IP \(bu 2 +\fI\%torrent\-file\fP +.UNINDENT +.sp +Note that this expansion occurs even if the above options are used in +the command\-line. This means that expansion may occur 2 times: first, +shell and then aria2c. +.SS dht.dat +.sp +Unless the legacy file paths \fB$HOME/.aria2/dht.dat\fP and +\fB$HOME/.aria2/dht6.dat\fP are pointing to existing files, the routing +table of IPv4 DHT is saved to the path +\fB$XDG_CACHE_HOME/aria2/dht.dat\fP and the routing table of IPv6 DHT is +saved to the path \fB$XDG_CACHE_HOME/aria2/dht6.dat\fP\&. +.SS Netrc +.sp +Netrc support is enabled by default for HTTP(S)/FTP/SFTP. To disable +netrc support, specify \fI\%\-\-no\-netrc\fP option. Your .netrc +file should have correct permissions(600). +.sp +If machine name starts \fB\&.\fP, aria2 performs domain\-match instead of +exact match. This is an extension of aria2. For example of domain +match, imagine the following .netrc entry: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +machine .example.org login myid password mypasswd +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBaria2.example.org\fP domain\-matches \fB\&.example.org\fP and uses \fBmyid\fP and +\fBmypasswd\fP\&. +.sp +Some domain\-match example follow: \fBexample.net\fP does not domain\-match +\fB\&.example.org\fP\&. \fBexample.org\fP does not domain\-match \fB\&.example.org\fP +because of preceding \fB\&.\fP\&. If you want to match \fBexample.org\fP, specify +\fBexample.org\fP\&. +.SS Control File +.sp +aria2 uses a control file to track the progress of a download. A +control file is placed in the same directory as the downloading file +and its file name is the file name of downloading file with \fB\&.aria2\fP +appended. For example, if you are downloading file.zip, then the +control file should be file.zip.aria2. (There is a exception for this +naming convention. If you are downloading a multi torrent, its +control file is the "top directory" name of the torrent with \fB\&.aria2\fP +appended. The "top directory" name is a value of "name" key in "info" +directory in a torrent file.) +.sp +Usually a control file is deleted once download completed. If aria2 +decides that download cannot be resumed(for example, when downloading +a file from a HTTP server which doesn\(aqt support resume), a control +file is not created. +.sp +Normally if you lose a control file, you cannot resume download. But +if you have a torrent or metalink with chunk checksums for the file, +you can resume the download without a control file by giving \-V option +to aria2c in command\-line. +.SS Input File +.sp +The input file can contain a list of URIs for aria2 to download. You +can specify multiple URIs for a single entity: separate URIs on a +single line using the TAB character. +.sp +Each line is treated as if it is provided in command\-line argument. +Therefore they are affected by \fI\%\-\-force\-sequential\fP and \fI\%\-\-parameterized\-uri\fP options. +.sp +Since URIs in the input file are directly read by aria2, they must not +be quoted with single(\fB\(aq\fP) or double(\fB"\fP) quotation. +.sp +Lines starting with \fB#\fP are treated as comments and skipped. +.sp +Additionally, the following options can be specified after each line +of URIs. These optional lines must start with white space(s). +.INDENT 0.0 +.INDENT 2.0 +.IP \(bu 2 +\fI\%all\-proxy\fP +.IP \(bu 2 +\fI\%all\-proxy\-passwd\fP +.IP \(bu 2 +\fI\%all\-proxy\-user\fP +.IP \(bu 2 +\fI\%allow\-overwrite\fP +.IP \(bu 2 +\fI\%allow\-piece\-length\-change\fP +.IP \(bu 2 +\fI\%always\-resume\fP +.IP \(bu 2 +\fI\%async\-dns\fP +.IP \(bu 2 +\fI\%auto\-file\-renaming\fP +.IP \(bu 2 +\fI\%bt\-enable\-hook\-after\-hash\-check\fP +.IP \(bu 2 +\fI\%bt\-enable\-lpd\fP +.IP \(bu 2 +\fI\%bt\-exclude\-tracker\fP +.IP \(bu 2 +\fI\%bt\-external\-ip\fP +.IP \(bu 2 +\fI\%bt\-force\-encryption\fP +.IP \(bu 2 +\fI\%bt\-hash\-check\-seed\fP +.IP \(bu 2 +\fI\%bt\-load\-saved\-metadata\fP +.IP \(bu 2 +\fI\%bt\-max\-peers\fP +.IP \(bu 2 +\fI\%bt\-metadata\-only\fP +.IP \(bu 2 +\fI\%bt\-min\-crypto\-level\fP +.IP \(bu 2 +\fI\%bt\-prioritize\-piece\fP +.IP \(bu 2 +\fI\%bt\-remove\-unselected\-file\fP +.IP \(bu 2 +\fI\%bt\-request\-peer\-speed\-limit\fP +.IP \(bu 2 +\fI\%bt\-require\-crypto\fP +.IP \(bu 2 +\fI\%bt\-save\-metadata\fP +.IP \(bu 2 +\fI\%bt\-seed\-unverified\fP +.IP \(bu 2 +\fI\%bt\-stop\-timeout\fP +.IP \(bu 2 +\fI\%bt\-tracker\fP +.IP \(bu 2 +\fI\%bt\-tracker\-connect\-timeout\fP +.IP \(bu 2 +\fI\%bt\-tracker\-interval\fP +.IP \(bu 2 +\fI\%bt\-tracker\-timeout\fP +.IP \(bu 2 +\fI\%check\-integrity\fP +.IP \(bu 2 +\fI\%checksum\fP +.IP \(bu 2 +\fI\%conditional\-get\fP +.IP \(bu 2 +\fI\%connect\-timeout\fP +.IP \(bu 2 +\fI\%content\-disposition\-default\-utf8\fP +.IP \(bu 2 +\fI\%continue\fP +.IP \(bu 2 +\fI\%dir\fP +.IP \(bu 2 +\fI\%dry\-run\fP +.UNINDENT +.INDENT 2.0 +.IP \(bu 2 +\fI\%enable\-http\-keep\-alive\fP +.IP \(bu 2 +\fI\%enable\-http\-pipelining\fP +.IP \(bu 2 +\fI\%enable\-mmap\fP +.IP \(bu 2 +\fI\%enable\-peer\-exchange\fP +.IP \(bu 2 +\fI\%file\-allocation\fP +.IP \(bu 2 +\fI\%follow\-metalink\fP +.IP \(bu 2 +\fI\%follow\-torrent\fP +.IP \(bu 2 +\fI\%force\-save\fP +.IP \(bu 2 +\fI\%ftp\-passwd\fP +.IP \(bu 2 +\fI\%ftp\-pasv\fP +.IP \(bu 2 +\fI\%ftp\-proxy\fP +.IP \(bu 2 +\fI\%ftp\-proxy\-passwd\fP +.IP \(bu 2 +\fI\%ftp\-proxy\-user\fP +.IP \(bu 2 +\fI\%ftp\-reuse\-connection\fP +.IP \(bu 2 +\fI\%ftp\-type\fP +.IP \(bu 2 +\fI\%ftp\-user\fP +.IP \(bu 2 +\fI\%gid\fP +.IP \(bu 2 +\fI\%hash\-check\-only\fP +.IP \(bu 2 +\fI\%header\fP +.IP \(bu 2 +\fI\%http\-accept\-gzip\fP +.IP \(bu 2 +\fI\%http\-auth\-challenge\fP +.IP \(bu 2 +\fI\%http\-no\-cache\fP +.IP \(bu 2 +\fI\%http\-passwd\fP +.IP \(bu 2 +\fI\%http\-proxy\fP +.IP \(bu 2 +\fI\%http\-proxy\-passwd\fP +.IP \(bu 2 +\fI\%http\-proxy\-user\fP +.IP \(bu 2 +\fI\%http\-user\fP +.IP \(bu 2 +\fI\%https\-proxy\fP +.IP \(bu 2 +\fI\%https\-proxy\-passwd\fP +.IP \(bu 2 +\fI\%https\-proxy\-user\fP +.IP \(bu 2 +\fI\%index\-out\fP +.IP \(bu 2 +\fI\%lowest\-speed\-limit\fP +.IP \(bu 2 +\fI\%max\-connection\-per\-server\fP +.IP \(bu 2 +\fI\%max\-download\-limit\fP +.IP \(bu 2 +\fI\%max\-file\-not\-found\fP +.IP \(bu 2 +\fI\%max\-mmap\-limit\fP +.IP \(bu 2 +\fI\%max\-resume\-failure\-tries\fP +.UNINDENT +.INDENT 2.0 +.IP \(bu 2 +\fI\%max\-tries\fP +.IP \(bu 2 +\fI\%max\-upload\-limit\fP +.IP \(bu 2 +\fI\%metalink\-base\-uri\fP +.IP \(bu 2 +\fI\%metalink\-enable\-unique\-protocol\fP +.IP \(bu 2 +\fI\%metalink\-language\fP +.IP \(bu 2 +\fI\%metalink\-location\fP +.IP \(bu 2 +\fI\%metalink\-os\fP +.IP \(bu 2 +\fI\%metalink\-preferred\-protocol\fP +.IP \(bu 2 +\fI\%metalink\-version\fP +.IP \(bu 2 +\fI\%min\-split\-size\fP +.IP \(bu 2 +\fI\%no\-file\-allocation\-limit\fP +.IP \(bu 2 +\fI\%no\-netrc\fP +.IP \(bu 2 +\fI\%no\-proxy\fP +.IP \(bu 2 +\fI\%out\fP +.IP \(bu 2 +\fI\%parameterized\-uri\fP +.IP \(bu 2 +\fI\%pause\fP +.IP \(bu 2 +\fI\%pause\-metadata\fP +.IP \(bu 2 +\fI\%piece\-length\fP +.IP \(bu 2 +\fI\%proxy\-method\fP +.IP \(bu 2 +\fI\%realtime\-chunk\-checksum\fP +.IP \(bu 2 +\fI\%referer\fP +.IP \(bu 2 +\fI\%remote\-time\fP +.IP \(bu 2 +\fI\%remove\-control\-file\fP +.IP \(bu 2 +\fI\%retry\-wait\fP +.IP \(bu 2 +\fI\%reuse\-uri\fP +.IP \(bu 2 +\fI\%rpc\-save\-upload\-metadata\fP +.IP \(bu 2 +\fI\%seed\-ratio\fP +.IP \(bu 2 +\fI\%seed\-time\fP +.IP \(bu 2 +\fI\%select\-file\fP +.IP \(bu 2 +\fI\%split\fP +.IP \(bu 2 +\fI\%ssh\-host\-key\-md\fP +.IP \(bu 2 +\fI\%stream\-piece\-selector\fP +.IP \(bu 2 +\fI\%timeout\fP +.IP \(bu 2 +\fI\%uri\-selector\fP +.IP \(bu 2 +\fI\%use\-head\fP +.IP \(bu 2 +\fI\%user\-agent\fP +.UNINDENT +.UNINDENT +.sp +These options have exactly same meaning of the ones in the +command\-line options, but it just applies to the URIs it belongs to. +Please note that for options in input file \fB\-\-\fP prefix must be +stripped. +.sp +For example, the content of uri.txt is: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +http://server/file.iso http://mirror/file.iso + dir=/iso_images + out=file.img +http://foo/bar +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +If aria2 is executed with \fB\-i uri.txt \-d /tmp\fP options, then +\fBfile.iso\fP is saved as \fB/iso_images/file.img\fP and it is downloaded +from \fBhttp://server/file.iso\fP and \fBhttp://mirror/file.iso\fP\&. The file +\fBbar\fP is downloaded from \fBhttp://foo/bar\fP and saved as \fB/tmp/bar\fP\&. +.sp +In some cases, \fI\%out\fP parameter has no effect. +See note of \fI\%\-\-out\fP +option for the restrictions. +.SS Server Performance Profile +.sp +This section describes the format of server performance profile. The +file is plain text and each line has several \fBNAME=VALUE\fP pair, +delimited by comma. Currently following NAMEs are recognized: +.INDENT 0.0 +.TP +.B \fBhost\fP +Host name of the server. Required. +.TP +.B \fBprotocol\fP +Protocol for this profile, such as ftp, http. Required. +.TP +.B \fBdl_speed\fP +The average download speed observed in the previous download in +bytes per sec. Required. +.TP +.B \fBsc_avg_speed\fP +The average download speed observed in the previous download in +bytes per sec. This value is only updated if the download is done in +single connection environment and only used by +AdaptiveURISelector. Optional. +.TP +.B \fBmc_avg_speed\fP +The average download speed observed in the previous download in +bytes per sec. This value is only updated if the download is done in +multi connection environment and only used by +AdaptiveURISelector. Optional. +.TP +.B \fBcounter\fP +How many times the server is used. Currently this value is only used +by AdaptiveURISelector. Optional. +.TP +.B \fBlast_updated\fP +Last contact time in GMT with this server, specified in the seconds +since the Epoch(00:00:00 on January 1, 1970, UTC). Required. +.TP +.B \fBstatus\fP +ERROR is set when server cannot be reached or out\-of\-service or +timeout occurred. Otherwise, OK is set. +.UNINDENT +.sp +Those fields must exist in one line. The order of the fields is not +significant. You can put pairs other than the above; they are simply +ignored. +.sp +An example follows: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +host=localhost, protocol=http, dl_speed=32000, last_updated=1222491640, status=OK +host=localhost, protocol=ftp, dl_speed=0, last_updated=1222491632, status=ERROR +.ft P +.fi +.UNINDENT +.UNINDENT +.SH RPC INTERFACE +.sp +aria2 provides JSON\-RPC over HTTP and XML\-RPC over HTTP interfaces that offer +basically the same functionality. aria2 also provides JSON\-RPC +over WebSocket. JSON\-RPC over WebSocket uses the same method signatures +and response format as JSON\-RPC over HTTP, but additionally provides +server\-initiated notifications. See \fI\%JSON\-RPC over WebSocket\fP section for more +information. +.sp +The request path of the JSON\-RPC interface (for both over HTTP and over +WebSocket) is \fB/jsonrpc\fP\&. The request path of the XML\-RPC interface is +\fB/rpc\fP\&. +.sp +The WebSocket URI for JSON\-RPC over WebSocket is +\fBws://HOST:PORT/jsonrpc\fP\&. If you enabled SSL/TLS encryption, use +\fBwss://HOST:PORT/jsonrpc\fP instead. +.sp +The implemented JSON\-RPC is based on JSON\-RPC 2.0 +<\fI\%http://jsonrpc.org/specification\fP>, and +supports HTTP POST and GET (JSONP). The WebSocket transport is +an aria2 extension. +.sp +The JSON\-RPC interface does not support notifications over HTTP, but the +RPC server will send notifications over WebSocket. It also does not +support floating point numbers. The character encoding must be UTF\-8. +.sp +When reading the following documentation for JSON\-RPC, interpret structs as JSON +objects. +.SS Terminology +.sp +GID +.INDENT 0.0 +.INDENT 3.5 +The GID (or gid) is a key to manage each download. Each download will be +assigned a unique GID. The GID is stored as 64\-bit binary value in aria2. +For RPC access, it is represented as a hex string of 16 characters (e.g., +\fB2089b05ecca3d829\fP). Normally, aria2 generates this GID for each +download, but the user can specify GIDs manually using the \fI\%\-\-gid\fP option. When querying downloads by GID, you can specify only the +prefix of a GID as long as it is unique among others. +.UNINDENT +.UNINDENT +.SS RPC authorization secret token +.sp +As of 1.18.4, in addition to HTTP basic authorization, aria2 provides +RPC method\-level authorization. In a future release, HTTP basic +authorization will be removed and RPC method\-level authorization will +become mandatory. +.sp +To use RPC method\-level authorization, the user has to specify an RPC secret +authorization token using the \fI\%\-\-rpc\-secret\fP option. For each RPC +method call, the caller has to include the token prefixed with +\fBtoken:\fP\&. Even when the \fI\%\-\-rpc\-secret\fP option is not used, if the +first parameter in the RPC method is a string and starts with \fBtoken:\fP, it +will removed from the parameter list before the request is being processed. +.sp +For example, if the RPC secret authorization token is \fB$$secret$$\fP, +calling \fIaria2.addUri\fP RPC method would have to look like this: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +aria2.addUri("token:$$secret$$", ["http://example.org/file"]) +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The \fIsystem.multicall\fP RPC method is treated specially. Since the XML\-RPC +specification only allows a single array as a parameter for this method, we +don\(aqt specify the token in the call. Instead, each nested method call has +to provide the token as the first parameter as described above. +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +The secret token validation in aria2 is designed to take at least a certain +amount of time to mitigate brute\-force/dictionary attacks against the RPC +interface. Therefore it is recommended to prefer Batch or \fIsystem.multicall\fP +requests when appropriate. +.sp +\fIsystem.listMethods\fP and \fIsystem.listNotifications\fP can be executed without token. Since they just +return available methods/notifications, they do not alter anything, they\(aqre safe without secret token. +.UNINDENT +.UNINDENT +.SS Methods +.sp +All code examples are compatible with the Python 2.7 interpreter. +For information on the \fIsecret\fP parameter, see \fI\%RPC authorization secret token\fP\&. +.INDENT 0.0 +.TP +.B aria2.addUri([secret], uris[, options[, position]]) +This method adds a new download. \fIuris\fP is an array of +HTTP/FTP/SFTP/BitTorrent URIs (strings) pointing to the same +resource. If you mix URIs pointing to different resources, then the +download may fail or be corrupted without aria2 complaining. When +adding BitTorrent Magnet URIs, \fIuris\fP must have only one element and +it should be BitTorrent Magnet URI. \fIoptions\fP is a struct and its +members are pairs of option name and value. See \fI\%Options\fP +below for more details. If \fIposition\fP is given, it must be an +integer starting from 0. The new download will be inserted at +\fIposition\fP in the waiting queue. If \fIposition\fP is omitted or +\fIposition\fP is larger than the current size of the queue, the new +download is appended to the end of the queue. This method returns +the GID of the newly registered download. +.sp +\fBJSON\-RPC Example\fP +.sp +The following example adds \fBhttp://example.org/file\fP: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addUri\(aq, +\&... \(aqparams\(aq:[[\(aqhttp://example.org/file\(aq]]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> c.read() +\(aq{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.sp +The following example adds \fBhttp://example.org/file\fP: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.addUri([\(aqhttp://example.org/file\(aq]) +\(aq2089b05ecca3d829\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The following example adds a new download with two sources and some options: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> s.aria2.addUri([\(aqhttp://example.org/file\(aq, \(aqhttp://mirror/file\(aq], + dict(dir="/tmp")) +\(aqd2703803b52216d1\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The following example adds a download and inserts it to the front of the +queue: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> s.aria2.addUri([\(aqhttp://example.org/file\(aq], {}, 0) +\(aqca3d829cee549a4d\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.addTorrent([secret], torrent[, uris[, options[, position]]]) +This method adds a BitTorrent download by uploading a ".torrent" file. +If you want to add a BitTorrent Magnet URI, use the \fI\%aria2.addUri()\fP +method instead. \fItorrent\fP must be a base64\-encoded string containing the +contents of the ".torrent" file. +\fIuris\fP is an array of URIs (string). \fIuris\fP is used for +Web\-seeding. For single file torrents, the URI can be a complete URI +pointing to the resource; if URI ends with /, name in torrent file +is added. For multi\-file torrents, name and path in torrent are +added to form a URI for each file. +\fIoptions\fP is a struct and its members are pairs of option name and value. +See \fI\%Options\fP below for more details. +If \fIposition\fP is given, it must be an integer starting from 0. The new +download will be inserted at \fIposition\fP in the waiting queue. If +\fIposition\fP is omitted or \fIposition\fP is larger than the current size of the +queue, the new download is appended to the end of the queue. +This method returns the GID of the newly registered download. +If \fI\%\-\-rpc\-save\-upload\-metadata\fP is \fBtrue\fP, the +uploaded data is saved as a file named as the hex string of SHA\-1 hash of +data plus ".torrent" in the directory specified by \fI\%\-\-dir\fP option. E.g. a file name might be +\fB0a3893293e27ac0490424c06de4d09242215f0a6.torrent\fP\&. If a file with the +same name already exists, it is overwritten! If the file cannot be saved +successfully or \fI\%\-\-rpc\-save\-upload\-metadata\fP is \fBfalse\fP, +the downloads added by this method are not saved by \fI\%\-\-save\-session\fP\&. +.sp +The following examples add local file \fBfile.torrent\fP\&. +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json, base64 +>>> torrent = base64.b64encode(open(\(aqfile.torrent\(aq).read()) +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqasdf\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addTorrent\(aq, \(aqparams\(aq:[torrent]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> c.read() +\(aq{"id":"asdf","jsonrpc":"2.0","result":"2089b05ecca3d829"}\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.addTorrent(xmlrpclib.Binary(open(\(aqfile.torrent\(aq, mode=\(aqrb\(aq).read())) +\(aq2089b05ecca3d829\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.addMetalink([secret], metalink[, options[, position]]) +This method adds a Metalink download by uploading a ".metalink" file. +\fImetalink\fP is a base64\-encoded string which contains the contents of the +".metalink" file. +\fIoptions\fP is a struct and its members are pairs of option name and value. +See \fI\%Options\fP below for more details. +If \fIposition\fP is given, it must be an integer starting from 0. The new +download will be inserted at \fIposition\fP in the waiting queue. If +\fIposition\fP is omitted or \fIposition\fP is larger than the current size of the +queue, the new download is appended to the end of the queue. +This method returns an array of GIDs of newly registered downloads. +If \fI\%\-\-rpc\-save\-upload\-metadata\fP is \fBtrue\fP, the uploaded data +is saved as a file named hex string of SHA\-1 hash of data plus +".metalink" in the directory specified by \fI\%\-\-dir\fP +option. E.g. a file name might be +\fB0a3893293e27ac0490424c06de4d09242215f0a6.metalink\fP\&. If a file with the +same name already exists, it is overwritten! If the file cannot be saved +successfully or \fI\%\-\-rpc\-save\-upload\-metadata\fP is \fBfalse\fP, +the downloads added by this method are not saved by +\fI\%\-\-save\-session\fP\&. +.sp +The following examples add local file file.meta4. +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json, base64 +>>> metalink = base64.b64encode(open(\(aqfile.meta4\(aq).read()) +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addMetalink\(aq, +\&... \(aqparams\(aq:[metalink]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> c.read() +\(aq{"id":"qwer","jsonrpc":"2.0","result":["2089b05ecca3d829"]}\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.addMetalink(xmlrpclib.Binary(open(\(aqfile.meta4\(aq, mode=\(aqrb\(aq).read())) +[\(aq2089b05ecca3d829\(aq] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.remove([secret], gid) +This method removes the download denoted by \fIgid\fP (string). If the specified +download is in progress, it is first stopped. The status of the removed +download becomes \fBremoved\fP\&. +This method returns GID of removed download. +.sp +The following examples remove a download with GID#2089b05ecca3d829. +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.remove\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> c.read() +\(aq{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.remove(\(aq2089b05ecca3d829\(aq) +\(aq2089b05ecca3d829\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.forceRemove([secret], gid) +This method removes the download denoted by \fIgid\fP\&. This method +behaves just like \fI\%aria2.remove()\fP except that this method removes +the download without performing any actions which take time, such as +contacting BitTorrent trackers to unregister the download first. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.pause([secret], gid) +This method pauses the download denoted by \fIgid\fP (string). The status of +paused download becomes \fBpaused\fP\&. If the download was active, the download +is placed in the front of waiting queue. While the status is \fBpaused\fP, +the download is not started. To change status to \fBwaiting\fP, use the +\fI\%aria2.unpause()\fP method. +This method returns GID of paused download. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.pauseAll([secret]) +This method is equal to calling \fI\%aria2.pause()\fP for every active/waiting +download. This methods returns \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.forcePause([secret], gid) +This method pauses the download denoted by \fIgid\fP\&. This method +behaves just like \fI\%aria2.pause()\fP except that this method pauses +downloads without performing any actions which take time, such as contacting +BitTorrent trackers to unregister the download first. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.forcePauseAll([secret]) +This method is equal to calling \fI\%aria2.forcePause()\fP for every +active/waiting download. This methods returns \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.unpause([secret], gid) +This method changes the status of the download denoted by \fIgid\fP (string) from +\fBpaused\fP to \fBwaiting\fP, making the download eligible to be restarted. +This method returns the GID of the unpaused download. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.unpauseAll([secret]) +This method is equal to calling \fI\%aria2.unpause()\fP for every paused +download. This methods returns \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.tellStatus([secret], gid[, keys]) +This method returns the progress of the download denoted by \fIgid\fP (string). +\fIkeys\fP is an array of strings. If specified, the response contains only keys +in the \fIkeys\fP array. If \fIkeys\fP is empty or omitted, the response contains all +keys. This is useful when you just want specific keys and avoid unnecessary +transfers. +For example, \fBaria2.tellStatus("2089b05ecca3d829", ["gid", "status"])\fP +returns the \fIgid\fP and \fIstatus\fP keys only. The response is a struct and +contains following keys. Values are strings. +.INDENT 7.0 +.TP +.B \fBgid\fP +GID of the download. +.TP +.B \fBstatus\fP +\fBactive\fP for currently downloading/seeding downloads. +\fBwaiting\fP for downloads in the queue; download is not started. +\fBpaused\fP for paused downloads. +\fBerror\fP for downloads that were stopped because of error. +\fBcomplete\fP for stopped and completed downloads. +\fBremoved\fP for the downloads removed by user. +.TP +.B \fBtotalLength\fP +Total length of the download in bytes. +.TP +.B \fBcompletedLength\fP +Completed length of the download in bytes. +.TP +.B \fBuploadLength\fP +Uploaded length of the download in bytes. +.TP +.B \fBbitfield\fP +Hexadecimal representation of the download progress. The highest bit +corresponds to the piece at index 0. Any set bits indicate loaded pieces, +while unset bits indicate not yet loaded and/or missing pieces. Any overflow +bits at the end are set to zero. When the download was not started yet, +this key will not be included in the response. +.TP +.B \fBdownloadSpeed\fP +Download speed of this download measured in bytes/sec. +.TP +.B \fBuploadSpeed\fP +Upload speed of this download measured in bytes/sec. +.TP +.B \fBinfoHash\fP +InfoHash. BitTorrent only. +.TP +.B \fBnumSeeders\fP +The number of seeders aria2 has connected to. BitTorrent only. +.TP +.B \fBseeder\fP +\fBtrue\fP if the local endpoint is a seeder. Otherwise \fBfalse\fP\&. +BitTorrent only. +.TP +.B \fBpieceLength\fP +Piece length in bytes. +.TP +.B \fBnumPieces\fP +The number of pieces. +.TP +.B \fBconnections\fP +The number of peers/servers aria2 has connected to. +.TP +.B \fBerrorCode\fP +The code of the last error for this item, if any. The value +is a string. The error codes are defined in the \fI\%EXIT STATUS\fP section. +This value is only available for stopped/completed downloads. +.TP +.B \fBerrorMessage\fP +The (hopefully) human readable error message associated to +\fBerrorCode\fP\&. +.TP +.B \fBfollowedBy\fP +List of GIDs which are generated as the result of this +download. For example, when aria2 downloads a Metalink file, it +generates downloads described in the Metalink (see the +\fI\%\-\-follow\-metalink\fP option). This value is useful to track +auto\-generated downloads. If there are no such downloads, this key will not +be included in the response. +.TP +.B \fBfollowing\fP +The reverse link for \fBfollowedBy\fP\&. A download included in +\fBfollowedBy\fP has this object\(aqs GID in its \fBfollowing\fP value. +.TP +.B \fBbelongsTo\fP +GID of a parent download. Some downloads are a part of another +download. For example, if a file in a Metalink has BitTorrent +resources, the downloads of ".torrent" files are parts of that parent. +If this download has no parent, this key will not be included in the +response. +.TP +.B \fBdir\fP +Directory to save files. +.TP +.B \fBfiles\fP +Returns the list of files. The elements of this list are the same structs +used in \fI\%aria2.getFiles()\fP method. +.TP +.B \fBbittorrent\fP +Struct which contains information retrieved from the .torrent +(file). BitTorrent only. It contains following keys. +.INDENT 7.0 +.TP +.B \fBannounceList\fP +List of lists of announce URIs. If the torrent contains \fBannounce\fP +and no \fBannounce\-list\fP, \fBannounce\fP is converted to the +\fBannounce\-list\fP format. +.TP +.B \fBcomment\fP +The comment of the torrent. \fBcomment.utf\-8\fP is used if available. +.TP +.B \fBcreationDate\fP +The creation time of the torrent. The value is an integer since +the epoch, measured in seconds. +.TP +.B \fBmode\fP +File mode of the torrent. The value is either \fBsingle\fP or \fBmulti\fP\&. +.TP +.B \fBinfo\fP +Struct which contains data from Info dictionary. It contains +following keys. +.INDENT 7.0 +.TP +.B \fBname\fP +name in info dictionary. \fBname.utf\-8\fP is used if available. +.UNINDENT +.UNINDENT +.TP +.B \fBverifiedLength\fP +The number of verified number of bytes while the files are being +hash checked. This key exists only when this download is being +hash checked. +.TP +.B \fBverifyIntegrityPending\fP +\fBtrue\fP if this download is waiting for the hash check in a +queue. This key exists only when this download is in the queue. +.UNINDENT +.sp +\fBJSON\-RPC Example\fP +.sp +The following example gets information about a download with GID#2089b05ecca3d829: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.tellStatus\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqbitfield\(aq: u\(aq0000000000\(aq, + u\(aqcompletedLength\(aq: u\(aq901120\(aq, + u\(aqconnections\(aq: u\(aq1\(aq, + u\(aqdir\(aq: u\(aq/downloads\(aq, + u\(aqdownloadSpeed\(aq: u\(aq15158\(aq, + u\(aqfiles\(aq: [{u\(aqindex\(aq: u\(aq1\(aq, + u\(aqlength\(aq: u\(aq34896138\(aq, + u\(aqcompletedLength\(aq: u\(aq34896138\(aq, + u\(aqpath\(aq: u\(aq/downloads/file\(aq, + u\(aqselected\(aq: u\(aqtrue\(aq, + u\(aquris\(aq: [{u\(aqstatus\(aq: u\(aqused\(aq, + u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]}], + u\(aqgid\(aq: u\(aq2089b05ecca3d829\(aq, + u\(aqnumPieces\(aq: u\(aq34\(aq, + u\(aqpieceLength\(aq: u\(aq1048576\(aq, + u\(aqstatus\(aq: u\(aqactive\(aq, + u\(aqtotalLength\(aq: u\(aq34896138\(aq, + u\(aquploadLength\(aq: u\(aq0\(aq, + u\(aquploadSpeed\(aq: u\(aq0\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The following example gets only specific keys: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.tellStatus\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq, +\&... [\(aqgid\(aq, +\&... \(aqtotalLength\(aq, +\&... \(aqcompletedLength\(aq]]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqcompletedLength\(aq: u\(aq5701632\(aq, + u\(aqgid\(aq: u\(aq2089b05ecca3d829\(aq, + u\(aqtotalLength\(aq: u\(aq34896138\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.sp +The following example gets information about a download with GID#2089b05ecca3d829: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.tellStatus(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +{\(aqbitfield\(aq: \(aqffff80\(aq, + \(aqcompletedLength\(aq: \(aq34896138\(aq, + \(aqconnections\(aq: \(aq0\(aq, + \(aqdir\(aq: \(aq/downloads\(aq, + \(aqdownloadSpeed\(aq: \(aq0\(aq, + \(aqerrorCode\(aq: \(aq0\(aq, + \(aqfiles\(aq: [{\(aqindex\(aq: \(aq1\(aq, + \(aqlength\(aq: \(aq34896138\(aq, + \(aqcompletedLength\(aq: \(aq34896138\(aq, + \(aqpath\(aq: \(aq/downloads/file\(aq, + \(aqselected\(aq: \(aqtrue\(aq, + \(aquris\(aq: [{\(aqstatus\(aq: \(aqused\(aq, + \(aquri\(aq: \(aqhttp://example.org/file\(aq}]}], + \(aqgid\(aq: \(aq2089b05ecca3d829\(aq, + \(aqnumPieces\(aq: \(aq17\(aq, + \(aqpieceLength\(aq: \(aq2097152\(aq, + \(aqstatus\(aq: \(aqcomplete\(aq, + \(aqtotalLength\(aq: \(aq34896138\(aq, + \(aquploadLength\(aq: \(aq0\(aq, + \(aquploadSpeed\(aq: \(aq0\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The following example gets only specific keys: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> r = s.aria2.tellStatus(\(aq2089b05ecca3d829\(aq, [\(aqgid\(aq, \(aqtotalLength\(aq, \(aqcompletedLength\(aq]) +>>> pprint(r) +{\(aqcompletedLength\(aq: \(aq34896138\(aq, \(aqgid\(aq: \(aq2089b05ecca3d829\(aq, \(aqtotalLength\(aq: \(aq34896138\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getUris([secret], gid) +This method returns the URIs used in the download denoted by \fIgid\fP (string). +The response is an array of structs and it contains following keys. +Values are string. +.INDENT 7.0 +.TP +.B \fBuri\fP +URI +.TP +.B \fBstatus\fP +\(aqused\(aq if the URI is in use. \(aqwaiting\(aq if the URI is still waiting in the +queue. +.UNINDENT +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getUris\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [{u\(aqstatus\(aq: u\(aqused\(aq, + u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getUris(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +[{\(aqstatus\(aq: \(aqused\(aq, \(aquri\(aq: \(aqhttp://example.org/file\(aq}] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getFiles([secret], gid) +This method returns the file list of the download denoted by \fIgid\fP (string). +The response is an array of structs which contain following keys. +Values are strings. +.INDENT 7.0 +.TP +.B \fBindex\fP +Index of the file, starting at 1, in the same order as files appear in the +multi\-file torrent. +.TP +.B \fBpath\fP +File path. +.TP +.B \fBlength\fP +File size in bytes. +.TP +.B \fBcompletedLength\fP +Completed length of this file in bytes. Please note that it is +possible that sum of \fBcompletedLength\fP is less than the +\fBcompletedLength\fP returned by the \fI\%aria2.tellStatus()\fP method. +This is because \fBcompletedLength\fP in +\fI\%aria2.getFiles()\fP +only includes completed pieces. On the other hand, \fBcompletedLength\fP +in \fI\%aria2.tellStatus()\fP also includes partially completed pieces. +.TP +.B \fBselected\fP +\fBtrue\fP if this file is selected by \fI\%\-\-select\-file\fP option. If +\fI\%\-\-select\-file\fP is not specified or this is single\-file torrent or +not a torrent download at all, this value is always \fBtrue\fP\&. Otherwise +\fBfalse\fP\&. +.TP +.B \fBuris\fP +Returns a list of URIs for this file. The element type is the same struct +used in the \fI\%aria2.getUris()\fP method. +.UNINDENT +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getFiles\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [{u\(aqindex\(aq: u\(aq1\(aq, + u\(aqlength\(aq: u\(aq34896138\(aq, + u\(aqcompletedLength\(aq: u\(aq34896138\(aq, + u\(aqpath\(aq: u\(aq/downloads/file\(aq, + u\(aqselected\(aq: u\(aqtrue\(aq, + u\(aquris\(aq: [{u\(aqstatus\(aq: u\(aqused\(aq, + u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]}]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getFiles(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +[{\(aqindex\(aq: \(aq1\(aq, + \(aqlength\(aq: \(aq34896138\(aq, + \(aqcompletedLength\(aq: \(aq34896138\(aq, + \(aqpath\(aq: \(aq/downloads/file\(aq, + \(aqselected\(aq: \(aqtrue\(aq, + \(aquris\(aq: [{\(aqstatus\(aq: \(aqused\(aq, + \(aquri\(aq: \(aqhttp://example.org/file\(aq}]}] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getPeers([secret], gid) +This method returns a list peers of the download denoted by \fIgid\fP (string). +This method is for BitTorrent only. The response is an array of structs and +contains the following keys. Values are strings. +.INDENT 7.0 +.TP +.B \fBpeerId\fP +Percent\-encoded peer ID. +.TP +.B \fBip\fP +IP address of the peer. +.TP +.B \fBport\fP +Port number of the peer. +.TP +.B \fBbitfield\fP +Hexadecimal representation of the download progress of the peer. The +highest bit corresponds to the piece at index 0. Set bits indicate the +piece is available and unset bits indicate the piece is missing. Any +spare bits at the end are set to zero. +.TP +.B \fBamChoking\fP +\fBtrue\fP if aria2 is choking the peer. Otherwise \fBfalse\fP\&. +.TP +.B \fBpeerChoking\fP +\fBtrue\fP if the peer is choking aria2. Otherwise \fBfalse\fP\&. +.TP +.B \fBdownloadSpeed\fP +Download speed (byte/sec) that this client obtains from the peer. +.TP +.B \fBuploadSpeed\fP +Upload speed(byte/sec) that this client uploads to the peer. +.TP +.B \fBseeder\fP +\fBtrue\fP if this peer is a seeder. Otherwise \fBfalse\fP\&. +.UNINDENT +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getPeers\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [{u\(aqamChoking\(aq: u\(aqtrue\(aq, + u\(aqbitfield\(aq: u\(aqffffffffffffffffffffffffffffffffffffffff\(aq, + u\(aqdownloadSpeed\(aq: u\(aq10602\(aq, + u\(aqip\(aq: u\(aq10.0.0.9\(aq, + u\(aqpeerChoking\(aq: u\(aqfalse\(aq, + u\(aqpeerId\(aq: u\(aqaria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6\(aq, + u\(aqport\(aq: u\(aq6881\(aq, + u\(aqseeder\(aq: u\(aqtrue\(aq, + u\(aquploadSpeed\(aq: u\(aq0\(aq}, + {u\(aqamChoking\(aq: u\(aqfalse\(aq, + u\(aqbitfield\(aq: u\(aqffffeff0fffffffbfffffff9fffffcfff7f4ffff\(aq, + u\(aqdownloadSpeed\(aq: u\(aq8654\(aq, + u\(aqip\(aq: u\(aq10.0.0.30\(aq, + u\(aqpeerChoking\(aq: u\(aqfalse\(aq, + u\(aqpeerId\(aq: u\(aqbittorrent client758\(aq, + u\(aqport\(aq: u\(aq37842\(aq, + u\(aqseeder\(aq: u\(aqfalse\(aq, + u\(aquploadSpeed\(aq: u\(aq6890\(aq}]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getPeers(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +[{\(aqamChoking\(aq: \(aqtrue\(aq, + \(aqbitfield\(aq: \(aqffffffffffffffffffffffffffffffffffffffff\(aq, + \(aqdownloadSpeed\(aq: \(aq10602\(aq, + \(aqip\(aq: \(aq10.0.0.9\(aq, + \(aqpeerChoking\(aq: \(aqfalse\(aq, + \(aqpeerId\(aq: \(aqaria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6\(aq, + \(aqport\(aq: \(aq6881\(aq, + \(aqseeder\(aq: \(aqtrue\(aq, + \(aquploadSpeed\(aq: \(aq0\(aq}, + {\(aqamChoking\(aq: \(aqfalse\(aq, + \(aqbitfield\(aq: \(aqffffeff0fffffffbfffffff9fffffcfff7f4ffff\(aq, + \(aqdownloadSpeed\(aq: \(aq8654\(aq, + \(aqip\(aq: \(aq10.0.0.30\(aq, + \(aqpeerChoking\(aq: \(aqfalse\(aq, + \(aqpeerId\(aq: \(aqbittorrent client758\(aq, + \(aqport\(aq: \(aq37842\(aq, + \(aqseeder\(aq: \(aqfalse, + \(aquploadSpeed\(aq: \(aq6890\(aq}] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getServers([secret], gid) +This method returns currently connected HTTP(S)/FTP/SFTP servers of +the download denoted by \fIgid\fP (string). The response is an array of +structs and contains the following keys. Values are strings. +.INDENT 7.0 +.TP +.B \fBindex\fP +Index of the file, starting at 1, in the same order as files appear in the +multi\-file metalink. +.TP +.B \fBservers\fP +A list of structs which contain the following keys. +.INDENT 7.0 +.TP +.B \fBuri\fP +Original URI. +.TP +.B \fBcurrentUri\fP +This is the URI currently used for downloading. If redirection is +involved, currentUri and uri may differ. +.TP +.B \fBdownloadSpeed\fP +Download speed (byte/sec) +.UNINDENT +.UNINDENT +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getServers\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [{u\(aqindex\(aq: u\(aq1\(aq, + u\(aqservers\(aq: [{u\(aqcurrentUri\(aq: u\(aqhttp://example.org/file\(aq, + u\(aqdownloadSpeed\(aq: u\(aq10467\(aq, + u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]}]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getServers(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +[{\(aqindex\(aq: \(aq1\(aq, + \(aqservers\(aq: [{\(aqcurrentUri\(aq: \(aqhttp://example.org/dl/file\(aq, + \(aqdownloadSpeed\(aq: \(aq20285\(aq, + \(aquri\(aq: \(aqhttp://example.org/file\(aq}]}] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.tellActive([secret][, keys]) +This method returns a list of active downloads. The response is an array of +the same structs as returned by the \fI\%aria2.tellStatus()\fP method. +For the \fIkeys\fP parameter, please refer to the \fI\%aria2.tellStatus()\fP method. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.tellWaiting([secret], offset, num[, keys]) +This method returns a list of waiting downloads, including paused +ones. +\fIoffset\fP is an integer and specifies the offset from +the download waiting at the front. +\fInum\fP is an integer and specifies the max. number of downloads to be returned. +For the \fIkeys\fP parameter, please refer to the \fI\%aria2.tellStatus()\fP method. +.sp +If \fIoffset\fP is a positive integer, this method returns downloads in the +range of [\fIoffset\fP, \fIoffset\fP + \fInum\fP). +.sp +\fIoffset\fP can be a negative integer. \fIoffset\fP == \-1 points last +download in the waiting queue and \fIoffset\fP == \-2 points the download +before the last download, and so on. Downloads in the response are +in reversed order then. +.sp +For example, imagine three downloads "A","B" and "C" are waiting +in this order. \fBaria2.tellWaiting(0, 1)\fP returns +\fB["A"]\fP\&. \fBaria2.tellWaiting(1, 2)\fP returns \fB["B", "C"]\fP\&. +\fBaria2.tellWaiting(\-1, 2)\fP returns \fB["C", "B"]\fP\&. +.sp +The response is an array of the same structs as returned by +\fI\%aria2.tellStatus()\fP method. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.tellStopped([secret], offset, num[, keys]) +This method returns a list of stopped downloads. +\fIoffset\fP is an integer and specifies the offset from the least recently +stopped download. +\fInum\fP is an integer and specifies the max. number of downloads to be returned. +For the \fIkeys\fP parameter, please refer to the \fI\%aria2.tellStatus()\fP method. +.sp +\fIoffset\fP and \fInum\fP have the same semantics as described in the +\fI\%aria2.tellWaiting()\fP method. +.sp +The response is an array of the same structs as returned by the +\fI\%aria2.tellStatus()\fP method. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.changePosition([secret], gid, pos, how) +This method changes the position of the download denoted by +\fIgid\fP in the queue. +\fIpos\fP is an integer. +\fIhow\fP is a string. If \fIhow\fP is \fBPOS_SET\fP, it moves the download to a +position relative to the beginning of the queue. If \fIhow\fP is \fBPOS_CUR\fP, it +moves the download to a position relative to the current position. If \fIhow\fP is +\fBPOS_END\fP, it moves the download to a position relative to the end of the +queue. If the destination position is less than 0 or beyond the end of +the queue, it moves the download to the beginning or the end of the +queue respectively. The response is an integer denoting the resulting +position. +.sp +For example, if GID#2089b05ecca3d829 is currently in position 3, +\fBaria2.changePosition(\(aq2089b05ecca3d829\(aq, \-1, \(aqPOS_CUR\(aq)\fP will +change its position to 2. Additionally +\fBaria2.changePosition(\(aq2089b05ecca3d829\(aq, 0, \(aqPOS_SET\(aq)\fP will +change its position to 0 (the beginning of the queue). +.sp +The following examples move the download GID#2089b05ecca3d829 to the +front of the queue. +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.changePosition\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq, 0, \(aqPOS_SET\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: 0} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.changePosition(\(aq2089b05ecca3d829\(aq, 0, \(aqPOS_SET\(aq) +0 +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.changeUri([secret], gid, fileIndex, delUris, addUris[, position]) +This method removes the URIs in \fIdelUris\fP from and appends the URIs in +\fIaddUris\fP to download denoted by \fIgid\fP\&. \fIdelUris\fP and \fIaddUris\fP are +lists of strings. A download can contain multiple files and URIs are +attached to each file. \fIfileIndex\fP is used to select which file to +remove/attach given URIs. \fIfileIndex\fP is 1\-based. \fIposition\fP is used +to specify where URIs are inserted in the existing waiting URI +list. \fIposition\fP is 0\-based. When \fIposition\fP is omitted, URIs are +appended to the back of the list. This method first executes the removal +and then the addition. \fIposition\fP is the position after URIs are removed, +not the position when this method is called. When removing an URI, if +the same URIs exist in download, only one of them is removed for each URI +in \fIdelUris\fP\&. In other words, if there are three URIs +\fBhttp://example.org/aria2\fP and you want remove them all, you have to +specify (at least) 3 \fBhttp://example.org/aria2\fP in \fIdelUris\fP\&. This +method returns a list which contains two integers. The first integer is +the number of URIs deleted. The second integer is the number of URIs +added. +.sp +The following examples add the URI \fBhttp://example.org/file\fP to the +file whose index is \fB1\fP and belongs to the download +GID#2089b05ecca3d829. +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.changeUri\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq, 1, [], + [\(aqhttp://example.org/file\(aq]]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: [0, 1]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.changeUri(\(aq2089b05ecca3d829\(aq, 1, [], + [\(aqhttp://example.org/file\(aq]) +[0, 1] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getOption([secret], gid) +This method returns options of the download denoted by \fIgid\fP\&. The +response is a struct where keys are the names of options. +The values are strings. +Note that this method does not return options which +have no default value and have not been set on the command\-line, in +configuration files or RPC methods. +.sp +The following examples get options of the download +GID#2089b05ecca3d829. +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getOption\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqallow\-overwrite\(aq: u\(aqfalse\(aq, + u\(aqallow\-piece\-length\-change\(aq: u\(aqfalse\(aq, + u\(aqalways\-resume\(aq: u\(aqtrue\(aq, + u\(aqasync\-dns\(aq: u\(aqtrue\(aq, + ... +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getOption(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +{\(aqallow\-overwrite\(aq: \(aqfalse\(aq, + \(aqallow\-piece\-length\-change\(aq: \(aqfalse\(aq, + \(aqalways\-resume\(aq: \(aqtrue\(aq, + \(aqasync\-dns\(aq: \(aqtrue\(aq, + .... +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.changeOption([secret], gid, options) +This method changes options of the download denoted by \fIgid\fP (string) +dynamically. \fIoptions\fP is a struct. +The options listed in \fI\%Input File\fP subsection are available, +\fBexcept\fP for following options: +.INDENT 7.0 +.IP \(bu 2 +\fI\%dry\-run\fP +.IP \(bu 2 +\fI\%metalink\-base\-uri\fP +.IP \(bu 2 +\fI\%parameterized\-uri\fP +.IP \(bu 2 +\fI\%pause\fP +.IP \(bu 2 +\fI\%piece\-length\fP +.IP \(bu 2 +\fI\%rpc\-save\-upload\-metadata\fP +.UNINDENT +.sp +Except for the following options, changing the other options of +active download makes it restart (restart itself is managed by +aria2, and no user intervention is required): +.INDENT 7.0 +.IP \(bu 2 +\fI\%bt\-max\-peers\fP +.IP \(bu 2 +\fI\%bt\-request\-peer\-speed\-limit\fP +.IP \(bu 2 +\fI\%bt\-remove\-unselected\-file\fP +.IP \(bu 2 +\fI\%force\-save\fP +.IP \(bu 2 +\fI\%max\-download\-limit\fP +.IP \(bu 2 +\fI\%max\-upload\-limit\fP +.UNINDENT +.sp +This method returns \fBOK\fP for success. +.sp +The following examples set the \fI\%max\-download\-limit\fP option to \fB20K\fP for the download +GID#2089b05ecca3d829. +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.changeOption\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq, +\&... {\(aqmax\-download\-limit\(aq:\(aq10K\(aq}]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aqOK\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.changeOption(\(aq2089b05ecca3d829\(aq, {\(aqmax\-download\-limit\(aq:\(aq20K\(aq}) +\(aqOK\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getGlobalOption([secret]) +This method returns the global options. The response is a struct. Its keys +are the names of options. Values are strings. +Note that this method does not return options which have no default +value and have not been set on the command\-line, in configuration +files or RPC methods. Because global options are used as a template +for the options of newly added downloads, the response contains keys +returned by the \fI\%aria2.getOption()\fP method. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.changeGlobalOption([secret], options) +This method changes global options dynamically. \fIoptions\fP is a struct. +The following options are available: +.INDENT 7.0 +.IP \(bu 2 +\fI\%bt\-max\-open\-files\fP +.IP \(bu 2 +\fI\%download\-result\fP +.IP \(bu 2 +\fI\%keep\-unfinished\-download\-result\fP +.IP \(bu 2 +\fI\%log\fP +.IP \(bu 2 +\fI\%log\-level\fP +.IP \(bu 2 +\fI\%max\-concurrent\-downloads\fP +.IP \(bu 2 +\fI\%max\-download\-result\fP +.IP \(bu 2 +\fI\%max\-overall\-download\-limit\fP +.IP \(bu 2 +\fI\%max\-overall\-upload\-limit\fP +.IP \(bu 2 +\fI\%optimize\-concurrent\-downloads\fP +.IP \(bu 2 +\fI\%save\-cookies\fP +.IP \(bu 2 +\fI\%save\-session\fP +.IP \(bu 2 +\fI\%server\-stat\-of\fP +.UNINDENT +.sp +In addition, options listed in the \fI\%Input File\fP subsection +are available, \fBexcept\fP for following options: +\fI\%checksum\fP, +\fI\%index\-out\fP, +\fI\%out\fP, +\fI\%pause\fP and +\fI\%select\-file\fP\&. +.sp +With the \fI\%log\fP option, you can dynamically start logging or +change log file. To stop logging, specify an empty string("") as the parameter +value. Note that log file is always opened in append mode. This method +returns \fBOK\fP for success. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getGlobalStat([secret]) +This method returns global statistics such as the overall download and +upload speeds. The response is a struct and contains the following +keys. Values are strings. +.INDENT 7.0 +.TP +.B \fBdownloadSpeed\fP +Overall download speed (byte/sec). +.TP +.B \fBuploadSpeed\fP +Overall upload speed(byte/sec). +.TP +.B \fBnumActive\fP +The number of active downloads. +.TP +.B \fBnumWaiting\fP +The number of waiting downloads. +.TP +.B \fBnumStopped\fP +The number of stopped downloads in the current session. This value +is capped by the \fI\%\-\-max\-download\-result\fP option. +.TP +.B \fBnumStoppedTotal\fP +The number of stopped downloads in the current session and \fInot\fP +capped by the \fI\%\-\-max\-download\-result\fP option. +.UNINDENT +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getGlobalStat\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqdownloadSpeed\(aq: u\(aq21846\(aq, + u\(aqnumActive\(aq: u\(aq2\(aq, + u\(aqnumStopped\(aq: u\(aq0\(aq, + u\(aqnumWaiting\(aq: u\(aq0\(aq, + u\(aquploadSpeed\(aq: u\(aq0\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getGlobalStat() +>>> pprint(r) +{\(aqdownloadSpeed\(aq: \(aq23136\(aq, + \(aqnumActive\(aq: \(aq2\(aq, + \(aqnumStopped\(aq: \(aq0\(aq, + \(aqnumWaiting\(aq: \(aq0\(aq, + \(aquploadSpeed\(aq: \(aq0\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.purgeDownloadResult([secret]) +This method purges completed/error/removed downloads to free memory. +This method returns \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.removeDownloadResult([secret], gid) +This method removes a completed/error/removed download denoted by \fIgid\fP +from memory. This method returns \fBOK\fP for success. +.sp +The following examples remove the download result of the download +GID#2089b05ecca3d829. +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.removeDownloadResult\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aqOK\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.removeDownloadResult(\(aq2089b05ecca3d829\(aq) +\(aqOK\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getVersion([secret]) +This method returns the version of aria2 and the list of enabled +features. The response is a struct and contains following keys. +.INDENT 7.0 +.TP +.B \fBversion\fP +Version number of aria2 as a string. +.TP +.B \fBenabledFeatures\fP +List of enabled features. Each feature is given as a string. +.UNINDENT +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getVersion\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqenabledFeatures\(aq: [u\(aqAsync DNS\(aq, + u\(aqBitTorrent\(aq, + u\(aqFirefox3 Cookie\(aq, + u\(aqGZip\(aq, + u\(aqHTTPS\(aq, + u\(aqMessage Digest\(aq, + u\(aqMetalink\(aq, + u\(aqXML\-RPC\(aq], + u\(aqversion\(aq: u\(aq1.11.0\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getVersion() +>>> pprint(r) +{\(aqenabledFeatures\(aq: [\(aqAsync DNS\(aq, + \(aqBitTorrent\(aq, + \(aqFirefox3 Cookie\(aq, + \(aqGZip\(aq, + \(aqHTTPS\(aq, + \(aqMessage Digest\(aq, + \(aqMetalink\(aq, + \(aqXML\-RPC\(aq], + \(aqversion\(aq: \(aq1.11.0\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getSessionInfo([secret]) +This method returns session information. +The response is a struct and contains following key. +.INDENT 7.0 +.TP +.B \fBsessionId\fP +Session ID, which is generated each time when aria2 is invoked. +.UNINDENT +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getSessionInfo\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqsessionId\(aq: u\(aqcd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.getSessionInfo() +{\(aqsessionId\(aq: \(aqcd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.shutdown([secret]) +This method shuts down aria2. This method returns \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.forceShutdown([secret]) +This method shuts down \fBaria2()\fP\&. This method behaves like +:func:\(aqaria2.shutdown\(ga without performing any actions which take time, +such as contacting BitTorrent trackers to unregister downloads first. +This method returns \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.saveSession([secret]) +This method saves the current session to a file specified by the +\fI\%\-\-save\-session\fP option. This method returns \fBOK\fP if it +succeeds. +.UNINDENT +.INDENT 0.0 +.TP +.B system.multicall(methods) +This methods encapsulates multiple method calls in a single request. +\fImethods\fP is an array of structs. The structs contain two keys: +\fBmethodName\fP and \fBparams\fP\&. \fBmethodName\fP is the +method name to call and \fBparams\fP is array containing parameters to the +method call. This method returns an array of responses. The elements +will be either a one\-item array containing the return value of the +method call or a struct of fault element if an encapsulated method call +fails. +.sp +In the following examples, we add 2 downloads. The first one is +\fBhttp://example.org/file\fP and the second one is \fBfile.torrent\fP\&. +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json, base64 +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqsystem.multicall\(aq, +\&... \(aqparams\(aq:[[{\(aqmethodName\(aq:\(aqaria2.addUri\(aq, +\&... \(aqparams\(aq:[[\(aqhttp://example.org\(aq]]}, +\&... {\(aqmethodName\(aq:\(aqaria2.addTorrent\(aq, +\&... \(aqparams\(aq:[base64.b64encode(open(\(aqfile.torrent\(aq).read())]}]]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: [[u\(aq2089b05ecca3d829\(aq], [u\(aqd2703803b52216d1\(aq]]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +JSON\-RPC additionally supports Batch requests as described in the +JSON\-RPC 2.0 Specification: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> jsonreq = json.dumps([{\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addUri\(aq, +\&... \(aqparams\(aq:[[\(aqhttp://example.org\(aq]]}, +\&... {\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqasdf\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addTorrent\(aq, +\&... \(aqparams\(aq:[base64.b64encode(open(\(aqfile.torrent\(aq).read())]}]) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +[{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aq2089b05ecca3d829\(aq}, + {u\(aqid\(aq: u\(aqasdf\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aqd2703803b52216d1\(aq}] +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> mc = xmlrpclib.MultiCall(s) +>>> mc.aria2.addUri([\(aqhttp://example.org/file\(aq]) +>>> mc.aria2.addTorrent(xmlrpclib.Binary(open(\(aqfile.torrent\(aq, mode=\(aqrb\(aq).read())) +>>> r = mc() +>>> tuple(r) +(\(aq2089b05ecca3d829\(aq, \(aqd2703803b52216d1\(aq) +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B system.listMethods() +This method returns all the available RPC methods in an array of +string. Unlike other methods, this method does not require secret +token. This is safe because this method just returns the available +method names. +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqsystem.listMethods\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [u\(aqaria2.addUri\(aq, + u\(aqaria2.addTorrent\(aq, +\&... +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.system.listMethods() +[\(aqaria2.addUri\(aq, \(aqaria2.addTorrent\(aq, ... +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B system.listNotifications() +This method returns all the available RPC notifications in an array of +string. Unlike other methods, this method does not require secret +token. This is safe because this method just returns the available +notifications names. +.sp +\fBJSON\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqsystem.listNotifications\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [u\(aqaria2.onDownloadStart\(aq, + u\(aqaria2.onDownloadPause\(aq, +\&... +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC Example\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.system.listNotifications() +[\(aqaria2.onDownloadStart\(aq, \(aqaria2.onDownloadPause\(aq, ... +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.SS Error Handling +.sp +Over JSON\-RPC, aria2 returns a JSON object which contains an error code in +\fBcode\fP and the error message in \fBmessage\fP\&. +.sp +Over XML\-RPC, aria2 returns \fBfaultCode=1\fP and the error message in +\fBfaultString\fP\&. +.SS Options +.sp +The same options as for \fI\%\-\-input\-file\fP are available. See the +\fI\%Input File\fP subsection for a complete list of options. +.sp +In the option struct, the name element is the option name (without the preceding +\fB\-\-\fP) and the value element is the argument as a string. +.SS JSON\-RPC Example +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +{\(aqsplit\(aq:\(aq1\(aq, \(aqhttp\-proxy\(aq:\(aqhttp://proxy/\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.SS XML\-RPC Example +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C + + + split + 1 + + + http\-proxy + http://proxy/ + + +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The \fI\%header\fP and \fI\%index\-out\fP +options are allowed multiple times on the command\-line. Since the name should be +unique in a struct (many XML\-RPC library implementations use a hash or dict for +struct), a single string is not enough. To overcome this limitation, you may use +an array as the value as well as a string. +.SS JSON\-RPC Example +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +{\(aqheader\(aq:[\(aqAccept\-Language: ja\(aq, \(aqAccept\-Charset: utf\-8\(aq]} +.ft P +.fi +.UNINDENT +.UNINDENT +.SS XML\-RPC Example +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C + + + header + + + + Accept\-Language: ja + Accept\-Charset: utf\-8 + + + + + +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The following example adds a download with two options: \fBdir\fP and \fBheader\fP\&. +The \fBheader\fP option requires two values, so it uses a list: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> opts = dict(dir=\(aq/tmp\(aq, +\&... header=[\(aqAccept\-Language: ja\(aq, +\&... \(aqAccept\-Charset: utf\-8\(aq]) +>>> s.aria2.addUri([\(aqhttp://example.org/file\(aq], opts) +\(aq1\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.SS JSON\-RPC using HTTP GET +.sp +The JSON\-RPC interface also supports requests via HTTP GET. +The encoding scheme in GET parameters is based on JSON\-RPC over HTTP Specification [2008\-1\-15(RC1)]. +The encoding of GET parameters are follows: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +/jsonrpc?method=METHOD_NAME&id=ID¶ms=BASE64_ENCODED_PARAMS +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The \fBmethod\fP and \fBid\fP are always treated as JSON string and their +encoding must be UTF\-8. +.sp +For example, The encoded string of +\fBaria2.tellStatus(\(aq2089b05ecca3d829\(aq)\fP with \fBid=\(aqfoo\(aq\fP looks like +this: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +/jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The \fBparams\fP parameter is Base64\-encoded JSON array which usually +appears in \fBparams\fP attribute in JSON\-RPC request object. In the +above example, the params is \fB["2089b05ecca3d829"]\fP, therefore: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +["2089b05ecca3d829"] \-\-(Base64)\-\-> WyIyMDg5YjA1ZWNjYTNkODI5Il0= + \-\-(Percent Encode)\-\-> WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The JSON\-RPC interface also supports JSONP. You can specify the callback +function in the \fBjsoncallback\fP parameter: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +/jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D&jsoncallback=cb +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +For Batch requests, the \fBmethod\fP and \fBid\fP parameters must not be specified. +The whole request must be specified in the \fBparams\fP parameter. For example, +a Batch request: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +[{\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \(aqmethod\(aq:\(aqaria2.getVersion\(aq}, + {\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqasdf\(aq, \(aqmethod\(aq:\(aqaria2.tellActive\(aq}] +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +must be encoded like this: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +/jsonrpc?params=W3sianNvbnJwYyI6ICIyLjAiLCAiaWQiOiAicXdlciIsICJtZXRob2QiOiAiYXJpYTIuZ2V0VmVyc2lvbiJ9LCB7Impzb25ycGMiOiAiMi4wIiwgImlkIjogImFzZGYiLCAibWV0aG9kIjogImFyaWEyLnRlbGxBY3RpdmUifV0%3D +.ft P +.fi +.UNINDENT +.UNINDENT +.SS JSON\-RPC over WebSocket +.sp +JSON\-RPC over WebSocket uses same method signatures and response +format as JSON\-RPC over HTTP. The supported WebSocket version is 13 +which is detailed in \fI\%RFC 6455\fP\&. +.sp +To send a RPC request to the RPC server, send a serialized JSON string +in a Text frame. The response from the RPC server is delivered also in +a Text frame. +.SS Notifications +.sp +The RPC server might send notifications to the client. Notifications is +unidirectional, therefore the client which receives the notification must not +respond to it. The method signature of a notification is much like a normal +method request but lacks the id key. The value of the params key is the data +which this notification carries. The format of the value varies depending on the +notification method. Following notification methods are defined. +.INDENT 0.0 +.TP +.B aria2.onDownloadStart(event) +This notification will be sent when a download is started. +The \fIevent\fP is of type struct and it contains following keys. +The value type is string. +.INDENT 7.0 +.TP +.B \fBgid\fP +GID of the download. +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onDownloadPause(event) +This notification will be sent when a download is paused. The \fIevent\fP +is the same struct as the \fIevent\fP argument of +\fI\%aria2.onDownloadStart()\fP method. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onDownloadStop(event) +This notification will be sent when a download is stopped by the user. +The \fIevent\fP is the same struct as the \fIevent\fP argument of +\fI\%aria2.onDownloadStart()\fP method. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onDownloadComplete(event) +This notification will be sent when a download is complete. For +BitTorrent downloads, this notification is sent when the download is +complete and seeding is over. The \fIevent\fP is the same struct of the +\fIevent\fP argument of +\fI\%aria2.onDownloadStart()\fP method. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onDownloadError(event) +This notification will be sent when a download is stopped due to an error. +The \fIevent\fP is the same struct as the \fIevent\fP argument of +\fI\%aria2.onDownloadStart()\fP method. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onBtDownloadComplete(event) +This notification will be sent when a torrent download is complete but seeding +is still going on. The \fIevent\fP is the same struct as the \fIevent\fP argument of +\fI\%aria2.onDownloadStart()\fP method. +.UNINDENT +.SS Sample XML\-RPC Client Code +.sp +The following Ruby script adds \fBhttp://localhost/aria2.tar.bz2\fP to +aria2c (running on localhost) with option \fI\%\-\-dir=/downloads\fP and +prints the RPC response: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +#!/usr/bin/env ruby + +require \(aqxmlrpc/client\(aq +require \(aqpp\(aq + +client=XMLRPC::Client.new2("http://localhost:6800/rpc") + +options={ "dir" => "/downloads" } +result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options) + +pp result +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +If you are a Python lover, you can use xmlrpclib (Python3 uses +xmlrpc.client instead) to interact with aria2: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +import xmlrpclib +from pprint import pprint + +s = xmlrpclib.ServerProxy("http://localhost:6800/rpc") +r = s.aria2.addUri(["http://localhost/aria2.tar.bz2"], {"dir":"/downloads"}) +pprint(r) +.ft P +.fi +.UNINDENT +.UNINDENT +.SH MISC +.SS Console Readout +.sp +While downloading files, aria2 prints a readout to the console to show the +progress of the downloads. The console readout looks like this: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +[#2089b0 400.0KiB/33.2MiB(1%) CN:1 DL:115.7KiB ETA:4m51s] +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +This section describes what these numbers and strings mean. +.INDENT 0.0 +.TP +.B \fB#NNNNNN\fP +The first 6 characters of the GID as a hex string. The GID is an unique ID for +each download, internal to aria2. The GID is particularly useful when +interacting with aria2 using the RPC interface. +.TP +.B \fBX/Y(Z%)\fP +Completed length, the total file length and its progress. If +\fI\%\-\-select\-file\fP is used, this is the sum of selected files. +.TP +.B \fBSEED\fP +Share ratio when the aria2 is seeding a finished torrent. +.TP +.B \fBCN\fP +The number of connections aria2 has established. +.TP +.B \fBSD\fP +The number of seeders aria2 is connected to. +.TP +.B \fBDL\fP +Download speed (bytes per second). +.TP +.B \fBUL\fP +Upload speed (bytes per second) and the number of uploaded bytes. +.TP +.B \fBETA\fP +Expected time to finish the download. +.UNINDENT +.sp +When more than one download is in progress, some of the information +described above will be omitted in order to show information for several +downloads. And the overall download and upload speeds are shown at +the beginning of the line. +.sp +When aria2 is allocating file space or validating checksums, it +additionally prints the progress of these operations: +.INDENT 0.0 +.TP +.B FileAlloc +GID, already allocated length and total length in bytes. +.TP +.B Checksum +GID, already validated length and total length in bytes. +.UNINDENT +.SH EXAMPLE +.SS HTTP/FTP Segmented Downloads +.SS Download a file +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c "http://host/file.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +To stop a download, press \fBCtrl\-C\fP\&. You can resume the transfer by +running aria2c with the same argument in the same directory. You can change +URIs as long as they are pointing to the same file. +.UNINDENT +.UNINDENT +.SS Download a file from two different HTTP servers +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c "http://host/file.zip" "http://mirror/file.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download a file from one host using multiple connections +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-x2 \-k1M "http://host/file.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +The \-x option specified the number of allowed connections, while the \-k option +specified the size of chunks. +.UNINDENT +.UNINDENT +.SS Download a file from HTTP and FTP servers at the same time +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c "http://host1/file.zip" "ftp://host2/file.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download files listed in a text file concurrently +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-ifiles.txt \-j2 +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +\-j option specifies the number of parallel downloads. +.UNINDENT +.UNINDENT +.SS Using a proxy +.sp +For HTTP: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-http\-proxy="http://proxy:8080" "http://host/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-http\-proxy="http://proxy:8080" \-\-no\-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://host/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +For FTP: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-ftp\-proxy="http://proxy:8080" "ftp://host/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +See \fI\%\-\-http\-proxy\fP, \fI\%\-\-https\-proxy\fP, \fI\%\-\-ftp\-proxy\fP, +\fI\%\-\-all\-proxy\fP and \fI\%\-\-no\-proxy\fP for details. You can specify +proxy in the environment variables. See \fI\%ENVIRONMENT\fP section. +.UNINDENT +.UNINDENT +.SS Using a Proxy with authorization +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-http\-proxy="http://username:password@proxy:8080" "http://host/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-http\-proxy="http://proxy:8080" \-\-http\-proxy\-user="username" \-\-http\-proxy\-passwd="password" "http://host/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Metalink Download +.SS Download files with remote Metalink +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-follow\-metalink=mem "http://host/file.metalink" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download using a local metalink file +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-p \-\-lowest\-speed\-limit=4000 file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +To stop a download, press \fBCtrl\-C\fP\&. +You can resume the transfer by running aria2c with the same argument in the same +directory. +.UNINDENT +.UNINDENT +.SS Download several local metalink files +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-j2 file1.metalink file2.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download only selected files +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-select\-file=1\-4,8 file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +The index is printed to the console using \-S option. +.UNINDENT +.UNINDENT +.SS Download a file using a local metalink file with user preference +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-metalink\-location=jp,us \-\-metalink\-version=1.1 \-\-metalink\-language=en\-US file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS BitTorrent Download +.SS Download files using a remote BitTorrent file +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-follow\-torrent=mem "http://host/file.torrent" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download using a local torrent file +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-max\-upload\-limit=40K file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +\-\-max\-upload\-limit specifies the max of upload rate. +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +To stop a download, press \fBCtrl\-C\fP\&. You can resume the transfer later by +running aria2c with the same argument in the same directory. +.UNINDENT +.UNINDENT +.SS Download using BitTorrent Magnet URI +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C&dn=aria2" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +Don\(aqt forget to quote BitTorrent Magnet URIs which include \fB&\fP +characters with single(\fB\(aq\fP) or double(\fB"\fP) quotes when specifying URIs on +the command\-line. +.UNINDENT +.UNINDENT +.SS Download 2 torrents +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-j2 file1.torrent file2.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download a file via torrent and HTTP/FTP server in parallel +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-Ttest.torrent "http://host1/file" "ftp://host2/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Only download specific files (usually called "selected download") +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-select\-file=1\-4,8 file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +The index is printed to the console using \-S option. +.UNINDENT +.UNINDENT +.SS Download a .torrent file, but do not download the torrent +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-follow\-torrent=false "http://host/file.torrent" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Specify the output file name +.sp +To specify the output file name for BitTorrent downloads, you need to know +the index of file in the torrent (see \fI\%\-\-show\-files\fP). For +example, the output looks like this: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +idx|path/length +===+====================== + 1|dist/base\-2.6.18.iso + |99.9MiB +\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- + 2|dist/driver\-2.6.18.iso + |169.0MiB +\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +To save \(aqdist/base\-2.6.18.iso\(aq in \(aq/tmp/mydir/base.iso\(aq and +\(aqdist/driver\-2.6.18.iso\(aq in \(aq/tmp/dir/driver.iso\(aq, use the following +command: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-dir=/tmp \-\-index\-out=1=mydir/base.iso \-\-index\-out=2=dir/driver.iso file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Change the listening ports for incoming peer connections +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-listen\-port=7000\-7001,8000 file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +Since aria2 doesn\(aqt configure firewalls or routers for port forwarding, it\(aqs +up to you to do so manually. +.UNINDENT +.UNINDENT +.SS Specify conditions to stop seeding after torrent downloads finish +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-seed\-time=120 \-\-seed\-ratio=1.0 file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +In the above example, the program stops seeding after 120 minutes since +download completed or seed ratio reaches 1.0. +.UNINDENT +.UNINDENT +.SS Throttle upload speed +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-max\-upload\-limit=100K file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Enable IPv4 DHT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-enable\-dht \-\-dht\-listen\-port=6881 file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +DHT uses UDP. Since aria2 doesn\(aqt configure firewalls or routers for port +forwarding, it\(aqs up to you to do it manually. +.UNINDENT +.UNINDENT +.SS Enable IPv6 DHT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-enable\-dht6 \-\-dht\-listen\-port=6881 \-\-dht\-listen\-addr6=YOUR_GLOBAL_UNICAST_IPV6_ADDR +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +aria2 uses the same ports as IPv4 for IPv6. +.UNINDENT +.UNINDENT +.SS Add and remove tracker URIs +.sp +Ignore all tracker announce URIs defined in file.torrent and use +\fBhttp://tracker1/announce\fP and \fBhttp://tracker2/announce\fP instead: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-bt\-exclude\-tracker="*" \-\-bt\-tracker="http://tracker1/announce,http://tracker2/announce" file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SS More advanced HTTP features +.SS Load cookies +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-load\-cookies=cookies.txt "http://host/file.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +You can use Firefox/Mozilla/Chromium\(aqs cookie files without modification. +.UNINDENT +.UNINDENT +.SS Resume download started by web browsers or other programs +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-c \-s2 "http://host/partiallydownloadedfile.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +This will only work when the initial download was not multi\-segmented. +.UNINDENT +.UNINDENT +.SS Client certificate authorization for SSL/TLS +.sp +Specify a PKCS12 file as follows: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-certificate=/path/to/mycert.p12 +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +The file specified in \fI\%\-\-certificate\fP must be contain one PKCS12 encoded +certificate and key. The password must be blank. +.UNINDENT +.UNINDENT +.sp +Alternatively, if PEM files are supported, use a command like the following: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-certificate=/path/to/mycert.pem \-\-private\-key=/path/to/mykey.pem https://host/file +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +The file specified in \fI\%\-\-private\-key\fP must be decrypted. The behavior when +encrypted one is given is undefined. +.UNINDENT +.UNINDENT +.SS Verify SSL/TLS servers using given CA certificates +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-ca\-certificate=/path/to/ca\-certificates.crt \-\-check\-certificate https://host/file +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +This option is only available when aria2 was compiled against GnuTLS or +OpenSSL. +WinTLS and AppleTLS will always use the system certificate store. Instead of +\fB\(ga\-\-ca\-certificate\fP install the certificate in that store. +.UNINDENT +.UNINDENT +.SS RPC +.SS Encrypt RPC traffic with SSL/TLS +.sp +Specify a server PKC12 file: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-enable\-rpc \-\-rpc\-certificate=/path/to/server.p12 \-\-rpc\-secure +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +The file specified in \fI\%\-\-rpc\-certificate\fP must be contain one PKCS12 +encoded certificate and key. The password must be blank. +.UNINDENT +.UNINDENT +.sp +Alternatively, when PEM files are supported (GnuTLS and OpenSSL), specify the +server certificate file and private key file as follows: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-enable\-rpc \-\-rpc\-certificate=/path/to/server.crt \-\-rpc\-private\-key=/path/to/server.key \-\-rpc\-secure +.ft P +.fi +.UNINDENT +.UNINDENT +.SS And more advanced features +.SS Throttle the download speed +.sp +Per\-download: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-max\-download\-limit=100K file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Overall: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-max\-overall\-download\-limit=100K file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Repair a damaged download +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-V file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +Repairing damaged downloads can be done efficiently when used with +BitTorrent or Metalink with chunk checksums. +.UNINDENT +.UNINDENT +.SS Drop connections if download speed is lower than a specified limit +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-lowest\-speed\-limit=10K file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Parameterized URI support +.sp +You can specify set of parts: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-P "http://{host1,host2,host3}/file.iso" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +You can specify numeric sequence: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-Z \-P "http://host/image[000\-100].png" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +The \-Z option is required if the URIs don\(aqt point to the same file, such as in +the above example. +.UNINDENT +.UNINDENT +.sp +You can specify step counter: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-Z \-P "http://host/image[A\-Z:2].png" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Verifying checksums +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-checksum=sha\-1=0192ba11326fe2298c8cb4de616f4d4140213837 http://example.org/file +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Parallel downloads of an arbitrary number of URIs, metalink, torrent +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-j3 \-Z "http://host/file1" file2.torrent file3.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS BitTorrent Encryption +.sp +Encrypt the whole payload using ARC4 (obfuscation): +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-bt\-min\-crypto\-level=arc4 \-\-bt\-require\-crypto=true file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SH SEE ALSO +.sp +Project Web Site: \fI\%https://aria2.github.io/\fP +.sp +Metalink Homepage: \fI\%http://www.metalinker.org/\fP +.sp +The Metalink Download Description Format: \fI\%RFC 5854\fP +.SH COPYRIGHT +.sp +Copyright (C) 2006, 2015 Tatsuhiro Tsujikawa +.sp +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. +.sp +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +.sp +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110\-1301 USA +.sp +In addition, as a special exception, the copyright holders give +permission to link the code of portions of this program with the +OpenSSL library under certain conditions as described in each +individual source file, and distribute linked combinations +including the two. +You must obey the GNU General Public License in all respects +for all of the code used other than OpenSSL. If you modify +file(s) with this exception, you may extend this exception to your +version of the file(s), but you are not obligated to do so. If you +do not wish to do so, delete this exception statement from your +version. If you delete this exception statement from all source +files in the program, then also delete it here. +.\" Generated by docutils manpage writer. +. diff --git a/share/man/pt/man1/aria2c.1 b/share/man/pt/man1/aria2c.1 new file mode 100644 index 0000000000000000000000000000000000000000..8baf3b006da6c4b2396b9d66d7545e231a48f4df --- /dev/null +++ b/share/man/pt/man1/aria2c.1 @@ -0,0 +1,4992 @@ +.\" Man page generated from reStructuredText. +. +.TH "ARIA2C" "1" "21 ago. 2021" "1.36.0" "aria2" +.SH NAME +aria2c \- Utilitário para download super ultra rápido +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.SH SINOPSE +.sp +\fBaria2c\fP [] [|||] ... +.SH DESCRIÇÃO +.sp +\fBAVISO:\fP +.INDENT 0.0 +.INDENT 3.5 +This translation has been outdated quite sometime now, and lacks +many recent changes. Please consult English version manual for +updated information. +.UNINDENT +.UNINDENT +.sp +Observação: Para executar o aria2 em um terminal ou no prompt da +linha de comando do windows, utilize o comando aria2c. +.sp +aria2 é um utilitário para download de arquivos. Os protocolos suportados são +HTTP, HTTPS, FTP, BitTorrent e Metalink. aria2 pode efetuar download de arquivos +a partir de múltiplas fontes e protocolos e tenta utilizar a máxima capacidade +de banda. Há suporte para download de arquivos que tem origem em HTTP, HTTPS, +FTP, BitTorrent e Metalink ao mesmo tempo, enquanto os dados baixados podem ser +(uploaded) e compartilhados pelo BitTorrent. Usando conferência / aferição (checksum) nos +Metalinks, aria2 automaticamente valida o conteúdo dos dados enquanto faz +o download do arquivo como BitTorrent. +.SH OPÇÕES BÁSICAS DO ARIA2 +.SS Opções Comuns +.INDENT 0.0 +.TP +.B \-d, \-\-dir= +O diretório onde será armazenado o arquivo baixado. +.UNINDENT +.INDENT 0.0 +.TP +.B \-i, \-\-input\-file= +Executa download da(s) URI encontradas no ARQUIVO. Podem ser especificados +múltiplos URI para uma simples entidade: separe URI na mesma linha com +um caracter TAB (tabulação). +Quando desejar ler a entrada padrão (stdin) especificar \fB\-\fP (hífen). +Adicionalmente, diversas opções podem ser especificadas após cada linha de URI. +Esta(s) linha(s) opcional(is) deve(m) começar(em) com um ou mais espaços em +branco e possuir(em) apenas uma opção por linha. +Ver subseção \fI\%Arquivo de Entrada\fP para mais detalhes. +Ver também opção \fI\%\-\-deferred\-input\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-l, \-\-log= +O nome do arquivo de log. Se \fB\-\fP for especificado (entrada padrão), log é +gravado em stdout (saída padrão). Se uma string vazia("") é especificada, log +não será gravado em arquivo. +.UNINDENT +.INDENT 0.0 +.TP +.B \-j, \-\-max\-concurrent\-downloads= +Configura o número máximo de downloads paralelos para cada URI (HTTP, +HTTPS, FTP), Torrent e Metalink. Ver também opção \fI\%\-\-split\fP\&. +Padrão: \fB5\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-V, \-\-check\-integrity [true|false] +Verifica a integridade do arquivo validando pedaços hashes ou um hash do +arquivo inteiro. Essa opção tem efeito só em downloads BitTorrent, Metalink +com checksums ou HTTP, HTTPS e FTP com a opção \fI\%\-\-checksum\fP\&. Se pedaços +de hashes são providos, essa opção pode detectar porções danificadas de um +arquivo e efetuar novamente o download desses pedaços. Se especificar hash +do arquivo inteiro, a verificação do hash ocorrerá só ao final do download, +validação que leva em conta o tamanho do arquivo, e o download reinicirá a +partir do início. Se houver especificação de ambos métodos de hash será +utilizado o hash de pedações. +Padrão: +\fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-c, \-\-continue [true|false] +Continua o download a partir de um download parcial, anteriormente +interrompido. Use esta opção para retormar um download iniciado a partir +de um browser (navegador) ou outro programa que faz baixa de arquivos +sequencialmente desde o início. +Atualmente esta opção só é aplicavel a download de HTTP, HTTPS e FTP. +.UNINDENT +.INDENT 0.0 +.TP +.B \-h, \-\-help[=|] +As mensagens de Ajuda são classificadas em temas. Um tema se inicia com +\fB#\fP\&. Por exemplo, digitar \fB\-\-help=#http\fP para obter a explicação do uso das +opções do tema \fB#http\fP\&. Se digitar um termo que não é tema, haverá exibição +das opções que incluem o termo informado. +Valores disponíveis para temas podem ser: \fB#basic\fP, \fB#advanced\fP, +\fB#http\fP, \fB#https\fP, \fB#ftp\fP, +\fB#metalink\fP, \fB#bittorrent\fP, \fB#cookie\fP, \fB#hook\fP, \fB#file\fP, \fB#rpc\fP, +\fB#checksum\fP, \fB#experimental\fP, \fB#deprecated\fP, \fB#help\fP, \fB#all\fP +Padrão: \fB#basic\fP +.UNINDENT +.SS Opções HTTP / FTP +.INDENT 0.0 +.TP +.B \-\-all\-proxy= +Usar este servidor proxy para todos protocolos. Para limpar proxy +previamente definido, use "". Esta configuração pode ser sobreposta através +da especificação de um servidor proxy para um determinado protocolo usando +opções \fI\%\-\-http\-proxy\fP, \fI\%\-\-https\-proxy\fP e \fI\%\-\-ftp\-proxy\fP\&. +Isto afeta todas as URIs. +O formato da opção PROXY é \fB[http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]\fP\&. +Ver também seção \fI\%VARIÁVEIS DE AMBIENTE\fP section. +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +Se usuário e senha são embutidos na URI do proxy eles também podem ser +especificados através das opções +\fI\-\-{http,https,ftp,all}\-proxy\-{usuário,senha}\fP, +aqueles que aparecerem por último assumem a precedência. +Por exemplo, quando temos: +\fBhttp\-proxy\-user=meunome\fP, \fBhttp\-proxy\-passwd=minhasenha\fP +em aria2.conf e especificamos \fB\-\-http\-proxy="http://svrproxy"\fP na +linha de comando, então obtemos como proxy HTTP \fBhttp://svrproxy\fP +com o usuário \fBmeunome\fP e senha \fBminhasenha\fP\&. +.sp +Outro exemplo: quando especificamos na linha de comando: +\fB\-\-http\-proxy="http://usuário:senha@svrproxy" \-\-http\-proxy\-user="meunome" +\-\-http\-proxy\-passwd="minhasenha"\fP, então obtemos proxy HTTP +\fBhttp://svrproxy\fP com usuário \fBmeunome\fP e senha \fBminhasenha\fP\&. +.sp +Mais um exemplo: se especificamos na linha de comando: +\fB\-\-http\-proxy\-user="meunome" \-\-http\-proxy\-passwd="minhasenha" +\-\-http\-proxy="http://utilizador:acesso@svrproxy"\fP, então obtemos +o proxy HTTP \fBhttp://svrproxy\fP com o usuário \fButilizador\fP +e a senha \fBacesso\fP\&. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-all\-proxy\-passwd= +Define senha para a opção \fI\%\-\-all\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-all\-proxy\-user= +Define usuário para opção \fI\%\-\-all\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-checksum== +Define verificação (checksum). TIPO é o tipo de algoritmo(hash). Os tipos de +algoritmos estão listados em \fBAlgoritmos de Hash\fP e podem ser obtidos +através do do comando \fBaria2c \-v\fP\&. DIGEST é o código hexadecimal. Por +examplo, definindo sha\-1 o resultado parece com: +\fBsha\-1=0192ba11326fe2298c8cb4de616f4d4140213838\fP Essa opção aplica\-se +apenas para downloads HTTP, HTTPS e FTP. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-connect\-timeout= +Define o tempo de espera em segundos para estabelecer a conexão com o servidor +proxy. Após o estabelecimento da conexão, esta opção não tem mais efeito, mas +a opção \fI\%\-\-timeout\fP será utilizada. +Padrão: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dry\-run [true|false] +Se \fBtrue\fP é informado, aria2 apenas verifica se o arquivo remoto está +disponível para download dos dados. Esta opção tem efeito em downloads de +servidores HTTP, HTTPS e FTP. Downloads de BitTorrent serão cancelados se for +especificado \fBtrue\fP\&. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-lowest\-speed\-limit= +Fecha a conexão se a velocidade de download é menor ou igual ao valor +especificado, bytes por segundo. +\fB0\fP significa que aria2 não levará em conta limite de velocidade mínima. +Pode ser anexado \fBK\fP ou \fBM\fP (1K = 1024, 1M = 1024K). +Esta opção não abrange downloads do tipo BitTorrent. +Padrão: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-x, \-\-max\-connection\-per\-server= +O número máximo de conexões para um servidor em cada download. +Padrão: \fB1\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-file\-not\-found= +Se aria2 recebe çódigo de retorno "arquivo não encontrado" de um servidor +remoto de HTTP / FTP um NÚMERO de vezes sem obter nenhum byte, então o +download é forçado a falhar. +Especificar \fB0\fP para desabilitar esta opção. Esta opção só é válida +para servidores HTTP / FTP. +Padrão: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-m, \-\-max\-tries= +Define o número de tentativas. \fB0\fP significa ilimitadas. +See also \fI\%\-\-retry\-wait\fP\&. +Padrão: \fB5\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-k, \-\-min\-split\-size= +aria2 não divide menos que 2 * TAMANHO o intervalo de bytes. Por exemplo, +considere download de um arquivo de 20MiB. Se o TAMANHO é 10M, aria2 pode +dividir o arquivo em 2 intervalos de [0\-10MiB) e [10MiB\-20MiB) e executar o +download usando 2 fontes (logicamente se a opção \fI\%\-\-split\fP >= 2). +Se o TAMANHO é 15M, desde que 2 * 15M > 20Mib, aria2 não dividirá o arquivo e +fará o download de 1 fonte. Pde ser anexado \fBK\fP ou \fBM\fP +(1K = 1024, 1M = 1024K). +Valores Possíveis: \fB1M\fP \-\fB1024M\fP +Padrão: \fB20M\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-n, \-\-no\-netrc [true|false] +Desabilita suporte netrc. +Padrão: Suporte a netrc é habilitado por padrão. +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +arquivo netrc é lido somente no início se a opção \fI\%\-\-no\-netrc\fP é +\fBfalse\fP\&. +Portanto se a opção \fI\%\-\-no\-netrc\fP é \fBtrue\fP no início, não haverá +netrc disponível durante toda a sessão, mesmo que seja utilizada a opção +\fI\%aria2.changeGlobalOption()\fP para executar a opção :option: +\fI\-\-no\-netrc=false <\-n>\fP\&. +\&. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-proxy= +Especifica nomes de servidores, domínios e endereços de redes com ou sem blocos +CIDR para os quais não serão utilizados proxy. +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +Para endereço de rede com blocos CIDR, ambos endereços IPv4 ou IPv6 funcionam. +Implementação atual, não resolve nome host em URI para comparar com endereço +especificado na opção \fI\%\-\-no\-proxy\fP\&. Portanto só será efetiva se a URI +possuir números de endereço IP. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-o, \-\-out= +O nome do arquivo baixado. Quando a opção \fI\%\-\-force\-sequential\fP é +utilizada esta opção será ignorada. +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +Em um download Metalink ou BitTorrent não poderá ser especificado o nome +do arquivo. O nome do arquivo especificado aqui é usado quando através +da linha de comando é informada para o aria2 sem a utilização da opção +\fI\%\-\-input\-file\fP, \fI\%\-\-force\-sequential\fP\&. +Por exemplo: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-o meuarquivo.zip "http://server1/arquivo.zip" "http://server2/arquivo.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-proxy\-method= +Define o método utilizado para requisições de proxy. MÉTODO é \fBget\fP ou +\fBtunnel\fP\&. Downloads HTTPS sempre utiliza \fBtunnel\fP, independentemente +desta opção. +Padrão: \fBget\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-R, \-\-remote\-time [true|false] +Recuperar timestamp do arquivo remoto a partir do servidor remoto HTTP / FTP +e se disponível, aplicá\-lo ao arquivo local. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-reuse\-uri [true|false] +Reutilizar uma URI já utilizada. Se não habilitada as URIs já utilizadas serão +abandonadas. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-retry\-wait= +Define quantos segundos haverá entre as tentativas. Com SEGUNDOS > 0, aria2 irá +tentará fazer o download quando o servidor HTTP retornar código resposta 503. +Padrão: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-server\-stat\-of= +Define o nome do arquivo no qual será salvo o perfil de performance de um +ou mais servidores acessados. +Para carregar dados já salvos utilizar opção \fI\%\-\-server\-stat\-if\fP\&. +Ver subseção \fI\%Perfil Performance Servidor\fP abaixo, +para o formato do arquivo. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-server\-stat\-if= +Specify the filename to load performance profile of the servers. The +loaded data will be used in some URI selector such as \fBfeedback\fP\&. +See also \fI\%\-\-uri\-selector\fP option. See +\fI\%Perfil Performance Servidor\fP +subsection below for file format. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-server\-stat\-timeout= +Specifies timeout in seconds to invalidate performance profile of +the servers since the last contact to them. +Padrão: \fB86400\fP (24hours) +.UNINDENT +.INDENT 0.0 +.TP +.B \-s, \-\-split= +Download a file using N connections. If more than N URIs are given, +first N URIs are used and remaining URIs are used for backup. If +less than N URIs are given, those URIs are used more than once so +that N connections total are made simultaneously. The number of +connections to the same host is restricted by +\fI\%\-\-max\-connection\-per\-server\fP option. +See also \fI\%\-\-min\-split\-size\fP option. +Padrão: \fB5\fP +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +Some Metalinks regulate the number of servers to connect. aria2 +strictly respects them. This means that if Metalink defines the +maxconnections attribute lower than N, then aria2 uses the +value of maxconnections attribute instead of N. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stream\-piece\-selector= +Specify piece selection algorithm used in HTTP e FTP download. Piece +means fixed length segment which is downloaded in parallel in +segmented download. If \fBdefault\fP is given, aria2 selects piece so +that it reduces the number of establishing connection. This is +reasonable default behaviour because establishing connection is an +expensive operation. If \fBinorder\fP is given, aria2 selects piece +which has minimum index. Index=0 means first of the file. This will +be useful to view movie while downloading it. +\fI\%\-\-enable\-http\-pipelining\fP option may +be useful to reduce reconnection overhead. Please note that aria2 +honors +\fI\%\-\-min\-split\-size\fP option, +so it will be necessary to specify a reasonable value to +\fI\%\-\-min\-split\-size\fP option. +If \fBgeom\fP is given, at the beginning aria2 selects piece which has +minimum index like \fBinorder\fP, but it exponentially increasingly +keeps space from previously selected piece. This will reduce the +number of establishing connection and at the same time it will +download the beginning part of the file first. This will be useful +to view movie while downloading it. +Padrão: \fBdefault\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-t, \-\-timeout= +Set timeout in seconds. +Padrão: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-uri\-selector= +Specify URI selection algorithm. The possible values are \fBinorder\fP, +\fBfeedback\fP and \fBadaptive\fP\&. If \fBinorder\fP is given, URI is tried in +the order appeared in the URI list. If \fBfeedback\fP is given, aria2 +uses download speed observed in the previous downloads and choose +fastest server in the URI list. This also effectively skips dead +mirrors. The observed download speed is a part of performance +profile of servers mentioned in \fI\%\-\-server\-stat\-of\fP and +\fI\%\-\-server\-stat\-if\fP options. If \fBadaptive\fP is given, selects one of +the best mirrors for the first and reserved connections. For +supplementary ones, it returns mirrors which has not been tested +yet, and if each of them has already been tested, returns mirrors +which has to be tested again. Otherwise, it doesn\(aqt select anymore +mirrors. Like \fBfeedback\fP, it uses a performance profile of servers. +Padrão: \fBfeedback\fP +.UNINDENT +.SS Opções Específicas de HTTP e HTTPS +.INDENT 0.0 +.TP +.B \-\-ca\-certificate= +Utilizar o certificado do ARQUIVO FILE para verificar os Servidores. +O certificado precisa estar no formato PEM e pode conter múltiplos +certificados CA. +.sp +Utilizar a opção \fI\%\-\-check\-certificate\fP para habilitar a verificação. +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +Se aria2 foi compilado com OpenSSL ou versão mais recente de GnuTLS a qual +tem a função \fBgnutls_certificate_set_x509_system_trust()\fP e a biblioteca +foi adequadamente configurada para localizar o certificado CA existente, +aria2 irá carregar automaticamente estes certificados no início. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-certificate= +Usar arquivo com certificado cliente. +O certificado deve estar no formato PEM. +Pode ser usada a opção \fI\%\-\-private\-key\fP para especificar uma chave +particular. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-check\-certificate [true|false] +Verifica se o peer esta usando o certificado especificado na opção +\fI\%\-\-ca\-certificate\fP\&. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-accept\-gzip [true|false] +Envia cabeçalho requisição \fBAccept: deflate, gzip\fP e faz (inflate) se +o servidor remoto responder com \fBContent\-Encoding: gzip\fP ou +\fBContent\-Encoding: deflate\fP\&. Padrão: \fBfalse\fP +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +Alguns servidores respondem com \fBContent\-Encoding: gzip\fP para arquivos +que são gzip. aria2 faz inflate destes por causa do cabeçalho de resposta. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-auth\-challenge [true|false] +Envia cabeçalho de autorização HTTP só quando requisitado pelo servidor. +Se \fBfalse\fP é habilitado, então o cabeçalho de autorização sempre será +enviado ao servidor. Há uma exceção: se o nome do usuário de senha são +embutidas na URI, o cabeçalho de autorização sempre será enviado ao servidor +independente desta opção. Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-no\-cache [true|false] +Envia Cache\-Control: no\-cache e Pragma: cabeçalho no\-cache para evitar +conteúdo do cache. Se \fBfalse\fP é fornecido, esses cabeçalhos não serão +enviados e poderá ser adicionado o cabeçalho de Cache\-Control com a diretiva +desejada usando a opção \fI\%\-\-header\fP\&. Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-user= +Define usuário HTTP. Isto afeta todas as URIs. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-passwd= +Define senha HTTP. Isto afeta todas as URIs. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-proxy= +Usar este servidor proxy para HTTP. Para limpar o proxy anteriormente +definido use "". Ver também opção \fI\%\-\-all\-proxy\fP\&. Isto afeta todas +URIs. O formato de PROXY é \fB[http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-proxy\-passwd= +Define a senha para opção \fI\%\-\-http\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-proxy\-user= +Define o usuário para a opção \fI\%\-\-http\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-https\-proxy= +Usar este servidor proxy para HTTPS. Para limpar o proxy anteriormente, +use "". Ver também opção \fI\%\-\-all\-proxy\fP\&. Isto afeta todas URIs. O +formato de PROXY é \fB[https://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-https\-proxy\-passwd= +Define senha para a opção \fI\%\-\-https\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-https\-proxy\-user= +Define usuário para a opção \fI\%\-\-https\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-private\-key= +Define o arquivo de chave particular que será usado. +A chave particular deve estar no formato PEM e não pode estar criptografada. +O comportamento quando estiver criptografada é indefinido. +Ver também a opção \fI\%\-\-certificate\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-referer= +Define a referência. Afeta todas URIs. Se \fB*\fP é usado, cada URI requisitada é usada +como referência (referer). Pode ser útil quando usado em conjunto com a opção +\fI\%\-\-parameterized\-uri\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-http\-keep\-alive [true|false] +Enable HTTP/1.1 persistent connection. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-http\-pipelining [true|false] +Habilita pipelining para HTTP/1.1. +Padrão: \fBfalse\fP +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +Da perspectiva de performance, não há vantagem em habilitar esta opção. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-header=
+Anexa CABEÇALHOao ao cabeçalho HTTP requisitado. +Pode usar esta opção várias vezes para especificar múltiplos cabeçalhos: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-header="X\-A: b78" \-\-header="X\-B: 9J1" "http://servidor/arquivo" +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-load\-cookies= +Carregar Cookies do ARQUIVO usando formato Firefox3 format (SQLite3), +Chromium / Google Chrome (SQLite3) e formato +Mozilla / Firefox(1.x/2.x) / Netscape. +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +Se aria2 é compilado sem libsqlite3, então não havera suporte aos formatos +de cookie Firefox3 e Chromium / Google Chrome. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-save\-cookies= +Salva Cookies para o ARQUIVO no formato Mozilla / Firefox(1.x/2.x) / +Netscape. Se ARQUIVO já existe, será sobreposto. Cookies da Sessão também +serão salvos e seus valores de expiração serão tratados como 0. +Valores Possíveis: \fB/caminho/do/arquivo\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-use\-head [true|false] +Usar método HEAD para a primeira requisição ao servidor HTTP. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-U, \-\-user\-agent= +Define usuário agente para download HTTP, HTTPS. +Padrão: \fBaria2/$VERSION\fP, $VERSION é substituída pela versão do aria2. +.UNINDENT +.SS Opções Específicas de FTP +.INDENT 0.0 +.TP +.B \-\-ftp\-user= +Definir o usuário FTP. Isto afeta todas as URIs. +Padrão: \fBanonymous\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-passwd= +Definir senha FTP. Isto afeta todas as URIs. +Se o nome existe, mas a senha esta ausente, para login em uma URI, aria2 +tenta obter a senha usando o arquivo .netrc, caso exista senha declarada +no .netrc. Se não existir será utilizada a senha declarada nesta opção. +Padrão: \fBARIA2USER@\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-p, \-\-ftp\-pasv [true|false] +Usar modo passivo no FTP. +Se \fBfalse\fP é informado, o modo ativo será usado. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-proxy= +Usar este servidor proxy para FTP. Para limpar definição proxy previamente +definido, use "". Ver também opção \fI\%\-\-all\-proxy\fP\&. +Isto afeta todas URIs. O formato do PROXY é +\fB[http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-proxy\-passwd= +Define senha para a opção \fI\%\-\-ftp\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-proxy\-user= +Define senha para opção \fI\%\-\-ftp\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-type= +Define tipo de transferência FTP. Que pode ser: \fBbinary\fP ou \fBascii\fP\&. +Padrão: \fBbinary\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-reuse\-connection [true|false] +Reutilizar conexão FTP. +Padrão: \fBtrue\fP +.UNINDENT +.SS Opções Comuns de BitTorrent / Metalink +.INDENT 0.0 +.TP +.B \-\-select\-file=... +Define arquivo para download através da especificação de seu index. +Para achar o index do arquivo use a opção \fI\%\-\-show\-files\fP\&. +Múltiplos indíces podem ser especificados usando\-se \fB,\fP, por exemplo: +\fB3,6\fP\&. Também pode ser usado \fB\-\fP para especificar intervalos: +\fB1\-5\fP\&. Ambos podem ser usados juntos \fB,\fP e \fB\-\fP exemplo: +\fB1\-5,8,9\fP\&. Quando usados com a opção \-M, o índice pode variar dependendo +das opções da query. Ver opções (\fI\-\-metalink\-*\fP). +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +Em torrent de múltiplos arquivos, os arquivos adjacentes especificados +por essa opção também podem ser baixados. Esse é o comportamento esperado +não é um bug/erro. Um simples pedaço pode incluir diversos arquivos ou +partes de arquivos, e aria2 grava o pedaço(s) no(s) arquivo(s) +apropriado(s). +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-S, \-\-show\-files [true|false] +Imprimir a lista de arquivos do ".torrent", ".meta4" e ".metalink" e termina. +No caso de arquivo ".torrent", informações adicionais são impressas. +(infohash, tamanho pedaço, etc). +.UNINDENT +.SS Opções Específicas de BitTorrent +.INDENT 0.0 +.TP +.B \-\-bt\-enable\-lpd [true|false] +Habilita Descobrir Peer Local. Se indicador particular é configurado +no torrent, aria2 não usa esta funcionalidade mesmo que \fBtrue\fP foi +informato. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-exclude\-tracker=[,...] +Lista separada por vírgulas, de trackers de URI BitTorrent que devem ser +removidas. Pode ser usado o valor especial \fB*\fP para especificar todas +URIs; isso irá excluir todas URIs de "announce". Quando especificar \fB*\fP +em uma linha de comando do shell, lembre\-se de forçar o escape or delimite +com aspas, apóstrofo ou em linux com crase caracter \fI\&. +Ver também opção :option: \(ga\-\-bt\-tracker\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-external\-ip= +Especificar o IP externo para reportar um track BitTorrent. Mesmo que esta +função tenha o nome \fBexternal\fP, ela pode aceitar qualquer tipo de endereço +IP. ENDEREÇO\-IP deve ser um endereço IP numérico. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-hash\-check\-seed [true|false] +Se \fBtrue\fP é informado, após o check do hash usando a opção :option: +\fI\-\-check\-integrity <\-V>\fP e o arquivo esta completo, continue o arquivo seed. +Se desejar verificar o arquivo e efetuar o download somente quando ele estiver +imcompleto ou danificado, defina esta opção para \fBfalse\fP\&. Esta opção +só tem efeito para download de BitTorrent. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-lpd\-interface= +Use o interface de rede informado para Descobrir o Peer Local. Se esta opção +não é especificada, o interface padrão é usado. Pode ser especificado o nome +do interface e o endereço IP. +Valores possíveis: interface, endereço IP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-max\-open\-files= +Especificar o número máximo de arquivos para abrir para cada download +BitTorrent. +Padrão: \fB100\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-max\-peers= +Especificar o número máximo de peers para cada torrent. \fB0\fP significa +ilimitado. Ver também a opção :option: \fI\-\-bt\-request\-peer\-speed\-limit\fP\&. +Padrão: \fB55\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-metadata\-only [true|false] +Download somente os metadados. O(s) arquivo(s) descrito(s) no(s) metadado(s) +não será(ão) baixado(s). Esta opção só tem efeito para URI BitTorrent Magnet. +Ver também a opção :option: \fI\-\-bt\-save\-metadata\fP\&. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-min\-crypto\-level=plain|arc4 +Define o nível mínimo do método de critografia. +Se existem diversos métodos são fornecidos por um peer, aria2 escolhe o que +satisfaz o menor nível especificado. +Padrão: \fBplain\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-prioritize\-piece=head[=],tail[=] +Tentar primeiramente o download do primeiro e último pedaço de cada arquivo +Isto é útil para ver antecipadamente os arquivos. O argumento pode conter +duas palavras chave: +\fBhead\fP e \fBtail\fP\&. Para incluir ambos, devem estar separados por vírgula. +Estas palavras chave possuem um parâmetro tamanho. Por examplo, +se \fBhead=\fP é especificado, pedaço no intervalo do número de bytes +iniciais de cada arquivo terão prioridade. \fBtail=\fP significa +que o intervalo final no TAMANHO informado de cada arquivo. TAMANHO pode +incluir \fBK\fP ou \fBM\fP (1K = 1024, 1M = 1024K). Se TAMANHO é omitido, +TAMNHA de 1M será usado. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-remove\-unselected\-file [true|false] +Remove os arquivos não selecionados quando o download do BitTorrent estiver +completo. Para selecionar arquivo(s) use a opção \fI\%\-\-select\-file\fP\&. +Se não for usada esta opção, é assumido que todos os arquivos serão +selecionados. Use esta opção com critério pois ela realmente remove +arquivo(s) do seu disco. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-require\-crypto [true|false] +Se true é informado, aria2 não aceita nem estabelece conexão com handshake de +BitTorrent (protocolo 19BitTorrent). Em vez disso aria2 usa +(Obfuscation handshake. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-request\-peer\-speed\-limit= +Se a velocidade total de download do torrent é menor que a , +aria2 temporariamente incrementa o número de peers para tentar maior +velocidade de download. Configurando esta opção com sua velocidade +preferida pode incrementar a velocidade de download em alguns casos. Pode +ser anexado \fBK\fP ou \fBM\fP (1K = 1024, 1M = 1024K). +Padrão: \fB50K\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-save\-metadata [true|false] +Salvar metadados como arquivo ".torrent" file. Esta opção tem efeito somente +se URI usada é de BitTorrent Magnet. O nome do arquivo é codificado em hash +em hexadecimal com sufixo de ".torrent". O diretório onde será salvo o +o metadado, é o mesmo onde aponta o download do arquivo. Se o arquivo já +existe, o metadado não será salvo. Ver tambémn a opção :option: +\fI\-\-bt\-metadata\-only\fP\&. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-seed\-unverified [true|false] +Faz Seed do arquivo previamente baixado sem verificar os hashes dos pedaços. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-stop\-timeout= +Interrompe o download do BitTorrent se a velocidade do for zero por +consecutivos SEGUNDOS. Se \fB0\fP é informado, esta funcionalidade é +desabilitada. +Padrão: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-tracker=[,...] +Lista URI, separada por vírgulas, dos rastreadores BitTorrent. Estas URIs não +são afetadas pela opção \fI\%\-\-bt\-exclude\-tracker\fP, porque elas são +adicionadas após as URIs da opção \fI\%\-\-bt\-exclude\-tracker\fP serem +removidas. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-tracker\-connect\-timeout= +Define o tempo de conexão em segundos para estabelecera conexão com o tracker. +Após a conexão ser estabelecida, esta opção não tem mais efeito e a opção +\fI\%\-\-bt\-tracker\-timeout\fP é usada. +Padrão: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-tracker\-interval= +Define o intervalo em segundos, entre as requisições ao tracker / rastreador. +Isso sobrepõe o valor do intervalo e aria2 passa a usá\-los e ignorar o +valor mínimo de resposta do tracker / rastreador. Se \fB0\fP é definido, aria2 +assume que o intervalo será baseado no tracker / rastreador e o download +irá prosseguir. +Padrão: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-tracker\-timeout= +Define em segundos o intervalo do timeout. +Padrão: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-entry\-point=: +Define servidor e a porta da rede DHT IPv4. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-entry\-point6=: +Define servidor e a porta da rede DHT IPv6. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-file\-path= +Modifica o caminho (CAMINHO) para o arquivo da tabela de roteamento DHT IPv4. +Padrão: \fB$HOME/.aria2/dht.dat\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-file\-path6= +Modifica o caminho (CAMINHO) para o arquivo da tabela de roteamento DHT IPv6. +Padrão: \fB$HOME/.aria2/dht6.dat\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-listen\-addr6= +Define o endereço para o bind do socket para DHT IPv6. Deve ser endereço +global IPv6 do servidor. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-listen\-port=... +Define portas UDP para ouvir para DHT (IPv4 e IPv6) e rastreador UDP. +Múltiplas portas podem ser especificadas através do uso de \fB,\fP, +por exemplo: \fB6881,6885\fP\&. Também pode ser usado \fB\-\fP para especificar +intervalo, exemplo: \fB6881\-6999\fP\&. Ambos \fB,\fP and \fB\-\fP podem ser +usados em conjunto. +Padrão: \fB6881\-6999\fP +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +Cerfifique\-se que as portas especificadas estão disponíveis para tráfego UDP +de entrada. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-message\-timeout= +Define timeout em segundos. +Padrão: \fB10\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-dht [true|false] +Habilita funcionalidade DHT IPv4. Tambem habilita suporte a rastreador UDP. +Se um identificador particular é usado em um torrente, aria2 não usa DHT +para aquele download, mesmo que \fBtrue\fP foi informado. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-dht6 [true|false] +Habilita funcionalidade DHT IPv6. Se identificador particular é usado em um +torrent, aria2 não usa DHT para aquele download mesmo que \fBtrue\fP foi +informado. Usar opção \fI\%\-\-dht\-listen\-port\fP para especificar número(s) +de porta(s) para ser(em) ouvida(s). Ver também opção :option:\(ga +\-\-dht\-listen\-addr6\(ga +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-peer\-exchange [true|false] +Habilita extensão Peer Exchange. Se um indicador particular é usado nesse +torrent, essa funcionalidade será desabilitada para o download, mesmo que +\fBtrue\fP foi informado. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-follow\-torrent=true|false|mem +Se \fBtrue\fP ou \fBmem\fP é especificado, quando um arquivo cujo sufixo é +\fB\&.torrent\fP ou o tipo de conteúdo é \fBapplication/x\-bittorrent\fP é baixado, +aria2 faz o parse como arquivo torrent e executa o download dos arquivos +mencionados nele. +Se \fBmem\fP é especificado, o arquivo torrent não será gravado em disco, apenas +será mantido em memória. +Se \fBfalse\fP é especificado, a ação acima descrita não será executada. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-O, \-\-index\-out== +Define o caminho do arquivo com índice=INDEX. O arquivo índice pode ser +localizado usando\-se a opção \fI\%\-\-show\-files\fP\&. PATH é o caminho +relativo ao caminho especificado na opção \fI\%\-\-dir\fP\&. +Esta opção pode ser usada múltiplas vezes. Com esta opção pode\-se especificar +o nome dos arquivos que serão baixados pelo BitTorrent. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-listen\-port=... +Define o número das portas TCP para download de BitTorrent. +Multiplas portas são especificadas usando \fB,\fP, por exemplo: \fB6881,6885\fP\&. +Também pode usar \fB\-\fP para especificar intervalos: \fB6881\-6999\fP\&. +Ambos \fB,\fP and \fB\-\fP podem ser usados em conjunto: \fB6881\-6889,6999\fP\&. +Padrão: \fB6881\-6999\fP +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +Certifique\-se que as portas estejam habilitadas para tráfego TCP de entrada. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-overall\-upload\-limit= +Define a velocidade máxima geral de upload em bytes/seg. \fB0\fP significa +irrestrito. Pode anexar \fBK\fP ou \fBM\fP (1K = 1024, 1M = 1024K). Para +limitar a velocidade de upload por torrent, usar opção +\fI\%\-\-max\-upload\-limit\fP\&. +Padrão: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-u, \-\-max\-upload\-limit= +Define a velocidade máxima para cada torrent em bytes/seg. \fB0\fP significa +irrestrito. Pode anexar \fBK\fP ou \fBM\fP (1K = 1024, 1M = 1024K). Para +limitar a velocidade global de upload de torrent, usar opção +\fI\%\-\-max\-overall\-upload\-limit\fP\&. +Padrão: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-peer\-id\-prefix= +Especifica o prefixo para ID do peer. O ID do peer em um BitTorrent tem o +tamanho de 20 bytes. Se mais de 20 bytes são especificados, somente os 20 +bytes iniciais serão usados. Se menos de 20 bytes são especificados, dados +randomicos serão adicionados para completar o tamanho de 20 bytes. +Padrão: \fBaria2/$VERSÃO\-\fP, $VERSÃO é a versão do pacote aria2. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-seed\-ratio= +Specify share ratio. Seed completed torrents until share ratio reaches +RATIO. +You are strongly encouraged to specify equals or more than \fB1.0\fP here. +Specify \fB0.0\fP if you intend to do seeding regardless of share ratio. +If \fI\%\-\-seed\-time\fP option is specified along with this option, +seeding ends when at least one of the conditions is satisfied. +Padrão: \fB1.0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-seed\-time= +Especificar o tempo de (seeding) em minutos. Ver também a opção +\fI\%\-\-seed\-ratio\fP\&. +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +Especificando \fI\%\-\-seed\-time=0\fP desabilita o (seeding) +após o download ter sido completado. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-T, \-\-torrent\-file= +O caminho para o arquivo ".torrent". Não é obrigatório usar esta opção pois +pode ser especificado arquivo ".torrent" sem a opção +\fI\%\-\-torrent\-file\fP\&. +.UNINDENT +.SS Opções Específicas de Metalink +.INDENT 0.0 +.TP +.B \-\-follow\-metalink=true|false|mem +If \fBtrue\fP or \fBmem\fP is specified, when a file whose suffix is \fB\&.meta4\fP +or \fB\&.metalink\fP or content type of \fBapplication/metalink4+xml\fP or +\fBapplication/metalink+xml\fP is downloaded, aria2 parses it as a metalink +file and downloads files mentioned in it. +If \fBmem\fP is specified, a metalink file is not written to the disk, +but is just kept in memory. +If \fBfalse\fP is specified, the action mentioned above is not taken. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-base\-uri= +Specify base URI to resolve relative URI in metalink:url and +metalink:metaurl element in a metalink file stored in local disk. If +URI points to a directory, URI must end with \fB/\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-M, \-\-metalink\-file= +The file path to ".meta4" and ".metalink" file. Reads input from stdin when +\fB\-\fP is specified. You are not required to use this option because you can +specify ".metalink" files without \fI\%\-\-metalink\-file\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-language= +The language of the file to download. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-location=[,...] +The location of the preferred server. +A comma\-delimited list of locations is acceptable, for example, \fBjp,us\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-os= +The operating system of the file to download. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-version= +The version of the file to download. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-preferred\-protocol= +Specify preferred protocol. +The possible values are \fBhttp\fP, \fBhttps\fP, \fBftp\fP and \fBnone\fP\&. +Specify \fBnone\fP to disable this feature. +Padrão: \fBnone\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-enable\-unique\-protocol [true|false] +If \fBtrue\fP is given and several protocols are available for a mirror in a +metalink file, aria2 uses one of them. +Use \fI\%\-\-metalink\-preferred\-protocol\fP option to specify +the preference of protocol. +Padrão: \fBtrue\fP +.UNINDENT +.SS Opções específicas de RPC +.INDENT 0.0 +.TP +.B \-\-enable\-rpc [true|false] +Enable JSON\-RPC/XML\-RPC server. It is strongly recommended to set username +and password using \fI\%\-\-rpc\-user\fP and \fI\%\-\-rpc\-passwd\fP +option. See also \fI\%\-\-rpc\-listen\-port\fP option. Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-pause [true|false] +Pause o download após adicionado. Está opção só é efetiva quando +a opção \fI\%\-\-enable\-rpc=true\fP é informada. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-allow\-origin\-all [true|false] +Adiciona o campo de cabeçalho, \fBAccess\-Control\-Allow\-Origin\fP, +com o valor \fB*\fP á resposta RPC. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-certificate= +Usar o certificado no ARQUIVO para servidor RPC. O certificado +deve estar no formato PEM. Usar opção \fI\%\-\-rpc\-private\-key\fP +para especificar chave particular. Usar a opção +\fI\%\-\-rpc\-secure\fP para habilitar criptografia. +Usuários de \fIAppleTLS\fP precisam antes gerar o certificado próprio +auto\-assinado através do utilitário \fBKeychain Access\fP, por ex: +usando o assistente e tomando nota da identificação SHA\-1 do +certificado gerado. +Para executar o aria2c com a opção \fI\%\-\-rpc\-secure\fP usar +\fI\-\-rpc\-certificate=\fP e apenas omitir a opção +\fI\%\-\-rpc\-private\-key\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-listen\-all [true|false] +Listen incoming JSON\-RPC/XML\-RPC requests on all network interfaces. If false +is given, listen only on local loopback interface. Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-listen\-port= +Specify a port number for JSON\-RPC/XML\-RPC server to listen to. Possible +Values: \fB1024\fP \-\fB65535\fP Padrão: \fB6800\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-max\-request\-size= +Set max size of JSON\-RPC/XML\-RPC request. If aria2 detects the request is +more than SIZE bytes, it drops connection. Padrão: \fB2M\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-passwd= +Set JSON\-RPC/XML\-RPC password. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-private\-key= +Use the private key in FILE for RPC server. The private key must be +decrypted and in PEM format. Use \fI\%\-\-rpc\-secure\fP option to +enable encryption. See also \fI\%\-\-rpc\-certificate\fP option. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-save\-upload\-metadata [true|false] +Save the uploaded torrent or metalink metadata in the directory +specified by \fI\%\-\-dir\fP option. The filename consists of SHA\-1 +hash hex string of metadata plus extension. For torrent, the +extension is \(aq.torrent\(aq. For metalink, it is \(aq.meta4\(aq. If false is +given to this option, the downloads added by +\fI\%aria2.addTorrent()\fP or \fI\%aria2.addMetalink()\fP will not be +saved by \fI\%\-\-save\-session\fP option. Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-secure [true|false] +RPC transport will be encrypted by SSL/TLS. The RPC clients must +use https scheme to access the server. For WebSocket client, use wss +scheme. Use \fI\%\-\-rpc\-certificate\fP and +\fI\%\-\-rpc\-private\-key\fP options to specify the server +certificate and private key. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-user= +Set JSON\-RPC/XML\-RPC user. +.UNINDENT +.SS Opções Avançadas +.INDENT 0.0 +.TP +.B \-\-allow\-overwrite [true|false] +Reiniciar o download desde o início se o correspondente arquivo de controle +não existir. Ver também a opção \fI\%\-\-auto\-file\-renaming\fP\&. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-allow\-piece\-length\-change [true|false] +Se \fBfalse\fP é informado, aria2 interrompe o download quando o tamanho de um +pedaço for diferente do especificado no arquivo controle. Se \fBtrue\fP +é informado, o download prossegue mas o progresso será perdido. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-always\-resume [true|false] +Sempre continuar. Se If \fBtrue\fP é informado, aria2 sempre tentará +retomar o download do ponto interrompido e se não for possivel o download +será interrompido. Se \fBfalse\fP é informado, quando todas URIs fornecidas +não suportarem a continuidade do download ou aria2 encontrar \fBN\fP URIs as +quais não suportem retomar o download (\fBN\fP é o valor especificado na +opção \fI\%\-\-max\-resume\-failure\-tries\fP), aria2 irá iniciar o download +do início. Ver opção \fI\%\-\-max\-resume\-failure\-tries\fP +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-async\-dns [true|false] +Habilita DNS assíncrono. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-async\-dns\-server=[,...] +Lista separada por vírgulas, dos endereços dos servidores DNS assíncronos +usados pelo resolvedor. Normalmente o resolvedor de DNS assíncronos faz a +leitura dos endereços a partir do arquivo \fB/etc/resolv.conf\fP\&. +Quando essa opção é usada é feito uso dos servidores DNS especificados na +opção em detrimento do conteúdo do arquivo \fB/etc/resolv.conf\fP\&. +Podem ser usados ambos endereços IPv4 e IPv6. Essa opção é útil +quando o sistema não possui \fB/etc/resolv.conf\fP e o usuário não tem +permissão para criá\-lo. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-auto\-file\-renaming [true|false] +Renomear o arquivo se o mesmo já existir. +Essa opção só funciona em download HTTP, HTTPS e FTP. +O novo nome do arquivo terá um ponto e uma sequência (1..9999) como sufixo. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-auto\-save\-interval= +Salvar o arquivo de controle (*.aria2) a cada intervalo de SEGUNDOS. +Se \fB0\fP é informado, o arquivo de controle não será salvo durante o +download. aria2 salva o arquivo de controle quando parar, independentemente +do valor. As possibilidades vão desde \fB0\fP até \fB600\fP\&. +Padrão: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-conditional\-get [true|false] +Download file only when the local file is older than remote +file. This function only works with HTTP, HTTPS, downloads only. It does +not work if file size is specified in Metalink. It also ignores +Content\-Disposition header. If a control file exists, this option +will be ignored. This function uses If\-Modified\-Since header to get +only newer file conditionally. When getting modification time of +local file, it uses user supplied filename(see \fI\%\-\-out\fP option) or +filename part in URI if \fI\%\-\-out\fP is not specified. +To overwrite existing file, \fI\%\-\-allow\-overwrite\fP is required. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-conf\-path= +Change the configuration file path to PATH. +Padrão: \fB$HOME/.aria2/aria2.conf\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-console\-log\-level= +Set log level to output to console. LEVEL is either \fBdebug\fP, +\fBinfo\fP, \fBnotice\fP, \fBwarn\fP or \fBerror\fP\&. Default: \fBnotice\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-D, \-\-daemon [true|false] +Run as daemon. The current working directory will be changed to \fB/\fP +and standard input, standard output and standard error will be +redirected to \fB/dev/null\fP\&. Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-deferred\-input [true|false] +If \fBtrue\fP is given, aria2 does not read all URIs and options from file +specified by \fI\%\-\-input\-file\fP option at startup, +but it reads one by one when it +needs later. This may reduce memory usage if input file contains a +lot of URIs to download. If \fBfalse\fP is given, aria2 reads all URIs +and options at startup. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-disable\-ipv6 [true|false] +Disable IPv6. This is useful if you have to use broken DNS and want +to avoid terribly slow AAAA record lookup. Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-disk\-cache= +Enable disk cache. If SIZE is \fB0\fP, the disk cache is +disabled. This feature caches the downloaded data in memory, which +grows to at most SIZE bytes. The cache storage is created for aria2 +instance and shared by all downloads. The one advantage of the disk +cache is reduce the disk I/O because the data are written in larger +unit and it is reordered by the offset of the file. If hash +checking is involved and the data are cached in memory, we don\(aqt +need to read them from the disk. SIZE can include \fBK\fP or \fBM\fP +(1K = 1024, 1M = 1024K). Default: \fB16M\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-download\-result= +This option changes the way \fBDownload Results\fP is formatted. If OPT +is \fBdefault\fP, print GID, status, average download speed and +path/URI. If multiple files are involved, path/URI of first +requested file is printed and remaining ones are omitted. If OPT is +\fBfull\fP, print GID, status, average download speed, percentage of +progress and path/URI. The percentage of progress and path/URI are +printed for each requested file in each row. +Padrão: \fBdefault\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-async\-dns6 [true|false] +Enable IPv6 name resolution in asynchronous DNS resolver. This +option will be ignored when \fI\%\-\-async\-dns=false.\fP +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-mmap [true|false] +Map files into memory. This option may not work if the file space +is not pre\-allocated. See \fI\%\-\-file\-allocation\fP\&. +.sp +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-event\-poll= +Specify the method for polling events. The possible values are +\fBepoll\fP, \fBkqueue\fP, \fBport\fP, \fBpoll\fP and \fBselect\fP\&. For each \fBepoll\fP, +\fBkqueue\fP, \fBport\fP and \fBpoll\fP, it is available if system supports it. +\fBepoll\fP is available on recent Linux. \fBkqueue\fP is available on +various *BSD systems including Mac OS X. \fBport\fP is available on Open +Solaris. The default value may vary depending on the system you use. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-file\-allocation= +Specify file allocation method. +\fBnone\fP doesn\(aqt pre\-allocate file space. \fBprealloc\fP pre\-allocates file space +before download begins. This may take some time depending on the size of the +file. +If you are using newer file systems such as ext4 +(with extents support), btrfs, xfs or NTFS(MinGW build only), \fBfalloc\fP is +your best choice. It allocates large(few GiB) +files almost instantly. Don\(aqt use \fBfalloc\fP with +legacy file systems such as ext3 and FAT32 because it takes +almost same time as \fBprealloc\fP and it blocks aria2 +entirely until allocation finishes. \fBfalloc\fP may +not be available if your system doesn\(aqt have +\fBposix_fallocate(3)\fP function. +\fBtrunc\fP uses \fBftruncate(2)\fP system call or +platform\-specific counterpart to truncate a file to a specified +length. +.sp +Possible Values: \fBnone\fP, \fBprealloc\fP, \fBtrunc\fP, \fBfalloc\fP +Padrão: \fBprealloc\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-force\-save [true|false] +Save download with \fI\%\-\-save\-session\fP option +even if the download is completed or removed. This may be useful to +save BitTorrent seeding which is recognized as completed state. +Default: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-gid= +Set GID manually. aria2 identifies each download by the ID called +GID. The GID must be hex string of 16 characters, thus [0\-9a\-zA\-Z] +are allowed and leading zeros must not be stripped. The GID all 0 is +reserved and must not be used. The GID must be unique, otherwise +error is reported and the download is not added. This option is +useful when restoring the sessions saved using +\fI\%\-\-save\-session\fP option. If this option is +not used, new GID is generated by aria2. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-hash\-check\-only [true|false] +If \fBtrue\fP is given, after hash check using +\fI\%\-\-check\-integrity\fP option, +abort download whether or not download is complete. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-human\-readable [true|false] +Print sizes and speed in human readable format (e.g., 1.2Ki, 3.4Mi) +in the console readout. Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-interface= +Bind sockets to given interface. You can specify interface name, IP +address and hostname. +Possible Values: interface, IP address, hostname +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +If an interface has multiple addresses, it is highly recommended to +specify IP address explicitly. See also \fI\%\-\-disable\-ipv6\fP\&. If your +system doesn\(aqt have \fBgetifaddrs(3)\fP, this option doesn\(aqt accept interface +name. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-download\-result= +Set maximum number of download result kept in memory. The download +results are completed/error/removed downloads. The download results +are stored in FIFO queue and it can store at most NUM download +results. When queue is full and new download result is created, +oldest download result is removed from the front of the queue and +new one is pushed to the back. Setting big number in this option may +result high memory consumption after thousands of +downloads. Specifying 0 means no download result is kept. Padrão: +\fB1000\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-resume\-failure\-tries= +When used with \fI\%\-\-always\-resume=false,\fP aria2 downloads file from +scratch when aria2 detects N number of URIs that does not support +resume. If N is \fB0\fP, aria2 downloads file from scratch when all +given URIs do not support resume. See \fI\%\-\-always\-resume\fP option. +Padrão: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-log\-level= +Set log level to output. +LEVEL is either \fBdebug\fP, \fBinfo\fP, \fBnotice\fP, \fBwarn\fP or \fBerror\fP\&. +Padrão: \fBdebug\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-bt\-download\-complete= +For BitTorrent, a command specified in \fI\%\-\-on\-download\-complete\fP is +called after download completed and seeding is over. On the other +hand, this option set the command to be executed after download +completed but before seeding. +See \fI\%Interação com Eventos (Hook)\fP for more details about COMMAND. +Possible Values: \fB/path/to/command\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-complete= +Set the command to be executed after download completed. See +See \fI\%Interação com Eventos (Hook)\fP for more details about COMMAND. +See also \fI\%\-\-on\-download\-stop\fP option. +Possible Values: \fB/path/to/command\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-error= +Set the command to be executed after download aborted due to error. +See \fI\%Interação com Eventos (Hook)\fP for more details about COMMAND. +See also \fI\%\-\-on\-download\-stop\fP option. Possible Values: +\fB/path/to/command\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-pause= +Set the command to be executed after download was paused. +See \fI\%Interação com Eventos (Hook)\fP for more details about COMMAND. +Possible Values: \fB/path/to/command\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-start= +Set the command to be executed after download got started. +See \fI\%Interação com Eventos (Hook)\fP for more details about COMMAND. +Possible Values: \fB/path/to/command\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-stop= +Set the command to be executed after download stopped. You can override +the command to be executed for particular download result using +\fI\%\-\-on\-download\-complete\fP and \fI\%\-\-on\-download\-error\fP\&. If they are +specified, command specified in this option is not executed. +See \fI\%Interação com Eventos (Hook)\fP for more details about COMMAND. +Possible Values: \fB/path/to/command\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-piece\-length= +Set a piece length for HTTP e FTP downloads. This is the boundary when +aria2 splits a file. All splits occur at multiple of this +length. This option will be ignored in BitTorrent downloads. It +will be also ignored if Metalink file contains piece hashes. +Padrão: \fB1M\fP +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +The possible usecase of \fI\%\-\-piece\-length\fP +option is change the request range in one HTTP pipelined request. +To enable HTTP pipelining use +\fI\%\-\-enable\-http\-pipelining\fP\&. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-show\-console\-readout [true|false] +Show console readout. Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-summary\-interval= +Set interval in seconds to output download progress summary. +Setting \fB0\fP suppresses the output. +Padrão: \fB60\fP +.sp +\fBNOTA:\fP +.INDENT 7.0 +.INDENT 3.5 +In multi file torrent downloads, the files adjacent forward to the specified files +are also allocated if they share the same piece. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-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. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-overall\-download\-limit= +Set max overall download speed in bytes/sec. \fB0\fP means +unrestricted. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). To +limit the download speed per download, use \fI\%\-\-max\-download\-limit\fP +option. Padrão: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-download\-limit= +Set max download speed per each download in bytes/sec. \fB0\fP means +unrestricted. You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). To +limit the overall download speed, use \fI\%\-\-max\-overall\-download\-limit\fP +option. Padrão: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-conf [true|false] +Disable loading aria2.conf file. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-file\-allocation\-limit= +No file allocation is made for files whose size is smaller than SIZE. +You can append \fBK\fP or \fBM\fP (1K = 1024, 1M = 1024K). +Padrão: \fB5M\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-P, \-\-parameterized\-uri [true|false] +Enable parameterized URI support. +You can specify set of parts: \fBhttp://{sv1,sv2,sv3}/foo.iso\fP\&. +Also you can specify numeric sequences with step counter: +\fBhttp://host/image[000\-100:2].img\fP\&. +A step counter can be omitted. +If all URIs do not point to the same file, such as the second example above, +\-Z option is required. +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-q, \-\-quiet [true|false] +Make aria2 quiet (no console output). +Padrão: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-realtime\-chunk\-checksum [true|false] +Validate chunk of data by calculating checksum while downloading a file if +chunk checksums are provided. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-remove\-control\-file [true|false] +Remove control file before download. Using with +\fI\%\-\-allow\-overwrite=true,\fP download always starts from +scratch. This will be useful for users behind proxy server which +disables resume. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-save\-session= +Salvar downloads não concluídos ou com erro, para um ARQUIVO quando sair. +Pode ser informado o nome do arquivo para o aria2 com a opção +\fI\%\-\-input\-file\fP no restart. Note que downloads adicionados +pela função \fI\%aria2.addTorrent()\fP e pela função +\fI\%aria2.addMetalink()\fP método RPC e seus respectivos metadados não podem +ser salvos. Downloads removidos usando a função \fI\%aria2.remove()\fP e +\fI\%aria2.forceRemove()\fP não serão salvos. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-save\-session\-interval= +Save error/unfinished downloads to a file specified by +\fI\%\-\-save\-session\fP option every SEC seconds. If \fB0\fP is +given, file will be saved only when aria2 exits. Default: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stop= +Finaliza a aplicação após SEGUNDOS se passarem. +Se \fB0\fP é informado, essa funcionalidade é desabilitada. +Padrão: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stop\-with\-process= +Finaliza a aplicação quando o processo de número PID não estiver executando. +Isso é útil se o processo aria2 foi derivado de um processo precursor. +O processo precursor pode ter criado o processo aria2 com seu próprio pid +e quando o processo precursor terminar por alguma razão, aria2 pode +detectar por ele mesmo, essa situação e executar ele mesmo o shutdown. +Este recurso evita que um processo gere subprocessos que ficam no +limbo. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-truncate\-console\-readout [true|false] +Truncar a linha da console para ajustar\-se a uma linha. +Padrão: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-v, \-\-version +Exibe o número da versão, copyright e informação da configuração e sai. +.UNINDENT +.SS Argumento(s) Opcional(is) +.sp +As opções que possuem seus argumentos delimitados por colchetes ([]), são +opcionais. Normalmente omitindo o argumento, ele será assumido como \fBtrue\fP +(verdadeiro). +Se for usada a forma abreviada dessas opções (como em \fB\-V\fP) e informado +um argumento, estão o nome da opção e seu argumento devem ser concatenados, +por exemplo: (\fB\-Vfalse\fP). Se houver espaços entre a opção e o argumento o +argumento será tratado como URI e normalmente não é isto o esperado. +.SS Unidades (K and M) +.sp +Algumas opções usam \fBK\fP e \fBM\fP para convenientemente representar +1.024 e 1.048.576 respectivamente. aria2 detecta estas caracteres de maneira +transparente (maiúsculas e minúsculas), portanto podem ser usados +\fIk\(ga\fP ou \fBK\fP e \fBm\fP ou \fBM\fP\&. +.SS URI, MAGNET, TORRENT_FILE, METALINK_FILE +.sp +Podemos especificar múltiplas URIs em uma linha de comando. A menos que seja +especificada a opção \fI\%\-\-force\-sequential\fP, todas as URIs devem +apontar para o mesmo arquivo que será baixado ou o download falhará. +.sp +Pode\-se especificar um número arbitrátio de URIs de BitTorrent Magnet URI. +Nove que eles sempre serão tratados como downloads separados. +São suportados Hash de Info de 40 characters e Hast de Info Base32 de 32 +characters. Múltiplos parâmetros \fBtr\fP são suportados. Devido a URI +BitTorrent Magnet poder conter o caracter \fB&\fP, é altamente recomendável +delimitar a URI com apóstrofo single(\fB\(aq\fP) ou aspas double(\fB"\fP). +É altamente recomendável habilitar DHT especialmente quando \fBtr\fP o parâmetro +estiver ausente. Ver \fI\%http://www.bittorrent.org/beps/bep_0009.html\fP +para maiores detalhes sobre URI BitTorrent Magnet. +.sp +Pode\-se também especificar um número arbitrário de arquivos torrent e +Documentos Metalink armazenados em um dispositivo local. Note que sempre serão +tratados como download distintos. Tanto Metalink4 quanto Metalink da versão 3 +são suportados. +.sp +Pode\-se especificar arquivo torrent usando a opção \-T e URI. Fazendo isso +o download será baixado do servidor swarm e HTTP, HTTPS e FTP ao mesmo tempo, +enquanto os dados do HTTP, HTTPS e FTP serão uploaded para o swarm torrent. +Para torrent de um arquivo a URI deve ser completa e apontar inclusive o +recurso ou se a URI terminar com / o nome do torrent será adicionado. Para +múltiplos torrents, name e caminho serão adicionados para formar a URI, para +cada um dos arquivos. +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Certifique\-se que a URI seja delimitada por apóstrofo single(\fB\(aq\fP) ou +aspas double(\fB"\fP) se a URI contiver \fB&\fP ou qualquer outro caracter que +tenha significado especial para o shell. +.UNINDENT +.UNINDENT +.SS Continuar Download Interrompido +.sp +Normalmente pode\-se retomar uma transferência apenas executando\-se o comando +aria2c URI, caso a transferência anterior estava sendo feita pelo aria2. +.sp +Caso a transferência anterior estava sendo feita por um navegador ou wget de +maneira sequencial, então utilize a opção \fI\%\-\-continue\fP para +retomar do ponto onde foi interrompida a transferência. +.SS Interação com Eventos (Hook) +.sp +aria2 possui opções para especificar comando arbitrário após um evento +específico ocorrer. Atualmente as seguintes opções estão disponíveis: +.sp +\fI\%\-\-on\-bt\-download\-complete\fP, +\fI\%\-\-on\-download\-pause\fP, +\fI\%\-\-on\-download\-complete\fP\&. +\fI\%\-\-on\-download\-start\fP, +\fI\%\-\-on\-download\-error\fP, +\fI\%\-\-on\-download\-stop\fP\&. +.sp +aria2 passa 3 argumentos para um comando especificado quando este comando for +executado. Estes argumentos são: GID, o número de arquivos e o caminho dos +arquivos. Para downloads HTTP, HTTPS e FTP normalmente o número de arquivos é 1. +BitTorrent podem conter múltiplos arquivos. Se o número de arquivos é maior +que 1, o caminho do arquivo é o primeiro. Em outras palavras, este é o valor +da chave path da primeira estrutura se aquela chave for verdadeira como +resposta do método da função \fI\%aria2.getFiles()\fP RPC. +Se for necessário todos os caminhos dos arquivos, considere usar o método +JSON\-RPC/XML\-RPC. Lembre\-se que o caminho do arquivo pode ser modificado +durante o download no HTTP por causa do redirecionamento ou Disposição do +Conteúdo do Cabeçalho. +.sp +Observemos um exemplo de como são passados argumentos para um comando: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ cat hook.sh +#!/bin/sh +echo "chamado com [$1] [$2] [$3]" +$ aria2c \-\-on\-download\-complete hook.sh http://dobrasil.org/arquivo.iso +chamado com [1] [1] [/caminho/para/arquivo.iso] +.ft P +.fi +.UNINDENT +.UNINDENT +.SH CÓDIGO DE RETORNO OU SAÍDA +.sp +Como aria2 pode manipular múltiplos downloads concomitantemente, podem ser +encontrados vários erros durante uma sessão. aria2 retorna os códigos de +retorno ou saída com base no último erro encontrado. +.INDENT 0.0 +.TP +.B 0 +Se todos os downloads terminam com sucesso. +.TP +.B 1 +Erro desconhecido ocorreu. +.TP +.B 2 +Tempo transcorrido (time out). +.TP +.B 3 +Recurso não encontrado. +.TP +.B 4 +Se aria2 tentou um número especificado de vezes e obteve "recurso não encontrado". +Ver opção \fI\%\-\-max\-file\-not\-found\fP\&. +.TP +.B 5 +Se download interrompido porque a velocidade de download é muito baixa. +Ver opção \fI\%\-\-lowest\-speed\-limit\fP +.TP +.B 6 +Erro na rede (network). +.TP +.B 7 +Se existem downloads não concluidos. Esse erro é reportado somente se +todos os downloads foram concluídos com sucesso mas existe uma fila quando +aria2 foi interrompido por quando foi pressionado \fBCtrl\-C\fP pelo usuário +ou enviado o sinal TERM ou INT. +.TP +.B 8 +Se o servidor remoto não suporta retomar um download que deve ser completado. +.TP +.B 9 +Não há espaço em disco suficiente para os downloads. +.TP +.B 10 +Se o tamanho do pedaço (piece) foi diferente do arquivo de controle .aria2. +Ver opção \fI\%\-\-allow\-piece\-length\-change\fP\&. +.TP +.B 11 +Se aria2 estava fazendo o download do mesmo arquivo no momento. +.TP +.B 12 +If aria2 estava fazendo o download do mesmo, hash do torrent, no momento. +.TP +.B 13 +Se o arquivo já existe. Ver opção \fI\%\-\-allow\-overwrite\fP\&. +.TP +.B 14 +Se renomer o arquivo falhou. Ver opção \fI\%\-\-auto\-file\-renaming\fP\&. +.TP +.B 15 +Se aria2 não pode abrir o arquivo existente. +.TP +.B 16 +Se aria2 não pode criar novo arquivo ou truncar um arquivo já existente. +.TP +.B 17 +Se ocorreu erro de I/O no arquivo. +.TP +.B 18 +Se aria2 não pode criar diretório. +.TP +.B 19 +Se resolução de nomes falhou. +.TP +.B 20 +Se aria2 não pode passar documento Metalink. +.TP +.B 21 +Se comando FTP falhou. +.TP +.B 22 +Se cabeçalho de resposta HTTP está errado ou inesperado. +.TP +.B 23 +Se muitos redirecionamentos ocorreram. +.TP +.B 24 +Se autorização HTTP falhou. +.TP +.B 25 +Se aria2 não pode passar arquivo bencoded file (normalmente arq. ".torrent"). +.TP +.B 26 +Se arquivo ".torrent" estava corrompido ou inexistem informações que aria2 +necessita. +.TP +.B 27 +Se URI Magnet URI está errada. +.TP +.B 28 +Se opção está errada ou não é reconhecida ou argumento inválido de uma opção +foi informado. +.TP +.B 29 +Se o servidor remoto não pode manusear uma requisição devido a sobrecarga +temporária ou manutenção. +.TP +.B 30 +Se aria2 não pode passar uma requisição JSON\-RPC. +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Um erro ocorrido em um download completado não será reportado como um +status de saida nem como código de retorno (exit status). +.UNINDENT +.UNINDENT +.SH VARIÁVEIS DE AMBIENTE +.sp +aria2 reconhece as seguintes variáveis de ambiente. +.INDENT 0.0 +.TP +.B \fBhttp_proxy [http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]\fP +Especifica o servidor para uso do HTTP. +Sobrepõe o valor do http\-proxy do arquivo de configuração. +A opção linha de comando \fI\%\-\-http\-proxy\fP sobrepõe este valor. +.TP +.B \fBhttps_proxy [http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]\fP +Especifica o servidor proxy para uso do HTTPS. +Sobrepõe o valor do https\-proxy do arquivo de configuração. +A opção linha de comando \fI\%\-\-https\-proxy\fP sobrepõe este valor. +.TP +.B \fBftp_proxy [http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]\fP +Especifica o servidor proxy para uso do FTP. +Sobrepõe o valor do http\-proxy do arquivo de configuração. +A opção linha de comando \fI\%\-\-ftp\-proxy\fP sobrepõe este valor. +.TP +.B \fBall_proxy [http://][USUÁRIO:SENHA@]SERVIDOR[:PORTA]\fP +Especifica o servidor proxy para uso se nenhum protocolo\-específico de proxy +é informado. +Sobrepõe o valor all\-proxy do arquivo de configuração. +A opção linha de comando \fI\%\-\-all\-proxy\fP sobrepõe este valor. +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Apesar de aria2 aceitar os esquemas \fBftp://\fP e \fBhttps://\fP para proxy de +URI, aria2 assume que \fBhttp://\fP é especificado e não troca o comportamento +com base no esquema especificado. +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \fBno_proxy [DOMÍNIO,...]\fP +Especifica nome de servidores, separados por vírgula, domínios e endereços +de rede com ou sem blocos CIDR para os quais não será usado proxy. +Sobrepõe o valor no\-proxy do arquivo de configuração. +A opção linha de comando \fI\%\-\-no\-proxy\fP sobrepõe este valor. +.UNINDENT +.SH ARQUIVOS DE CONFIGURAÇÃO +.SS aria2.conf +.sp +Por padrão, aria2 utiliza \fB$HOME/.aria2/aria2.conf\fP como arquivo de +configuração. Pode ser especificado o caminho do arquivo usando\-se a opção +\fI\%\-\-conf\-path\fP\&. Se não desejar usar a configuração de arquivo utilize +a opção \fI\%\-\-no\-conf\fP\&. +.sp +O arquivo de configuração é um arquivo texto e possui uma opção por linha. +Em cada linha, deve haver um par (nome\-valor), no formato: +\fBNOME=VALOR\fP, onde nome é o nome longo da linha de comando sem o prefixo +\fB\-\-\fP\&. Pode ser usada a mesma sintaxe da opção da linha de comando. +Linhas que começam com \fB#\fP são tratados como comentários: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +# arquivo de simples configuração para aria2c +listen\-port=60000 +dht\-listen\-port=60000 +seed\-ratio=1.0 +max\-upload\-limit=50K +ftp\-pasv=true +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Informações confidenciais como usuário/senha podem ser incluídas no arquivo +de configuração, mas recomenda\-se trocar os bits de seu modo de acesso +(por exemplo: \fBchmod 600 aria2.conf\fP), dessa maneira nenhum outro usuário +consegue ver o conteúdo desse arquivo de configuração. +.UNINDENT +.UNINDENT +.SS dht.dat +.sp +Por padrão, a tabela de rota do IPv4 DHT está em \fB$HOME/.aria2/dht.dat\fP e a +tabela de rota do IPv6 DHT está em \fB$HOME/.aria2/dht6.dat\fP\&. +.SS Netrc +.sp +Por padrão, o suporte a Netrc está habilitado para HTTP, HTTPS e FTP. Para +desabilitar o suporte a netrc especificar \fI\%\-\-no\-netrc\fP\&. Seu +arquivo .netrc precisa ter as permissões corretas (600). +.sp +Se o nome do servidor inicia com \fB\&.\fP, aria2 executa pesquisa domínio ao +invés de pesquisa exata. Isto é uma extensão de aria2. Exemplo de pesquisa +de domínio, imagine as seguinte entrada no arquivo .netrc: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +machine .dobrasil.org login meuid password minhasenha +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBaria2.dobrasil.org\fP pesquisa domínio \fB\&.dobrasil.org\fP e usa \fBmeuid\fP e +\fBminhasenha\fP\&. +.sp +Mais exemplos de pesquisa domínio: \fBnobrasil.net\fP não executa pesquisa +domínio \fB\&.nobrasil.net\fP\&. \fBdobrasil.org\fP não faz pesquisa domínio \fB\&.dobrasil.org\fP +pois tem maior amplitude hierárquica por causa do ponto precedente \fB\&.\fP\&. Se +desejar utilizar \fBdobrasil.org\fP, especificar \fBdobrasil.org\fP\&. +.SS Arquivo de Controle +.sp +aria2 utiliza um arquivo de controle para rastrear o progresso +de um download. Este arquivo é gravado no mesmo diretório do +arquivo que está sendo baixado e possui o sufixo \fB\&.aria2\fP\&. +Por exemplo,se está baixando arquivo.zip, então o arquivo de controle +será arquivo.zip.aria2. (Existe apenas uma exceção para essa convenção +que é quando você está baixando um multi torrent, o arquivo de controle +estará no "diretório topo" do torrent com o sufixo \fB\&.aria2\fP\&. O nome do +"diretório topo" é o valor da chave "name" no diretório "info" do arquivo +torrent). +.sp +Normalmente um arquivo controle é apagado quando o download se completa. Se +aria2 detecta que o download não pode ser retomado (por exemplo, quando faz +download de um servidor HTTP que não suporta retomar o processamento de um +ponto mas sempre do início), o arquivo de controle não será criado. +.sp +Se você perder o arquivo de controle, não será possivel retomar o download do +ponto onde estava. Mas se há um torrent ou metalink com checksum (verificação) do +arquivo, poderá ser retomado do último ponto especificando a opção \-V na linha +de comando. +.SS Arquivo de Entrada +.sp +O arquivo de entrada pode conter uma lista de URIs para que o aria2 efetua +download. Podem ser especificados múltiplas URIs para cada simples entidade: +separar as entidades por um caracter TAB ou espaço. +.sp +Cada linha é tratada como se fosse especificada através de um argumento da linha +de comando. Entretando estas linhas são afetadas pela opção +\fI\%\-\-force\-sequential\fP e pela opção \fI\%\-\-parameterized\-uri\fP +.sp +Quando as URIs do arquivo de entrada são diretamente lidas pelo aria2, as URIs +não precisam necessáriamente estarem delimitadas por apóstrofo (\fB\(aq\fP) nem +aspas(\fB"\fP). +.sp +Linhas que começam com \fB#\fP são tratadas como comentário e desprezadas. +.sp +Adicionalmente, as seguintes opções podem ser especificadas após cada linha de +URI. Estas linhas opcionais precisam iniciar com um ou mais espaços. +.INDENT 0.0 +.INDENT 2.0 +.IP \(bu 2 +\fI\%all\-proxy\fP +.IP \(bu 2 +\fI\%all\-proxy\-passwd\fP +.IP \(bu 2 +\fI\%all\-proxy\-user\fP +.IP \(bu 2 +\fI\%allow\-overwrite\fP +.IP \(bu 2 +\fI\%allow\-piece\-length\-change\fP +.IP \(bu 2 +\fI\%always\-resume\fP +.IP \(bu 2 +\fI\%async\-dns\fP +.IP \(bu 2 +\fI\%auto\-file\-renaming\fP +.IP \(bu 2 +\fI\%bt\-enable\-lpd\fP +.IP \(bu 2 +\fI\%bt\-exclude\-tracker\fP +.IP \(bu 2 +\fI\%bt\-external\-ip\fP +.IP \(bu 2 +\fI\%bt\-hash\-check\-seed\fP +.IP \(bu 2 +\fI\%bt\-max\-open\-files\fP +.IP \(bu 2 +\fI\%bt\-max\-peers\fP +.IP \(bu 2 +\fI\%bt\-metadata\-only\fP +.IP \(bu 2 +\fI\%bt\-min\-crypto\-level\fP +.IP \(bu 2 +\fI\%bt\-prioritize\-piece\fP +.IP \(bu 2 +\fI\%bt\-remove\-unselected\-file\fP +.IP \(bu 2 +\fI\%bt\-request\-peer\-speed\-limit\fP +.IP \(bu 2 +\fI\%bt\-require\-crypto\fP +.IP \(bu 2 +\fI\%bt\-save\-metadata\fP +.IP \(bu 2 +\fI\%bt\-seed\-unverified\fP +.IP \(bu 2 +\fI\%bt\-stop\-timeout\fP +.IP \(bu 2 +\fI\%bt\-tracker\fP +.IP \(bu 2 +\fI\%bt\-tracker\-connect\-timeout\fP +.IP \(bu 2 +\fI\%bt\-tracker\-interval\fP +.IP \(bu 2 +\fI\%bt\-tracker\-timeout\fP +.IP \(bu 2 +\fI\%check\-integrity\fP +.IP \(bu 2 +\fI\%checksum\fP +.IP \(bu 2 +\fI\%conditional\-get\fP +.IP \(bu 2 +\fI\%connect\-timeout\fP +.IP \(bu 2 +\fI\%continue\fP +.IP \(bu 2 +\fI\%dir\fP +.IP \(bu 2 +\fI\%dry\-run\fP +.IP \(bu 2 +\fI\%enable\-async\-dns6\fP +.UNINDENT +.INDENT 2.0 +.IP \(bu 2 +\fI\%enable\-http\-keep\-alive\fP +.IP \(bu 2 +\fI\%enable\-http\-pipelining\fP +.IP \(bu 2 +\fI\%enable\-mmap\fP +.IP \(bu 2 +\fI\%enable\-peer\-exchange\fP +.IP \(bu 2 +\fI\%file\-allocation\fP +.IP \(bu 2 +\fI\%follow\-metalink\fP +.IP \(bu 2 +\fI\%follow\-torrent\fP +.IP \(bu 2 +\fI\%force\-save\fP +.IP \(bu 2 +\fI\%ftp\-passwd\fP +.IP \(bu 2 +\fI\%ftp\-pasv\fP +.IP \(bu 2 +\fI\%ftp\-proxy\fP +.IP \(bu 2 +\fI\%ftp\-proxy\-passwd\fP +.IP \(bu 2 +\fI\%ftp\-proxy\-user\fP +.IP \(bu 2 +\fI\%ftp\-reuse\-connection\fP +.IP \(bu 2 +\fI\%ftp\-type\fP +.IP \(bu 2 +\fI\%ftp\-user\fP +.IP \(bu 2 +\fI\%hash\-check\-only\fP +.IP \(bu 2 +\fI\%header\fP +.IP \(bu 2 +\fI\%http\-accept\-gzip\fP +.IP \(bu 2 +\fI\%http\-auth\-challenge\fP +.IP \(bu 2 +\fI\%http\-no\-cache\fP +.IP \(bu 2 +\fI\%http\-passwd\fP +.IP \(bu 2 +\fI\%http\-proxy\fP +.IP \(bu 2 +\fI\%http\-proxy\-passwd\fP +.IP \(bu 2 +\fI\%http\-proxy\-user\fP +.IP \(bu 2 +\fI\%http\-user\fP +.IP \(bu 2 +\fI\%https\-proxy\fP +.IP \(bu 2 +\fI\%https\-proxy\-passwd\fP +.IP \(bu 2 +\fI\%https\-proxy\-user\fP +.IP \(bu 2 +\fI\%index\-out\fP +.IP \(bu 2 +\fI\%lowest\-speed\-limit\fP +.IP \(bu 2 +\fI\%max\-connection\-per\-server\fP +.IP \(bu 2 +\fI\%max\-download\-limit\fP +.IP \(bu 2 +\fI\%max\-file\-not\-found\fP +.IP \(bu 2 +\fI\%max\-resume\-failure\-tries\fP +.UNINDENT +.INDENT 2.0 +.IP \(bu 2 +\fI\%max\-tries\fP +.IP \(bu 2 +\fI\%max\-upload\-limit\fP +.IP \(bu 2 +\fI\%metalink\-base\-uri\fP +.IP \(bu 2 +\fI\%metalink\-enable\-unique\-protocol\fP +.IP \(bu 2 +\fI\%metalink\-language\fP +.IP \(bu 2 +\fI\%metalink\-location\fP +.IP \(bu 2 +\fI\%metalink\-os\fP +.IP \(bu 2 +\fI\%metalink\-preferred\-protocol\fP +.IP \(bu 2 +\fI\%metalink\-version\fP +.IP \(bu 2 +\fI\%min\-split\-size\fP +.IP \(bu 2 +\fI\%no\-file\-allocation\-limit\fP +.IP \(bu 2 +\fI\%no\-netrc\fP +.IP \(bu 2 +\fI\%no\-proxy\fP +.IP \(bu 2 +\fI\%out\fP +.IP \(bu 2 +\fI\%parameterized\-uri\fP +.IP \(bu 2 +\fI\%pause\fP +.IP \(bu 2 +\fI\%piece\-length\fP +.IP \(bu 2 +\fI\%proxy\-method\fP +.IP \(bu 2 +\fI\%realtime\-chunk\-checksum\fP +.IP \(bu 2 +\fI\%referer\fP +.IP \(bu 2 +\fI\%remote\-time\fP +.IP \(bu 2 +\fI\%remove\-control\-file\fP +.IP \(bu 2 +\fI\%retry\-wait\fP +.IP \(bu 2 +\fI\%reuse\-uri\fP +.IP \(bu 2 +\fI\%rpc\-save\-upload\-metadata\fP +.IP \(bu 2 +\fI\%seed\-ratio\fP +.IP \(bu 2 +\fI\%seed\-time\fP +.IP \(bu 2 +\fI\%select\-file\fP +.IP \(bu 2 +\fI\%split\fP +.IP \(bu 2 +\fI\%stream\-piece\-selector\fP +.IP \(bu 2 +\fI\%timeout\fP +.IP \(bu 2 +\fI\%uri\-selector\fP +.IP \(bu 2 +\fI\%use\-head\fP +.IP \(bu 2 +\fI\%user\-agent\fP +.UNINDENT +.UNINDENT +.sp +Estas opções possuem exatamente o mesmo significado das opções existentes na +linha de comando, mas aplicam\-se apenas a URI a que pertencem. +Por favor perceba que dentro de um arquivo, elas não terão o prefixo \fB\-\-\fP\&. +.sp +Por exemplo, o conteúdo do arquivo de entrada uri.txt é: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +http://servidor/arquivo.iso http://espelho/arquivo.iso + dir=/imagens_iso + out=arquivo.img +http://fu/ba +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Se aria2 é executado com as opções \fB\-i uri.txt \-d /tmp\fP, então o +\fBarquivo.iso\fP será salvo como \fB/imagens_iso/arquivo.img\fP e será baixado +dos servidores \fBhttp://servidor/arquivo.iso\fP e +\fBhttp://espelho/arquivo.iso\fP\&. +O arquivo \fBba\fP e baixado de \fBhttp://fu/ba\fP e salvo como \fB/tmp/ba\fP\&. +.sp +Em alguns casos, o parâmetro \fI\%out\fP não tem efeito. +Ver nota da opção \fI\%\-\-out\fP para entender as restrições. +.SS Perfil Performance Servidor +.sp +Esta seção descreve o formato do perfil de performance do servidor, composto +por um arquivo de texto plano com cada linha contendo um par \fBNOME=VALOR\fP, +delimitados por virgula. Atualmente esta é a lista de nomes reconhecidos: +.INDENT 0.0 +.TP +.B \fBhost\fP +Nome do servidor. Requerido. +.TP +.B \fBprotocol\fP +Protocolo para este perfil, como ftp, http, https. http é requerido. +.TP +.B \fBdl_speed\fP +Velocidade média de download observada no download prévio, em bytes por +segundo. Requerido. +.TP +.B \fBsc_avg_speed\fP +The average download speed observed in the previous download in +bytes per sec. This value is only updated if the download is done in +single connection environment and only used by +AdaptiveURISelector. Optional. +.TP +.B \fBmc_avg_speed\fP +The average download speed observed in the previous download in +bytes per sec. This value is only updated if the download is done in +multi connection environment and only used by +AdaptiveURISelector. Optional. +.TP +.B \fBcounter\fP +How many times the server is used. Currently this value is only used +by AdaptiveURISelector. Optional. +.TP +.B \fBlast_updated\fP +Last contact time in GMT with this server, specified in the seconds +since the Epoch(00:00:00 on January 1, 1970, UTC). Required. +.TP +.B \fBstatus\fP +ERROR is set when server cannot be reached or out\-of\-service or +timeout occurred. Otherwise, OK is set. +.UNINDENT +.sp +Estes campos devem existir em uma linha. A ordem dos campos não importa. +Podem ser colocados pares; eles serão simplesmente ignorados. +.sp +Um exemplo abaixo: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +host=localhost, protocol=http, dl_speed=32000, last_updated=1222491640, +status=OK +host=localhost, protocol=ftp, dl_speed=0, last_updated=1222491632, +status=ERROR +.ft P +.fi +.UNINDENT +.UNINDENT +.SH INTERFACE RPC +.sp +aria2 provê o serviço JSON\-RPC sobre HTTP e XML\-RPC sobre HTTP e eles +basicamente possuem a mesma funcionalidade. aria2 também provê JSON\-RPC +sobre WebSocket que utiliza o mesmo formato, do método e assinatura e +de resposta do formato JSON\-RPC sobre HTTP, mas adicionalmente possui +notificações iniciadas pelo servidor. +Ver detalhes na seção \fI\%JSON\-RPC sobre WebSocket\fP . +.sp +O caminho requisitado do interface JSON\-RPC (sobre HTTP e sobre +WebSocket) é \fB/jsonrpc\fP\&. O caminho requisitado do interface XML\-RPC é +\fB/rpc\fP\&. +.sp +A URI WebSocket para JSON\-RPC sobre WebSocket é \fBws://HOST:PORT/jsonrpc\fP\&. +.sp +A implementação JSON\-RPC é baseada na especificação +\fBJSON\-RPC 2.0 \fP e suporta +HTTP POST e GET (JSONP). Usando WebSocket como transporte, é uma extensão +original do aria2. +.sp +A interface JSON\-RPC não suporta notificação em HTTP, mas o servidor RPC irá +enviar a notificação no WebSocket. Não é suportado número de ponto flutuante +O codificação de página deve ser UTF\-8. +.sp +Quanto a seguinte documentação do JSON\-RPC, entenda estrutura JSON como objeto. +.SS Terminologia +.INDENT 0.0 +.TP +.B GID +GID(or gid) é a chave para gerenciar cada download. Cada download tem um +único GID. Atualmente GID é armazenado em 64 bits como dado binário no +aria2. Para acesso RPG, isso é representado em uma string hexadecimal +de 16 caracteres (exemplo: \fB2089b05ecca3d829\fP). Normalmente, aria2 +gera esse GID para cada download, mas o usuário pode especificar +o GID manualmente usando a opção \fI\%\-\-gid\fP\&. Quando +consultando um download por GID, pode ser especificado o prefixo +do GID como um prefixo único e exclusivo entre outros. +.UNINDENT +.SS Métodos +.sp +São descritos em torno de 35 exemplos, os quais serão numerados +utilizando código fonte com exemplos que usam a linguagem +Python versão 2.7. +.INDENT 0.0 +.TP +.B aria2.addUri(uris[, options[, position]]) +This method adds new HTTP(S)/FTP/BitTorrent Magnet URI. \fIuris\fP is of +type array and its element is URI which is of type string. For +BitTorrent Magnet URI, \fIuris\fP must have only one element and it should +be BitTorrent Magnet URI. URIs in \fIuris\fP must point to the same file. +If you mix other URIs which point to another file, aria2 does not +complain but download may fail. \fIoptions\fP is of type struct and its +members are a pair of option name and value. See \fI\%Opções\fP below for +more details. If \fIposition\fP is given as an integer starting from 0, +the new download is inserted at \fIposition\fP in the waiting queue. If +\fIposition\fP is not given or \fIposition\fP is larger than the size of the +queue, it is appended at the end of the queue. This method returns +GID of registered download. +.sp +\fBJSON\-RPC EXEMPLO M010\fP +.sp +The following example adds \fBhttp://example.org/file\fP: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addUri\(aq, +\&... \(aqparams\(aq:[[\(aqhttp://example.org/file\(aq]]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> c.read() +\(aq{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M020\fP +.sp +The following example adds \fBhttp://example.org/file\fP: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.addUri([\(aqhttp://example.org/file\(aq]) +\(aq2089b05ecca3d829\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The following example adds 2 sources and some options: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> s.aria2.addUri([\(aqhttp://example.org/file\(aq, \(aqhttp://mirror/file\(aq], + dict(dir="/tmp")) +\(aqd2703803b52216d1\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The following example adds a download and insert it to the front of +waiting downloads: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> s.aria2.addUri([\(aqhttp://example.org/file\(aq], {}, 0) +\(aqca3d829cee549a4d\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.addTorrent(torrent[, uris[, options[, position]]]) +This method adds BitTorrent download by uploading ".torrent" file. +If you want to add BitTorrent Magnet URI, use \fI\%aria2.addUri()\fP +method instead. \fItorrent\fP is of type base64 which contains +Base64\-encoded ".torrent" file. \fIuris\fP is of type array and its +element is URI which is of type string. \fIuris\fP is used for +Web\-seeding. For single file torrents, URI can be a complete URI +pointing to the resource or if URI ends with /, name in torrent file +is added. For multi\-file torrents, name and path in torrent are +added to form a URI for each file. \fIoptions\fP is of type struct and +its members are a pair of option name and value. See +\fI\%Opções\fP below for more details. If \fIposition\fP is given +as an integer starting from 0, the new download is inserted at +\fIposition\fP in the waiting queue. If \fIposition\fP is not given or +\fIposition\fP is larger than the size of the queue, it is appended at +the end of the queue. This method returns GID of registered +download. If \fI\%\-\-rpc\-save\-upload\-metadata\fP is \fBtrue\fP, the +uploaded data is saved as a file named hex string of SHA\-1 hash of +data plus ".torrent" in the directory specified by \fI\%\-\-dir\fP option. The example of filename is +\fB0a3893293e27ac0490424c06de4d09242215f0a6.torrent\fP\&. If same file +already exists, it is overwritten. If the file cannot be saved +successfully or \fI\%\-\-rpc\-save\-upload\-metadata\fP is \fBfalse\fP, +the downloads added by this method are not saved by +\fI\%\-\-save\-session\fP\&. +.sp +The following examples add local file \fBfile.torrent\fP\&. +.sp +\fBJSON\-RPC EXEMPLO M030\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json, base64 +>>> torrent = base64.b64encode(open(\(aqfile.torrent\(aq).read()) +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqasdf\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addTorrent\(aq, \(aqparams\(aq:[torrent]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> c.read() +\(aq{"id":"asdf","jsonrpc":"2.0","result":"2089b05ecca3d829"}\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M040\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.addTorrent(xmlrpclib.Binary(open(\(aqfile.torrent\(aq).read())) +\(aq2089b05ecca3d829\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.addMetalink(metalink[, options[, position]]) +This method adds Metalink download by uploading ".metalink" file. +\fImetalink\fP is of type base64 which contains Base64\-encoded +".metalink" file. \fIoptions\fP is of type struct and its members are a +pair of option name and value. See \fI\%Opções\fP below for more +details. If \fIposition\fP is given as an integer starting from 0, the +new download is inserted at \fIposition\fP in the waiting queue. If +\fIposition\fP is not given or \fIposition\fP is larger than the size of the +queue, it is appended at the end of the queue. This method returns +array of GID of registered download. If +\fI\%\-\-rpc\-save\-upload\-metadata\fP is \fBtrue\fP, the uploaded data +is saved as a file named hex string of SHA\-1 hash of data plus +".metalink" in the directory specified by \fI\%\-\-dir\fP +option. The example of filename is +\fB0a3893293e27ac0490424c06de4d09242215f0a6.metalink\fP\&. If same file +already exists, it is overwritten. If the file cannot be saved +successfully or \fI\%\-\-rpc\-save\-upload\-metadata\fP is \fBfalse\fP, +the downloads added by this method are not saved by +\fI\%\-\-save\-session\fP\&. +.sp +The following examples add local file file.meta4. +.sp +\fBJSON\-RPC EXEMPLO M050\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json, base64 +>>> metalink = base64.b64encode(open(\(aqfile.meta4\(aq).read()) +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addMetalink\(aq, +\&... \(aqparams\(aq:[metalink]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> c.read() +\(aq{"id":"qwer","jsonrpc":"2.0","result":["2089b05ecca3d829"]}\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M060\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.addMetalink(xmlrpclib.Binary(open(\(aqfile.meta4\(aq).read())) +[\(aq2089b05ecca3d829\(aq] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.remove(gid) +This method removes the download denoted by \fIgid\fP\&. \fIgid\fP is of type +string. If specified download is in progress, it is stopped at +first. The status of removed download becomes \fBremoved\fP\&. This method +returns GID of removed download. +.sp +The following examples remove download GID#2089b05ecca3d829. +.sp +\fBJSON\-RPC EXEMPLO M070\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.remove\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> c.read() +\(aq{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M080\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.remove(\(aq2089b05ecca3d829\(aq) +\(aq2089b05ecca3d829\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.forceRemove(gid) +This method removes the download denoted by \fIgid\fP\&. This method +behaves just like \fI\%aria2.remove()\fP except that this method removes +download without any action which takes time such as contacting +BitTorrent tracker. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.pause(gid) +This method pauses the download denoted by \fIgid\fP\&. \fIgid\fP is of type +string. The status of paused download becomes \fBpaused\fP\&. If the +download is active, the download is placed on the first position of +waiting queue. As long as the status is \fBpaused\fP, the download is not +started. To change status to \fBwaiting\fP, use \fI\%aria2.unpause()\fP method. +This method returns GID of paused download. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.pauseAll() +This method is equal to calling \fI\%aria2.pause()\fP for every active/waiting +download. This methods returns \fBOK\fP for success. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.forcePause(pid) +This method pauses the download denoted by \fIgid\fP\&. This method +behaves just like \fI\%aria2.pause()\fP except that this method pauses +download without any action which takes time such as contacting +BitTorrent tracker. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.forcePauseAll() +This method is equal to calling \fI\%aria2.forcePause()\fP for every +active/waiting download. This methods returns \fBOK\fP for success. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.unpause(gid) +This method changes the status of the download denoted by \fIgid\fP from +\fBpaused\fP to \fBwaiting\fP\&. This makes the download eligible to restart. +\fIgid\fP is of type string. This method returns GID of unpaused +download. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.unpauseAll() +This method is equal to calling \fI\%aria2.unpause()\fP for every active/waiting +download. This methods returns \fBOK\fP for success. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.tellStatus(gid[, keys]) +This method returns download progress of the download denoted by +\fIgid\fP\&. \fIgid\fP is of type string. \fIkeys\fP is array of string. If it is +specified, the response contains only keys in \fIkeys\fP array. If \fIkeys\fP +is empty or not specified, the response contains all keys. This is +useful when you just want specific keys and avoid unnecessary +transfers. For example, \fBaria2.tellStatus("2089b05ecca3d829", ["gid", "status"])\fP +returns \fIgid\fP and \(aqstatus\(aq key. The response is of type struct and it +contains following keys. The value type is string. +.INDENT 7.0 +.TP +.B \fBgid\fP +GID of this download. +.TP +.B \fBstatus\fP +\fBactive\fP for currently downloading/seeding entry. \fBwaiting\fP for the +entry in the queue; download is not started. \fBpaused\fP for the +paused entry. \fBerror\fP for the stopped download because of +error. \fBcomplete\fP for the stopped and completed download. \fBremoved\fP +for the download removed by user. +.TP +.B \fBtotalLength\fP +Total length of this download in bytes. +.TP +.B \fBcompletedLength\fP +Completed length of this download in bytes. +.TP +.B \fBuploadLength\fP +Uploaded length of this download in bytes. +.TP +.B \fBbitfield\fP +Hexadecimal representation of the download progress. The highest bit +corresponds to piece index 0. The set bits indicate the piece is +available and unset bits indicate the piece is missing. The spare +bits at the end are set to zero. When download has not started yet, +this key will not be included in the response. +.TP +.B \fBdownloadSpeed\fP +Download speed of this download measured in bytes/sec. +.TP +.B \fBuploadSpeed\fP +Upload speed of this download measured in bytes/sec. +.TP +.B \fBinfoHash\fP +InfoHash. BitTorrent only. +.TP +.B \fBnumSeeders\fP +The number of seeders the client has connected to. BitTorrent only. +.TP +.B \fBpieceLength\fP +Piece length in bytes. +.TP +.B \fBnumPieces\fP +The number of pieces. +.TP +.B \fBconnections\fP +The number of peers/servers the client has connected to. +.TP +.B \fBerrorCode\fP +The last error code occurred in this download. The value is of type +string. The error codes are defined in \fI\%CÓDIGO DE RETORNO ou SAÍDA\fP +section. This value is only available for stopped/completed downloads. +.TP +.B \fBfollowedBy\fP +List of GIDs which are generated by the consequence of this +download. For example, when aria2 downloaded Metalink file, it +generates downloads described in it(see \fI\%\-\-follow\-metalink\fP +option). This value is useful to track these auto generated +downloads. If there is no such downloads, this key will not +be included in the response. +.TP +.B \fBbelongsTo\fP +GID of a parent download. Some downloads are a part of another +download. For example, if a file in Metalink has BitTorrent +resource, the download of ".torrent" is a part of that file. If this +download has no parent, this key will not be included in the +response. +.TP +.B \fBdir\fP +Directory to save files. This key is not available for stopped +downloads. +.TP +.B \fBfiles\fP +Returns the list of files. The element of list is the same struct +used in \fI\%aria2.getFiles()\fP method. +.TP +.B \fBbittorrent\fP +Struct which contains information retrieved from .torrent +file. BitTorrent only. It contains following keys. +.INDENT 7.0 +.TP +.B \fBannounceList\fP +List of lists of announce URI. If ".torrent" file contains announce +and no announce\-list, announce is converted to announce\-list +format. +.TP +.B \fBcomment\fP +The comment for the torrent. \fBcomment.utf\-8\fP is used if available. +.TP +.B \fBcreationDate\fP +The creation time of the torrent. The value is an integer since +the Epoch, measured in seconds. +.TP +.B \fBmode\fP +File mode of the torrent. The value is either \fBsingle\fP or \fBmulti\fP\&. +.TP +.B \fBinfo\fP +Struct which contains data from Info dictionary. It contains +following keys. +.INDENT 7.0 +.TP +.B \fBname\fP +name in info dictionary. \fBname.utf\-8\fP is used if available. +.UNINDENT +.UNINDENT +.UNINDENT +.sp +\fBJSON\-RPC EXEMPLO M090\fP +.sp +The following example gets information about download GID#2089b05ecca3d829: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.tellStatus\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqbitfield\(aq: u\(aq0000000000\(aq, + u\(aqcompletedLength\(aq: u\(aq901120\(aq, + u\(aqconnections\(aq: u\(aq1\(aq, + u\(aqdir\(aq: u\(aq/downloads\(aq, + u\(aqdownloadSpeed\(aq: u\(aq15158\(aq, + u\(aqfiles\(aq: [{u\(aqindex\(aq: u\(aq1\(aq, + u\(aqlength\(aq: u\(aq34896138\(aq, + u\(aqcompletedLength\(aq: u\(aq34896138\(aq, + u\(aqpath\(aq: u\(aq/downloads/file\(aq, + u\(aqselected\(aq: u\(aqtrue\(aq, + u\(aquris\(aq: [{u\(aqstatus\(aq: u\(aqused\(aq, + u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]}], + u\(aqgid\(aq: u\(aq2089b05ecca3d829\(aq, + u\(aqnumPieces\(aq: u\(aq34\(aq, + u\(aqpieceLength\(aq: u\(aq1048576\(aq, + u\(aqstatus\(aq: u\(aqactive\(aq, + u\(aqtotalLength\(aq: u\(aq34896138\(aq, + u\(aquploadLength\(aq: u\(aq0\(aq, + u\(aquploadSpeed\(aq: u\(aq0\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The following example gets information specifying keys you are +interested in: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.tellStatus\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq, +\&... [\(aqgid\(aq, +\&... \(aqtotalLength\(aq, +\&... \(aqcompletedLength\(aq]]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqcompletedLength\(aq: u\(aq5701632\(aq, + u\(aqgid\(aq: u\(aq2089b05ecca3d829\(aq, + u\(aqtotalLength\(aq: u\(aq34896138\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M100\fP +.sp +The following example gets information about download GID#2089b05ecca3d829: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.tellStatus(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +{\(aqbitfield\(aq: \(aqffff80\(aq, + \(aqcompletedLength\(aq: \(aq34896138\(aq, + \(aqconnections\(aq: \(aq0\(aq, + \(aqdir\(aq: \(aq/downloads\(aq, + \(aqdownloadSpeed\(aq: \(aq0\(aq, + \(aqerrorCode\(aq: \(aq0\(aq, + \(aqfiles\(aq: [{\(aqindex\(aq: \(aq1\(aq, + \(aqlength\(aq: \(aq34896138\(aq, + \(aqcompletedLength\(aq: \(aq34896138\(aq, + \(aqpath\(aq: \(aq/downloads/file\(aq, + \(aqselected\(aq: \(aqtrue\(aq, + \(aquris\(aq: [{\(aqstatus\(aq: \(aqused\(aq, + \(aquri\(aq: \(aqhttp://example.org/file\(aq}]}], + \(aqgid\(aq: \(aq2089b05ecca3d829\(aq, + \(aqnumPieces\(aq: \(aq17\(aq, + \(aqpieceLength\(aq: \(aq2097152\(aq, + \(aqstatus\(aq: \(aqcomplete\(aq, + \(aqtotalLength\(aq: \(aq34896138\(aq, + \(aquploadLength\(aq: \(aq0\(aq, + \(aquploadSpeed\(aq: \(aq0\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The following example gets information specifying keys you are +interested in: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> r = s.aria2.tellStatus(\(aq2089b05ecca3d829\(aq, [\(aqgid\(aq, \(aqtotalLength\(aq, \(aqcompletedLength\(aq]) +>>> pprint(r) +{\(aqcompletedLength\(aq: \(aq34896138\(aq, \(aqgid\(aq: \(aq2089b05ecca3d829\(aq, \(aqtotalLength\(aq: \(aq34896138\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getUris(gid) +This method returns URIs used in the download denoted by \fIgid\fP\&. \fIgid\fP +is of type string. The response is of type array and its element is of +type struct and it contains following keys. The value type is string. +.INDENT 7.0 +.TP +.B \fBuri\fP +URI +.TP +.B \fBstatus\fP +\(aqused\(aq if the URI is already used. \(aqwaiting\(aq if the URI is waiting +in the queue. +.UNINDENT +.sp +\fBJSON\-RPC EXEMPLO M110\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getUris\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [{u\(aqstatus\(aq: u\(aqused\(aq, + u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M120\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getUris(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +[{\(aqstatus\(aq: \(aqused\(aq, \(aquri\(aq: \(aqhttp://example.org/file\(aq}] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getFiles(gid) +This method returns file list of the download denoted by \fIgid\fP\&. \fIgid\fP +is of type string. The response is of type array and its element is of +type struct and it contains following keys. The value type is string. +.INDENT 7.0 +.TP +.B \fBindex\fP +Index of file. Starting with 1. This is the same order with the +files in multi\-file torrent. +.TP +.B \fBpath\fP +File path. +.TP +.B \fBlength\fP +File size in bytes. +.TP +.B \fBcompletedLength\fP +Completed length of this file in bytes. Please note that it is +possible that sum of completedLength is less than completedLength in +\fI\%aria2.tellStatus()\fP method. +This is because completedLength in +\fI\%aria2.getFiles()\fP +only calculates completed pieces. On the other hand, completedLength +in +\fI\%aria2.tellStatus()\fP takes into account +of partially completed piece. +.TP +.B \fBselected\fP +\fBtrue\fP if this file is selected by \fI\%\-\-select\-file\fP option. If +\fI\%\-\-select\-file\fP is not specified or this is single torrent or no +torrent download, this value is always \fBtrue\fP\&. Otherwise \fBfalse\fP\&. +.TP +.B \fBuris\fP +Returns the list of URI for this file. The element of list is the +same struct used in \fI\%aria2.getUris()\fP method. +.UNINDENT +.sp +\fBJSON\-RPC EXEMPLO M130\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getFiles\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [{u\(aqindex\(aq: u\(aq1\(aq, + u\(aqlength\(aq: u\(aq34896138\(aq, + u\(aqcompletedLength\(aq: u\(aq34896138\(aq, + u\(aqpath\(aq: u\(aq/downloads/file\(aq, + u\(aqselected\(aq: u\(aqtrue\(aq, + u\(aquris\(aq: [{u\(aqstatus\(aq: u\(aqused\(aq, + u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]}]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M140\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getFiles(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +[{\(aqindex\(aq: \(aq1\(aq, + \(aqlength\(aq: \(aq34896138\(aq, + \(aqcompletedLength\(aq: \(aq34896138\(aq, + \(aqpath\(aq: \(aq/downloads/file\(aq, + \(aqselected\(aq: \(aqtrue\(aq, + \(aquris\(aq: [{\(aqstatus\(aq: \(aqused\(aq, + \(aquri\(aq: \(aqhttp://example.org/file\(aq}]}] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getPeers(gid) +This method returns peer list of the download denoted by \fIgid\fP\&. \fIgid\fP +is of type string. This method is for BitTorrent only. The response +is of type array and its element is of type struct and it contains +following keys. The value type is string. +.INDENT 7.0 +.TP +.B \fBpeerId\fP +Percent\-encoded peer ID. +.TP +.B \fBip\fP +IP address of the peer. +.TP +.B \fBport\fP +Port number of the peer. +.TP +.B \fBbitfield\fP +Hexadecimal representation of the download progress of the peer. The +highest bit corresponds to piece index 0. The set bits indicate the +piece is available and unset bits indicate the piece is missing. The +spare bits at the end are set to zero. +.TP +.B \fBamChoking\fP +\fBtrue\fP if this client is choking the peer. Otherwise \fBfalse\fP\&. +.TP +.B \fBpeerChoking\fP +\fBtrue\fP if the peer is choking this client. Otherwise \fBfalse\fP\&. +.TP +.B \fBdownloadSpeed\fP +Download speed (byte/sec) that this client obtains from the peer. +.TP +.B \fBuploadSpeed\fP +Upload speed(byte/sec) that this client uploads to the peer. +.TP +.B \fBseeder\fP +\fBtrue\fP is this client is a seeder. Otherwise \fBfalse\fP\&. +.UNINDENT +.sp +\fBJSON\-RPC EXEMPLO M150\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getPeers\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [{u\(aqamChoking\(aq: u\(aqtrue\(aq, + u\(aqbitfield\(aq: u\(aqffffffffffffffffffffffffffffffffffffffff\(aq, + u\(aqdownloadSpeed\(aq: u\(aq10602\(aq, + u\(aqip\(aq: u\(aq10.0.0.9\(aq, + u\(aqpeerChoking\(aq: u\(aqfalse\(aq, + u\(aqpeerId\(aq: u\(aqaria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6\(aq, + u\(aqport\(aq: u\(aq6881\(aq, + u\(aqseeder\(aq: u\(aqtrue\(aq, + u\(aquploadSpeed\(aq: u\(aq0\(aq}, + {u\(aqamChoking\(aq: u\(aqfalse\(aq, + u\(aqbitfield\(aq: u\(aqffffeff0fffffffbfffffff9fffffcfff7f4ffff\(aq, + u\(aqdownloadSpeed\(aq: u\(aq8654\(aq, + u\(aqip\(aq: u\(aq10.0.0.30\(aq, + u\(aqpeerChoking\(aq: u\(aqfalse\(aq, + u\(aqpeerId\(aq: u\(aqbittorrent client758\(aq, + u\(aqport\(aq: u\(aq37842\(aq, + u\(aqseeder\(aq: u\(aqfalse\(aq, + u\(aquploadSpeed\(aq: u\(aq6890\(aq}]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M160\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getPeers(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +[{\(aqamChoking\(aq: \(aqtrue\(aq, + \(aqbitfield\(aq: \(aqffffffffffffffffffffffffffffffffffffffff\(aq, + \(aqdownloadSpeed\(aq: \(aq10602\(aq, + \(aqip\(aq: \(aq10.0.0.9\(aq, + \(aqpeerChoking\(aq: \(aqfalse\(aq, + \(aqpeerId\(aq: \(aqaria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6\(aq, + \(aqport\(aq: \(aq6881\(aq, + \(aqseeder\(aq: \(aqtrue\(aq, + \(aquploadSpeed\(aq: \(aq0\(aq}, + {\(aqamChoking\(aq: \(aqfalse\(aq, + \(aqbitfield\(aq: \(aqffffeff0fffffffbfffffff9fffffcfff7f4ffff\(aq, + \(aqdownloadSpeed\(aq: \(aq8654\(aq, + \(aqip\(aq: \(aq10.0.0.30\(aq, + \(aqpeerChoking\(aq: \(aqfalse\(aq, + \(aqpeerId\(aq: \(aqbittorrent client758\(aq, + \(aqport\(aq: \(aq37842\(aq, + \(aqseeder\(aq: \(aqfalse, + \(aquploadSpeed\(aq: \(aq6890\(aq}] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getServers(gid) +This method returns currently connected HTTP, HTTPS, FTP servers of the +download denoted by \fIgid\fP\&. \fIgid\fP is of type string. The response +is of type array and its element is of type struct and it contains +following keys. The value type is string. +.INDENT 7.0 +.TP +.B \fBindex\fP +Index of file. Starting with 1. This is the same order with the +files in multi\-file torrent. +.TP +.B \fBservers\fP +The list of struct which contains following keys. +.INDENT 7.0 +.TP +.B \fBuri\fP +URI originally added. +.TP +.B \fBcurrentUri\fP +This is the URI currently used for downloading. If redirection is +involved, currentUri and uri may differ. +.TP +.B \fBdownloadSpeed\fP +Download speed (byte/sec) +.UNINDENT +.UNINDENT +.sp +\fBJSON\-RPC EXEMPLO M170\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getServers\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [{u\(aqindex\(aq: u\(aq1\(aq, + u\(aqservers\(aq: [{u\(aqcurrentUri\(aq: u\(aqhttp://example.org/file\(aq, + u\(aqdownloadSpeed\(aq: u\(aq10467\(aq, + u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]}]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M180\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getServers(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +[{\(aqindex\(aq: \(aq1\(aq, + \(aqservers\(aq: [{\(aqcurrentUri\(aq: \(aqhttp://example.org/dl/file\(aq, + \(aqdownloadSpeed\(aq: \(aq20285\(aq, + \(aquri\(aq: \(aqhttp://example.org/file\(aq}]}] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.tellActive([keys]) +This method returns the list of active downloads. The response is of +type array and its element is the same struct returned by +\fI\%aria2.tellStatus()\fP method. For \fIkeys\fP parameter, please refer to +\fI\%aria2.tellStatus()\fP method. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.tellWaiting(offset, num[, keys]) +This method returns the list of waiting download, including paused +downloads. \fIoffset\fP is of type integer and specifies the offset from +the download waiting at the front. \fInum\fP is of type integer and +specifies the number of downloads to be returned. For \fIkeys\fP +parameter, please refer to \fI\%aria2.tellStatus()\fP method. +.sp +If \fIoffset\fP is a positive integer, this method returns downloads in the +range of [\fIoffset\fP, \fIoffset\fP + \fInum\fP). +.sp +\fIoffset\fP can be a negative integer. \fIoffset\fP == \-1 points last +download in the waiting queue and \fIoffset\fP == \-2 points the download +before the last download, and so on. The downloads in the response are +in reversed order. +.sp +For example, imagine that three downloads "A","B" and "C" are waiting +in this order. \fBaria2.tellWaiting(0, 1)\fP returns +\fB["A"]\fP\&. \fBaria2.tellWaiting(1, 2)\fP returns \fB["B", "C"]\fP\&. +\fBaria2.tellWaiting(\-1, 2)\fP returns \fB["C", "B"]\fP\&. +.sp +The response is of type array and its element is the same struct +returned by \fI\%aria2.tellStatus()\fP method. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.tellStopped(offset, num[, keys]) +This method returns the list of stopped download. \fIoffset\fP is of type +integer and specifies the offset from the oldest download. \fInum\fP is of +type integer and specifies the number of downloads to be returned. +For \fIkeys\fP parameter, please refer to \fI\%aria2.tellStatus()\fP method. +.sp +\fIoffset\fP and \fInum\fP have the same semantics as \fI\%aria2.tellWaiting()\fP +method. +.sp +The response is of type array and its element is the same struct +returned by \fI\%aria2.tellStatus()\fP method. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.changePosition(gid, pos, how) +This method changes the position of the download denoted by +\fIgid\fP\&. \fIpos\fP is of type integer. \fIhow\fP is of type string. If \fIhow\fP is +\fBPOS_SET\fP, it moves the download to a position relative to the +beginning of the queue. If \fIhow\fP is \fBPOS_CUR\fP, it moves the download +to a position relative to the current position. If \fIhow\fP is \fBPOS_END\fP, +it moves the download to a position relative to the end of the +queue. If the destination position is less than 0 or beyond the end of +the queue, it moves the download to the beginning or the end of the +queue respectively. The response is of type integer and it is the +destination position. +.sp +For example, if GID#2089b05ecca3d829 is placed in position 3, +\fBaria2.changePosition(\(aq2089b05ecca3d829\(aq, \-1, \(aqPOS_CUR\(aq)\fP will +change its position to 2. Additional +\fBaria2.changePosition(\(aq2089b05ecca3d829\(aq, 0, \(aqPOS_SET\(aq)\fP will +change its position to 0(the beginning of the queue). +.sp +The following examples move the download GID#2089b05ecca3d829 to the +front of the waiting queue. +.sp +\fBJSON\-RPC EXEMPLO M190\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.changePosition\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq, 0, \(aqPOS_SET\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: 0} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M200\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.changePosition(\(aq2089b05ecca3d829\(aq, 0, \(aqPOS_SET\(aq) +0 +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.changeUri(gid, fileIndex, delUris, addUris[, position]) +This method removes URIs in \fIdelUris\fP from and appends URIs in +\fIaddUris\fP to download denoted by \fIgid\fP\&. \fIdelUris\fP and \fIaddUris\fP are +list of string. A download can contain multiple files and URIs are +attached to each file. \fIfileIndex\fP is used to select which file to +remove/attach given URIs. \fIfileIndex\fP is 1\-based. \fIposition\fP is used +to specify where URIs are inserted in the existing waiting URI +list. \fIposition\fP is 0\-based. When \fIposition\fP is omitted, URIs are +appended to the back of the list. This method first execute removal +and then addition. \fIposition\fP is the position after URIs are removed, +not the position when this method is called. When removing URI, if +same URIs exist in download, only one of them is removed for each URI +in \fIdelUris\fP\&. In other words, there are three URIs +\fBhttp://example.org/aria2\fP and you want remove them all, you have to +specify (at least) 3 \fBhttp://example.org/aria2\fP in \fIdelUris\fP\&. This +method returns a list which contains 2 integers. The first integer is +the number of URIs deleted. The second integer is the number of URIs +added. +.sp +The following examples add 1 URI \fBhttp://example.org/file\fP to the +file whose index is \fB1\fP and belongs to the download +GID#2089b05ecca3d829. +.sp +\fBJSON\-RPC EXEMPLO M210\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.changeUri\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq, 1, [], + [\(aqhttp://example.org/file\(aq]]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: [0, 1]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M220\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.changeUri(\(aq2089b05ecca3d829\(aq, 1, [], + [\(aqhttp://example.org/file\(aq]) +[0, 1] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getOption(gid) +This method returns options of the download denoted by \fIgid\fP\&. The +response is of type struct. Its key is the name of option. The value +type is string. Note that this method does not return options which +have no default value and have not been set by the command\-line +options, configuration files or RPC methods. +.sp +The following examples get options of the download +GID#2089b05ecca3d829. +.sp +\fBJSON\-RPC EXEMPLO M230\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getOption\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqallow\-overwrite\(aq: u\(aqfalse\(aq, + u\(aqallow\-piece\-length\-change\(aq: u\(aqfalse\(aq, + u\(aqalways\-resume\(aq: u\(aqtrue\(aq, + u\(aqasync\-dns\(aq: u\(aqtrue\(aq, + ... +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M240\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getOption(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +{\(aqallow\-overwrite\(aq: \(aqfalse\(aq, + \(aqallow\-piece\-length\-change\(aq: \(aqfalse\(aq, + \(aqalways\-resume\(aq: \(aqtrue\(aq, + \(aqasync\-dns\(aq: \(aqtrue\(aq, + .... +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.changeOption(gid, options) +This method changes options of the download denoted by \fIgid\fP +dynamically. \fIgid\fP is of type string. \fIoptions\fP is of type struct. +The following options are available for active downloads: +.INDENT 7.0 +.IP \(bu 2 +\fI\%bt\-max\-peers\fP +.IP \(bu 2 +\fI\%bt\-request\-peer\-speed\-limit\fP +.IP \(bu 2 +\fI\%bt\-remove\-unselected\-file\fP +.IP \(bu 2 +\fI\%force\-save\fP +.IP \(bu 2 +\fI\%max\-download\-limit\fP +.IP \(bu 2 +\fI\%max\-upload\-limit\fP +.UNINDENT +.sp +For waiting or paused downloads, in addition to the above options, +options listed in \fI\%Arquivo de Entrada\fP subsection are available, +except for following options: +\fI\%dry\-run\fP, +\fI\%metalink\-base\-uri\fP, +\fI\%parameterized\-uri\fP, +\fI\%pause\fP, +\fI\%piece\-length\fP and +\fI\%rpc\-save\-upload\-metadata\fP option. +This method returns \fBOK\fP for success. +.sp +The following examples set \fI\%max\-download\-limit\fP option to \fB20K\fP for the download +GID#2089b05ecca3d829. +.sp +\fBJSON\-RPC EXEMPLO M250\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.changeOption\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq, +\&... {\(aqmax\-download\-limit\(aq:\(aq10K\(aq}]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aqOK\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M260\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.changeOption(\(aq2089b05ecca3d829\(aq, {\(aqmax\-download\-limit\(aq:\(aq20K\(aq}) +\(aqOK\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getGlobalOption() +This method returns global options. The response is of type +struct. Its key is the name of option. The value type is string. +Note that this method does not return options which have no default +value and have not been set by the command\-line options, configuration +files or RPC methods. Because global options are used as a template +for the options of newly added download, the response contains keys +returned by \fI\%aria2.getOption()\fP method. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.changeGlobalOption(options) +This method changes global options dynamically. \fIoptions\fP is of type +struct. +The following options are available: +.INDENT 7.0 +.IP \(bu 2 +\fI\%download\-result\fP +.IP \(bu 2 +\fI\%log\fP +.IP \(bu 2 +\fI\%log\-level\fP +.IP \(bu 2 +\fI\%max\-concurrent\-downloads\fP +.IP \(bu 2 +\fI\%max\-download\-result\fP +.IP \(bu 2 +\fI\%max\-overall\-download\-limit\fP +.IP \(bu 2 +\fI\%max\-overall\-upload\-limit\fP +.IP \(bu 2 +\fI\%save\-cookies\fP +.IP \(bu 2 +\fI\%save\-session\fP +.IP \(bu 2 +\fI\%server\-stat\-of\fP +.UNINDENT +.sp +In addition to them, options listed in \fI\%Arquivo de Entrada\fP subsection +are available, except for following options: +\fI\%checksum\fP, +\fI\%index\-out\fP, +\fI\%out\fP, +\fI\%pause\fP and +\fI\%select\-file\fP\&. +.sp +Using \fI\%log\fP option, you can dynamically start logging or +change log file. To stop logging, give empty string("") as a parameter +value. Note that log file is always opened in append mode. This method +returns \fBOK\fP for success. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getGlobalStat() +This method returns global statistics such as overall download and +upload speed. The response is of type struct and contains following +keys. The value type is string. +.INDENT 7.0 +.TP +.B \fBdownloadSpeed\fP +Overall download speed (byte/sec). +.TP +.B \fBuploadSpeed\fP +Overall upload speed(byte/sec). +.TP +.B \fBnumActive\fP +The number of active downloads. +.TP +.B \fBnumWaiting\fP +The number of waiting downloads. +.TP +.B \fBnumStopped\fP +The number of stopped downloads. +.UNINDENT +.sp +\fBJSON\-RPC EXEMPLO M270\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getGlobalStat\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqdownloadSpeed\(aq: u\(aq21846\(aq, + u\(aqnumActive\(aq: u\(aq2\(aq, + u\(aqnumStopped\(aq: u\(aq0\(aq, + u\(aqnumWaiting\(aq: u\(aq0\(aq, + u\(aquploadSpeed\(aq: u\(aq0\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M280\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getGlobalStat() +>>> pprint(r) +{\(aqdownloadSpeed\(aq: \(aq23136\(aq, + \(aqnumActive\(aq: \(aq2\(aq, + \(aqnumStopped\(aq: \(aq0\(aq, + \(aqnumWaiting\(aq: \(aq0\(aq, + \(aquploadSpeed\(aq: \(aq0\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.purgeDownloadResult() +This method purges completed/error/removed downloads to free memory. +This method returns \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.removeDownloadResult(gid) +This method removes completed/error/removed download denoted by \fIgid\fP +from memory. This method returns \fBOK\fP for success. +.sp +The following examples remove the download result of the download +GID#2089b05ecca3d829. +.sp +\fBJSON\-RPC EXEMPLO M290\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.removeDownloadResult\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aqOK\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M300\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.removeDownloadResult(\(aq2089b05ecca3d829\(aq) +\(aqOK\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getVersion() +This method returns version of the program and the list of enabled +features. The response is of type struct and contains following keys. +.INDENT 7.0 +.TP +.B \fBversion\fP +Version number of the program in string. +.TP +.B \fBenabledFeatures\fP +List of enabled features. Each feature name is of type string. +.UNINDENT +.sp +\fBJSON\-RPC EXEMPLO M310\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getVersion\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqenabledFeatures\(aq: [u\(aqAsync DNS\(aq, + u\(aqBitTorrent\(aq, + u\(aqFirefox3 Cookie\(aq, + u\(aqGZip\(aq, + u\(aqHTTPS\(aq, + u\(aqMessage Digest\(aq, + u\(aqMetalink\(aq, + u\(aqXML\-RPC\(aq], + u\(aqversion\(aq: u\(aq1.11.0\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M320\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getVersion() +>>> pprint(r) +{\(aqenabledFeatures\(aq: [\(aqAsync DNS\(aq, + \(aqBitTorrent\(aq, + \(aqFirefox3 Cookie\(aq, + \(aqGZip\(aq, + \(aqHTTPS\(aq, + \(aqMessage Digest\(aq, + \(aqMetalink\(aq, + \(aqXML\-RPC\(aq], + \(aqversion\(aq: \(aq1.11.0\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getSessionInfo() +This method returns session information. +The response is of type struct and contains following key. +.INDENT 7.0 +.TP +.B \fBsessionId\fP +Session ID, which is generated each time when aria2 is invoked. +.UNINDENT +.sp +\fBJSON\-RPC EXEMPLO M330\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getSessionInfo\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqsessionId\(aq: u\(aqcd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M340\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.getSessionInfo() +{\(aqsessionId\(aq: \(aqcd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.shutdown() +This method shutdowns aria2. This method returns \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.forceShutdown() +This method shutdowns \fBaria2. This method behaves like aria2.shutdown()\fP +except that any actions which takes time such as contacting BitTorrent +tracker are skipped. This method returns \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B system.multicall(methods) +This methods encapsulates multiple method calls in a single request. +\fImethods\fP is of type array and its element is struct. The struct +contains two keys: \fBmethodName\fP and \fBparams\fP\&. \fBmethodName\fP is the +method name to call and \fBparams\fP is array containing parameters to the +method. This method returns array of responses. The element of array +will either be a one\-item array containing the return value of each +method call or struct of fault element if an encapsulated method call +fails. +.sp +In the following examples, we add 2 downloads. First one is +\fBhttp://example.org/file\fP and second one is \fBfile.torrent\fP\&. +.sp +\fBJSON\-RPC EXEMPLO M350\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json, base64 +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqsystem.multicall\(aq, +\&... \(aqparams\(aq:[[{\(aqmethodName\(aq:\(aqaria2.addUri\(aq, +\&... \(aqparams\(aq:[[\(aqhttp://example.org\(aq]]}, +\&... {\(aqmethodName\(aq:\(aqaria2.addTorrent\(aq, +\&... \(aqparams\(aq:[base64.b64encode(open(\(aqfile.torrent\(aq).read())]}]]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: [[u\(aq2089b05ecca3d829\(aq], [u\(aqd2703803b52216d1\(aq]]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +JSON\-RPC also supports Batch request described in JSON\-RPC 2.0 Specification: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> jsonreq = json.dumps([{\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addUri\(aq, +\&... \(aqparams\(aq:[[\(aqhttp://example.org\(aq]]}, +\&... {\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqasdf\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addTorrent\(aq, +\&... \(aqparams\(aq:[base64.b64encode(open(\(aqfile.torrent\(aq).read())]}]) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +[{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aq2089b05ecca3d829\(aq}, + {u\(aqid\(aq: u\(aqasdf\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aqd2703803b52216d1\(aq}] +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBXML\-RPC EXEMPLO M360\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> mc = xmlrpclib.MultiCall(s) +>>> mc.aria2.addUri([\(aqhttp://example.org/file\(aq]) +>>> mc.aria2.addTorrent(xmlrpclib.Binary(open(\(aqfile.torrent\(aq).read())) +>>> r = mc() +>>> tuple(r) +(\(aq2089b05ecca3d829\(aq, \(aqd2703803b52216d1\(aq) +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.SS Tratamento de Erros +.sp +Usando JSON\-RPC, aria2 retorna objeto JSON que contém código de erro +no código e a mensagem de erro na mensagem. +.sp +Usando XML\-RPC, aria2 retorna código de falha (faultCode=1) e a mensagem +de erro em (faultString). +.SS Opções +.sp +Same options for \fI\%\-\-input\-file\fP list are available. +Ver subseção \fI\%Arquivo de Entrada\fP para lista completa de opções. +.sp +In the option struct, name element is option name(without preceding +\fB\-\-\fP) and value element is argument as string. +.SS EXEMPLO JSON\-RPC M370 +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +{\(aqsplit\(aq:\(aq1\(aq, \(aqhttp\-proxy\(aq:\(aqhttp://proxy/\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.SS EXEMPLO XML\-RPC M380 +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C + + + split + 1 + + + http\-proxy + http://proxy/ + + +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fI\%header\fP and \fI\%index\-out\fP +option are allowed multiple times in +command\-line. Since name should be unique in struct(many XML\-RPC +library implementation uses hash or dict for struct), single string is +not enough. To overcome this situation, they can take array as value +as well as string. +.SS EXEMPLO JSON\-RPC M390 +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +{\(aqheader\(aq:[\(aqAccept\-Language: ja\(aq, \(aqAccept\-Charset: utf\-8\(aq]} +.ft P +.fi +.UNINDENT +.UNINDENT +.SS EXEMPLO XML\-RPC M400 +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C + + + header + + + + Accept\-Language: ja + Accept\-Charset: utf\-8 + + + + + +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Following example adds a download with 2 options: dir and header. +header option has 2 values, so it uses a list: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> opts = dict(dir=\(aq/tmp\(aq, +\&... header=[\(aqAccept\-Language: ja\(aq, +\&... \(aqAccept\-Charset: utf\-8\(aq]) +>>> s.aria2.addUri([\(aqhttp://example.org/file\(aq], opts) +\(aq1\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.SS JSON\-RPC usando HTTP GET +.sp +The JSON\-RPC interface also supports request via HTTP GET. +The encoding scheme in GET parameters is based on JSON\-RPC over HTTP +Specification [2008\-1\-15(RC1)]. The encoding of GET parameters are follows: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +/jsonrpc?method=METHOD_NAME&id=ID¶ms=BASE64_ENCODED_PARAMS +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The \fBmethod\fP and \fBid\fP are always treated as JSON string and their +encoding must be UTF\-8. +.sp +For example, The encoded string of +\fBaria2.tellStatus(\(aq2089b05ecca3d829\(aq)\fP with \fBid=\(aqfoo\(aq\fP looks like +this: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +/jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The \fBparams\fP parameter is Base64\-encoded JSON array which usually +appears in \fBparams\fP attribute in JSON\-RPC request object. In the +above example, the params is \fB["2089b05ecca3d829"]\fP, therefore: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +["2089b05ecca3d829"] \-\-(Base64)\-\-> WyIyMDg5YjA1ZWNjYTNkODI5Il0= + \-\-(Percent Encode)\-\-> WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +The JSON\-RPC interface supports JSONP. You can specify the callback +function in \fBjsoncallback\fP parameter: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +/jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D&jsoncallback=cb +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +For Batch request, \fBmethod\fP and \fBid\fP parameter must not be specified. +Whole request must be specified in \fBparams\fP parameter. For example, +Batch request: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +[{\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \(aqmethod\(aq:\(aqaria2.getVersion\(aq}, + {\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqasdf\(aq, \(aqmethod\(aq:\(aqaria2.tellActive\(aq}] +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +will be encoded like this: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +/jsonrpc?params=W3sianNvbnJwYyI6ICIyLjAiLCAiaWQiOiAicXdlciIsICJtZXRob2QiOiAiYXJpYTIuZ2V0VmVyc2lvbiJ9LCB7Impzb25ycGMiOiAiMi4wIiwgImlkIjogImFzZGYiLCAibWV0aG9kIjogImFyaWEyLnRlbGxBY3RpdmUifV0%3D +.ft P +.fi +.UNINDENT +.UNINDENT +.SS JSON\-RPC sobre WebSocket +.sp +JSON\-RPC sobre WebSocket utiliza o mesmo método de assinatura e resposta +do formato JSON\-RPC sobre HTTP. O WebSocket suportado é da versão 13 +o qual é detalhado na \fI\%RFC 6455\fP\&. +.sp +Para enviar uma requisição RPC para um servidor RPC, enviar strings serializadas +JSON num frame Text. A resposta do servidor RPC será entregue também em um frame +Text. +.sp +O servidor RPC ira enviar a notificação ao cliente. A notificação é +unidirecional, portanto o cliente que receber a notificação não pode +responde\-la. Esse método de assinatura de notificação é muito usual mas +não provê uma identificação de chave. Os valores associados pelos parâmetros +chave são os dados que a notificação porta. O formato desses valores +variam dependendo do método de notificação. Os seguintes métodos de notificação +são definidos: +.INDENT 0.0 +.TP +.B aria2.onDownloadStart(event) +Essa notificação será enviada quando e se o download for iniciado. +\fIevent\fP é o tipo de estrutura e pode conter as seguintes chaves: +O formato do valor é string. +.INDENT 7.0 +.TP +.B \fBgid\fP +GID do download. +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onDownloadPause(event) +Esta notificação será enviada se o download for pausado. \fIevent\fP +tem a mesma estrutura do argumento \fIevent\fP do método da função +\fI\%aria2.onDownloadStart()\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onDownloadStop(event) +Essa notificação será enviada se o download for interrompido pelo usuário. +\fIevent\fP tem a mesma estrutura do argumento \fIevent\fP do método da função +\fI\%aria2.onDownloadStart()\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onDownloadComplete(event) +Esta notificação será enviada quando o download for completado. Para +downloads BitTorrent, esta notificação será enviada quando for completado e +o (seed) terminar. O \fIevent\fP tem a mesma estrutura do \fIevent\fP do método da +função \fI\%aria2.onDownloadStart()\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onDownloadError(event) +Esta notificação será enviada se o download for interrompido por causa de +um erro. +O \fIevent\fP tem a mesma estrutura do \fIevent\fP do método da função +\fI\%aria2.onDownloadStart()\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onBtDownloadComplete(event) +Esta notificação será enviada se o download for completado para o +BitTorrent (mas o seeding pode não ter sido concluído). O \fIevent\fP tem a +mesma estrutura do \fIevent\fP do método da função \fI\%aria2.onDownloadStart()\fP\&. +.UNINDENT +.SS Exemplo Cliente XML\-RPC Ruby +.sp +O seguinte script Ruby script adiciona \fBhttp://localhost/aria2.tar.bz2\fP em +aria2c no servidor em localhost com a opção \fI\%\-\-dir=/downloads\fP e +imprime a resposta do processamento: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +#!/usr/bin/env ruby + +require \(aqxmlrpc/client\(aq +require \(aqpp\(aq + +client=XMLRPC::Client.new2("http://localhost:6800/rpc") + +options={ "dir" => "/downloads" } +result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options) + +pp result +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Se você usa Python, pode usar xmlrpclib (em Python3.x, use xmlrpc.client) para +interagir com aria2: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +import xmlrpclib +from pprint import pprint + +s = xmlrpclib.ServerProxy("http://localhost:6800/rpc") +r = s.aria2.addUri(["http://localhost/aria2.tar.bz2"], {"dir":"/downloads"}) +pprint(r) +.ft P +.fi +.UNINDENT +.UNINDENT +.SH DIVERSOS +.SS Mensagens na Console +.sp +Enquanto executa o download de arquivos, aria2 imprime mensagens na console +para mostrar o progresso dos downloads. Um exemplo abaixo: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +[#1 SIZE:400.0KiB/33.2MiB(1%) CN:1 SPD:115.7KiBs ETA:4m51s] +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Entenda o que estes números e strings significam. +.INDENT 0.0 +.TP +.B \fB#N\fP +N significa GID, o qual é um ID único para cada download. +.TP +.B \fBSIZE\fP +Tamanho Total e Tamanho em bytes. Se a \fI\%\-\-select\-file\fP é usada, +será exibida a somatória do tamanho do arquivo. +.TP +.B \fBSEEDING\fP +Taxa compartilhamento ratio. O cliente está funcionando. Após término do +download do BitTorrent, \fBSIZE\fP será substituído por \fBSEEDING\fP\&. +.TP +.B \fBCN\fP +Número de conexões que o cliente estabeleceu. +.TP +.B \fBSEED\fP +O número de seeders ao qual o cliente está conectado. +.TP +.B \fBSPD\fP +Velocidade do download. +.TP +.B \fBUP\fP +Velocidade e número de bytes transmitidos upload. +.TP +.B \fBETA\fP +Tempo previsto para conclusão. +.TP +.B \fBTOTAL SPD\fP +A soma das velocidades de download para todos downloads paralelos. +.UNINDENT +.sp +Quando aria2 está alocando o espaço para arquivo ou validando o checksum, +adicionalmente exibirá o progresso: +.INDENT 0.0 +.TP +.B FileAlloc +GID, tamanho alocado e total em bytes. +.TP +.B Checksum +GID, tamanho validado e total em bytes. +.UNINDENT +.SH EXEMPLOS DOWNLOAD HTTP / FTP +.SS Download Segmentado HTTP/FTP +.SS Download de arquivo +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c "http://servidor/arquivo.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Para parar o download, pressione \fBCtrl\-C\fP\&. Posteriormente pode ser +retomado o mesmo download no mesmo diretório. Podem ser modificadas as URIs +pois elas apontam para o mesmo arquivo. +.UNINDENT +.UNINDENT +.SS Download de arquivo de 2 servidores HTTP diferentes +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c "http://servidor/arquivo.zip" "http://espelhobrasil/arquivo.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download de arquivo do mesmo servidor HTTP usando 2 conexões +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-x2 \-k1M "http://servidorbrasil/arquivo.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download de arquivo de servidor HTTP e FTP +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c "http://svrbrasil/arquivo.zip" "ftp://servebr/arquivo.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download arquivos especificados num arquivo txt concomitantemente +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-i arquivo.txt \-j2 +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +\-j especifica número de downloads paralelos. +.UNINDENT +.UNINDENT +.SS Usando proxy +.sp +Para HTTP: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-http\-proxy="http://svrproxy:8080" "http://servidor/arquivo" +.ft P +.fi +.UNINDENT +.UNINDENT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-http\-proxy="http://svrproxy:8080" +\-\-no\-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://servidor/arquivo" + +a máscara de rede /16 quer dizer que para toda a rede 192.168 também não +será usado o servidor proxy +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Para FTP: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-ftp\-proxy="http://svrproxy:8080" "ftp://servidor/arquivo" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Ver \fI\%\-\-http\-proxy\fP, \fI\%\-\-https\-proxy\fP, \fI\%\-\-ftp\-proxy\fP, +\fI\%\-\-all\-proxy\fP e \fI\%\-\-no\-proxy\fP para detalhes. Proxy pode ser +especificado nas variáveis de ambiente. Ver seção \fI\%VARIÁVEIS DE AMBIENTE\fP . +.UNINDENT +.UNINDENT +.SS Proxy com autenticação / autorização +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-http\-proxy="http://usuário:senha@svrproxy:8080" +"http://servidor/arquivo" +.ft P +.fi +.UNINDENT +.UNINDENT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-http\-proxy="http://svrproxy:8080" +\-\-http\-proxy\-user="usuário" \-\-http\-proxy\-passwd="senha" +"http://servidor/arquivo" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download Metalink +.SS Download arquivos com Metalink remoto +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-follow\-metalink=mem "http://servidor/arquivo.metalink" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download arquivos com Metalink local +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-p \-\-lowest\-speed\-limit=4000 arquivo.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Para parar o download, pressione \fBCtrl\-C\fP\&. +A transferência pode ser retomada executando aria2c com o mesmo argumento +no mesmo diretório +.UNINDENT +.UNINDENT +.SS Download diversos arquivos Metalink local +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-j2 arquivo1.metalink arquivo2.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download só arquivos selecionados usando index +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-select\-file=1\-4,8 arquivo.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +O index é exibido na console usando opção \-S. +.UNINDENT +.UNINDENT +.SS Download um arquivo usando Metalink local com preferência do usuário +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-metalink\-location=pt,us \-\-metalink\-version=1.1 \-\-metalink\-language=pt\-BR arquivo.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download BitTorrent +.SS Download arquivos de BitTorrent remotos +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-follow\-torrent=mem "http://servidortorrent/arquivo.torrent" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download usando arquivo torrent local +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-max\-upload\-limit=40K arquivo.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +\-\-max\-upload\-limit especifica taxa máxima de transmissão (upload). +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Para parar o download, pressione \fBCtrl\-C\fP\&. A transferência pode ser retomada +ao executar aria2c com os mesmos argumentos no mesmo diretório. +.UNINDENT +.UNINDENT +.SS Download usando URI BitTorrent Magnet +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C&dn=aria2" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Lembre\-se inserir delimitadores na URI BitTorrent Magnet, pois ela inclui \fB&\fP +que tem significado de parâmetro. Utilizar apóstrofo(\fB\(aq\fP) ou aspas(\fB"\fP). +.UNINDENT +.UNINDENT +.SS Download 2 torrents +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-j2 arquivo1.torrent arquivo2.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download um arquivo usando torrent e servidor HTTP/FTP +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-T arqfile.torrent "http://serv1/arqfile" "ftp://svr2/arqfile" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Download de arquivos múltiplos torrent com HTTP e FTP não é suportado. +.UNINDENT +.UNINDENT +.SS Download arquivos selecionados usando index(chamado "download seletivo") +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-select\-file=1\-4,8 arquivo.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +O index é exibido na console usando\-se a opção \-S. +.UNINDENT +.UNINDENT +.SS Especificar arquivo saída +.sp +Para especificar arquivo de saída em Downloads de BitTorrent, faz\-se necessário +conhecer o index do arquivo no torrent usando a opção \fI\%\-\-show\-files\fP\&. +Por exemplo, a saída exibirá algo como: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +idx|path/length +===+====================== + 1|dist/base\-2.6.18.iso + |99.9MiB +\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- + 2|dist/driver\-2.6.18.iso + |169.0MiB +\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Para salvar \(aqdist/base\-2.6.18.iso\(aq em \(aq/tmp/meudir/base.iso\(aq e +\(aqdist/driver\-2.6.18.iso\(aq em \(aq/tmp/dir/driver.iso\(aq, use o seguinte comando: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-dir=/tmp \-\-index\-out=1=meudir/base.iso \-\-index\-out=2=dir/driver.iso arquivo.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Modificar porta escuta para peer de entrada +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-listen\-port=7000\-7001,8000 arquivo.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Já que aria2 não configura o firewall ou porta de roteamento para portas +de encaminhamento, isto deve ser explicitado manualmente por você. +.UNINDENT +.UNINDENT +.SS Especificar condição para para o programa torrent após término do download +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-seed\-time=120 \-\-seed\-ratio=1.0 arquivo.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +No exemplo acima, o programa termina após transcorrer 120 minutos após +término do download ou taxa chegar a 1.0. +.UNINDENT +.UNINDENT +.SS Controlar velocidade upload Torrent +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-max\-upload\-limit=100K arquivo.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Habilitar IPv4 DHT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-enable\-dht \-\-dht\-listen\-port=6881 arquivo.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +DHT utiliza a porta udp, como o aria2 não configura firewall nem porta de roteamento +ou forwarding, por favor executar estas configurações manualmente. +.UNINDENT +.UNINDENT +.SS Habilitar IPv6 DHT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-enable\-dht6 \-\-dht\-listen\-port=6881 \-\-dht\-listen\-addr6=YOUR_GLOBAL_UNICAST_IPV6_ADDR \-\-enable\-async\-dns6 +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Se aria2c não foi compilado com c\-ares, a opção \fI\%\-\-enable\-async\-dns6\fP +não é necessária. aria2 compartilha a mesma porta ente IPv4 e IPv6 DHT. +.UNINDENT +.UNINDENT +.SS Adicionar e remover rastreador URI +.sp +Remover todos os rastreadores (tracker) das URIs descritas no arquivo.torrent +utilize \fBhttp://tracker1/announce\fP e \fBhttp://tracker2/announce\fP +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-bt\-exclude\-tracker="*" \-\-bt\-tracker="http://tracker1/announce,http://tracker2/announce" file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Funcionalidades avançadas HTTP +.SS Carregar cookies +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-load\-cookies=cookies.txt "http://servidor/arquivo.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Podem ser utilizados sem nenhuma modificação coookies dos navegadores: +Firefox / Mozilla / Chromium. +.UNINDENT +.UNINDENT +.SS Continuar download iniciado por navegadores ou outros programas +.INDENT 0.0 +.INDENT 3.5 +Quando desejar continuar ou retomar um download cujo processamento foi +interrompido, seja em navegador ou qualquer outro programa utilize +o aria2c para retomar este download do ponto onde parou. +.UNINDENT +.UNINDENT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-c \-s2 "http://servidor/arquivodedownloadparcial.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Autenticação certificado para Cliente SSL/TLS +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-certificate=/path/para/mycert.pem \-\-private\-key=/path/para/mykey.pem https://servidor/arquivo +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +O arquivo especificado na opção \fI\%\-\-private\-key\fP não pode estar +criptografado. O comportamento do processo fica indefinido quando o +arquivo estiver criptografado. +.UNINDENT +.UNINDENT +.SS Verificar peer em SSL/TLS usando certificados CA +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-ca\-certificate=/path/para/ca\-certificates.crt +\-\-check\-certificate https://servidor/arquivo +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Funcionalidades avançadas adicionais +.SS Controlar velocidade de download +.sp +Quando for necessário o controle da utilização da banda disponível, pode ser +utilizado a opção abaixo. Atenção o sufixo K ou M deve ser em letra maiúscula. +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-max\-download\-limit=100K arquivo.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Reparar um download danificado +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-V arquivo.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +Reparar downloads danificados pode ser mais eficiente usando +BitTorrent ou Metalink com a opção verificação (checksums). +.UNINDENT +.UNINDENT +.SS Desconectar conexão se a velocidade download for menor que um valor +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-lowest\-speed\-limit=10K file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Suporte a URI parametrizada +.sp +A URI pode ser especificada como partes de um conjunto: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-P "http://{svr1,svr2,svr3}/arquivo.iso" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Também podem ser especificados sequencias de intervalos: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-Z \-P "http://servidor/imagem[000\-100].png" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBNOTA:\fP +.INDENT 0.0 +.INDENT 3.5 +\-Z opção requerida para que todas URIs não apontem para o mesmo arquivo, +como declarado no código acima. +.UNINDENT +.UNINDENT +.sp +Especificar incrementos para contador: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-Z \-P "http://servidor/imagem[A\-Z:2].png" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Verificar validação checksum +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-checksum=sha\-1=0192ba11326fe2298c8cb4de616f4d4140213837 +http://dobrasil.org/arquivo +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Download Paralelo de uma quantidade arbitrária de URI, Metalink ou Torrent +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-j3 \-Z "http://servidor/arquivo1" arquivo2.torrent arq3.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS BitTorrent Criptografado +.sp +Criptografar todo conjunto usando ARC4: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-bt\-min\-crypto\-level=arc4 \-\-bt\-require\-crypto=true arquivo.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SH VER TAMBÉM +.sp +Site do Projeto aria2: \fI\%https://aria2.github.io/\fP +.sp +Site do Projeto Metalink: \fI\%http://www.metalinker.org/\fP +.sp +Descrição do Formato Download Metalink: \fI\%RFC 5854\fP +.SH COPYRIGHT +.sp +Copyright (C) 2006, 2014 Tatsuhiro Tsujikawa +Tradução para Português do Brasil 2013, Gilberto dos Santos Alves +utilizando editor kate e gedit no Debian squeeze 6.0.6 novembro de 2012 +revisado em março de 2013 usando editor kate e gedit no ubuntu 12.04 LTS +.sp +Esse programa é software livre; pode ser redistribuido e/ou modificado +sob os termos da Licença GNU General Public License como publicada por +Free Software Foundation www.fsf.org; versão 2 da Licença, ou qualquer +versão mais recente, qualquer que seja sua escolha. +.sp +Este programa é distribuído na intenção de ser útil, mas SEM NENHUMA GARANTIA; +sem qualquer garantia implícita de ser COMERCIALIZÁVEL ou para PROPÓSITO +ESPECÍFICO. Consulte a Linceça GNU Genérica para mais detalhes. +.sp +Você precisa receber uma cópia da Licença Pública GNU Genérica junto com +este programa; caso não tenha, escrevá para Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110\-1301 USA +.sp +Adicionalmente, como uma exceção especial, os detentores do direito autoral +autorizam a permissão para compilar programas que possuem ligação com +parte do código com a biblioteca OpenSSL sob certas condições como descritas +em cada arquivo fonte e autorizam a distribuição das das combinações das +ligações incluindo ambas. +Devem ser obedecidos todos os detalhes da Licença Pública GNU Genérica +em relação a OpenSSL. Caso haja modificação nos arquivos com esta exceção +deverá ser extendida esta exceção para as versões modificadas dos arquivos, mas +isto não é obrigatório. Se não houver esta intenção exclua esta declaração +de exceção da sua versão. Caso sejam excluídas as declarações de todos +os arquivos fontes, exclua também esta declaração daqui. +.sp +Anotação sobre divergência entre Manual e o aria2: +.sp +Esta página de manual pode não necessariamente conter a última informação. +Caso haja discrepância entre alguma informação do manual e o aria2, por +favor refira\-se a versão em inglês resultante do comando man aria2c +.SH COPYRIGHT +2013, Tatsuhiro Tsujikawa +.\" Generated by docutils manpage writer. +. diff --git a/share/man/ru/man1/aria2c.1 b/share/man/ru/man1/aria2c.1 new file mode 100644 index 0000000000000000000000000000000000000000..f7a2e05fe922d157fb35793eab7a1ac4ff451b89 --- /dev/null +++ b/share/man/ru/man1/aria2c.1 @@ -0,0 +1,5806 @@ +.\" -*- mode: troff; coding: utf-8 -*- +.\" Man page generated from reStructuredText. +. +.TH "ARIA2C" "1" "авг. 21, 2021" "1.36.0" "aria2" +.SH NAME +aria2c \- сверхбыстрая утилита загрузки +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.SH ОБЗОР +.sp +\fBaria2c\fP [<ПАРАМЕТРЫ>] [|||] ... +.SH ОПИСАНИЕ +.sp +aria2 \- это утилита для загрузки файлов. Поддерживаемые протоколы: HTTP(S), +FTP, SFTP, BitTorrent и Metalink. aria2 может загрузить файл с разных +источников/протоколов и пытается максимально использовать пропускную +способность канала. Есть поддержка загрузки файла по протоколам +HTTP(S)/FTP/SFTP и BitTorrent одновременно, пока данные загружаются по +HTTP(S)/FTP, они тут же могут выгружаться в BitTorrent\-рой. Используя +контрольные суммы блока данных для Metalink, aria2 автоматически проверяет +части данных во время загрузки файла. +.SH ПАРАМЕТРЫ +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Большинство связанных с FTP параметров применимы также к SFTP. +Некоторые параметры не являются эффективными по отношению к SFTP (например, \fI\%\-\-ftp\-pasv\fP) +.UNINDENT +.UNINDENT +.SS Основные параметры +.INDENT 0.0 +.TP +.B \-d, \-\-dir= +Каталог для сохранения загруженных файлов. +.UNINDENT +.INDENT 0.0 +.TP +.B \-i, \-\-input\-file= +Загрузить URI, перечисленные в файле FILE. Вы можете указать различные источники +для одного объекта, перечислив различные URI в строке, разделенных символом +TAB (табуляция). +Дополнительные параметры можно указывать после каждой URI\-строки. Cтроки параметров +должны начинаться с одного или нескольких пробелов (\fBSPACE\fP или \fBTAB\fP) +и содержать один параметр на строку. +Когда \fBFILE\fP указан как \fB\-\fP, aria2 будет считывать ввод из +stdin (стандартный поток ввода). +Входной файл может использовать gzip\-сжатие. +Смотрите подраздел \fI\%Входной файл\fP для детальных пояснений. +Также смотрите параметр \fI\%\-\-deferred\-input\fP\&. +Также смотрите параметр \fI\%\-\-save\-session\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-l, \-\-log= +Имя файла для журнала событий. Если указан \fB\-\fP, то журнал событий будет +записан в stdout (стандартный поток вывода). Если указана пустая +строка ("") или параметр пропущен, то журнал событий вообще не будет записан +на диск. +.UNINDENT +.INDENT 0.0 +.TP +.B \-j, \-\-max\-concurrent\-downloads= +Задать максимальное количество параллельных загрузок для каждого +элемента очереди. +Смотрите также параметр \fI\%\-\-split\fP\&. +По умолчанию: \fB5\fP +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +\fI\%\-\-max\-concurrent\-downloads\fP ограничивает количество +элементов, которые загружаются одновременно. +\fI\%\-\-split\fP и \fI\%\-\-min\-split\-size\fP влияет +на количество соединений внутри каждого элемента. +Допустим у вас есть такой входной файл (см. параметр \fI\%\-\-input\-file\fP): +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +http://example.com/foo +http://example.com/bar +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Здесь 2 загружаемых элемента. aria2 может загрузить эти элементы +одновременно, если значение, заданное в \fI\%\-\-max\-concurrent\-downloads\fP, +больше или равно 2. В каждом загружаемом элементе, вы можете задать +количество соединений, используя \fI\%\-\-split\fP +и/или \fI\%\-\-min\-split\-size\fP\&. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-V, \-\-check\-integrity [true|false] +Проверить целостность файла путем подтверждения хэшей блоков или хэша +полного файла. Этот параметр влияет лишь на BitTorrent, Metalink +или HTTP(S)/FTP загрузки с параметром \fI\%\-\-checksum\fP\&. +Параметр может обнаружить поврежденные части файла и перезагрузить их. +Если есть хэш полного файла, то проверка выполняется только, когда файл +уже полностью загружен. Момент полной загрузки определяется по размеру файла. Если +проверка хэша завершилась неудачно, то файл будет перезагружен с +нуля. Если есть хэши блоков и хэш полного файла, то будут +использоваться только хэши блоков. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-c, \-\-continue [true|false] +Продолжить загрузку частично загруженного файла. +Используйте этот параметр, чтобы возобновить загрузку, +начатую в веб\-браузере или в другой программе, которая загружает +файлы последовательно сначала. Сейчас этот параметр можно +использовать только для HTTP(S)/FTP\-загрузок. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-h, \-\-help[=|] +Справочное сообщение определяется метками (TAG). Метки начинаются +с \fB#\fP\&. Например, \fB\-\-help=#http\fP даст справку по параметрам, +помеченным меткой \fB#http\fP\&. Если задано слово (KEYWORD), не +являющееся меткой, то будет выведена справка по параметрам, +содержащих это слово. Возможные значения: \fB#basic\fP, \fB#advanced\fP, +\fB#http\fP, \fB#https\fP, \fB#ftp\fP, \fB#metalink\fP, \fB#bittorrent\fP, \fB#cookie\fP, +\fB#hook\fP, \fB#file\fP, \fB#rpc\fP, \fB#checksum\fP, \fB#experimental\fP, +\fB#deprecated\fP, \fB#help\fP, \fB#all\fP\&. +По умолчанию: \fB#basic\fP +.UNINDENT +.SS Параметры HTTP/FTP/SFTP +.INDENT 0.0 +.TP +.B \-\-all\-proxy= +Использовать указанный прокси\-сервер для всех протоколов. Для отмены +ранее определенного адреса используйте "". Вы также можете отменить эту +настройку и указать прокси\-сервер для отдельного протокола, используя +параметры \fI\%\-\-http\-proxy\fP, +\fI\%\-\-https\-proxy\fP и \fI\%\-\-ftp\-proxy\fP\&. Влияет на все загрузки. +Формат PROXY \- \fB[http://][ПОЛЬЗОВАТЕЛЬ:ПАРОЛЬ@]ХОСТ[:ПОРТ]\fP\&. +Смотрите также раздел \fI\%ОКРУЖЕНИЕ\fP\&. +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Если пользователь и пароль вставлены в URI\-прокси и они также указаны в +параметрах \fI\-\-{http,https,ftp,all}\-proxy\-{user,passwd}\fP, то те, которые +указаны позже переопределят предыдущие параметры. +Например, если вы указали \fBhttp\-proxy\-user="myname"\fP, +\fBhttp\-proxy\-passwd="mypass"\fP в aria2.conf и указали +\fB\-\-http\-proxy="http://proxy"\fP в командной строке, тогда вы получите +HTTP\-прокси \fBhttp://proxy\fP с пользователем \fBmyname\fP и паролем \fBmypass\fP\&. +.sp +Другой пример: если вы указали в командной строке +\fB\-\-http\-proxy="http://user:pass@proxy" \-\-http\-proxy\-user="myname" +\-\-http\-proxy\-passwd="mypass"\fP, тогда вы получите HTTP\-прокси \fBhttp://proxy\fP +с пользователем \fBmyname\fP и паролем \fBmypass\fP\&. +.sp +Еще один пример: если вы указали в командной строке \fB\-\-http\-proxy\-user="myname" +\-\-http\-proxy\-passwd="mypass" \-\-http\-proxy="http://user:pass@proxy"\fP, тогда вы +получите HTTP\-прокси \fBhttp://proxy\fP с пользователем \fBuser\fP и паролем +\fBpass\fP\&. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-all\-proxy\-passwd= +Задать пароль для параметра \fI\%\-\-all\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-all\-proxy\-user= +Задать пользователя для параметра \fI\%\-\-all\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-checksum== +Задать контрольную сумму. TYPE \- тип хэша. Поддерживаемые типы хэшей +перечислены в \fBАлгоритмы хэширования\fP при \fBaria2c \-v\fP\&. +DIGEST \- шестнадцатеричное значение хэша. Например, указание значения +sha\-1 хэша выглядит так: +\fBsha\-1=0192ba11326fe2298c8cb4de616f4d4140213838\fP +Этот параметр применим только к HTTP(S)/FTP загрузкам. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-connect\-timeout= +Задать в соединении время ожидания в секундах для установки +подключения к HTTP/FTP/прокси\-серверу. После установки +подключения этот параметр не имеет значения, и вместо него +используется параметр \fI\%\-\-timeout\fP\&. +По умолчанию: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dry\-run [true|false] +Если задано \fBtrue\fP, aria2 только проверяет, является ли удаленный +файл доступным и не загружает данные. Этот параметр влияет на +HTTP/FTP\-загрузку. BitTorrent\-загрузки отменяются, если указано +\fBtrue\fP\&. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-lowest\-speed\-limit= +Закрывать соединение, если скорость загрузки меньше чем или равна +значению SPEED (байт в секунду). \fB0\fP означает, что aria2 не имеет +нижнего ограничения скорости. Вы можете добавить \fBK\fP или \fBM\fP +(1K = 1024, 1M = 1024K). Этот параметр не влияет на +BitTorrent\-загрузки. +По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-x, \-\-max\-connection\-per\-server= +Максимально количество соединений с одним сервером для каждой +загрузки. +По умолчанию: \fB1\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-file\-not\-found= +Если aria2 получает статус "file not found" (файл не найден) с +удаленных HTTP/FTP\-серверов NUM раз без получения, хотя бы одного байта, +тогда принудительно отказывается от загрузки. Укажите \fB0\fP, чтобы +отключить этот параметр. Этот параметр действенен только, когда +используются HTTP/FTP\-серверы. Количество повторных попыток засчитывается в +\fI\%\-\-max\-tries\fP, таким образом, этот параметр также должен быть +сконфигурирован. +.sp +По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-m, \-\-max\-tries= +Задать количество попыток. \fB0\fP означает неограниченно. +Смотрите также \fI\%\-\-retry\-wait\fP\&. +По умолчанию: \fB5\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-k, \-\-min\-split\-size= +aria2 не разбивает на части меньше чем 2*SIZE байт. Например, +нужно загрузить файл размером 20МиБ. Если SIZE задать 10M, то +aria2 может разбить файл на части в 2\-ух диапазонах [0\-10МиБ) и +[10МиБ\-20МиБ) и загрузить его, используя 2 источника +(если \fI\%\-\-split\fP >= 2, конечно же). +Если SIZE задать 15M, т.к. 2*15M > 20MiB, aria2 не разобьет файл +на части и загрузит его, используя 1 источник. Вы можете +добавить \fBK\fP или \fBM\fP (1K = 1024, 1M = 1024K). Возможные значения: +\fB1M\fP \-\fB1024M\fP\&. +По умолчанию: \fB20M\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-netrc\-path= +Указать путь к файлу .netrc. +По умолчанию: \fB$(HOME)/.netrc\fP +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Права доступа к файлу .netrc должны быть равны 600. Иначе, файл +будет проигнорирован. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-n, \-\-no\-netrc [true|false] +Отключить поддержку netrc. Поддержка netrc по умолчанию +включена. +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Файл netrc считывается только при запуске, если \fI\%\-\-no\-netrc\fP задан +как \fBfalse\fP\&. Так что если \fI\%\-\-no\-netrc\fP задан как \fBtrue\fP при +загрузке, то netrc недоступен на протяжении всей сессии. Вы не сможете получить +доступ к netrc, даже если отправите \fI\%\-\-no\-netrc=false,\fP используя +\fI\%aria2.changeGlobalOption()\fP\&. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-proxy= +Укажите через запятую список имён хостов, доменов и сетевых адресов +с или без маски подсети, для которых не будет использоваться прокси. +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +IPv4\- и IPv6\-адресация работает для сетевых адресов с маской подсети. +Текущая реализация не разрешает имена хостов в URI для сравнения +сетевых адресов указанных в \fI\%\-\-no\-proxy\fP\&. Таким образом, это +эффективно, только если в URI есть IP\-адреса. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-o, \-\-out= +Сохранить загруженный файл под указанным именем, относительно каталога, +заданного в параметре \fI\%\-\-dir\fP\&. Данный параметр +игнорируется, когда используется параметр \fI\%\-\-force\-sequential\fP\&. +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Вы не можете указать имя файла для Metalink или BitTorrent загрузок. Имя +файла указанное здесь, используется только когда URI передаются aria2 +с командной строкой непосредственно, но не при использовании параметров +\fI\%\-\-input\-file\fP, \fI\%\-\-force\-sequential\fP\&. +.sp +Пример: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-proxy\-method= +Задать метод для использования в прокси\-запросах. METHOD один +из двух: \fBget\fP или \fBtunnel\fP\&. HTTPS\-загрузки всегда используют \fBtunnel\fP, +не обращая внимания на этот параметр. +По умолчанию: \fBget\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-R, \-\-remote\-time [true|false] +Извлекать временную метку файла с удаленного HTTP/FTP\-сервера и, +если это доступно, применить ее к локальному файлу. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-reuse\-uri [true|false] +Повторно использовать уже использованные URI, если +не осталось неиспользованных URI. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-retry\-wait= +Задать в секундах интервал ожидания между повторными попытками. +При \fISEC > 0\(ga\fP, если HTTP\-сервер возвращает ответ 503, aria2 будет +снова пытаться загрузить. +По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-server\-stat\-of= +Указать имя файла, в который сохраняется профиль функционирования +сервера. Вы можете загрузить сохраненные данные, используя параметр +\fI\%\-\-server\-stat\-if\fP\&. Формат файла +смотрите ниже в подразделе +\fI\%Профиль функционирования сервера\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-server\-stat\-if= +Указать имя файла для загрузки профиля функционирования сервера. +Загруженные данные будут использованы в некоторых URI селекторах, таких +как \fBfeedback\fP\&. Смотрите также параметр +\fI\%\-\-uri\-selector\fP\&. Формат файла смотрите +ниже в подразделе +\fI\%Профиль функционирования сервера\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-server\-stat\-timeout= +Указывает время ожидания в секундах, для того, чтобы сделать +недействительным профиль функционирования сервера, с тех пор, +как состоялся последний контакт с ним. +По умолчанию: \fB86400\fP (24 часа) +.UNINDENT +.INDENT 0.0 +.TP +.B \-s, \-\-split= +Загружать файл, используя N соединений. Если задано более чем N URI, +будут использоваться первые N URI, а оставшиеся URI будут в резерве. +Если задано менее чем N URI, то URI будут использованы более одного раза, +так чтобы были задействованы все N соединений одновременно. Количество +соединений к одному и тому же хосту ограничивается параметром +\fI\%\-\-max\-connection\-per\-server\fP\&. +Смотрите также параметр \fI\%\-\-min\-split\-size\fP\&. +По умолчанию: \fB5\fP +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Некоторые Metalink регламентируют количество серверов для соединения. aria2 +строго соблюдает это. Это значит, что если Metalink определяет атрибут +\fBmaxconnections\fP меньше чем N, то aria2 использует это, более низкое +значение, вместо N. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stream\-piece\-selector= +Указать алгоритм выбора блока, который используется в HTTP/FTP\-загрузке. +Блок \- означает сегмент фиксированной длины, который загружается +параллельно, в разделенной на части, загрузке. Если задано \fBdefault\fP, +то aria2 выберет блок так, чтобы это уменьшило количество установленных +подключений. Это разумное поведение по умолчанию, поскольку установка +подключения очень затратная операция. Если задано \fBinorder\fP, то aria2 +выберет блок, который имеет минимальный индекс. Index=0 означает первый +из файла. Это будет полезно при просмотре фильма, в то время как он +загружается. Параметр \fI\%\-\-enable\-http\-pipelining\fP может +быть полезен для снижения накладных расходов при повторном подключении. +Обратите внимание, что aria2 принимает на обработку параметр +\fI\%\-\-min\-split\-size\fP, так что необходимо будет указать +разумное значение параметра \fI\%\-\-min\-split\-size\fP\&. +Если задано \fBrandom\fP, то aria2 выбирает блоки случайно. Как и при +\fBinorder\fP учитывается параметр \fI\%\-\-min\-split\-size\fP\&. +Если задано \fBgeom\fP, то aria2 вначале выберет блок с минимальным +индексом, как при \fBinorder\fP, однако она сохранит +экспоненциально большую область от ранее выбранного блока. +Это уменьшит количество установленных подключений и в то же +время это позволит в первую очередь загрузить начало файла. +Это будет полезно при просмотре фильма, в то время как он +загружается. +По умолчанию: \fBdefault\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-t, \-\-timeout= +Задать время ожидания в секундах. +По умолчанию: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-uri\-selector= +Указать алгоритм выбора URI. Возможные значения: \fBinorder\fP, \fBfeedback\fP +и \fBadaptive\fP\&. Если задано \fBinorder\fP, то URI проверяются в порядке +представления в списке URI. Если задано \fBfeedback\fP, aria2 использует +скорость загрузки, которая наблюдалась в предыдущих загрузках, и выбирает +самый быстрый сервер в списке URI. Это также эффективно исключает мертвые +зеркала. Наблюдаемая скорость загрузки является частью профиля +функционирования сервера, упомянутой в параметрах +\fI\%\-\-server\-stat\-of\fP и +\fI\%\-\-server\-stat\-if\fP\&. Если задано \fBadaptive\fP, +выбирается одно из лучших зеркал для первого и резервного соединений. +Дополнительно, возвращаются зеркала, которые пока не были проверены, и, +если каждое из них уже проверено, возвращаются зеркала, которые должны +быть проверены снова. Иначе зеркала больше не выбираются. +Подобно \fBfeedback\fP, используются профиль функционирования сервера. +По умолчанию: \fBfeedback\fP +.UNINDENT +.SS Специфические параметры HTTP +.INDENT 0.0 +.TP +.B \-\-ca\-certificate= +Использовать для проверки узлов FILE с сертификатами +удостоверяющих центров. FILE должен быть в PEM\-формате и может содержать +несколько CA\-сертификатов. +Используйте параметр \fI\%\-\-check\-certificate\fP, чтобы включить +проверку. +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Если вы при сборке используете OpenSSL или последнею версию GnuTLS, +в которой есть функция \fBgnutls_certificate_set_x509_system_trust()\fP, +и библиотека правильно настроена, чтобы найти хранилище общесистемных +CA\-сертификатов, то aria2 автоматически загрузит эти сертификаты +при старте. +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +\fIWinTLS\fP и \fIAppleTLS\fP не поддерживают этот параметр. Вместо этого вам +придется импортировать сертификат в хранилище доверенных сертификатов ОС. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-certificate= +Использовать клиентский сертификат в FILE. Сертификат должен +быть один из двух: PKCS12 (.p12, .pfx) или в PEM\-формате. +.sp +PKCS12\-файлы должны содержать сертификат, ключ и, необязательно, цепочку +дополнительных сертификатов. Могут быть открыты PKCS12\-файлы только +с пустым импортированным паролем! +.sp +При использовании PEM, вы также должны указать закрытый ключ через \fI\%\-\-private\-key\fP, +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +\fIWinTLS\fP не поддерживает PEM\-файлы в данный момент. Пользователи должны +использовать PKCS12\-файлы. +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +\fIAppleTLS\fP пользователи должны использовать утилиту KeyChain Access для +импорта сертификата клиента и получения соответствующего SHA\-1 отпечатка +этого сертификата из окна Information. +Для запуска aria2c используйте \fI\-\-certificate=\fP\&. +Альтернативные PKCS12\-файлы также поддерживаются. PEM\-файлы, однако, +не поддерживаются. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-check\-certificate [true|false] +Проверять узел, используя сертификаты, которые указаны в параметре +\fI\%\-\-ca\-certificate\fP\&. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-accept\-gzip [true|false] +Посылать \fBAccept: deflate, gzip\fP в запросе\-заголовке и добавлять в ответ, +если удаленный сервер ответит \fBContent\-Encoding: gzip\fP или +\fBContent\-Encoding: deflate\fP\&. +По умолчанию: \(aqfalse +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Некоторые серверы отвечают \fBContent\-Encoding: gzip\fP для файлов, которые сами +по себе сжаты (gzipped). aria2 добавляет их, так или иначе, из\-за заголовка +ответа. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-auth\-challenge [true|false] +Отправлять заголовок HTTP\-авторизации только тогда, когда он запрошен +с сервера. Если задано \fBfalse\fP, тогда заголовок авторизации всегда +отправляется на сервер. Существует исключение: если имя пользователя +и пароль являются встроенными в URI, то заголовок авторизации всегда +отправляется на сервер, независимо от этого параметра. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-no\-cache [true|false] +Отправлять заголовок \fBCache\-Control: no\-cache\fP и \fBPragma: no\-cache\fP, +чтобы избежать кэширования содержимого. Если задано \fBfalse\fP, то эти +заголовки не посылаются, и вы можете добавить любую директиву к +заголовку Cache\-Control с помощью параметра \fI\%\-\-header\fP\&. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-user= +Задать пользователя для HTTP. Влияет на все URI. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-passwd= +Задать пароль для HTTP. Влияет на все URI. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-proxy= +Использовать указанный прокси\-сервер для HTTP. Для отмены +ранее определенного адреса используйте "". +Смотрите также параметр \fI\%\-\-all\-proxy\fP\&. Влияет на все +HTTP\-загрузки. +Формат PROXY \- \fB[http://][ПОЛЬЗОВАТЕЛЬ:ПАРОЛЬ@]ХОСТ[:ПОРТ]\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-proxy\-passwd= +Задать пароль для \fI\%\-\-http\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-http\-proxy\-user= +Задать пользователя для \fI\%\-\-http\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-https\-proxy= +Использовать указанный прокси\-сервер для HTTPS. Для отмены +ранее определенного адреса используйте "". +Смотрите также параметр \fI\%\-\-all\-proxy\fP\&. Влияет на все +HTTPS\-загрузки. +Формат PROXY \- \fB[http://][ПОЛЬЗОВАТЕЛЬ:ПАРОЛЬ@]ХОСТ[:ПОРТ]\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-https\-proxy\-passwd= +Задать пароль для \fI\%\-\-https\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-https\-proxy\-user= +Задать пользователя для \fI\%\-\-https\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-private\-key= +Использовать закрытый ключ в FILE. Закрытый ключ должен +быть дешифрованным и в PEM\-формате. Режим работы, с исходно +зашифрованным закрытым ключом, не определён. Смотрите также +параметр \fI\%\-\-certificate\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-referer= +Задать HTTP источник запроса (Referer). Влияет на все HTTP/HTTPS\-загрузки. +Если задано \fB*\fP, то URI загрузки будет также использован как источник запроса. +Это может быть полезно при использовании вместе с параметром +\fI\%\-\-parameterized\-uri\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-http\-keep\-alive [true|false] +Включить HTTP/1.1 постоянное соединение. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-http\-pipelining [true|false] +Включить конвейерную обработку HTTP/1.1. +По умолчанию: \fBfalse\fP +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +С точки зрения производительности, как правило, нет преимущества от +включения этого параметра. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-header=
+Добавлять HEADER к HTTP запросу\-заголовку. Вы можете использовать +этот параметр повторно, чтоб указать более одного заголовка: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-header="X\-A: b78" \-\-header="X\-B: 9J1" "http://host/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-load\-cookies= +Загружать куки\-файл из FILE, используя форматы Firefox3 (SQLite3), +Chromium/Google Chrome (SQLite3) и Mozilla/Firefox(1.x/2.x)/Netscape. +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Если aria2 собрана без libsqlite3, то форматы куки\-файлов Firefox3 и +Chromium/Google Chrome не поддерживаются. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-save\-cookies= +Сохранить куки в FILE формате Mozilla/Firefox(1.x/2.x)/Netscape. +Если FILE уже существует, то он будет перезаписан. Куки\-сессия также +сохранится, и значение ее окончания будет трактоваться как 0. +Возможные значения: \fB/путь/к/файлу\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-use\-head [true|false] +Использовать метод HEAD для первого запроса к HTTP серверу. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-U, \-\-user\-agent= +Задать клиентское приложение для HTTP(S)\-загрузок. +По умолчанию: \fBaria2/$VERSION\fP, $VERSION заменяется на версию пакета. +.UNINDENT +.SS Специфические параметры FTP/SFTP +.INDENT 0.0 +.TP +.B \-\-ftp\-user= +Задать пользователя для FTP. +Влияет на все URI. +По умолчанию: \fBanonymous\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-passwd= +Задать пароль для FTP. Влияет на все URI. Если имя пользователя +встроено, но пароль отсутствует в URI, то aria2 пытается использовать +пароль из .netrc. Если пароль найден в .netrc, то он используется. +Если нет, используется пароль, указанный в этом параметре. +По умолчанию: \fBARIA2USER@\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-p, \-\-ftp\-pasv [true|false] +Использовать пассивный режим FTP. Если задано \fBfalse\fP, +то будет использован активный режим. +По умолчанию: \fBtrue\fP +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Этот параметр игнорируется для SFTP\-передачи. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-proxy= +Использовать указанный прокси\-сервер для FTP. Для отмены +ранее определенного адреса используйте "". +Смотрите также параметр \fI\%\-\-all\-proxy\fP\&. Влияет на все FTP\-загрузки. +Формат PROXY \- \fB[http://][ПОЛЬЗОВАТЕЛЬ:ПАРОЛЬ@]ХОСТ[:ПОРТ]\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-proxy\-passwd= +Задать пароль для параметра \fI\%\-\-ftp\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-proxy\-user= +Задать пользователя для параметра \fI\%\-\-ftp\-proxy\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-type= +Задать тип передачи для FTP. TYPE может быть один из +двух: \fBbinary\fP или \fBascii\fP\&. +По умолчанию: \fBbinary\fP +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Этот параметр игнорируется для SFTP\-передачи. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ftp\-reuse\-connection [true|false] +Повторно использовать FTP соединение. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-ssh\-host\-key\-md== +Задать контрольную сумму для публичного SSH\-ключа хоста. TYPE \- тип хэша. +Поддерживаемые типы хэшей \- \fBsha\-1\fP или \fBmd5\fP\&. +DIGEST \- шестнадцатеричное значение хэша. +Например: \fBsha\-1=b030503d4de4539dc7885e6f0f5e256704edf4c3\fP\&. +Этот параметр может быть использован для проверки публичного ключа сервера +при использовании SFTP. Если параметр не задан (по умолчанию), то никакой +проверки не происходит. +.UNINDENT +.SS Параметры BitTorrent/Metalink +.INDENT 0.0 +.TP +.B \-\-select\-file=... +Задать файл для загрузки по заданному индексу. Вы можете найти +индекс файла, используя параметр \fI\%\-\-show\-files\fP\&. +Составной индекс можно указать, используя \fB,\fP, например: \fB3,6\fP\&. +Вы можете также использовать \fB\-\fP, чтобы указать диапазон: \fB1\-5\fP\&. +\fB,\fP и \fB\-\fP могут быть использованы вместе: \fB1\-5,8,9\fP\&. +Когда используется с параметром \-M, индекс может сильно зависеть +от запроса (смотрите параметры \fI\-\-metalink\-*\fP). +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +В многофайловом торренте, смежные файлы, указанные в этом параметре также +могут быть загружены. Это не ошибка, а особенность утилиты. Одиночный блок +данных может включать несколько файлов или часть файла, и aria2 запишет блок +данных соответствующего файла. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-S, \-\-show\-files [true|false] +Вывести список файлов из ".torrent", ".meta4" или ".metalink" и +завершить работу. Для файла .torrent будет выведена более детальная +информация (информация по хэшу, размер блока и др.). +.UNINDENT +.SS Специфические параметры BitTorrent +.INDENT 0.0 +.TP +.B \-\-bt\-detach\-seed\-only [true|false] +Исключить только раздачи при подсчёте одновременных активных загрузок +(смотрите параметр \fI\%\-j\fP). Это значит, что если задано \fB\-j3\fP +и этот параметр включён, активны 3 загрузки и одна из них переходит +в режим сидирования (раздачи), то она исключается из количества активных +загрузок (таким образом их становится 2), и следующая ожидающая в очереди +загрузка стартует. Но знайте, что в RPC\-методе сидирующий элемент всё +ещё признаётся как активная загрузка. По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-enable\-hook\-after\-hash\-check [true|false] +Позволяет перехватить команду вызова (управление) после проверки хэша +(см. параметр \fI\%\-V\fP) в BitTorrent\-загрузке. По умолчанию, когда +проверка хэша завершилась удачно, выполняется команда заданная в +\fI\%\-\-on\-bt\-download\-complete\fP\&. +Укажите для этого параметра \fBfalse\fP, чтобы отключить это действие. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-enable\-lpd [true|false] +Включить поиск локальных пиров. Если в torrent\-файле установлен +приватный признак, то aria2 не будет использовать эту возможность, +даже если задано \fBtrue\fP\&. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-exclude\-tracker=[,...] +Разделенный запятыми список URI анонса BitTorrent\-трекера, +которые будут исключены. Вы можете использовать специальное +значение \fB*\fP, которое соответствует всем URI, таким образом, +исключаются все URI анонса. При указании \fB*\fP в командной +оболочке, не забывайте, экранировать или брать в кавычки. +Смотрите также параметр \fI\%\-\-bt\-tracker\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-external\-ip= +Указать внешний IP\-адрес для использования в BitTorrent\-загрузке и DHT. +Он может быть отправлен BitTorrent\-трекеру. Для DHT, этот параметр должен +быть задан, чтобы сообщить, что локальный узел загружает конкретный +торрент. Это критически важно, чтобы использовать DHT в частной сети. +Несмотря на то, что эта функция названа \fBexternal\fP (\fBвнешний\fP), +она может принимать любой IP\-адрес. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-force\-encryption [true|false] +Требовать шифрование при помощи arc4 полезной нагрузки +BitTorrent\-сообщения. Это сокращение \fI\%\-\-bt\-require\-crypto\fP +\fI\%\-\-bt\-min\-crypto\-level\fP=arc4. Этот параметр не изменяет +значения тех параметров. Если задано \fBtrue\fP, то отвергается +традиционное BitTorrent\-рукопожатие (handshake), а используется +только обфускация рукопожатия (handshake) и всегда шифруется +полезная нагрузка. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-hash\-check\-seed [true|false] +Если задано \fBtrue\fP, то после проверки хэша с использованием параметра +\fI\%\-\-check\-integrity\fP, и когда файл +загружен полностью, продолжается раздача файла. Если вы хотите +проверить файл и загрузить его только если он поврежден или не загружен +полностью, то задайте этот параметр как \fBfalse\fP\&. Этот параметр влияет +лишь на BitTorrent\-загрузки. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-load\-saved\-metadata [true|false] +Прежде, чем получить метаданные торрента из DHT при загрузке +magnet\-ссылки, сначала попытаться считать файл, сохранённый параметром +\fI\%\-\-bt\-save\-metadata\fP\&. Если попытка успешна, то пропустить +загрузку метаданных из DHT. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-lpd\-interface= +Использовать для поиска локальных пиров заданный интерфейс. Если этот +параметр не указан, используется интерфейс по умолчанию. Можно указать +имя интерфейса и IP\-адрес. Возможные значения: интерфейс, IP\-адрес. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-max\-open\-files= +Указать глобально максимальное количество файлов для открытия в многофайловой +BitTorrent/Metalink\-загрузке. +По умолчанию: \fB100\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-max\-peers= +Указать максимальное количество узлов для каждого торрента. +\fB0\fP означает неограниченно. Смотрите также параметр +\fI\%\-\-bt\-request\-peer\-speed\-limit\fP\&. +По умолчанию: \fB55\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-metadata\-only [true|false] +Загрузить только метаданные. Файл(ы), описывающий метаданные не +должен быть загружен. Этот параметр эффективен, только если +используется BitTorrent Magnet\-ссылка. Смотрите также параметр +\fI\%\-\-bt\-save\-metadata\fP\&. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-min\-crypto\-level=plain|arc4 +Задать минимальный уровень метода шифрования. Если узел поддерживает +несколько методов шифрования, aria2 выбирает наименьший, который +удовлетворяет заданный уровень. +По умолчанию: \fBplain\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-prioritize\-piece=head[=],tail[=] +Пытаться загрузить сначала первую и последнюю части каждого файла. +Это бывает полезно для предварительного просмотра файлов. Аргумент +может содержать 2 ключевых слова: \fBhead\fP и \fBtail\fP\&. Для включения +обоих, необходимо разделить их запятой. Ключевые слова принимают +один параметр, SIZE. Например, если указано \fBhead=\fP, части, в +пределах первых SIZE байт каждого файла, получат повышенный +приоритет. \fBtail=\fP обозначает диапазон из последних SIZE байт +каждого файла. SIZE может включать букву \fBK\fP или \fBM\fP для обозначения +размера в килобайтах или мегабайтах, соответственно +(1K = 1024, 1M = 1024K). Если SIZE пропущено, то будет использовано +по умолчанию значение: SIZE=1M. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-remove\-unselected\-file [true|false] +Удалить невыбранные файлы, когда завершена загрузка в +BitTorrent. Чтобы выбрать файлы, используйте параметр +\fI\%\-\-select\-file\fP\&. Если не +использовался этот параметр, то предполагается, что все файлы +выбраны. Пожалуйста, используйте этот параметр внимательно, +так как это фактически удалит файлы с вашего диска. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-require\-crypto [true|false] +Если задано \fBtrue\fP, aria2 не принимает и не устанавливает соединение с +традиционным BitTorrent\-рукопожатием (handshake) (\e19BitTorrent протокол). +Таким образом, aria2 всегда использует обфускацию handshake\-сообщения. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-request\-peer\-speed\-limit= +Если итоговая скорость загрузки каждого торрента, ниже чем SPEED, +aria2 временно увеличивает количество узлов, пытаясь увеличить +скорость загрузки. Настройка этого параметра с выбранной вами +скоростью загрузки может, в некоторых случаях, увеличить вашу +скорость загрузки. Вы можете добавить \fBK\fP или \fBM\fP (1K = 1024, 1M = 1024K). +По умолчанию: \fB50K\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-save\-metadata [true|false] +Сохранить метаданные как файл ".torrent". Этот параметр +эффективен только если используется BitTorrent Magnet\-ссылка. +Имя файла шестнадцатеричное представление хэша с расширением +".torrent". Файл сохранится в каталог, в тот же самый, куда +сохранится загружаемый файл. Если тот же самый файл уже +существует, метаданные не сохранятся. Смотрите также параметр +\fI\%\-\-bt\-metadata\-only\fP\&. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-seed\-unverified [true|false] +Раздавать первоначально загруженные файлы без проверки хэшей блоков. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-stop\-timeout= +Остановить BitTorrent загрузку, если скорость загрузки равна 0 на +протяжении SEC секунд. Если задано \fB0\fP, то эта возможность не будет +использоваться. +По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-tracker=[,...] +Разделенный запятыми список дополнительных URI анонса +BitTorrent\-трекеров. На эти URI не действует параметр +\fI\%\-\-bt\-exclude\-tracker\fP, +потому что они добавляются после URI, указанных в параметре +\fI\%\-\-bt\-exclude\-tracker\fP, +которые исключаются. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-tracker\-connect\-timeout= +Задать время ожидания в секундах для установки соединения с трекером. +После установки соединения, это параметр станет недействительным, +а вместо него будет использован +\fI\%\-\-bt\-tracker\-timeout\fP\&. +По умолчанию: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-tracker\-interval= +Задать интервал в секундах между запросами трекера. Это полностью +отменяет значение интервала и aria2 использует только это значение +и игнорирует минимальный интервал и значение интервала в ответе +трекера. Если задан \fB0\fP, aria2 определяет интервал, основываясь на +ответе трекера и прогрессе загрузки. +По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-bt\-tracker\-timeout= +Задать время ожидания в секундах. +По умолчанию: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-entry\-point=: +Задать хост и порт, как точку входа в IPv4 DHT сеть. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-entry\-point6=: +Задать хост и порт, как точку входа в IPv6 DHT сеть. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-file\-path= +Сменить путь к файлу таблицы маршрутизации IPv4 DHT на PATH. +По умолчанию: \fB$HOME/.aria2/dht.dat\fP если существует, +иначе \fB$XDG_CACHE_HOME/aria2/dht.dat\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-file\-path6= +Сменить путь к файлу таблицы маршрутизации IPv6 DHT на PATH. +По умолчанию: \fB$HOME/.aria2/dht6.dat\fP если существует, +иначе \fB$XDG_CACHE_HOME/aria2/dht6.dat\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-listen\-addr6= +Указать адрес привязки сокета для IPv6 DHT. Он должен быть глобальным +IPv6 unicast\-адресом хоста. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-listen\-port=... +Задать прослушиваемый UDP\-порт используя DHT (IPv4, IPv6) и +UDP\-трекер. Несколько портов можно указать через \fB,\fP, +например: \fB6881,6885\fP\&. Вы также можете использовать \fB\-\fP +чтобы указать диапазон: \fB6881\-6999\fP\&. \fB,\fP и \fB\-\fP могут +быть использованы вместе. +По умолчанию: \fB6881\-6999\fP +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Удостоверьтесь, что указанные порты открыты для входящего UDP\-трафика. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dht\-message\-timeout= +Задать время ожидания в секундах. +По умолчанию: \fB10\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-dht [true|false] +Включить функцию IPv4 DHT. Это также включает поддержку +UDP\-трекера. Если в torrent\-файле задан приватный признак, +aria2 не будет использовать DHT для загрузки, даже если +установлен \fBtrue\fP\&. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-dht6 [true|false] +Включить IPv6 DHT функциональность. Если в torrent\-файле задан +приватный признак, aria2 не будет использовать DHT для загрузки, +даже если установлен \fBtrue\fP\&. Используйте параметр +\fI\%\-\-dht\-listen\-port\fP для указания +прослушиваемого порта. Смотрите также параметр +\fI\%\-\-dht\-listen\-addr6\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-peer\-exchange [true|false] +Включить расширение BitTorrent\-протокола для обмена списками участников. +Если в torrent\-файле задан приватный признак, то эта возможность будет +отключена, даже если установлен \fBtrue\fP\&. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-follow\-torrent=true|false|mem +Если указать \fBtrue\fP или \fBmem\fP, тогда загруженный файл, расширение +которого \- \fB\&.torrent\fP или mime\-тип \- \fBapplication/x\-bittorrent\fP, +aria2 анализирует как torrent\-файл и загружает файлы, указанные в нем. +Если указано \fBmem\fP, тогда torrent\-файл не записывается на диск, +а содержится в памяти. +Если указано \fBfalse\fP, то файл \fB\&.torrent\fP будет загружен на диск, но не +будет проанализирован как торрент и его содержимое не будет загружено. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-O, \-\-index\-out== +Задать путь к файлу PATH с индексом INDEX. Вы можете найти индекс файла, +используя параметр \fI\%\-\-show\-files\fP\&. PATH +является относительным путем к тому, который указан в параметре +\fI\%\-\-dir\fP\&. Вы можете использовать этот параметр +много раз. Используйте этот параметр, когда хотите указать имена +выходных файлов для BitTorrent\-загрузок. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-listen\-port=... +Задать номер TCP\-порта для BitTorrent\-загрузок. Несколько портов можно +указать, используя \fB,\fP, например: \fB6881,6885\fP\&. Вы также можете +использовать \fB\-\fP, чтобы указать диапазон: \fB6881\-6999\fP\&. \fB,\fP и \fB\-\fP +могут быть использованы вместе: \fB6881\-6889,6999\fP\&. +По умолчанию: \fB6881\-6999\fP +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Удостоверьтесь, что указанные порты открыты для входящего TCP\-трафика. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-overall\-upload\-limit= +Задать максимальную общую скорость отдачи в байтах/сек. +\fB0\fP значит неограниченно. Вы можете добавить +\fBK\fP или \fBM\fP (1K = 1024, 1M = 1024K). Чтобы ограничить скорость +отдачи для узла торрента, используйте параметр +\fI\%\-\-max\-upload\-limit\fP\&. +По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-u, \-\-max\-upload\-limit= +Задать максимальную скорость отдачи каждого узла торрента в байтах/сек. +\fB0\fP значит неограниченно. Вы можете добавить +\fBK\fP или \fBM\fP (1K = 1024, 1M = 1024K). Чтобы ограничить +общую скорость отдачи, используйте параметр +\fI\%\-\-max\-overall\-upload\-limit\fP\&. +По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-peer\-id\-prefix= +Указать префикс для ID узла. ID узла в BitTorrent +имеет размер 20 байт. Если будет указано более 20 байт, +то только первые 20 будут использоваться, если будет +указано меньше 20, то они будут дополнены случайными +данными до 20 байт. +.sp +По умолчанию: \fBA2\-$MAJOR\-$MINOR\-$PATCH\-\fP, $MAJOR, $MINOR и $PATCH +заменяется на номер версии значительный, незначительный и патч соответственно. +Например, версия aria2 1.18.8 имеет ID\-префикс \fBA2\-1\-18\-8\-\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-peer\-agent= +Указать строку, содержащую клиентскую версию пира, которая +используется во время расширенного +bitorrent\-рукопожатия (extended handshake). +.sp +По умолчанию: \fBaria2/$MAJOR.$MINOR.$PATCH\fP, $MAJOR, $MINOR и $PATCH +заменяется на номер версии значительный, незначительный и патч соответственно. +Например, версия aria2 1.18.8 имеет ID\-префикс \fBaria2/1.18.8\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-seed\-ratio= +Указать рейтинг. Сидировать завершенные торренты, пока рейтинг +не станет больше RATIO. Очень рекомендуется указать тут равный +или больший \fB1.0\fP\&. Указать \fB0.0\fP, если вы планируете сидировать +независимо от рейтинга. Если указан параметр +\fI\%\-\-seed\-time\fP вместе с этим +параметром, сидирование закончится тогда, когда хотя бы одно +условие будет удовлетворено. +По умолчанию: \fB1.0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-seed\-time= +Указать время сидирования [раздачи] в (дробных) минутах. +Смотрите также параметр \fI\%\-\-seed\-ratio\fP\&. +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Указанный \fI\%\-\-seed\-time=0\fP отключает +сидирование после завершения загрузки. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-T, \-\-torrent\-file= +Путь к файлу ".torrent". Вы не обязаны использовать этот параметр, т.к. +файл ".torrent" можно указать без \fI\%\-\-torrent\-file\fP\&. +.UNINDENT +.SS Специфические параметры Metalink +.INDENT 0.0 +.TP +.B \-\-follow\-metalink=true|false|mem +Если указано \fBtrue\fP или \fBmem\fP и когда загруженный файл имеет расширение +\fB\&.meta4\fP или \fB\&.metalink\fP, или mime\-тип \fBapplication/metalink4+xml\fP +или \fBapplication/metalink+xml\fP, aria2 считает его metalink\-файлом и +загружает упомянутые в нем файлы. +Если указано \fBmem\fP, то metalink\-файл не сохраняется на диск, а просто +хранится в памяти. +Если указано \fBfalse\fP, то файл \fB\&.metalink\fP будет загружен на диск, но не +будет проанализирован как metalink\-файл и его содержимое не будет загружено. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-base\-uri= +Указать основной URI для разрешения относительных URI в элементе +metalink:url и metalink:metaurl в metalink\-файле, сохраненном на +локальном диске. Если URI указывает на каталог, то URI должен +заканчиваться на \fB/\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-M, \-\-metalink\-file= +Путь к файлу ".meta4" и ".metalink". Читает ввод из \fBstdin\fP, если в качестве +имени файла указано \fB\-\fP\&. Вы не обязаны использовать этот параметр, +т.к. файлы .metalink можно указать без \fI\%\-\-metalink\-file\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-language= +Язык файла для загрузки. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-location=[,...] +Местонахождение предпочитаемого сервера. Список, разделенный запятыми, +допустимых местонахождений, например, \fBjp,us\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-os= +Целевая операционная система файла для загрузки. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-version= +Версия файла для загрузки. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-preferred\-protocol= +Указать предпочитаемый протокол. Возможные значения: \fBhttp\fP, \fBhttps\fP, \fBftp\fP +и \fBnone\fP\&. Указать \fBnone\fP для отключения этой возможности. +По умолчанию: \fBnone\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-metalink\-enable\-unique\-protocol [true|false] +Если задано \fBtrue\fP, а в metalink\-файле доступно несколько +протоколов, то aria2 использует один из них. Используйте параметр +\fI\%\-\-metalink\-preferred\-protocol\fP, +чтобы указать предпочитаемый протокол. +По умолчанию: \fBtrue\fP +.UNINDENT +.SS Параметры RPC +.INDENT 0.0 +.TP +.B \-\-enable\-rpc [true|false] +Включить JSON\-RPC/XML\-RPC\-сервер. Настоятельно рекомендуется указать +секретный маркер авторизации, используя параметр \fI\%\-\-rpc\-secret\fP\&. +Смотрите также параметр \fI\%\-\-rpc\-listen\-port\fP\&. По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-pause [true|false] +Приостановка загрузки после добавления. Этот параметр действенен +только, когда задан \fI\%\-\-enable\-rpc=true.\fP +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-pause\-metadata [true|false] +Приостановить загрузки, созданные в результате загрузки метаданных. +Есть 3 типа метаданных загрузок в aria2: (1) загрузка .torrent\-файла. +(2) загрузка метаданных торрента, используя magnet\-ссылку. (3) +загрузка metalink\-файла. Эти загрузки метаданных будут генерировать +загрузки, используя их метаданные. Этот параметр приостанавливает +эти последующие загрузки. Этот параметр действует только когда задано +\fI\%\-\-enable\-rpc=true\fP\&. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-allow\-origin\-all [true|false] +Добавить заголовок Access\-Control\-Allow\-Origin со значением \fB*\fP в RPC\-ответе. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-certificate= +Использовать сертификат в FILE для RPC\-сервера. Сертификат должен быть +один из двух: PKCS12 (.p12, .pfx) или в PEM\-формате. +.sp +PKCS12\-файлы должны содержать сертификат, ключ и, необязательно, цепочку +дополнительных сертификатов. Могут быть открыты PKCS12\-файлы только +с пустым импортированным паролем! +.sp +При использовании PEM, вы также указываете закрытый ключ через \fI\%\-\-rpc\-private\-key\fP, +Используйте параметр \fI\%\-\-rpc\-secure\fP для включения шифрования. +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +\fIWinTLS\fP не поддерживает PEM\-файлы в данный момент. Пользователи должны +использовать PKCS12\-файлы. +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +\fIAppleTLS\fP пользователи должны использовать утилиту KeyСhain Access, чтобы +сначала генерировать самоподписанный SSL\-Server сертификат, например, +используя мастер, и получить соответствующий SHA\-1 отпечаток нового +сертификата из окна Information. +Для запуска aria2c с \fI\%\-\-rpc\-secure\fP используйте +\fI\-\-rpc\-certificate=\fP\&. +Альтернативные PKCS12\-файлы также поддерживаются. PEM\-файлы, однако, +не поддерживаются. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-listen\-all [true|false] +Слушать входящие JSON\-RPC/XML\-RPC\-запросы на всех сетевых интерфейсах. +Если указано \fBfalse\fP, слушать только на локальном петлевом +интерфейсе (loopback). +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-listen\-port= +Указать номер порта, для прослушивания JSON\-RPC/XML\-RPC\-сервером. +Возможные значения: \fB1024\fP \-\fB65535\fP\&. +По умолчанию: \fB6800\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-max\-request\-size= +Задать максимальный размер JSON\-RPC/XML\-RPC\-запроса. +Если aria2 выявит запрос с размером большим, чем SIZE байт, +тогда соединение будет отклонено. +По умолчанию: \fB2M\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-passwd= +Задать JSON\-RPC/XML\-RPC пароль. +.sp +\fBПРЕДУПРЕЖДЕНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Параметр \fI\%\-\-rpc\-passwd\fP будет устаревшим в будущих +версиях. Перейдите на использование параметра \fI\%\-\-rpc\-secret\fP +как можно скорее. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-private\-key= +Использовать закрытый ключ в FILE для RPC\-сервера. Закрытый ключ должен +быть дешифрованным и в PEM\-формате. Используйте параметр +\fI\%\-\-rpc\-secure\fP для включения шифрования. +Смотрите также параметр \fI\%\-\-rpc\-certificate\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-save\-upload\-metadata [true|false] +Сохранить загруженные метаданные torrent или metalink в каталоге, +заданном параметром \fI\%\-\-dir\fP\&. Имя файла содержит +шестнадцатеричную строку SHA\-1\-хэша метаданных плюс расширение. +Для torrent расширение \(aq.torrent\(aq. Для metalink \- это \(aq.meta4\(aq. +Если параметр задан как false, то загрузки, добавленные с помощью +\fI\%aria2.addTorrent()\fP или \fI\%aria2.addMetalink()\fP, не будут +сохраняться при помощи параметра \fI\%\-\-save\-session\fP\&. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-secret= +Задать секретный маркер RPC\-авторизации. Читайте \fI\%RPC\-авторизация по секретному маркеру\fP, +чтобы узнать, как использовать значение этого параметра. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-secure [true|false] +RPC\-транспорт будет зашифрован с использованием SSL/TLS. RPC\-клиенты должны +использовать https\-схему для доступа к серверу. Для WebSocket\-клиента, +использовать wss\-схему. Используйте параметры \fI\%\-\-rpc\-certificate\fP и +\fI\%\-\-rpc\-private\-key\fP для указания сертификата севера и закрытого +ключа. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rpc\-user= +Задать JSON\-RPC/XML\-RPC пользователя. +.sp +\fBПРЕДУПРЕЖДЕНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Параметр \fI\%\-\-rpc\-user\fP будет устаревшим в будущих +версиях. Перейдите на использование параметра \fI\%\-\-rpc\-secret\fP +как можно скорее. +.UNINDENT +.UNINDENT +.UNINDENT +.SS Дополнительные параметры +.INDENT 0.0 +.TP +.B \-\-allow\-overwrite [true|false] +Повторно запустить загрузку с нуля, если соответствующий контрольный +файл отсутствует. Смотрите также параметр +\fI\%\-\-auto\-file\-renaming\fP\&. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-allow\-piece\-length\-change [true|false] +Если задано \fBfalse\fP, aria2 прерывает загрузку, когда длина блока +отлична от той, которая находится в контрольном файле. Если задано +\fBtrue\fP, вы можете продолжать, однако некоторый прогресс загрузки +будет потерян. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-always\-resume [true|false] +Всегда возобновлять загрузку. Если задано \fBtrue\fP, aria2 всегда пытается +возобновить загрузку и если это не возможно, прерывает ее. +Если задано \fBfalse\fP, тогда для всех заданных URI не поддерживается +возобновление загрузки, или aria2 столкнется с невозможностью +возобновления загрузки URI \fBN\fP\-ое количество раз +(значение \fBN\fP указывается в параметре \fI\%\-\-max\-resume\-failure\-tries\fP, +то aria2 будет загружать файл с нуля. Смотрите параметр +\fI\%\-\-max\-resume\-failure\-tries\fP\&. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-async\-dns [true|false] +Включить асинхронный DNS. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-async\-dns\-server=[,...] +Разделенный запятыми список адресов DNS\-серверов, которые используют +асинхронный DNS\-преобразователь. Обычно асинхронный DNS\-преобразователь +читает адреса DNS\-серверов из \fB/etc/resolv.conf\fP\&. Когда используется +этот параметр, то используются DNS\-серверы, указанные в параметре вместо +указанных в \fB/etc/resolv.conf\fP\&. Вы можете указать оба IPv4 и IPv6 адреса. +Этот параметр полезен, когда в системе нет \fB/etc/resolv.conf\fP и у +пользователя нет прав на его создание. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-auto\-file\-renaming [true|false] +Переименовать файл, если такой уже существует. +Этот параметр работает только для HTTP(S)/FTP\-загрузок. +К имени файла, но перед расширением (если оно есть), будет +добавлена точка и число от 1 до 9999. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-auto\-save\-interval= +Сохранять контрольный файл (*.aria2) каждые SEC секунд. +Если задано \fB0\fP, тогда контрольный файл не сохраняется на +протяжении загрузки. aria2 сохраняет контрольный файл тогда, +когда останавливается, не смотря на значение. +Возможные значения: от \fB0\fP до \fB600\fP\&. +По умолчанию: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-conditional\-get [true|false] +Загружать файл только когда локальный файл старше, чем удаленный. +Эта функция работает только для HTTP(S)\-загрузок. Это не работает, +если размер файла указан в Metalink. Это также игнорирует заголовок +Content\-Disposition. Если контрольный файл существует, то этот +параметр игнорируется. Эта функция использует заголовок +If\-Modified\-Since, как условие для получения только нового файла. +При получении времени модификации локального файла, используется +указанное пользователем имя файла +(см. параметр \fI\%\-\-out\fP) или часть имени файла в +URI, если \fI\%\-\-out\fP не указан. Для перезаписи +существующего файла необходим параметр +\fI\%\-\-allow\-overwrite\fP\&. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-conf\-path= +Сменить путь к файлу конфигурации на PATH. +По умолчанию: \fB$HOME/.aria2/aria2.conf\fP если существует, +иначе \fB$XDG_CACHE_HOME/aria2/aria2.conf\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-console\-log\-level= +Задать уровень вывода событий на консоль. LEVEL может +быть: \fBdebug\fP, \fBinfo\fP, \fBnotice\fP, \fBwarn\fP или \fBerror\fP\&. +По умолчанию: \fBnotice\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-content\-disposition\-default\-utf8 [true|false] +Обрабатывать строку в кавычках в заголовке Content\-Disposition как +UTF\-8 вместо ISO\-8859\-1, например, параметр filename, +но не расширенную версию filename*. По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-D, \-\-daemon [true|false] +Запустить как демон (фоновый процесс). Текущий рабочий каталог +будет заменен на \fB/\fP, а стандартный ввод, стандартный вывод, +стандартный вывод ошибок будут перенаправлены на \fB/dev/null\fP\&. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-deferred\-input [true|false] +Если задано \fBtrue\fP, aria2 при запуске не считывает все URI и параметры +из файла, указанного в параметре \fI\%\-\-input\-file\fP, а +считывает их позже отдельно, когда это нужно. Это может сократить +использование памяти, если во входном файле содержится много URI для +загрузки. Если задано \fBfalse\fP, aria2 при запуске считывает все URI +и параметры. +По умолчанию: \fBfalse\fP +.sp +\fBПРЕДУПРЕЖДЕНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +параметр \fI\%\-\-deferred\-input\fP будет заблокирован, если +используется вместе с \fI\%\-\-save\-session\fP\&. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-disable\-ipv6 [true|false] +Отключить IPv6. Это полезно, если вы используете поврежденный DNS +и хотите избежать ужасно медленного поиска AAAA\-записи. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-disk\-cache= +Включить дисковый кэш. Если SIZE задать как \fB0\fP, то дисковый кэш +будет отключён. Эта функция кэширует загруженных данных в памяти, +которая растет до не более чем SIZE байт. Кэш\-память создаётся для +экземпляра aria2 и совместно используется всеми загрузками. Одним из +преимуществ дискового кэша \- это уменьшение дискового ввода/вывода, +т.к. данные записываются большими блоками, и они распределяются через +смещение в файле. Если задействована хэш\-проверка и данные кэшируются +в памяти, то мы не должны читать их с диска. SIZE может включать букву +\fBK\fP или \fBM\fP (1K = 1024, 1M = 1024K). По умолчанию: \fB16M\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-download\-result= +Этот параметр изменяет формат сообщения \fBРезультаты загрузки\fP\&. Если OPT +задан как \fBdefault\fP, то отображается GID, статус, средняя скорость загрузки и +путь/URI. Если загружается множество файлов, то отобразится путь/URI первого +запрашиваемого файла, а остальные пропускаются. Если OPT задан как \fBfull\fP, +то отображается GID, статус, средняя скорость загрузки, процент прогресса и +путь/URI. Процент прогресса и путь/URI отобразится для каждого +запрашиваемого файла в отдельной строке. Если OPT задан как \fBhide\fP, то +\fBРезультаты загрузки\fP скрыты. +По умолчанию: \fBdefault\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-dscp= +Задать значение DSCP в исходящих IP\-пакетах BitTorrent\-трафика для +QoS. Этот параметр изменяет только DSCP\-биты в поле ToS IP\-пакетов, а +не всё поле. Если вы берёте значения из \fI/usr/include/netinet/ip.h\fP, +то делите их на 4 (иначе значения будут неверными, например, +ваш класс \fBCS1\fP превратится в \fBCS4\fP). Если берёте обычно используемые +значения из RFC, документации сетевых производителей, Википедии или других +источников, то используйте их как есть. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-rlimit\-nofile= +Задать мягкое (soft) ограничение для дескрипторов +открытых файлов. +Ограничение будет иметь эффект только, если: +.INDENT 7.0 +.INDENT 3.5 +.INDENT 0.0 +.IP a. 3 +Операционная система поддерживает его (posix). +.IP b. 3 +Ограничение не превышает жёсткое (hard) ограничение. +.IP c. 3 +Указанное ограничение больше, чем текущее мягкое ограничение. +.UNINDENT +.UNINDENT +.UNINDENT +.sp +Это эквивалентно установке nofile через ulimit, +за исключением того, оно никогда не будет +уменьшать ограничение. +.sp +Этот параметр доступен только в системах, поддерживающих API rlimit. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-color [true|false] +Включить цветной вывод для терминала. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-enable\-mmap [true|false] +Отображение файлов в память. Этот параметр может не работать, +если место под файл предварительно не выделено. +Смотрите \fI\%\-\-file\-allocation\fP\&. +.sp +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-event\-poll= +Указать метод опроса событий. Возможные значения: \fBepoll\fP, \fBkqueue\fP, +\fBport\fP, \fBpoll\fP и \fBselect\fP\&. Каждый метод \fBepoll\fP, \fBkqueue\fP, \fBport\fP и +\fBpoll\fP доступен, если система поддерживает его. \fBepoll\fP доступен в +современных дистрибутивах Linux. \fBkqueue\fP доступен в различных +*BSD\-системах, включая Mac OS X. \fBport\fP доступен в Open Solaris. +Значение по умолчанию может изменяться в зависимости от системы, +которую вы используете. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-file\-allocation= +Указать метод резервирования места для файла. \fBnone\fP не происходит +предварительное резервирование места для файла. \fBprealloc\fP \- предварительное +резервирование места для файла перед началом загрузки. Это может +продолжаться некоторое время, в зависимости от размера файла. Если вы +используете новые файловые системы, наподобие ext4 (с поддержкой экстентов), +btrfs, xfs или NTFS (только MinGW\-сборка) тогда лучше выбрать \fBfalloc\fP\&. +Так как они резервируют место под большие (на несколько Гигабайт) файлы +почти мгновенно. Не используйте \fBfalloc\fP вместе с традиционными файловыми +системами, такими как ext3 и FAT32, потому что это будет продолжаться +почти столько же времени, как и \fBprealloc\fP, а также полностью заблокирует +aria2, пока не закончится резервирование места. \fBfalloc\fP может быть +недоступным, если ваша система не содержит функцию \fBposix_fallocate(3)\fP\&. +\fBtrunc\fP использует системный вызов \fBftruncate(2)\fP или +специфичный для конкретной платформы эквивалент, чтобы усечь файл до указанной +длины. +.sp +Возможные значения: \fBnone\fP, \fBprealloc\fP, \fBtrunc\fP, \fBfalloc\fP +По умолчанию: \fBprealloc\fP +.sp +\fBПРЕДУПРЕЖДЕНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Использование \fBtrunc\fP, на вид, выделяет дисковое пространство +очень быстро, но на самом деле устанавливается длина файла в +метаданных файловой системы, а дисковое пространство вообще не +выделяется. Это означает, что это не помогает избежать +фрагментации. +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +В загрузках многофайлового торрента, по определенным смежным файлам также, +которые размещены в части одного блока. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-force\-save [true|false] +Сохранить загрузку с параметром \fI\%\-\-save\-session\fP, +даже если загрузка будет завершена или удалена. В этих ситуациях параметр +также сохраняет контрольный файл. Это может быть полезно, +чтобы сохранить BitTorrent\-сидирование, у которого будет распознано +состояние как завершенное. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-save\-not\-found [true|false] +Сохранить загрузку с параметром \fI\%\-\-save\-session\fP, +даже если файл не был найден на сервере. В этой ситуации параметр +также сохраняет контрольный файл. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-gid= +Задать GID вручную. aria2 идентифицирует каждую загрузку по ID, +называемому GID. GID должен быть шестнадцатеричной строкой из 16 +символов, таким образом разрешены [0\-9a\-fA\-F], а начальные нули +не должны быть пропущены. GID равный 0 зарезервирован и не должен +быть использован. GID должен быть уникальным, иначе отобразится +сообщение об ошибке и загрузка не добавится. Этот параметр полезен +при восстановлении сохранённой сессии, используя параметр +\fI\%\-\-save\-session\fP\&. Если этот параметр не +использован, то новый GID будет сгенерирован aria2. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-hash\-check\-only [true|false] +Если задано \fBtrue\fP, то после проверки хэша, используя параметр +\fI\%\-\-check\-integrity\fP, загрузка прервётся, в любом +случае загрузка завершится. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-human\-readable [true|false] +Выводить размеры и скорость в удобочитаемом формате +(например, 1.2Ки, 3.4Ми) на консольный индикатор. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-interface= +Привязать сокеты к заданному интерфейсу. Вы можете указать имя +интерфейса, IP\-адрес и имя хоста. Возможные значения: имя +интерфейса (например, eth0), IP\-адрес (например, 192.168.0.12), +имя хоста (например, myhost). +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Если интерфейс имеет несколько адресов, то настоятельно рекомендуется +указать IP\-адрес явно. Смотрите также +\fI\%\-\-disable\-ipv6\fP\&. Если ваша система не имеет \fBgetifaddrs(3)\fP, это +параметр не принимает имя интерфейса. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-keep\-unfinished\-download\-result [true|false] +Сохранять результаты незавершённых загрузок, даже если превышено значение +\fI\%\-\-max\-download\-result\fP\&. Это полезно, если незавершённые загрузки +должны сохраняться в файле сессии (см. параметр \fI\%\-\-save\-session\fP). +Пожалуйста, имейте в виду, что для сохранения не существует верхней границы +для количества результатов незавершённых загрузок. Если это нежелательно, +отключите эту опцию. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-download\-result= +Задать максимальное количество результатов загрузок, которые находятся +в памяти. Результаты загрузок \- завершенные/ошибка/удаленные загрузки. +Результаты загрузок хранятся FIFO очереди, в которой может хранится NUM +результатов загрузок. Когда очередь заполнена и появляется новый +результат загрузки, то старейший результат загрузки удаляется из начала +очереди, а новый добавляется в конец. Указание большого числа в этом +параметре может привести к высокому потреблению памяти после тысяч +загрузок. Значение 0 отключит сохранение результата загрузки. +Обратите внимание, что незавершённые загрузки хранятся в памяти +независимо от этого значения параметра. +См. параметр \fI\%\-\-keep\-unfinished\-download\-result\fP\&. +По умолчанию: \fB1000\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-mmap\-limit= +Задать максимальный размер файла для включения mmap (см. параметр +\fI\%\-\-enable\-mmap\fP). Размер файла определяется по сумме всех файлов, +содержащихся в одной загрузке. Например, если загрузка содержит 5 файлов, то +размер файла \- это суммарный размер этих файлов. Если размер файла строго больше +чем размер, указанный в этом параметре, то mmap будет отключён. +По умолчанию: \fB9223372036854775807\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-resume\-failure\-tries= +Если параметр \fI\%\-\-always\-resume=false,\fP aria2 +загрузит файл с нуля, при обнаружении \fBN\fP \-го URI, не поддерживающего +возобновление. Если \fBN\fP =\(ga\(ga0\(ga\(ga, то aria2 загрузит файл с нуля, когда все +URI не поддерживают возобновление. Смотрите параметр +\fI\%\-\-always\-resume\fP\&. +По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-min\-tls\-version= +Указать для использования минимальную версию SSL/TLS. +Возможные значения: \fBTLSv1.1\fP, \fBTLSv1.2\fP, \fBTLSv1.3\fP +По умолчанию: \fBTLSv1.2\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-multiple\-interface= +Разделенный запятыми список интерфейсов для привязки сокетов. +Запросы будут разделяться между интерфейсами для достижения объединения +каналов. Вы можете указать имя интерфейса (например, eth0), +IP\-адрес (например, 192.168.0.12) и имя хоста (например, myhost). Если +используется \fI\%\-\-interface\fP, то этот параметр будет проигнорирован. +Возможные значения: интерфейс, IP\-адрес, имя хоста. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-log\-level= +Задать уровень вывода журнала событий. LEVEL может +быть: \fBdebug\fP, \fBinfo\fP, \fBnotice\fP, \fBwarn\fP или \fBerror\fP\&. +По умолчанию: \fBdebug\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-bt\-download\-complete= +Для BitTorrent, в \fI\%\-\-on\-download\-complete\fP +указывается команда, которая вызывается после завершение загрузки и окончания +сидирования. С другой стороны, этот параметр определяет команду, которая +будет выполнена после завершения загрузки, но до сидирования. +Смотрите раздел \fI\%Перехват сообщения\fP для более подробной +информации о COMMAND. Возможные значения: \fB/путь/к/команде\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-complete= +Задать команду, которая будет выполнена после завершения загрузки. +Смотрите раздел \fI\%Перехват сообщения\fP для более +подробной информации о COMMAND. Смотрите также параметр +\fI\%\-\-on\-download\-stop\fP\&. +Возможные значения: \fB/путь/к/команде\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-error= +Задать команду, которая будет выполнена после того, как загрузка будет +прервана из\-за ошибки. Смотрите раздел \fI\%Перехват сообщения\fP +для более подробной информации о COMMAND. Смотрите также параметр +\fI\%\-\-on\-download\-stop\fP\&. Возможные +значения: \fB/путь/к/команде\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-pause= +Задать команду, которая будет выполнена после того, как +загрузка будет приостановлена. Смотрите раздел +\fI\%Перехват сообщения\fP для более подробной +информации о COMMAND. Возможные значения: \fB/путь/к/команде\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-start= +Задать команду, которая будет выполнена после того, как +началась загрузка. Смотрите раздел \fI\%Перехват сообщения\fP +для более подробной информации о COMMAND. Возможные +значения: \fB/путь/к/команде\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-on\-download\-stop= +Задать команду, которая будет выполнена после того, как загрузка +остановлена. Вы можете изменить команду, которая будет выполнятся +при определенном результате загрузки, используя параметры +\fI\%\-\-on\-download\-complete\fP и \fI\%\-\-on\-download\-error\fP\&. +Если они указаны, то команда, определенная в этом параметре не +будет выполнятся. Смотрите раздел \fI\%Перехват сообщения\fP +для более подробной информации о COMMAND. Возможные +значения: \fB/путь/к/команде\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-optimize\-concurrent\-downloads [true|false|:] +Оптимизирует количество одновременных загрузок в соответствии с +доступной полосой пропускания. aria2 использует скорость загрузки, +наблюдаемую в предыдущих загрузках, чтобы адаптировать количество +загрузок, запущенных параллельно согласно правилу N = A + B Log10 +(скорость в Мбит/c). Коэффициенты А и В могут быть настроены в +аргументах А и В, разделённых двоеточием. Значения по умолчанию +(A=5, B=25) приводят к использованию обычно 5 параллельных загрузок +в сетях с 1Мбит/с и более 50 в сетях с 100 Мбит/с. Число параллельных +загрузок остаётся ограниченно максимумом, определяемом в параметре +\fI\%\-\-max\-concurrent\-downloads\fP\&. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-piece\-length= +Задать длину блока для HTTP/FTP\-загрузок. Это является границей, когда +aria2 разделяет файл на части. Все разделения происходят многократно по +этой длине. Этот параметр будет игнорироваться при BitTorrent\-загрузках. +Также будет игнорироваться, если Metalink\-файл содержит хэши блоков. +По умолчанию: \fB1M\fP +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Возможный вариант использования параметра +\fI\%\-\-piece\-length\fP \- изменение диапазона запроса в одном конвейерном +HTTP\-запросе. Для включения конвейерной обработки HTTP используйте +\fI\%\-\-enable\-http\-pipelining\fP\&. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-show\-console\-readout [true|false] +Показывать консольный индикатор. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stderr [true|false] +Перенаправить весь вывод консоли в stderr (стандартный поток ошибок), +иначе будет использован stdout (стандартный поток вывода). +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-summary\-interval= +Задать интервал в секундах до вывода сообщения о прогрессе +загрузки. Установка \fB0\fP запрещает вывод. +По умолчанию: \fB60\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-Z, \-\-force\-sequential [true|false] +Получить URI в последовательности командной строки и загрузить каждое +URI в отдельной сессии, как в обычных утилитах загрузки командной +строки. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-overall\-download\-limit= +Задать максимальную общую скорость загрузки в байтах/сек. \fB0\fP значит +неограниченно. Вы можете добавить \fBK\fP или \fBM\fP (1K = 1024, 1M = 1024K). +Чтобы ограничить скорость загрузки для узла, используйте параметр +\fI\%\-\-max\-download\-limit\fP\&. +По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-max\-download\-limit= +Установить максимальную скорость каждого узла загрузки в байтах/сек. \fB0\fP +значит неограниченно. Вы можете добавить \fBK\fP или \fBM\fP (1K = 1024, 1M = 1024K). +Чтобы ограничить общую скорость загрузки, используйте параметр +\fI\%\-\-max\-overall\-download\-limit\fP\&. +По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-conf [true|false] +Отключить загрузку файла aria2.conf. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-no\-file\-allocation\-limit= +Не резервируется место для файлов, размер которых меньше SIZE. +Вы можете добавить \fBK\fP или \fBM\fP (1K = 1024, 1M = 1024K). +По умолчанию: \fB5M\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-P, \-\-parameterized\-uri [true|false] +Включить поддержку параметризованных URI. Вы можете указать набор +частей: \fBhttp://{sv1,sv2,sv3}/foo.iso\fP\&. Также вы можете указать +числовую последовательность с шагом +счетчика: \fBhttp://host/image[000\-100:2].img\fP\&. Шагом счетчика +можно пренебречь. Если все URI не указывают на такой же файл, как +во втором приведенном выше примере, то необходим параметр \-Z. +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-q, \-\-quiet [true|false] +Сделать aria2 молчаливой (без консольного вывода). +По умолчанию: \fBfalse\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-realtime\-chunk\-checksum [true|false] +Подтверждать правильность блока данных путем вычисления контрольной суммы +во время загрузки файла, если предусмотрена контрольная сумма блоков. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-remove\-control\-file [true|false] +Удалять контрольный файл перед загрузкой. При использовании с +\fI\%\-\-allow\-overwrite=true\fP файл +всегда загружается с нуля. Это может понадобиться пользователям +за прокси\-сервером, который блокирует возобновление загрузки. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-save\-session= +Сохранять ошибочные/незаконченные загрузки в FILE при завершении работы. Вы можете +передать этот выходной файл aria2c с параметром \fI\%\-\-input\-file\fP при +перезапуске. Если вам нужен сжатый файл, то добавьте к имени файла расширение .gz. +Обратите внимание, что загрузки, добавленные через RPC\-методы +\fI\%aria2.addTorrent()\fP, \fI\%aria2.addMetalink()\fP и чьи метаданные не могут +быть сохранены как файл, не будут сохраняться. +Загрузки, удаленные с использованием \fI\%aria2.remove()\fP и +\fI\%aria2.forceRemove()\fP не будут сохранены. GID также сохраняется параметром +\fI\%gid\fP, но с некоторыми ограничениями, смотрите ниже. +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 7.0 +.INDENT 3.5 +Обычно, GID загрузки сам будет сохранён. Но некоторые загрузки +используют метаданные (например, BitTorrent и Metalink). В этом +случае есть некоторые ограничения. +.INDENT 0.0 +.TP +.B magnet\-ссылка, и последующая torrent\-загрузка +Сохранится GID из метаданных BitTorrent\-загрузки. +.TP +.B URI к torrent\-файл, и последующая torrent\-загрузка +Сохранится GID из torrent\-файла загрузки. +.TP +.B URI к metalink\-файл, и последующая загрузка файлов, описанных metalink\-файле +Сохранится GID из metalink\-файла загрузки. +.TP +.B Локальный torrent\-файл +Сохранится GID из torrent\-загрузки. +.TP +.B Локальный metalink\-файл +Никакой значимый GID не сохранится. +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-save\-session\-interval= +Сохранять ошибочные/незаконченные загрузки в файл, указанный в +параметре \fI\%\-\-save\-session\fP, каждые SEC секунд. +Если указан \fB0\fP, то файл будет сохранён только тогда, когда +aria2 завершит работу. По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-socket\-recv\-buffer\-size= +Задать максимальный приёмный буфер сокета в байтах. Указание \fB0\fP +отключит этот параметр. Это значение будет установлено для дескриптора +файла сокета с помощью \fBSO_RCVBUF\fP, параметра сокета в вызове \fBsetsockopt()\fP\&. +По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stop= +Останавливать программу после того как пройдет +SEC секунд. Если задано \fB0\fP, эта возможность будет +отключена. +По умолчанию: \fB0\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-stop\-with\-process= +Остановить приложение, когда процесс с идентификационный номером PID +не работает. Это полезно, если процесс aria2 запущен из родительского +процесса. Родительский процесс может запустить aria2 со своим +идентификационным номером и когда он (процесс) завершится по какой\-то +причине, aria2 может обнаружить это и самостоятельно завершить работу. +.UNINDENT +.INDENT 0.0 +.TP +.B \-\-truncate\-console\-readout [true|false] +Укорачивать консольный индикатор, чтобы он поместился в +одну строку. +По умолчанию: \fBtrue\fP +.UNINDENT +.INDENT 0.0 +.TP +.B \-v, \-\-version +Вывести номер версии, информацию об авторских +правах, конфигурации и завершить работу. +.UNINDENT +.SS Примечания для параметров +.SS Необязательные аргументы +.sp +Параметры, которые имеют значения в квадратных скобках ([]), могут принимать +дополнительные (необязательные) аргументы. Обычно отсутствие аргумента +эквивалентно \fBtrue\fP\&. Если вы используется короткую форму параметров +(например, \fB\-V\fP) и указываете аргумент, то имя параметра и его аргумент +должны быть объедены (например, \fB\-Vfalse\fP). Если будут вставлены пробелы +между именем параметра и аргументом, то аргумент будет обрабатываться как +URI, и это не то, что обычно вы ожидаете. +.SS Единицы (K и M) +.sp +Некоторые параметры принимают \fBK\fP и \fBM\fP для удобства представления 1024 +и 1048576 соответственно. aria2 определяет эти символы без учета +регистра. Другими словами, \fBk\fP и \fBm\fP могут быть использованы также как +\fBK\fP и \fBM\fP соответственно. +.SS URI, MAGNET\-ССЫЛКА, TORRENT\-ФАЙЛ, METALINK\-ФАЙЛ +.sp +Вы можете перечислить несколько URI в командной строке. Пока вы не указали +параметр \fI\%\-\-force\-sequential\fP, все URI должны указывать на один +и тот же файл или загрузка завершится не удачно. +.sp +Вы можете указать произвольное количество BitTorrent Magnet URI. Обратите +внимание, что они всегда будут обрабатываться как отдельная +загрузка. Поддерживаются оба Info Hash (Информация о хэше), как +закодированный 40 шестнадцатеричными символами, так и закодированный 32 +символами Base32\-кодировки. Поддерживаются составные параметры +\fBtr\fP\&. Т.к. в BitTorrent Magnet URI возможно присутствие символа \fB&\fP, то +настоятельно рекомендуется всегда заключать URI в одиночные(\fB\(aq\fP) или +двойные(\fB"\fP) кавычки. Так же настоятельно рекомендуется включить DHT, +особенно когда параметр \fBtr\fP не указан. Смотрите +\fI\%http://www.bittorrent.org/beps/bep_0009.html\fP для детальной информации по +BitTorrent Magnet URI. +.sp +Вы также можете указать произвольное количество torrent\-файлов и +Metalink\-документов, которые хранятся на локальном диске. Обратите внимание, +что они всегда будут обрабатываться как отдельная загрузка. Поддерживаются +оба формата: Metalink4 и Metalink версии 3.0. +.sp +Вы можете указать вместе, torrent\-файл с параметром \fI\%\-\-torrent\-file\fP и URI. Сделав это, вы можете загружать файл, используя torrent\-рой и +HTTP(S)/FTP/SFTP\-сервер одновременно, пока данные из HTTP(S)/FTP/SFTP +выгружаются в torrent\-рой. Для однофайловых торрентов, URI может быть +завершенным, который указывает на ресурс, или же если заканчиваться символом +/, тогда name (имя) в torrent\-файле будет добавлено. Для многофайловых +торрентов, name (имя) и path (путь) в torrent\-файле будут добавлены из URI +для каждого файла. +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Удостоверьтесь, что URI заключен в одинарные(\(aq) или двойные(\fB"\fP) кавычки, если +есть символ \fB&\fP или любые символы, которые имеют особое значение в командной +оболочке. +.UNINDENT +.UNINDENT +.SS Возобновление загрузки +.sp +Обычно, вы можете возобновить передачу, только запустив ту же самую команду +(aria2c URI), которая выполнялась при предыдущей передаче, созданной aria2. +.sp +Если предыдущая передача создана веб\-браузером или wget\-подобным менеджером +загрузки, тогда используйте параметр \fI\%\-\-continue\fP для +продолжения передачи. +.SS Перехват сообщения +.sp +aria2 предоставляет параметры, в которых указываются произвольные команды, +выполняемые после наступления определенного события. В настоящее время +доступны следующие параметры: +\fI\%\-\-on\-bt\-download\-complete\fP, +\fI\%\-\-on\-download\-pause\fP, +\fI\%\-\-on\-download\-complete\fP, +\fI\%\-\-on\-download\-start\fP, +\fI\%\-\-on\-download\-error\fP, +\fI\%\-\-on\-download\-stop\fP\&. +.sp +aria2 передает 3 аргумента указанной команды, которая выполняется. Это +аргументы: GID, количество файлов и путь к файлу. Для HTTP\-, FTP\- и +SFTP\-загрузок, обычно количество файлов \- 1. BitTorrent загрузка может +содержать множество файлов. Если число файлов больше чем один, то путь к +файлу будет для первого. Другими словами, это значение параметра path в +первой структуре, определенный параметр которой имеет значение true +(истина), в ответе RPC\-метода \fI\%aria2.getFiles()\fP\&. Если вы хотите +получить все пути к файлам, то рассмотрите использование +JSON\-RPC/XML\-RPC. Обратите внимание, что путь к файлу может меняться в +процессе загрузки по HTTP из\-за перенаправления или заголовка +Content\-Disposition. +.sp +Посмотрите пример, как аргументы передаются команде: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ cat hook.sh +#!/bin/sh +echo "Called with [$1] [$2] [$3]" +$ aria2c \-\-on\-download\-complete hook.sh http://example.org/file.iso +Called with [1] [1] [/path/to/file.iso] +.ft P +.fi +.UNINDENT +.UNINDENT +.SH КОДЫ ЗАВЕРШЕНИЯ +.sp +Поскольку aria2 может обрабатывать несколько загрузок одновременно, она +сталкивается с множеством ошибок в сессии. aria2 возвращает следующий код +завершения, основанный на последней встретившейся ошибке. +.INDENT 0.0 +.TP +.B 0 +Если все загрузки завершились успешно. +.TP +.B 1 +Если произошла неизвестная ошибка. +.TP +.B 2 +Если время истекло. +.TP +.B 3 +Если ресурс не был найден. +.TP +.B 4 +Если aria2 получила определенное число ошибок "ресурс не найден". +Смотрите параметр \fI\%\-\-max\-file\-not\-found\fP\&. +.TP +.B 5 +Если загрузка прервана, поскольку скорость загрузки была слишком медленной. +Смотрите параметр \fI\%\-\-lowest\-speed\-limit\fP\&. +.TP +.B 6 +Если произошла проблема с сетью. +.TP +.B 7 +Если были незавершенные загрузки. Эта ошибка только появляется, только если +все завершенные загрузки были успешны и были незавершенные загрузки в +очереди, когда aria2 завершила работу по нажатию \fBCtrl\-C\fP пользователем или при +отправке сигнала TERM или INT. +.TP +.B 8 +Если удаленный сервер не поддерживает возобновление, когда оно было указано +как обязательное для завершения загрузки. +.TP +.B 9 +Если было недостаточно пространства на диске. +.TP +.B 10 +Если размер блока был отличным от указанного контрольном .aria2\-файле. +Смотрите параметр \fI\%\-\-allow\-piece\-length\-change\fP\&. +.TP +.B 11 +Если aria2 был загружен один и тот же файл в тот момент. +.TP +.B 12 +Если aria2 загрузила торрент с одним и тем же хэшем в этот момент. +.TP +.B 13 +Если файл уже существует. Смотрите параметр +\fI\%\-\-allow\-overwrite\fP\&. +.TP +.B 14 +Если не удалось переименование. Смотрите параметр +\fI\%\-\-auto\-file\-renaming\fP\&. +.TP +.B 15 +Если aria2 не смогла открыть существующий файл. +.TP +.B 16 +Если aria2 не смогла создать новый файл или обрезать существующий файл. +.TP +.B 17 +Если произошла ошибка чтения/записи файла. +.TP +.B 18 +Если aria2 не смогла создать каталог. +.TP +.B 19 +Если не удалось разрешение имен (DNS). +.TP +.B 20 +Если aria2 не смогла проанализировать Metalink\-документ. +.TP +.B 21 +Если FTP\-команда не удалась. +.TP +.B 22 +Если HTTP\-заголовок ответа был испорчен или неожиданным. +.TP +.B 23 +Если произошло слишком много перенаправлений. +.TP +.B 24 +Если HTTP\-авторизация не удалась. +.TP +.B 25 +Если aria2 не смогла проанализировать закодированный файл (обычно файл ".torrent"). +.TP +.B 26 +Если файл ".torrent" был испорчен или потеряна информация, которая необходима +aria2. +.TP +.B 27 +Если Magnet\-ссылка была плохой. +.TP +.B 28 +Если был задан плохой/неопознанный параметр или неожиданный аргумент к нему. +.TP +.B 29 +Если удаленный сервер не смог обработать запрос из\-за временной перегрузки +или регламентных работ. +.TP +.B 30 +Если aria2 не смогла проанализировать JSON\-RPC\-запрос. +.TP +.B 31 +Зарезервировано. Не используется. +.TP +.B 32 +Если проверка контрольной суммы не удалась. +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Ошибка, произошедшая в завершенной загрузке, не будет передана как код +завершения. +.UNINDENT +.UNINDENT +.SH ОКРУЖЕНИЕ +.sp +aria2 распознает следующие переменные окружения. +.INDENT 0.0 +.TP +.B \fBhttp_proxy [http://][ПОЛЬЗОВАТЕЛЬ:ПАРОЛЬ@]ХОСТ[:ПОРТ]\fP +Указать прокси\-сервер для использования в HTTP. Заменяет значение http\-proxy +в конфигурационном файле. Параметр +\fI\%\-\-http\-proxy\fP в командной строке заменяет эту переменную. +.TP +.B \fBhttps_proxy [http://][ПОЛЬЗОВАТЕЛЬ:ПАРОЛЬ@]ХОСТ[:ПОРТ]\fP +Указать прокси\-сервер для использования в HTTPS. Заменяет значение +https\-proxy в конфигурационном файле. Параметр +\fI\%\-\-https\-proxy\fP в командной строке заменяет эту переменную. +.TP +.B \fBftp_proxy [http://][ПОЛЬЗОВАТЕЛЬ:ПАРОЛЬ@]ХОСТ[:ПОРТ]\fP +Указать прокси\-сервер для использования в FTP. Заменяет значение ftp\-proxy в +конфигурационном файле. Параметр \fI\%\-\-ftp\-proxy\fP в +командной строке заменяет эту переменную. +.TP +.B \fBall_proxy [http://][ПОЛЬЗОВАТЕЛЬ:ПАРОЛЬ@]ХОСТ[:ПОРТ]\fP +Указать прокси\-сервер для использования, если не указан конкретный протокол +для прокси. Заменяет значение all\-proxy в конфигурационном файле. Параметр +\fI\%\-\-all\-proxy\fP в командной строке заменяет эту +переменную. +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Несмотря на то, что aria2 допускает \fBftp://\fP и \fBhttps://\fP схемы прокси в URI, +она просто предполагает, что определен \fBhttp://\fP и не меняет своего поведения, +основанного на определенной схеме. +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B \fBno_proxy [ДОМЕН,...]\fP +Указать, разделенные запятыми, список имён хостов, доменов и сетевых адресов +с или без маски подсети, для которых не будет использоваться прокси. Заменяет +значение \fIno\-proxy\fP в конфигурационном файле. Параметр \fI\%\-\-no\-proxy\fP в +командной строке заменяет эту переменную. +.UNINDENT +.SH ФАЙЛЫ +.SS aria2.conf +.sp +По умолчанию, aria2 проверяет наличие \fB$HOME/.aria2/aria2.conf\fP по +устаревшему пути, иначе анализируется \fB$XDG_CONFIG_HOME/aria2/aria2.conf\fP +как конфигурационный файл. Вы можете указать путь к конфигурационному файлу +в параметре \fI\%\-\-conf\-path\fP\&. Если вы не хотите использовать +конфигурационный файл, используйте параметр \fI\%\-\-no\-conf\fP\&. +.sp +Конфигурационный файл \- это текстовый файл, содержащий один параметр в +строке. В каждой строке, вы можете указать пары имя\-значение в формате: +ИМЯ=ЗНАЧЕНИЕ, где имя \- это длинный параметр командной строки, без префикса +\fB\-\-\fP\&. Вы можете использовать тот же синтаксис, что и для параметра +командной строки. Строки начинающиеся с \fB#\fP рассматриваются как +комментарии: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +# sample configuration file for aria2c +listen\-port=60000 +dht\-listen\-port=60000 +seed\-ratio=1.0 +max\-upload\-limit=50K +ftp\-pasv=true +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Конфиденциальная информация такая как пользователь/пароль могут быть +включены в конфигурационный файл. Рекомендуется изменить режим доступа +к конфигурационному файлу (например, \fBchmod 600 aria2.conf\fP), так +другие пользователи не смогут увидеть содержимое файла. +.UNINDENT +.UNINDENT +.sp +Значения перемененных окружения, таких как \fB${HOME}\fP, подставляются +командной оболочкой. Это означает, что эти переменные, используемые в файле +конфигурации, не подставляются. Тем не менее, полезно для обозначения +домашнего каталога пользователя в конфигурационном файле использовать +\fB${HOME}\fP, чтобы указать путь к файлам. Таким образом, aria2 подставляет +путь к домашней директории пользователя при найденной переменной +\fB${HOME}\fP, в следующих значениях параметров: +.INDENT 0.0 +.IP \(bu 2 +\fI\%ca\-certificate\fP +.IP \(bu 2 +\fI\%certificate\fP +.IP \(bu 2 +\fI\%dht\-file\-path\fP +.IP \(bu 2 +\fI\%dht\-file\-path6\fP +.IP \(bu 2 +\fI\%dir\fP +.IP \(bu 2 +\fI\%input\-file\fP +.IP \(bu 2 +\fI\%load\-cookies\fP +.IP \(bu 2 +\fI\%log\fP +.IP \(bu 2 +\fI\%metalink\-file\fP +.IP \(bu 2 +\fI\%netrc\-path\fP +.IP \(bu 2 +\fI\%on\-bt\-download\-complete\fP +.IP \(bu 2 +\fI\%on\-download\-complete\fP +.IP \(bu 2 +\fI\%on\-download\-error\fP +.IP \(bu 2 +\fI\%on\-download\-start\fP +.IP \(bu 2 +\fI\%on\-download\-stop\fP +.IP \(bu 2 +\fI\%on\-download\-pause\fP +.IP \(bu 2 +\fI\%out\fP +.IP \(bu 2 +\fI\%private\-key\fP +.IP \(bu 2 +\fI\%rpc\-certificate\fP +.IP \(bu 2 +\fI\%rpc\-private\-key\fP +.IP \(bu 2 +\fI\%save\-cookies\fP +.IP \(bu 2 +\fI\%save\-session\fP +.IP \(bu 2 +\fI\%server\-stat\-if\fP +.IP \(bu 2 +\fI\%server\-stat\-of\fP +.IP \(bu 2 +\fI\%torrent\-file\fP +.UNINDENT +.sp +Обратите внимание, что подстановка происходит даже в том случае, если +вышеуказанные параметры используются в командной строке. Это означает, что +подстановка может происходить 2 раза: сначала командной оболочкой, а затем +aria2c. +.SS dht.dat +.sp +Если устаревшие пути к файлам \fB$HOME/.aria2/dht.dat\fP и +\fB$HOME/.aria2/dht6.dat\fP указывают на несуществующие файлы, то таблица +маршрутизации IPv4 DHT сохраняется в \fB$XDG_CACHE_HOME/aria2/dht.dat\fP, а +таблица маршрутизации IPv6 DHT сохраняется в +\fB$XDG_CACHE_HOME/aria2/dht6.dat\fP\&. +.SS Netrc +.sp +Поддержка Netrc включена по умолчанию для HTTP(S)/FTP/SFTP. Для отключения +поддержки netrc, укажите параметр \fI\%\-\-no\-netrc\fP\&. Ваш файл .netrc +должен иметь соответствующие права (600). +.sp +Если имя машины (machine) начинается с \fB\&.\fP, то aria2 выполняет доменное +сопоставление вместо точного соответствия. Это расширение aria2. Пример +доменного сопоставления, представьте себе следующие содержимое .netrc: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +machine .example.org login myid password mypasswd +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Доменное имя \fBaria2.example.org\fP совпадает с \fB\&.example.org\fP и +используется \fBmyid\fP и \fBmypasswd\fP\&. +.sp +Примеры некоторых совпадений доменных имен: доменное имя \fBexample.net\fP не +совпадает с \fB\&.example.org\fP\&. Доменное имя \fBexample.org\fP не совпадает +\fB\&.example.org\fP из\-за предшествующей \fB\&.\fP\&. Если вы хотите совпадения +\fBexample.org\fP, то точно укажите \- \fBexample.org\fP\&. +.SS Контрольный файл +.sp +aria2 использует контрольный файл для отслеживания прогресса +загрузки. Контрольный файл размещается в том же каталоге, что и загружаемый +файл, и имеет имя, как у загружаемого файла с добавлением +\fB\&.aria2\fP\&. Например, если file.zip загружаемый файл, тогда контрольный файл +будет file.zip.aria2. (Существует исключение для этого именования. При +загрузке торрента с множеством файлов, контрольный файл будет в "корневом +каталоге" с именем торрента и добавлением \fB\&.aria2\fP\&. Имя "корневого +каталога" \- значение ключа "name" в "info" внутри torrent\-файла.) +.sp +Обычно контрольный файл удаляется после завершения загрузки. Если aria2 +решает, что загрузка не может быть возобновлена (например, когда загружается +файл с HTTP\-сервера, который не поддерживает возобновление), контрольный +файл не создается. +.sp +Обычно, если вы потеряете контрольный файл, вы не сможете возобновить +загрузку. Но если у вас есть torrent или metalink файлы с контрольными +суммами блоков данных, вы сможете возобновить загрузку без контрольного +файла, указав параметр \-V в командной строке aria2c. +.SS Входной файл +.sp +Входной файл может содержать список URI для загрузки aria2. Вы можете +указать несколько URI для одного объекта, разделяя URI, в одной строке, +табуляцией. +.sp +Каждая строка рассматривается, как аргумент командой строки. Следовательно, +на них влияют параметры \fI\%\-\-force\-sequential\fP и +\fI\%\-\-parameterized\-uri\fP\&. +.sp +Так как aria2 непосредственно читает URI из входного файла, то они не должны +быть указаны с одинарными(\(aq) или двойными(") кавычками. +.sp +Строка, которая начинается с \fB#\fP обрабатывается как комментарий и +пропускается. +.sp +Кроме того, следующие параметры могут быть определены после каждой строки с +URI. Эти дополнительные строки должны начинаться с пробела(ов). +.INDENT 0.0 +.INDENT 2.0 +.IP \(bu 2 +\fI\%all\-proxy\fP +.IP \(bu 2 +\fI\%all\-proxy\-passwd\fP +.IP \(bu 2 +\fI\%all\-proxy\-user\fP +.IP \(bu 2 +\fI\%allow\-overwrite\fP +.IP \(bu 2 +\fI\%allow\-piece\-length\-change\fP +.IP \(bu 2 +\fI\%always\-resume\fP +.IP \(bu 2 +\fI\%async\-dns\fP +.IP \(bu 2 +\fI\%auto\-file\-renaming\fP +.IP \(bu 2 +\fI\%bt\-enable\-hook\-after\-hash\-check\fP +.IP \(bu 2 +\fI\%bt\-enable\-lpd\fP +.IP \(bu 2 +\fI\%bt\-exclude\-tracker\fP +.IP \(bu 2 +\fI\%bt\-external\-ip\fP +.IP \(bu 2 +\fI\%bt\-force\-encryption\fP +.IP \(bu 2 +\fI\%bt\-hash\-check\-seed\fP +.IP \(bu 2 +\fI\%bt\-load\-saved\-metadata\fP +.IP \(bu 2 +\fI\%bt\-max\-peers\fP +.IP \(bu 2 +\fI\%bt\-metadata\-only\fP +.IP \(bu 2 +\fI\%bt\-min\-crypto\-level\fP +.IP \(bu 2 +\fI\%bt\-prioritize\-piece\fP +.IP \(bu 2 +\fI\%bt\-remove\-unselected\-file\fP +.IP \(bu 2 +\fI\%bt\-request\-peer\-speed\-limit\fP +.IP \(bu 2 +\fI\%bt\-require\-crypto\fP +.IP \(bu 2 +\fI\%bt\-save\-metadata\fP +.IP \(bu 2 +\fI\%bt\-seed\-unverified\fP +.IP \(bu 2 +\fI\%bt\-stop\-timeout\fP +.IP \(bu 2 +\fI\%bt\-tracker\fP +.IP \(bu 2 +\fI\%bt\-tracker\-connect\-timeout\fP +.IP \(bu 2 +\fI\%bt\-tracker\-interval\fP +.IP \(bu 2 +\fI\%bt\-tracker\-timeout\fP +.IP \(bu 2 +\fI\%check\-integrity\fP +.IP \(bu 2 +\fI\%checksum\fP +.IP \(bu 2 +\fI\%conditional\-get\fP +.IP \(bu 2 +\fI\%connect\-timeout\fP +.IP \(bu 2 +\fI\%content\-disposition\-default\-utf8\fP +.IP \(bu 2 +\fI\%continue\fP +.IP \(bu 2 +\fI\%dir\fP +.IP \(bu 2 +\fI\%dry\-run\fP +.UNINDENT +.INDENT 2.0 +.IP \(bu 2 +\fI\%enable\-http\-keep\-alive\fP +.IP \(bu 2 +\fI\%enable\-http\-pipelining\fP +.IP \(bu 2 +\fI\%enable\-mmap\fP +.IP \(bu 2 +\fI\%enable\-peer\-exchange\fP +.IP \(bu 2 +\fI\%file\-allocation\fP +.IP \(bu 2 +\fI\%follow\-metalink\fP +.IP \(bu 2 +\fI\%follow\-torrent\fP +.IP \(bu 2 +\fI\%force\-save\fP +.IP \(bu 2 +\fI\%ftp\-passwd\fP +.IP \(bu 2 +\fI\%ftp\-pasv\fP +.IP \(bu 2 +\fI\%ftp\-proxy\fP +.IP \(bu 2 +\fI\%ftp\-proxy\-passwd\fP +.IP \(bu 2 +\fI\%ftp\-proxy\-user\fP +.IP \(bu 2 +\fI\%ftp\-reuse\-connection\fP +.IP \(bu 2 +\fI\%ftp\-type\fP +.IP \(bu 2 +\fI\%ftp\-user\fP +.IP \(bu 2 +\fI\%gid\fP +.IP \(bu 2 +\fI\%hash\-check\-only\fP +.IP \(bu 2 +\fI\%header\fP +.IP \(bu 2 +\fI\%http\-accept\-gzip\fP +.IP \(bu 2 +\fI\%http\-auth\-challenge\fP +.IP \(bu 2 +\fI\%http\-no\-cache\fP +.IP \(bu 2 +\fI\%http\-passwd\fP +.IP \(bu 2 +\fI\%http\-proxy\fP +.IP \(bu 2 +\fI\%http\-proxy\-passwd\fP +.IP \(bu 2 +\fI\%http\-proxy\-user\fP +.IP \(bu 2 +\fI\%http\-user\fP +.IP \(bu 2 +\fI\%https\-proxy\fP +.IP \(bu 2 +\fI\%https\-proxy\-passwd\fP +.IP \(bu 2 +\fI\%https\-proxy\-user\fP +.IP \(bu 2 +\fI\%index\-out\fP +.IP \(bu 2 +\fI\%lowest\-speed\-limit\fP +.IP \(bu 2 +\fI\%max\-connection\-per\-server\fP +.IP \(bu 2 +\fI\%max\-download\-limit\fP +.IP \(bu 2 +\fI\%max\-file\-not\-found\fP +.IP \(bu 2 +\fI\%max\-mmap\-limit\fP +.IP \(bu 2 +\fI\%max\-resume\-failure\-tries\fP +.UNINDENT +.INDENT 2.0 +.IP \(bu 2 +\fI\%max\-tries\fP +.IP \(bu 2 +\fI\%max\-upload\-limit\fP +.IP \(bu 2 +\fI\%metalink\-base\-uri\fP +.IP \(bu 2 +\fI\%metalink\-enable\-unique\-protocol\fP +.IP \(bu 2 +\fI\%metalink\-language\fP +.IP \(bu 2 +\fI\%metalink\-location\fP +.IP \(bu 2 +\fI\%metalink\-os\fP +.IP \(bu 2 +\fI\%metalink\-preferred\-protocol\fP +.IP \(bu 2 +\fI\%metalink\-version\fP +.IP \(bu 2 +\fI\%min\-split\-size\fP +.IP \(bu 2 +\fI\%no\-file\-allocation\-limit\fP +.IP \(bu 2 +\fI\%no\-netrc\fP +.IP \(bu 2 +\fI\%no\-proxy\fP +.IP \(bu 2 +\fI\%out\fP +.IP \(bu 2 +\fI\%parameterized\-uri\fP +.IP \(bu 2 +\fI\%pause\fP +.IP \(bu 2 +\fI\%pause\-metadata\fP +.IP \(bu 2 +\fI\%piece\-length\fP +.IP \(bu 2 +\fI\%proxy\-method\fP +.IP \(bu 2 +\fI\%realtime\-chunk\-checksum\fP +.IP \(bu 2 +\fI\%referer\fP +.IP \(bu 2 +\fI\%remote\-time\fP +.IP \(bu 2 +\fI\%remove\-control\-file\fP +.IP \(bu 2 +\fI\%retry\-wait\fP +.IP \(bu 2 +\fI\%reuse\-uri\fP +.IP \(bu 2 +\fI\%rpc\-save\-upload\-metadata\fP +.IP \(bu 2 +\fI\%seed\-ratio\fP +.IP \(bu 2 +\fI\%seed\-time\fP +.IP \(bu 2 +\fI\%select\-file\fP +.IP \(bu 2 +\fI\%split\fP +.IP \(bu 2 +\fI\%ssh\-host\-key\-md\fP +.IP \(bu 2 +\fI\%stream\-piece\-selector\fP +.IP \(bu 2 +\fI\%timeout\fP +.IP \(bu 2 +\fI\%uri\-selector\fP +.IP \(bu 2 +\fI\%use\-head\fP +.IP \(bu 2 +\fI\%user\-agent\fP +.UNINDENT +.UNINDENT +.sp +Эти параметры имеют точно такой же смысл, что параметры командной строки, но +это применимо только к URI, к которым они принадлежат. Обратите внимание, +что параметры во входном файле не должны иметь префикс \fB\-\-\fP\&. +.sp +Например, такое содержимое uri.txt: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +http://server/file.iso http://mirror/file.iso + dir=/iso_images + out=file.img +http://foo/bar +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Если aria2 выполняется с параметрами \fB\-i uri.txt \-d /tmp\fP, а загрузка +происходит с \fBhttp://server/file.iso\fP и \fBhttp://mirror/file.iso\fP, то +\fBfile.iso\fP сохранится как \fB/iso_images/file.img\fP\&. Файл \fBbar\fP +загрузится с \fBhttp://foo/bar\fP и сохранится как \fB/tmp/bar\fP\&. +.sp +В некоторых случаях, параметр \fI\%out\fP не имеет никакого +эффекта. Смотрите примечание по ограничениям параметра \fI\%\-\-out\fP\&. +.SS Профиль функционирования сервера +.sp +Этот раздел описывает формат профиля функционирования сервера. Это открытый +текстовый файл, каждая строка которого имеет несколько пар ИМЯ=ЗНАЧЕНИЕ, +разделенных запятыми. В настоящее время распознаются следующие ИМЕНА: +.INDENT 0.0 +.TP +.B \fBhost\fP +Имя хоста сервера. Обязательно. +.TP +.B \fBprotocol\fP +Протокол для этого профиля, такие как ftp, http. Обязательно. +.TP +.B \fBdl_speed\fP +Средняя скорость загрузки, которая наблюдалась при предыдущей загрузке, в +байт/секунду. Обязательно. +.TP +.B \fBsc_avg_speed\fP +Средняя скорость загрузки, которая наблюдалась при предыдущей загрузке, в +байт/секунду. Это значение обновляется, только если загрузка произведена при +одном соединении и только с использованием +AdaptiveURISelector. Необязательно. +.TP +.B \fBmc_avg_speed\fP +Средняя скорость загрузки, которая наблюдалась при предыдущей загрузке, в +байт/секунду. Это значение обновляется, только если загрузка произведена при +нескольких соединениях и только с использованием +AdaptiveURISelector. Необязательно. +.TP +.B \fBcounter\fP +Сколько раз использовался сервер. В настоящее время это значение +используется только при AdaptiveURISelector. Необязательно. +.TP +.B \fBlast_updated\fP +Время связи, в GMT, с этим сервером, указывается в секундах, начиная с +00:00:00 1 Января, 1970, UTC. Обязательно. +.TP +.B \fBstatus\fP +ERROR, когда сервер недоступен из\-за неисправности или тайм\-аута. Иначе \- +OK. +.UNINDENT +.sp +Эти поля должны быть в одной строке. Последовательность полей не имеет +значения. Вы можете размещать пары, отличные от перечисленных выше; они +будут просто игнорироваться. +.sp +Например, следующим образом: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +host=localhost, protocol=http, dl_speed=32000, last_updated=1222491640, status=OK +host=localhost, protocol=ftp, dl_speed=0, last_updated=1222491632, status=ERROR +.ft P +.fi +.UNINDENT +.UNINDENT +.SH RPC-ИНТЕРФЕЙС +.sp +aria2 обеспечивает JSON\-RPC через HTTP и XML\-RPC через HTTP интерфейсы и они +в основном имеют одинаковые функции. aria2 также обеспечивает JSON\-RPC через +WebSocket. JSON\-RPC через WebSocket использует тот же самый метод сигнатур и +формат ответа как у JSON\-RPC через HTTP, но дополнительно предоставляет +уведомления, инициированные сервером. Смотрите раздел \fI\%JSON\-RPC через +WebSocket\fP для получения дополнительной информации. +.sp +Путь запроса к JSON\-RPC\-интерфейсу (для через HTTP и через WebSocket) \- +\fB/jsonrpc\fP\&. Путь запроса к XML\-RPC\-интерфейсу \- \fB/rpc\fP\&. +.sp +WebSocket URI для JSON\-RPC через WebSocket является +\fBws://HOST:PORT/jsonrpc\fP\&. Если вы включили SSL/TLS\-шифрование, то +используйте \fBwss://HOST:PORT/jsonrpc\fP\&. +.sp +Реализованный JSON\-RPC основан на спецификации JSON\-RPC 2.0 +<\fI\%http://jsonrpc.org/specification\fP> и поддерживает HTTP POST и GET +(JSONP). WebSocket\-транспорт является расширением aria2. +.sp +JSON\-RPC\-интерфейс не поддерживает уведомления через HTTP, но RPC\-сервер +будет отправлять уведомления через WebSocket. Он также не поддерживает числа +с плавающей точкой. Символы должны быть в кодировке UTF\-8. +.sp +Читая следующую документацию для JSON\-RPC, интерпретируйте структуры как +JSON\-объекты. +.SS Терминология +.sp +GID +.INDENT 0.0 +.INDENT 3.5 +GID (или gid) \- это ключ, для управления каждой загрузкой. Каждая +загрузка будет подписана уникальным GID. GID сохранится в aria2 как +64\-битное двоичное значение. +Для RPC\-доступа, он должен быть представлен в виде шестнадцатеричной +строки из 16 символов (например, \fB2089b05ecca3d829\fP). +Обычно, aria2 генерирует этот GID для каждой загрузки, но пользователь +может определить GID вручную, используя параметр \fI\%\-\-gid\fP\&. +При запросе загрузок по GID, вы можете задать только префикс GID пока он +является уникальным среди других. +.UNINDENT +.UNINDENT +.SS RPC\-авторизация по секретному маркеру +.sp +Начиная с 1.18.4, в дополнение к базовой HTTP\-авторизации, aria2 +обеспечивает method\-level RPC\-авторизацию. В будущих версиях, базовая +HTTP\-авторизация будет удалена и method\-level RPC\-авторизация станет +обязательной. +.sp +Чтобы использовать method\-level RPC\-авторизацию, пользователь должен указать +секретный маркер RPC\-авторизации, используя параметр +\fI\%\-\-rpc\-secret\fP\&. Для каждого вызова RPC\-метода, вызывающий должен +включать маркер с префиксом \fBtoken:\fP\&. Даже когда параметр +\fI\%\-\-rpc\-secret\fP не используется, и если первым параметром в +RPC\-методе является строка и начинается с \fBtoken:\fP, то она будет удалёна +из списка параметров, прежде чем запрос будет обработан. +.sp +Например, если секретный маркер RPC\-авторизации \- \fB$$secret$$\fP, то вызов +RPC\-метода \fIaria2.addUri\fP будет выглядеть следующим образом: +.INDENT 0.0 +.INDENT 3.5 +aria2.addUri("token:$$secret$$", ["\fI\%http://example.org/file\fP"]) +.UNINDENT +.UNINDENT +.sp +RPC\-метод \fIsystem.multicall\fP обрабатывается особым образом. Поскольку +спецификация XML\-RPC позволяет использовать только один массив в качестве +параметра для этого метода, мы не указываем маркер в вызове. Вместо этого +каждый вложенный вызов метода должен обеспечивать маркер в качестве первого +параметра, как описано выше. +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Проверка секретного маркера в aria2 разработана, чтобы противостоять хотя бы +определенное количество времени, ослаблять атаки методом грубой силы/по словарю +против RPC\-интерфейса. Поэтому рекомендуется отдавать предпочтение пакетным +или \fIsystem.multicall\fP запросам, когда это необходимо. +.sp +\fIsystem.listMethods\fP и \fIsystem.listNotifications\fP могут выполняться без секретного маркера. Так они +просто возвращает доступные методы/уведомления, и ничего не изменяют, они +безопасны без секретного маркера. +.UNINDENT +.UNINDENT +.SS Методы +.sp +Весь примеры кода совместимы с Python 2.7. Для получения информации о +параметре \fIsecret\fP смотрите \fI\%RPC\-авторизация по секретному маркеру\fP\&. +.INDENT 0.0 +.TP +.B aria2.addUri([secret], uris[, options[, position]]) +Этот метод добавляет новую загрузку. Параметр \fIuris\fP \- это массив +HTTP(S)/FTP/SFTP/BitTorrent Magnet URI (строки), указывающие на один и тот же +ресурс. Если вы смешивайте URI, указывающие на разные ресурсы, то загрузка +может неудачно завершиться или быть повреждена без жалоб со стороны aria2. +При добавлении BitTorrent Magnet URI, \fIuris\fP должен содержать только один +элемент, и он должен быть BitTorrent Magnet\-ссылкой. +Параметр \fIoptions\fP \- это структура, а её элементы являются парами имя и +значение. +Смотрите ниже \fI\%Параметры\fP для более подробной информации. +Если параметр \fIposition\fP задан, то он должен быть целым числом, +начиная с 0. Новая загрузка будет вставлена на позицию \fIposition\fP в +очередь ожидания. Если параметр \fIposition\fP пропущен или больше чем текущий +размер очереди, то новая загрузка будет добавлена в конец очереди. +Этот метод возвращает GID зарегистрированной загрузки. +.sp +\fBПример JSON\-RPC\fP +.sp +Следующий пример добавляет \fBhttp://example.org/file в aria2\fP: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addUri\(aq, +\&... \(aqparams\(aq:[[\(aqhttp://example.org/file\(aq]]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> c.read() +\(aq{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.sp +Следующий пример добавляет \fBhttp://example.org/file в aria2\fP: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.addUri([\(aqhttp://example.org/file\(aq]) +\(aq2089b05ecca3d829\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Следующий пример добавляет новую загрузку с двумя источниками и некоторые параметры: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> s.aria2.addUri([\(aqhttp://example.org/file\(aq, \(aqhttp://mirror/file\(aq], + dict(dir="/tmp")) +\(aqd2703803b52216d1\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Следующий пример добавляет загрузку и вставляет её впереди очереди: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> s.aria2.addUri([\(aqhttp://example.org/file\(aq], {}, 0) +\(aqca3d829cee549a4d\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.addTorrent([secret], torrent[, uris[, options[, position]]]) +Этот метод добавляет BitTorrent\-загрузку путем загрузки .torrent\-файла. +Если вы хотите добавить BitTorrent Magnet URI, взамен используйте метод +\fI\%aria2.addUri()\fP\&. Параметр \fItorrent\fP должен быть base64\-кодированной +строкой, с содержимым .torrent\-файла. +Параметр \fIuris\fP \- это массив c URI (строка). Параметр \fIuris\fP используется для +Web\-сидирования. Для однофайловых торрентов, URI может быть полным, +который указывает на ресурс; если URI заканчивается символом /, тогда будет +добавлено имя из torrent\-файла. Для многофайловых торрентов, чтобы cформировать +URI для каждого файла, будут добавлены имя и путь из торрента. +Параметр \fIoptions\fP \- это структура, а её элементы являются парами имя и значение. +Смотрите ниже \fI\%Параметры\fP для более подробной информации. +Если параметр \fIposition\fP задан, то он должен быть целым числом, +начиная с 0. Новая загрузка будет вставлена на позицию \fIposition\fP в +очередь ожидания. Если параметр \fIposition\fP пропущен или больше чем текущий +размер очереди, то новая загрузка будет добавлена в конец очереди. +Этот метод возвращает GID зарегистрированной загрузки. +Если \fI\%\-\-rpc\-save\-upload\-metadata\fP задан как \fBtrue\fP, +загруженные данные сохраняются в файл с именем шестнадцатеричной +строки SHA\-1\-хэша этих данных плюс ".torrent", в каталог указанный в +параметре \fI\%\-\-dir\fP\&. Например, имя файла может быть +\fB0a3893293e27ac0490424c06de4d09242215f0a6.torrent\fP\&. Если файл с таким же именем +существует, то он будет перезаписан! Если файл не может быть успешно сохранен или +\fI\%\-\-rpc\-save\-upload\-metadata\fP задан как \fBfalse\fP, то +загрузки, добавленные этим методом, не сохраняются при помощи параметра +\fI\%\-\-save\-session\fP\&. +.sp +Следующие примеры добавляют локальный файл \fBfile.torrent\fP\&. +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json, base64 +>>> torrent = base64.b64encode(open(\(aqfile.torrent\(aq).read()) +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqasdf\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addTorrent\(aq, \(aqparams\(aq:[torrent]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> c.read() +\(aq{"id":"asdf","jsonrpc":"2.0","result":"2089b05ecca3d829"}\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.addTorrent(xmlrpclib.Binary(open(\(aqfile.torrent\(aq, mode=\(aqrb\(aq).read())) +\(aq2089b05ecca3d829\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.addMetalink([secret], metalink[, options[, position]]) +Этот метод добавляет Metalink\-загрузку путем загрузки .metalink\-файла. +Параметр \fImetalink\fP должен быть base64\-кодированной строкой, с содержимым .metalink\-файла. +Параметр \fIoptions\fP \- это структура, а её элементы являются парами имя и значение. +Смотрите ниже \fI\%Параметры\fP для более подробной информации. +Если параметр \fIposition\fP задан, то он должен быть целым числом, +начиная с 0. Новая загрузка будет вставлена на позицию \fIposition\fP в +очередь ожидания. Если параметр \fIposition\fP пропущен или больше чем текущий +размер очереди, то новая загрузка будет добавлена в конец очереди. +Этот метод возвращает GID зарегистрированной загрузки. +Если \fI\%\-\-rpc\-save\-upload\-metadata\fP задан как \fBtrue\fP, +загруженные данные сохраняются в файл с именем шестнадцатеричной +строки SHA\-1\-хэша этих данных плюс ".metalink", в каталог указанный в +параметре \fI\%\-\-dir\fP\&. Например, имя файла может быть +\fB0a3893293e27ac0490424c06de4d09242215f0a6.metalink\fP\&. Если файл с таким же именем +существует, то он будет перезаписан! Если файл не может быть успешно сохранен или +\fI\%\-\-rpc\-save\-upload\-metadata\fP задан как \fBfalse\fP, то +загрузки, добавленные этим методом, не сохраняются при помощи параметра +\fI\%\-\-save\-session\fP\&. +.sp +Следующие примеры добавляют локальный файл file.meta4. +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json, base64 +>>> metalink = base64.b64encode(open(\(aqfile.meta4\(aq).read()) +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addMetalink\(aq, +\&... \(aqparams\(aq:[metalink]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> c.read() +\(aq{"id":"qwer","jsonrpc":"2.0","result":["2089b05ecca3d829"]}\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.addMetalink(xmlrpclib.Binary(open(\(aqfile.meta4\(aq, mode=\(aqrb\(aq).read())) +[\(aq2089b05ecca3d829\(aq] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.remove([secret], gid) +Этот метод удаляет загрузку, которая обозначена \fIgid\fP (строка). +Если указана загрузка, которая загружается в данный момент, то +сначала она остановится. Статус удаления станет \fBremoved\fP (удаленно). +Этот метод возвращает GID удаленной загрузки. +.sp +Следующие примеры удаляют загрузку c GID#2089b05ecca3d829. +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.remove\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> c.read() +\(aq{"id":"qwer","jsonrpc":"2.0","result":"2089b05ecca3d829"}\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.remove(\(aq2089b05ecca3d829\(aq) +\(aq2089b05ecca3d829\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.forceRemove([secret], gid) +Этот метод удаляет загрузку, которая обозначена \fIgid\fP\&. Метод действует +подобно \fI\%aria2.remove()\fP, за исключением того, что метод удаляет +загрузку без выполнения каких\-либо действий, которые требуют времени, +например связь с BitTorrent\-трекерами для отмены регистрации загрузки. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.pause([secret], gid) +Этот метод приостанавливает загрузку, которая обозначена \fIgid\fP (строка). +Статус приостановки станет \fBpaused\fP (приостановлено). Если загрузка активна, +то загрузка переместится в начало очереди ожидания. Пока статус \fBpaused\fP, +загрузка не начнется. Для смены статуса на \fBwaiting\fP, используйте метод +\fI\%aria2.unpause()\fP\&. +Этот метод возвращает GID приостановленной загрузки. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.pauseAll([secret]) +Этот метод эквивалентен по вызову \fI\%aria2.pause()\fP, для каждой +активной/ожидающей закачки. Этот метод возвращает \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.forcePause([secret], gid) +Этот метод приостанавливает загрузку, которая обозначена \fIgid\fP\&. Метод +действует подобно \fI\%aria2.pause()\fP, за исключением того, что метод +приостанавливает загрузки без выполнения каких\-либо действий, которые +требуют времени,например связь с BitTorrent\-трекерами для отмены +регистрации загрузки. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.forcePauseAll([secret]) +Этот метод эквивалентен по вызову \fI\%aria2.forcePause()\fP, для каждой +активной/ожидающей загрузки. Этот метод возвращает \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.unpause([secret], gid) +Этот метод изменяет статус загрузки, которая обозначена \(aqgid\(aq (строка), с +\fBpaused\fP на \fBwaiting\fP, что позволяет перезапускать загрузку. +Этот метод возвращает GID загрузки, снятой с паузы. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.unpauseAll([secret]) +Этот метод эквивалентен по вызову \fI\%aria2.unpause()\fP, для каждой +приостановленной загрузки. Этот метод возвращает \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.tellStatus([secret], gid[, keys]) +Этот метод возвращает состояние загрузки, которая обозначена \fIgid\fP (строка). +Параметр \fIkeys\fP \- это массив строк. Если \fIkeys\fP указан, то ответ содержит +только ключи в массиве \fIkeys\fP\&. Если \fIkeys\fP пустой или пропущен, то ответ +содержит все ключи. Это полезно, если вы хотите использовать определенные +параметры, чтобы исключить множество пересылок. Например, \fBaria2.tellStatus("2089b05ecca3d829", ["gid", "status"])\fP +возвратит только ключи \fIgid\fP и \fIstatus\fP\&. Ответ \- это структура и содержит +следующие ключи. Значения являются строками. +.INDENT 7.0 +.TP +.B \fBgid\fP +GID загрузки. +.TP +.B \fBstatus\fP +\fBactive\fP \- загружаемая/сидируемая в данный момент. +\fBwaiting\fP \- ожидающая в очереди; загрузка не началась. +\fBpaused\fP \- приостановленная. +\fBerror\fP \- остановленная, т.к. произошла ошибка. +\fBcomplete\fP \- остановленная и завершенная загрузка. +\fBremoved\fP \- удаленная пользователем загрузка. +.TP +.B \fBtotalLength\fP +Общий объём загрузки в байтах. +.TP +.B \fBcompletedLength\fP +Загруженный объём загрузки в байтах. +.TP +.B \fBuploadLength\fP +Выгруженный объём загрузки в байтах. +.TP +.B \fBbitfield\fP +Шестнадцатеричное представление процесса загрузки. Старший бит соответствует +блоку с индексом 0. Любые биты устанавливаются, если блоки загружены и не +устанавливаются, если блоки не загружены и/или отсутствуют. Любые избыточные биты +в конце устанавливаются в 0. Если загрузка ещё не была запущена, этот ключ не будет +включён в ответ. +.TP +.B \fBdownloadSpeed\fP +Скорость загрузки в байт/сек. +.TP +.B \fBuploadSpeed\fP +Скорость выгрузки в байт/сек. +.TP +.B \fBinfoHash\fP +Информация о хэше (InfoHash). Только для BitTorrent. +.TP +.B \fBnumSeeders\fP +Количество сидов, к которым подключена aria2. Только для BitTorrent. +.TP +.B \fBseeder\fP +\fBtrue\fP \- если локальная конечная точка является сидом. Иначе \fBfalse\fP\&. +Только для BitTorrent. +.TP +.B \fBpieceLength\fP +Размер блока в байтах. +.TP +.B \fBnumPieces\fP +Количество блоков. +.TP +.B \fBconnections\fP +Количество пиров/серверов, к которым подключена aria2. +.TP +.B \fBerrorCode\fP +Код последней ошибки для этого элемента, если таковая имеется. Значение +является строкой. Коды ошибок определены в разделе \fI\%КОДЫ ЗАВЕРШЕНИЯ\fP\&. +Это значение доступно только для остановленных/завершённых загрузок. +.TP +.B \fBerrorMessage\fP +Сообщение об ошибке, удобное (надеюсь) для восприятия, +связанной с \fBerrorCode\fP\&. +.TP +.B \fBfollowedBy\fP +Список с GID, которые сгенерируются в результате этой +загрузки. Например, когда aria2 загружает Metalink\-файл, то это генерирует +загрузки, описанные в Metalink\-файле (см. параметр +\fI\%\-\-follow\-metalink\fP). Это значение полезно для отслеживания автоматически +сгенерированных загрузок. Если таких загрузок нет, то ключ не будет +включён в ответ. +.TP +.B \fBfollowing\fP +Обратная ссылка для \fBfollowedBy\fP\&. У загрузки, включённой в +\fBfollowedBy\fP, есть GID этого объекта в этом значении \fBfollowing\fP\&. +.TP +.B \fBbelongsTo\fP +GID родительской загрузки. Некоторые загрузки являются частью другой +загрузки. Например, если файл в Metalink содержит BitTorrent ресурсы, +загрузки ".torrent" файлов будут частями этого родителя. Если эта +загрузка не имеет родителя, то ключ не будет включён в ответ. +.TP +.B \fBdir\fP +Каталог для сохранения файлов. +.TP +.B \fBfiles\fP +Возвращает список файлов. Элементы списка \- это структуры, такие же, что и в +методе \fI\%aria2.getFiles()\fP\&. +.TP +.B \fBbittorrent\fP +Структура, в которой содержится информация, извлеченная из .torrent\-файла. +Только для BitTorrent. Содержит следующие поля. +.INDENT 7.0 +.TP +.B \fBannounceList\fP +Список списков URI анонса. Если торрент содержит \fB\(gaannounce\fP, а не +\fIannounce\-list\(ga\fP, то \fIannounce\(ga\fP конвертируется в формат \fIannounce\-list\(ga\fP\&. +.TP +.B \fBcomment\fP +Комментарий торрента. Используется \fBcomment.utf\-8\fP, если доступно. +.TP +.B \fBcreationDate\fP +Время создания торрента. Значение является целым числом, с начала века, +измеряется в секундах. +.TP +.B \fBmode\fP +Файловый режим торрента. Значение одно из двух: \fBsingle\fP (одиночный) или +\fBmulti\fP (множественный). +.TP +.B \fBinfo\fP +Структура, которая содержит данные из раздела Info. Она содержит следующие +поля. +.INDENT 7.0 +.TP +.B \fBname\fP +имя в разделе info. Используется \fBname.utf\-8\fP, если доступно. +.UNINDENT +.UNINDENT +.TP +.B \fBverifiedLength\fP +Количество проверенных байт во время проверки хэша. Это поле +появляется только тогда, когда загрузка начинает проверять хэш. +.TP +.B \fBverifyIntegrityPending\fP +\fBtrue\fP \- если эта загрузка ожидает в очереди проверки хэша. +Это поле появляется только тогда, когда эта загрузка находится +в очереди. +.UNINDENT +.sp +\fBПример JSON\-RPC\fP +.sp +Следующий пример получает информацию о загрузке с GID#2089b05ecca3d829: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.tellStatus\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqbitfield\(aq: u\(aq0000000000\(aq, + u\(aqcompletedLength\(aq: u\(aq901120\(aq, + u\(aqconnections\(aq: u\(aq1\(aq, + u\(aqdir\(aq: u\(aq/downloads\(aq, + u\(aqdownloadSpeed\(aq: u\(aq15158\(aq, + u\(aqfiles\(aq: [{u\(aqindex\(aq: u\(aq1\(aq, + u\(aqlength\(aq: u\(aq34896138\(aq, + u\(aqcompletedLength\(aq: u\(aq34896138\(aq, + u\(aqpath\(aq: u\(aq/downloads/file\(aq, + u\(aqselected\(aq: u\(aqtrue\(aq, + u\(aquris\(aq: [{u\(aqstatus\(aq: u\(aqused\(aq, + u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]}], + u\(aqgid\(aq: u\(aq2089b05ecca3d829\(aq, + u\(aqnumPieces\(aq: u\(aq34\(aq, + u\(aqpieceLength\(aq: u\(aq1048576\(aq, + u\(aqstatus\(aq: u\(aqactive\(aq, + u\(aqtotalLength\(aq: u\(aq34896138\(aq, + u\(aquploadLength\(aq: u\(aq0\(aq, + u\(aquploadSpeed\(aq: u\(aq0\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Следующий пример получает только определённые ключи: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.tellStatus\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq, +\&... [\(aqgid\(aq, +\&... \(aqtotalLength\(aq, +\&... \(aqcompletedLength\(aq]]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqcompletedLength\(aq: u\(aq5701632\(aq, + u\(aqgid\(aq: u\(aq2089b05ecca3d829\(aq, + u\(aqtotalLength\(aq: u\(aq34896138\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.sp +Следующий пример получает информацию о загрузке с GID#2089b05ecca3d829: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.tellStatus(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +{\(aqbitfield\(aq: \(aqffff80\(aq, + \(aqcompletedLength\(aq: \(aq34896138\(aq, + \(aqconnections\(aq: \(aq0\(aq, + \(aqdir\(aq: \(aq/downloads\(aq, + \(aqdownloadSpeed\(aq: \(aq0\(aq, + \(aqerrorCode\(aq: \(aq0\(aq, + \(aqfiles\(aq: [{\(aqindex\(aq: \(aq1\(aq, + \(aqlength\(aq: \(aq34896138\(aq, + \(aqcompletedLength\(aq: \(aq34896138\(aq, + \(aqpath\(aq: \(aq/downloads/file\(aq, + \(aqselected\(aq: \(aqtrue\(aq, + \(aquris\(aq: [{\(aqstatus\(aq: \(aqused\(aq, + \(aquri\(aq: \(aqhttp://example.org/file\(aq}]}], + \(aqgid\(aq: \(aq2089b05ecca3d829\(aq, + \(aqnumPieces\(aq: \(aq17\(aq, + \(aqpieceLength\(aq: \(aq2097152\(aq, + \(aqstatus\(aq: \(aqcomplete\(aq, + \(aqtotalLength\(aq: \(aq34896138\(aq, + \(aquploadLength\(aq: \(aq0\(aq, + \(aquploadSpeed\(aq: \(aq0\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Следующий пример получает только определённые ключи: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> r = s.aria2.tellStatus(\(aq2089b05ecca3d829\(aq, [\(aqgid\(aq, \(aqtotalLength\(aq, \(aqcompletedLength\(aq]) +>>> pprint(r) +{\(aqcompletedLength\(aq: \(aq34896138\(aq, \(aqgid\(aq: \(aq2089b05ecca3d829\(aq, \(aqtotalLength\(aq: \(aq34896138\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getUris([secret], gid) +Этот метод возвращает URI, используемые в загрузке, которые обозначены +\fIgid\fP (строка). Ответ \- это массив структур и они содержат следующие ключи. +Значения являются строкой. +.INDENT 7.0 +.TP +.B \fBuri\fP +URI +.TP +.B \fBstatus\fP +\(aqused\(aq, если URI используется. \(aqwaiting\(aq, если URI все ещё ожидает в очереди. +.UNINDENT +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getUris\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [{u\(aqstatus\(aq: u\(aqused\(aq, + u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getUris(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +[{\(aqstatus\(aq: \(aqused\(aq, \(aquri\(aq: \(aqhttp://example.org/file\(aq}] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getFiles([secret], gid) +Этот метод возвращает список файлов загрузки, которая обозначена \fIgid\fP (строка). +Ответ \- это массив структур, которые содержат следующие ключи. +Значения являются строками. +.INDENT 7.0 +.TP +.B \fBindex\fP +Индекс файла, начинается с 1, в том же порядке, как файлы появляются в +многофайловом торренте. +.TP +.B \fBpath\fP +Путь к файлу. +.TP +.B \fBlength\fP +Размер файла в байта. +.TP +.B \fBcompletedLength\fP +Загруженный объём файла в байтах. Обратите внимание, вполне возможно, +что сумма \fBcompletedLength\fP меньше чем возвращаемая методом +\fI\%aria2.tellStatus()\fP\&. Это потому, что в \fBcompletedLength\fP +\fI\%aria2.getFiles()\fP включены только завершенные +блоки. С другой стороны, в \fBcompletedLength\fP +\fI\%aria2.tellStatus()\fP также включены частично завершённые блоки. +.TP +.B \fBselected\fP +\fBtrue\fP \- если этот файл выбран параметром \fI\%\-\-select\-file\fP\&. Если +параметр \fI\%\-\-select\-file\fP не указан или это однофайловый торрент +или загрузка вообще не торрент, то это значение всегда будет \fBtrue\fP\&. +Иначе \fBfalse\fP\&. +.TP +.B \fBuris\fP +Возвращает список URI для этого файла. Тип элемента такая же структура, +что используется в методе \fI\%aria2.getUris()\fP\&. +.UNINDENT +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getFiles\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [{u\(aqindex\(aq: u\(aq1\(aq, + u\(aqlength\(aq: u\(aq34896138\(aq, + u\(aqcompletedLength\(aq: u\(aq34896138\(aq, + u\(aqpath\(aq: u\(aq/downloads/file\(aq, + u\(aqselected\(aq: u\(aqtrue\(aq, + u\(aquris\(aq: [{u\(aqstatus\(aq: u\(aqused\(aq, + u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]}]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getFiles(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +[{\(aqindex\(aq: \(aq1\(aq, + \(aqlength\(aq: \(aq34896138\(aq, + \(aqcompletedLength\(aq: \(aq34896138\(aq, + \(aqpath\(aq: \(aq/downloads/file\(aq, + \(aqselected\(aq: \(aqtrue\(aq, + \(aquris\(aq: [{\(aqstatus\(aq: \(aqused\(aq, + \(aquri\(aq: \(aqhttp://example.org/file\(aq}]}] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getPeers([secret], gid) +Этот метод возвращает список пиров загрузки, которая обозначена \fIgid\fP (строка). +Этот метод только для BitTorrent. Ответ \- это массив структур, которые содержат +следующие ключи. Значения являются строками. +.INDENT 7.0 +.TP +.B \fBpeerId\fP +Закодированное ID пира. +.TP +.B \fBip\fP +IP\-адрес пира. +.TP +.B \fBport\fP +Номер порта пира. +.TP +.B \fBbitfield\fP +Шестнадцатеричное представление процесса загрузки. Старший бит соответствует +блоку с индексом 0. Бит устанавливается, если блок доступен и не +устанавливается, если блок отсутствует. Любые запасные биты в конце +устанавливаются в 0. +.TP +.B \fBamChoking\fP +\fBtrue\fP \- если aria2 блокирует пира. Иначе \fBfalse\fP\&. +.TP +.B \fBpeerChoking\fP +\fBtrue\fP \- если пир блокирует aria2. Иначе \fBfalse\fP\&. +.TP +.B \fBdownloadSpeed\fP +Скорость загрузки (байт/сек), с которой этот клиент получает от пира. +.TP +.B \fBuploadSpeed\fP +Скорость выгрузки (байт/сек), с которой этот клиент отдает пиру. +.TP +.B \fBseeder\fP +\fBtrue\fP \- если этот пир является сидом. Иначе \fBfalse\fP\&. +.UNINDENT +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getPeers\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [{u\(aqamChoking\(aq: u\(aqtrue\(aq, + u\(aqbitfield\(aq: u\(aqffffffffffffffffffffffffffffffffffffffff\(aq, + u\(aqdownloadSpeed\(aq: u\(aq10602\(aq, + u\(aqip\(aq: u\(aq10.0.0.9\(aq, + u\(aqpeerChoking\(aq: u\(aqfalse\(aq, + u\(aqpeerId\(aq: u\(aqaria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6\(aq, + u\(aqport\(aq: u\(aq6881\(aq, + u\(aqseeder\(aq: u\(aqtrue\(aq, + u\(aquploadSpeed\(aq: u\(aq0\(aq}, + {u\(aqamChoking\(aq: u\(aqfalse\(aq, + u\(aqbitfield\(aq: u\(aqffffeff0fffffffbfffffff9fffffcfff7f4ffff\(aq, + u\(aqdownloadSpeed\(aq: u\(aq8654\(aq, + u\(aqip\(aq: u\(aq10.0.0.30\(aq, + u\(aqpeerChoking\(aq: u\(aqfalse\(aq, + u\(aqpeerId\(aq: u\(aqbittorrent client758\(aq, + u\(aqport\(aq: u\(aq37842\(aq, + u\(aqseeder\(aq: u\(aqfalse\(aq, + u\(aquploadSpeed\(aq: u\(aq6890\(aq}]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getPeers(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +[{\(aqamChoking\(aq: \(aqtrue\(aq, + \(aqbitfield\(aq: \(aqffffffffffffffffffffffffffffffffffffffff\(aq, + \(aqdownloadSpeed\(aq: \(aq10602\(aq, + \(aqip\(aq: \(aq10.0.0.9\(aq, + \(aqpeerChoking\(aq: \(aqfalse\(aq, + \(aqpeerId\(aq: \(aqaria2%2F1%2E10%2E5%2D%87%2A%EDz%2F%F7%E6\(aq, + \(aqport\(aq: \(aq6881\(aq, + \(aqseeder\(aq: \(aqtrue\(aq, + \(aquploadSpeed\(aq: \(aq0\(aq}, + {\(aqamChoking\(aq: \(aqfalse\(aq, + \(aqbitfield\(aq: \(aqffffeff0fffffffbfffffff9fffffcfff7f4ffff\(aq, + \(aqdownloadSpeed\(aq: \(aq8654\(aq, + \(aqip\(aq: \(aq10.0.0.30\(aq, + \(aqpeerChoking\(aq: \(aqfalse\(aq, + \(aqpeerId\(aq: \(aqbittorrent client758\(aq, + \(aqport\(aq: \(aq37842\(aq, + \(aqseeder\(aq: \(aqfalse, + \(aquploadSpeed\(aq: \(aq6890\(aq}] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getServers([secret], gid) +Этот метод возвращает текущие подключенные HTTP(S)/FTP/SFTP\-серверы загрузки, +которая обозначена \fIgid\fP (строка). Ответ \- это массив структур, которые содержат +следующие ключи. Значения являются строками. +.INDENT 7.0 +.TP +.B \fBindex\fP +Индекс файла, начинается с 1, в том же порядке, как файлы появляются в +многофайловом metalink. +.TP +.B \fBservers\fP +Список структур, которые содержат следующие ключи. +.INDENT 7.0 +.TP +.B \fBuri\fP +Исходный URI. +.TP +.B \fBcurrentUri\fP +Это URI в настоящее время используется для загрузки. Если происходит +перенаправление, currentUri и uri могут отличаться. +.TP +.B \fBdownloadSpeed\fP +Скорость загрузки (байт/сек) +.UNINDENT +.UNINDENT +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getServers\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [{u\(aqindex\(aq: u\(aq1\(aq, + u\(aqservers\(aq: [{u\(aqcurrentUri\(aq: u\(aqhttp://example.org/file\(aq, + u\(aqdownloadSpeed\(aq: u\(aq10467\(aq, + u\(aquri\(aq: u\(aqhttp://example.org/file\(aq}]}]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getServers(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +[{\(aqindex\(aq: \(aq1\(aq, + \(aqservers\(aq: [{\(aqcurrentUri\(aq: \(aqhttp://example.org/dl/file\(aq, + \(aqdownloadSpeed\(aq: \(aq20285\(aq, + \(aquri\(aq: \(aqhttp://example.org/file\(aq}]}] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.tellActive([secret][, keys]) +Этот метод возвращает список активных загрузок. Ответ \- это массив таких же структур, +возвращаемых методом \fI\%aria2.tellStatus()\fP\&. За разъяснениями о +параметре \fIkeys\fP, обратитесь к методу \fI\%aria2.tellStatus()\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.tellWaiting([secret], offset, num[, keys]) +Этот метод возвращает список ожидающих загрузок, включая приостановленные +загрузки. +\fIoffset\fP является целым числом и указывает смещение, начиная от +ожидающей загрузки. +\fInum\fP является целым числом и указывает максимальное число возвращаемых загрузок. +За разъяснениями о параметре \fIkeys\fP, обратитесь к методу \fI\%aria2.tellStatus()\fP\&. +.sp +Если смещение положительное целое число, то этот метод возвращает загрузки в +диапазоне [\fIoffset\fP, \fIoffset*+*num\fP). +.sp +\fIoffset\fP может быть отрицательным целым числом. \fIoffset\fP == \-1 указывает на +последнею загрузку, которая ожидает в очереди, а \fIoffset\fP == \-2 указывает на +загрузку перед последней, и так далее. Тогда загрузки в ответе находятся в +обратном порядке. +.sp +Например, допустим, что есть три загрузки "A","B" и "C", в этом порядке, +которые ожидают. \fBaria2.tellWaiting(0, 1)\fP возвратит \fB["A"]\fP\&. +\fBaria2.tellWaiting(1, 2)\fP возвратит \fB["B", "C"]\fP\&. +\fBaria2.tellWaiting(\-1, 2)\fP возвратит \fB["C", "B"]\fP\&. +.sp +Ответ \- это массив таких же структур, возвращаемых методом +\fI\%aria2.tellStatus()\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.tellStopped([secret], offset, num[, keys]) +Этот метод возвращает список остановленных загрузок. +\fIoffset\fP является целым числом и указывает смещение, начиная от +последней, недавно остановленной, загрузки. +\fInum\fP является целым числом и указывает максимальное число возвращаемых загрузок. +За разъяснениями о параметре \fIkeys\fP, обратитесь к методу \fI\%aria2.tellStatus()\fP\&. +.sp +\fIoffset\fP и \fInum\fP имеют такую же семантику, как описано в методе +\fI\%aria2.tellWaiting()\fP\&. +.sp +Ответ \- это массив таких же структур, возвращаемых методом +\fI\%aria2.tellStatus()\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.changePosition([secret], gid, pos, how) +Этот метод меняет позицию загрузки, которая в очереди обозначена \fIgid\fP\&. +\fIpos\fP является целым числом. +\fIhow\fP является строкой. Если \fIhow\fP \- \fBPOS_SET\fP, то это +переместит загрузку на позицию, относительно начала очереди. Если \fIhow\fP \- +\fBPOS_CUR\fP, это переместит загрузку на позицию, относительно текущей +позиции. Если \fIhow\fP \- \fBPOS_END\fP, это переместит загрузку на позицию, +относительно конца очереди. Если целевая позиция меньше чем 0 или за +пределами конца очереди, это переместит загрузку в начало или конец очереди +соответственно. Ответ является целым числом, обозначающее получающуюся позицию. +.sp +Например, если текущей позицией GID#2089b05ecca3d829 является 3, то +\fBaria2.changePosition(\(aq2089b05ecca3d829\(aq, \-1, \(aqPOS_CUR\(aq)\fP +изменит позицию на 2. Дополнительно +\fBaria2.changePosition(\(aq2089b05ecca3d829\(aq, 0, \(aqPOS_SET\(aq)\fP +изменит позицию на 0 (начало очереди). +.sp +Следующие примеры перемещают загрузку GID#2089b05ecca3d829 в начало +очереди. +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.changePosition\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq, 0, \(aqPOS_SET\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: 0} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.changePosition(\(aq2089b05ecca3d829\(aq, 0, \(aqPOS_SET\(aq) +0 +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.changeUri([secret], gid, fileIndex, delUris, addUris[, position]) +Этот метод удаляет URI в \fIdelUris\fP из загрузки и добавляет URI в \fIaddUris\fP к +загрузке, которая обозначена \fIgid\fP\&. \fIdelUris\fP и \fIaddUris\fP являются списками +строк. Загрузка может содержать несколько файлов и URI прилагаются к каждому +файлу. \fIfileIndex\fP используется, чтобы выбрать файл для удаления/подключения +заданных URI. \fIfileIndex\fP начинается с 1. \fIposition\fP используется для +указания, куда будут вставлены URI в существующем списке ожидающих +URI. \fIposition\fP начинается с 0. Когда \fIposition\fP пропущено, URI добавляются +в конец списка. Этот метод сначала выполняет удаление, а потом +добавление. \fIposition\fP это позиция после URI, которые будут удалены, а не +позиция, когда метод вызывается. При удалении URI, если одинаковые URI +существуют в загрузке, только один из них будет удален, для каждого URI в +\fIdelUris\fP\&. Другими словами, если есть три URI \fBhttp://example.org/aria2\fP и вы +хотите удалить их все, то вы должны указать (по крайней мере) 3 +\fBhttp://example.org/aria2\fP в \fIdelUris\fP\&. Этот метод возвращает список, +который содержит два целых числа. Первое \- количество удаленных URI. Второе \- +количество добавленных URI. +.sp +Следующие примеры добавляют URI \fBhttp://example.org/file\fP к файлу +с индексом \fB1\fP, принадлежащий загрузке GID#2089b05ecca3d829. +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.changeUri\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq, 1, [], + [\(aqhttp://example.org/file\(aq]]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: [0, 1]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.changeUri(\(aq2089b05ecca3d829\(aq, 1, [], + [\(aqhttp://example.org/file\(aq]) +[0, 1] +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getOption([secret], gid) +Этот метод возвращает параметры загрузки, которая обозначена \fIgid\fP\&. +Ответ \- это структура, где ключи являются именами параметров. Значения +являются строками. +Обратите внимание, что этот метод не возвращает параметры, которые +не имеют значение по умолчанию и не были заданы параметрами командной +строки, конфигурационными файлами или RPC\-методами. +.sp +Следующие примеры получают параметры загрузки GID#2089b05ecca3d829. +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getOption\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqallow\-overwrite\(aq: u\(aqfalse\(aq, + u\(aqallow\-piece\-length\-change\(aq: u\(aqfalse\(aq, + u\(aqalways\-resume\(aq: u\(aqtrue\(aq, + u\(aqasync\-dns\(aq: u\(aqtrue\(aq, + ... +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getOption(\(aq2089b05ecca3d829\(aq) +>>> pprint(r) +{\(aqallow\-overwrite\(aq: \(aqfalse\(aq, + \(aqallow\-piece\-length\-change\(aq: \(aqfalse\(aq, + \(aqalways\-resume\(aq: \(aqtrue\(aq, + \(aqasync\-dns\(aq: \(aqtrue\(aq, + .... +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.changeOption([secret], gid, options) +Этот метод изменяет динамически параметры загрузки, которая обозначена +\fIgid\fP (строка). \fIoptions\fP является структурой. +Доступные параметры перечисленны в подразделе \fI\%Входной файл\fP, +\fBисключая\fP следующие: +.INDENT 7.0 +.IP \(bu 2 +\fI\%dry\-run\fP +.IP \(bu 2 +\fI\%metalink\-base\-uri\fP +.IP \(bu 2 +\fI\%parameterized\-uri\fP +.IP \(bu 2 +\fI\%pause\fP +.IP \(bu 2 +\fI\%piece\-length\fP +.IP \(bu 2 +\fI\%rpc\-save\-upload\-metadata\fP +.UNINDENT +.sp +За исключением следующих параметров, изменение других параметров +активной загрузки заставляет их перезапуститься (самим перезапуском +управляет aria2, и никакого вмешательства пользователя не требуется): +.INDENT 7.0 +.IP \(bu 2 +\fI\%bt\-max\-peers\fP +.IP \(bu 2 +\fI\%bt\-request\-peer\-speed\-limit\fP +.IP \(bu 2 +\fI\%bt\-remove\-unselected\-file\fP +.IP \(bu 2 +\fI\%force\-save\fP +.IP \(bu 2 +\fI\%max\-download\-limit\fP +.IP \(bu 2 +\fI\%max\-upload\-limit\fP +.UNINDENT +.sp +Этот метод возвращает \fBOK\fP, в случае успеха. +.sp +Следующие примеры устанавливают параметр +\fI\%max\-download\-limit\fP +в \fB20K\fP для загрузки GID#2089b05ecca3d829. +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.changeOption\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq, +\&... {\(aqmax\-download\-limit\(aq:\(aq10K\(aq}]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aqOK\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.changeOption(\(aq2089b05ecca3d829\(aq, {\(aqmax\-download\-limit\(aq:\(aq20K\(aq}) +\(aqOK\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getGlobalOption([secret]) +Этот метод возвращает глобальные параметры. Ответ является структурой. Её +ключи \- это названия параметров. Значения являются строками. +Обратите внимание, что этот метод не возвращает параметры, которые не имеют +значение по умолчанию и не были заданы параметрами командной строки, +конфигурационными файлами или RPC\-методами. Так как глобальные параметры +используются в качестве шаблона для вновь добавляемых загрузок, ответ содержит +ключи возвращаемые методом \fI\%aria2.getOption()\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.changeGlobalOption([secret], options) +Этот метод изменяет динамически глобальные параметры. \fIoptions\fP является +структурой. Доступны следующие параметры: +.INDENT 7.0 +.IP \(bu 2 +\fI\%bt\-max\-open\-files\fP +.IP \(bu 2 +\fI\%download\-result\fP +.IP \(bu 2 +\fI\%keep\-unfinished\-download\-result\fP +.IP \(bu 2 +\fI\%log\fP +.IP \(bu 2 +\fI\%log\-level\fP +.IP \(bu 2 +\fI\%max\-concurrent\-downloads\fP +.IP \(bu 2 +\fI\%max\-download\-result\fP +.IP \(bu 2 +\fI\%max\-overall\-download\-limit\fP +.IP \(bu 2 +\fI\%max\-overall\-upload\-limit\fP +.IP \(bu 2 +\fI\%optimize\-concurrent\-downloads\fP +.IP \(bu 2 +\fI\%save\-cookies\fP +.IP \(bu 2 +\fI\%save\-session\fP +.IP \(bu 2 +\fI\%server\-stat\-of\fP +.UNINDENT +.sp +В дополнение к ним, параметры перечисленные в подразделе \fI\%Входной файл\fP, \fBисключая\fP следующие параметры: +\fI\%checksum\fP, +\fI\%index\-out\fP, +\fI\%out\fP, +\fI\%pause\fP, +\fI\%select\-file\fP\&. +.sp +C параметром \fI\%log\fP, вы можете динамически +начинать вести журнал событий или изменять файл журнала событий. Чтобы +остановить ведение журнала событий, укажите пустую строку ("") в качестве +значения параметра. Обратите внимание, что файл журнала событий всегда +открыт в режиме добавления. Этот метод возвращает \fBOK\fP, в случае успеха. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getGlobalStat([secret]) +Этот метод возвращает глобальную статистику по скорости загрузки и скорости +отдачи. Ответ является структурой и содержит следующие ключи. Значения являются +строками. +.INDENT 7.0 +.TP +.B \fBdownloadSpeed\fP +Общая скорость загрузки (байт/сек). +.TP +.B \fBuploadSpeed\fP +Общая скорость отдачи (байт/сек). +.TP +.B \fBnumActive\fP +Количество активных загрузок. +.TP +.B \fBnumWaiting\fP +Количество ожидающих загрузок. +.TP +.B \fBnumStopped\fP +Количество остановленных загрузок в текущей сессии. Это значение +ограничено параметром \fI\%\-\-max\-download\-result\fP\&. +.TP +.B \fBnumStoppedTotal\fP +Количество остановленных загрузок в текущей сессии и \fIне\fP +ограничено параметром \fI\%\-\-max\-download\-result\fP\&. +.UNINDENT +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getGlobalStat\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqdownloadSpeed\(aq: u\(aq21846\(aq, + u\(aqnumActive\(aq: u\(aq2\(aq, + u\(aqnumStopped\(aq: u\(aq0\(aq, + u\(aqnumWaiting\(aq: u\(aq0\(aq, + u\(aquploadSpeed\(aq: u\(aq0\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getGlobalStat() +>>> pprint(r) +{\(aqdownloadSpeed\(aq: \(aq23136\(aq, + \(aqnumActive\(aq: \(aq2\(aq, + \(aqnumStopped\(aq: \(aq0\(aq, + \(aqnumWaiting\(aq: \(aq0\(aq, + \(aquploadSpeed\(aq: \(aq0\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.purgeDownloadResult([secret]) +Этот метод очищает, для освобождения памяти, завершенные/ошибка/удаленные +загрузки. Метод возвращает \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.removeDownloadResult([secret], gid) +Этот метод удаляет из памяти завершенную/ошибка/удаленную загрузку, которая +обозначена \fIgid\fP\&. Метод возвращает \fBOK\fP, в случае успеха. +.sp +Следующие примеры удаляют результат загрузки GID#2089b05ecca3d829. +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.removeDownloadResult\(aq, +\&... \(aqparams\(aq:[\(aq2089b05ecca3d829\(aq]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aqOK\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.removeDownloadResult(\(aq2089b05ecca3d829\(aq) +\(aqOK\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getVersion([secret]) +Этот метод возвращает версию aria2 и список включенных +возможностей. Ответ является структурой и содержит следующие ключи. +.INDENT 7.0 +.TP +.B \fBversion\fP +Номер версии aria2 в виде строки. +.TP +.B \fBenabledFeatures\fP +Список включенных возможностей. Каждая возможность задаётся в виде строки. +.UNINDENT +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getVersion\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqenabledFeatures\(aq: [u\(aqAsync DNS\(aq, + u\(aqBitTorrent\(aq, + u\(aqFirefox3 Cookie\(aq, + u\(aqGZip\(aq, + u\(aqHTTPS\(aq, + u\(aqMessage Digest\(aq, + u\(aqMetalink\(aq, + u\(aqXML\-RPC\(aq], + u\(aqversion\(aq: u\(aq1.11.0\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> from pprint import pprint +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> r = s.aria2.getVersion() +>>> pprint(r) +{\(aqenabledFeatures\(aq: [\(aqAsync DNS\(aq, + \(aqBitTorrent\(aq, + \(aqFirefox3 Cookie\(aq, + \(aqGZip\(aq, + \(aqHTTPS\(aq, + \(aqMessage Digest\(aq, + \(aqMetalink\(aq, + \(aqXML\-RPC\(aq], + \(aqversion\(aq: \(aq1.11.0\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.getSessionInfo([secret]) +Этот метод возвращает информацию о сессии. +Ответ является структурой и содержит следующие ключи. +.INDENT 7.0 +.TP +.B \fBsessionId\fP +ID сессии, которое генерируется каждый раз, при запуске aria2. +.UNINDENT +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.getSessionInfo\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: {u\(aqsessionId\(aq: u\(aqcd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9\(aq}} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.aria2.getSessionInfo() +{\(aqsessionId\(aq: \(aqcd6a3bc6a1de28eb5bfa181e5f6b916d44af31a9\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.shutdown([secret]) +Этот метод закрывает aria2. Метод возвращает \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.forceShutdown([secret]) +Этот метод закрывает aria2. Метод действует подобно \fI\%aria2.shutdown()\fP, +за исключением того, что метод выполняется без выполнения каких\-либо действий, +которые требуют времени, например связь с BitTorrent\-трекерами для отмены +регистрации загрузок. +Метод возвращает \fBOK\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.saveSession([secret]) +Этот метод сохраняет текущею сессию в файл, указанный в параметре +\fI\%\-\-save\-session\fP\&. Метод возвращает \fBOK\fP если это +удаётся. +.UNINDENT +.INDENT 0.0 +.TP +.B system.multicall(methods) +Этот метод объединяет несколько вызовов методов в один запрос. +\fImethods\fP является массив структур. Структуры содержат два ключа поля: +\fBmethodName\fP и \fBparams\fP\&. \fBmethodName\fP \- это имя вызываемого метода, а +\fBparams\fP \- содержит параметры вызова метода. Метод возвращает массив +ответов. Элементы массива будут одним из двух: массивом из одного элемента, +который содержит возвращаемое значение, для вызываемого метода или +структурой ошибочного элемента, если вызов объединённого метода завершился +неудачно. +.sp +В следующих примерах мы добавляем 2 загрузки. Первая \- +\fBhttp://example.org/file\fP и вторая \- один файл \fBfile.torrent\fP\&. +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json, base64 +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqsystem.multicall\(aq, +\&... \(aqparams\(aq:[[{\(aqmethodName\(aq:\(aqaria2.addUri\(aq, +\&... \(aqparams\(aq:[[\(aqhttp://example.org\(aq]]}, +\&... {\(aqmethodName\(aq:\(aqaria2.addTorrent\(aq, +\&... \(aqparams\(aq:[base64.b64encode(open(\(aqfile.torrent\(aq).read())]}]]}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: [[u\(aq2089b05ecca3d829\(aq], [u\(aqd2703803b52216d1\(aq]]} +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +JSON\-RPC дополнительно поддерживает пакетные запросы, которые описываются в +спецификации JSON\-RPC 2.0: +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> jsonreq = json.dumps([{\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addUri\(aq, +\&... \(aqparams\(aq:[[\(aqhttp://example.org\(aq]]}, +\&... {\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqasdf\(aq, +\&... \(aqmethod\(aq:\(aqaria2.addTorrent\(aq, +\&... \(aqparams\(aq:[base64.b64encode(open(\(aqfile.torrent\(aq).read())]}]) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +[{u\(aqid\(aq: u\(aqqwer\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aq2089b05ecca3d829\(aq}, + {u\(aqid\(aq: u\(aqasdf\(aq, u\(aqjsonrpc\(aq: u\(aq2.0\(aq, u\(aqresult\(aq: u\(aqd2703803b52216d1\(aq}] +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> mc = xmlrpclib.MultiCall(s) +>>> mc.aria2.addUri([\(aqhttp://example.org/file\(aq]) +>>> mc.aria2.addTorrent(xmlrpclib.Binary(open(\(aqfile.torrent\(aq, mode=\(aqrb\(aq).read())) +>>> r = mc() +>>> tuple(r) +(\(aq2089b05ecca3d829\(aq, \(aqd2703803b52216d1\(aq) +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B system.listMethods() +Этот метод возвращает все доступные RPC\-методы в массиве строк. +В отличие от других методов, этот метод не требует секретный маркер. +Это безопасно, потому что этот метод просто возвращает названия доступных +методов. +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqsystem.listMethods\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [u\(aqaria2.addUri\(aq, + u\(aqaria2.addTorrent\(aq, +\&... +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.system.listMethods() +[\(aqaria2.addUri\(aq, \(aqaria2.addTorrent\(aq, ... +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B system.listNotifications() +Этот метод возвращает все доступные RPC\-методы в массиве строк. +В отличие от других методов, этот метод не требует секретный маркер. +Это безопасно, потому что этот метод просто возвращает названия доступных +уведомлений. +.sp +\fBПример JSON\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import urllib2, json +>>> from pprint import pprint +>>> jsonreq = json.dumps({\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, +\&... \(aqmethod\(aq:\(aqsystem.listNotifications\(aq}) +>>> c = urllib2.urlopen(\(aqhttp://localhost:6800/jsonrpc\(aq, jsonreq) +>>> pprint(json.loads(c.read())) +{u\(aqid\(aq: u\(aqqwer\(aq, + u\(aqjsonrpc\(aq: u\(aq2.0\(aq, + u\(aqresult\(aq: [u\(aqaria2.onDownloadStart\(aq, + u\(aqaria2.onDownloadPause\(aq, +\&... +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПример XML\-RPC\fP +.INDENT 7.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> s.system.listNotifications() +[\(aqaria2.onDownloadStart\(aq, \(aqaria2.onDownloadPause\(aq, ... +.ft P +.fi +.UNINDENT +.UNINDENT +.UNINDENT +.SS Обработка ошибок +.sp +Через JSON\-RPC, aria2 возвращает JSON\-объект, который содержит код ошибки в +\fBcode\fP и сообщение об ошибке в \fBmessage\fP\&. +.sp +Через XML\-RPC, aria2 возвращает \fBfaultCode=1\fP и сообщение об ошибке в +\fBfaultString\fP\&. +.SS Параметры +.sp +Такие же параметры, что доступны для \fI\%\-\-input\-file\fP\&. Смотрите +подраздел \fI\%Входной файл\fP для полного списка параметров. +.sp +В структуре, имя элемента \- это имя параметра (без \fB\-\-\fP), а значение +элемента \- аргумент в виде строки. +.SS Пример JSON\-RPC +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +{\(aqsplit\(aq:\(aq1\(aq, \(aqhttp\-proxy\(aq:\(aqhttp://proxy/\(aq} +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Пример XML\-RPC +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C + + + split + 1 + + + http\-proxy + http://proxy/ + + +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Параметры \fI\%header\fP и \fI\%index\-out\fP допускают +нескольких определений в командной строке. Поскольку имя должно быть +уникальным в структуре (многие реализации библиотеки XML\-RPC используют хэш +или словарь для структуры), одной строки недостаточно. Для преодоления этого +ограничения, вы можете использовать массив в качестве значения, а также +строку. +.SS Пример JSON\-RPC +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +{\(aqheader\(aq:[\(aqAccept\-Language: ja\(aq, \(aqAccept\-Charset: utf\-8\(aq]} +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Пример XML\-RPC +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C + + + header + + + + Accept\-Language: ja + Accept\-Charset: utf\-8 + + + + + +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Следующий пример добавляет загрузку с двумя параметрами: \fBdir\fP и +\fBheader\fP\&. Параметр \fBheader\fP требует 2 значения, поэтому используется +список: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +>>> import xmlrpclib +>>> s = xmlrpclib.ServerProxy(\(aqhttp://localhost:6800/rpc\(aq) +>>> opts = dict(dir=\(aq/tmp\(aq, +\&... header=[\(aqAccept\-Language: ja\(aq, +\&... \(aqAccept\-Charset: utf\-8\(aq]) +>>> s.aria2.addUri([\(aqhttp://example.org/file\(aq], opts) +\(aq1\(aq +.ft P +.fi +.UNINDENT +.UNINDENT +.SS JSON\-RPC используя HTTP GET +.sp +JSON\-RPC\-интерфейс также поддерживает запросы через HTTP GET. Схема +кодирования в GET параметров основанных на JSON\-RPC через HTTP Спецификация +[2008\-1\-15(RC1)]. Кодирование параметров через GET следующие: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +/jsonrpc?method=METHOD_NAME&id=ID¶ms=BASE64_ENCODED_PARAMS +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBmethod\fP и \fBid\fP всегда обрабатывается как JSON\-строка и они должны быть +в кодировке UTF\-8. +.sp +Например, закодированная строка \fBaria2.tellStatus(\(aq2089b05ecca3d829\(aq)\fP с +\fBid=\(aqfoo\(aq\fP выглядит так: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +/jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Параметр \fBparams\fP \- это JSON\-массив в Base64\-кодировке, который обычно +появляется в атрибуте \fBparams\fP в JSON\-RPC\-запросе объекта. В примере выше, +params \- \fB["2089b05ecca3d829"]\fP, следовательно: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +["2089b05ecca3d829"] \-\-(Base64)\-\-> WyIyMDg5YjA1ZWNjYTNkODI5Il0= + \-\-(Кодирование процентом)\-\-> WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +JSON\-RPC\-интерфейс также поддерживает JSONP. Вы можете определить функцию +обратного вызова в параметре \fBjsoncallback\fP: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +/jsonrpc?method=aria2.tellStatus&id=foo¶ms=WyIyMDg5YjA1ZWNjYTNkODI5Il0%3D&jsoncallback=cb +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Для пакетных запросов, параметры \fBmethod\fP и \fBid\fP не должны быть +указаны. Полный запрос должен быть определен в параметре +\fBparams\fP\&. Например, пакетный запрос: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +[{\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqqwer\(aq, \(aqmethod\(aq:\(aqaria2.getVersion\(aq}, + {\(aqjsonrpc\(aq:\(aq2.0\(aq, \(aqid\(aq:\(aqasdf\(aq, \(aqmethod\(aq:\(aqaria2.tellActive\(aq}] +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +должен кодироваться так: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +/jsonrpc?params=W3sianNvbnJwYyI6ICIyLjAiLCAiaWQiOiAicXdlciIsICJtZXRob2QiOiAiYXJpYTIuZ2V0VmVyc2lvbiJ9LCB7Impzb25ycGMiOiAiMi4wIiwgImlkIjogImFzZGYiLCAibWV0aG9kIjogImFyaWEyLnRlbGxBY3RpdmUifV0%3D +.ft P +.fi +.UNINDENT +.UNINDENT +.SS JSON\-RPC через WebSocket +.sp +JSON\-RPC через WebSocket использует тот же самый метод сигнатур и формат +ответа как у JSON\-RPC через HTTP. Поддерживаемый WebSocket, версия 13, +детально описан в \fI\%RFC 6455\fP\&. +.sp +Для отправки RPC\-запроса на RPC\-сервер, надо отправлять преобразованную в +последовательную форму JSON\-строку в текстовом фрейме. Ответ от RPC\-сервера +также доставляется в текстовом фрейме. +.SS Уведомления +.sp +RPC\-сервер может отправлять уведомления клиенту. Уведомления являются +однонаправленными, поэтому клиент, который получает уведомление, не должен +отвечать на него. Метод сигнатуры уведомления такой же, как нормальный +запрос метода, но отсутствует ключ id. Значение, связанное с ключом params, +является данными, которые переносит это уведомление. Формат этого значения +варьируется в зависимости от метода уведомления. Определены следующие методы +уведомления. +.INDENT 0.0 +.TP +.B aria2.onDownloadStart(event) +Это уведомление будет оправлено, когда загрузка запущена. +Параметр \fIevent\fP имеет тип структура и содержит следующие ключи. Ключ имеет тип строка. +.INDENT 7.0 +.TP +.B \fBgid\fP +GID загрузки. +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onDownloadPause(event) +Это уведомление будет оправлено, когда загрузка приостановлена. \fIevent\fP \- +такая же структура, как параметр \fIevent\fP в методе +\fI\%aria2.onDownloadStart()\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onDownloadStop(event) +Это уведомление будет оправлено, когда загрузка остановлена +пользователем. \fIevent\fP \- такая же структура, как параметр \fIevent\fP в методе +\fI\%aria2.onDownloadStart()\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onDownloadComplete(event) +Это уведомление будет оправлено, когда загрузка завершена. Для +BitTorrent\-загрузок, это уведомление отправляется, когда загрузка завершена +и сидирование окончено. \fIevent\fP \- такая же структура, как параметр \fIevent\fP в +методе \fI\%aria2.onDownloadStart()\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onDownloadError(event) +Это уведомление будет оправлено, когда загрузка остановлена из\-за +ошибки. \fIevent\fP \- такая же структура, как параметр \fIevent\fP в методе +\fI\%aria2.onDownloadStart()\fP\&. +.UNINDENT +.INDENT 0.0 +.TP +.B aria2.onBtDownloadComplete(event) +Это уведомление будет оправлено, когда torrent\-загрузка завершена, но +сидирование продолжается. \fIevent\fP \- такая же структура, как параметр \fIevent\fP +в методе \fI\%aria2.onDownloadStart()\fP\&. +.UNINDENT +.SS Пример кода XML\-RPC\-клиента +.sp +Следующий Ruby\-скрипт добавляет \fBhttp://localhost/aria2.tar.bz2\fP в aria2c +(работает на localhost) с параметром \fI\%\-\-dir=/downloads,\fP и +отображает RPC\-ответ: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +#!/usr/bin/env ruby + +require \(aqxmlrpc/client\(aq +require \(aqpp\(aq + +client=XMLRPC::Client.new2("http://localhost:6800/rpc") + +options={ "dir" => "/downloads" } +result=client.call("aria2.addUri", [ "http://localhost/aria2.tar.bz2" ], options) + +pp result +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Если вы любитель Python, то можете использовать xmlrpclib (Python3 +использует xmlrpc.client) для взаимодействия с aria2: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +import xmlrpclib +from pprint import pprint + +s = xmlrpclib.ServerProxy("http://localhost:6800/rpc") +r = s.aria2.addUri(["http://localhost/aria2.tar.bz2"], {"dir":"/downloads"}) +pprint(r) +.ft P +.fi +.UNINDENT +.UNINDENT +.SH РАЗНОЕ +.SS Консольный индикатор +.sp +При загрузке файлов, aria2 отображает индикатор на консоль, для отображения +прогресса загрузок. Консольный индикатор имеет вид: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +[#2089b0 400.0KiB/33.2MiB(1%) CN:1 DL:115.7KiB ETA:4m51s] +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Этот раздел описывает значение чисел и строк. +.INDENT 0.0 +.TP +.B \fB#NNNNNN\fP +Первые 6 символов GID в виде шестнадцатеричной строки. GID является +уникальным ID (внутренний в aria2) для каждой загрузки. GID особенно полезен при +взаимодействии с aria2, используя RPC\-интерфейс. +.TP +.B \fBX/Y(Z%)\fP +Загруженный размер, общий размер файла и процент выполнения загрузки. +Если используется \fI\%\-\-select\-file\fP, то +значение является суммой выбранных файлов. +.TP +.B \fBSEED\fP +Рейтинг, когда aria2 сидирует завершённый торрент. +.TP +.B \fBCN\fP +Количество соединений, установленных aria2. +.TP +.B \fBSD\fP +Количество сидов, к которым сейчас подключена aria2. +.TP +.B \fBDL\fP +Скорость загрузки (байт/сек). +.TP +.B \fBUL\fP +Скорость выгрузки (байт/сек) и количество выгруженных байт. +.TP +.B \fBETA\fP +Ожидаемое время завершения загрузки. +.UNINDENT +.sp +При больше чем 1\-ой загрузке, выполняемой в данный момент, часть информации, +описанной выше будет опущена, чтобы показать информации о нескольких +загрузках. А общая скорость загрузки и выгрузки будет показана в начале +строки. +.sp +Когда aria2 выделяет место под файл или проверяет контрольную сумму, то при +этом дополнительно отображается прогресс этих операций: +.INDENT 0.0 +.TP +.B FileAlloc +GID, уже выделенный размер и общий размер в байтах. +.TP +.B Checksum +GID, уже проверенный размер и общий размер в байтах. +.UNINDENT +.SH ПРИМЕРЫ +.SS Сегментированные HTTP/FTP\-загрузки +.SS Загрузка файла +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c "http://host/file.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Для остановки загрузки, нажмите \fBCtrl\-C\fP\&. Вы можете возобновить передачу, +запустив aria2c с теми же аргументами в том же каталоге. Вы можете изменить +URI, если они указывают на тот же самый файл. +.UNINDENT +.UNINDENT +.SS Загрузка файла с 2\-ух разных HTTP\-серверов +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c "http://host/file.zip" "http://mirror/file.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Загрузка файла с одно хоста, используя множественные соединения +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-x2 \-k1M "http://host/file.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Параметр \-x указывает количество разрешённых соединений, в то время как параметр \-k +указывает размер частей данных. +.UNINDENT +.UNINDENT +.SS Загрузка файла с HTTP\- и FTP\-серверов одновременно +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c "http://host1/file.zip" "ftp://host2/file.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Одновременная загрузка файлов, перечисленных в текстовом файле +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-ifiles.txt \-j2 +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Параметр \-j указывает количество параллельных загрузок. +.UNINDENT +.UNINDENT +.SS Использование прокси\-сервера +.sp +Для HTTP: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-http\-proxy="http://proxy:8080" "http://host/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-http\-proxy="http://proxy:8080" \-\-no\-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://host/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Для FTP: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-ftp\-proxy="http://proxy:8080" "ftp://host/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Смотрите для подробностей \fI\%\-\-http\-proxy\fP, +\fI\%\-\-https\-proxy\fP, +\fI\%\-\-ftp\-proxy\fP, \fI\%\-\-all\-proxy\fP и +\fI\%\-\-no\-proxy\fP\&. Вы можете указать прокси в +переменных окружения. Смотрите раздел \fI\%ОКРУЖЕНИЕ\fP\&. +.UNINDENT +.UNINDENT +.SS Использование прокси\-сервера с авторизацией +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-http\-proxy="http://username:password@proxy:8080" "http://host/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-http\-proxy="http://proxy:8080" \-\-http\-proxy\-user="username" \-\-http\-proxy\-passwd="password" "http://host/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Загрузка Metalink +.SS Загрузка файлов с удаленного Metalink +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-follow\-metalink=mem "http://host/file.metalink" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Загрузка, используя локальный metalink\-файл +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-p \-\-lowest\-speed\-limit=4000 file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Для остановки загрузки, нажмите \fBCtrl\-C\fP\&. Вы можете возобновить передачу, +запустив aria2c с теми же аргументами в том же каталоге. +.UNINDENT +.UNINDENT +.SS Загрузка нескольких локальных metalink\-файлов +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-j2 file1.metalink file2.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Загрузка только выбранных файлов +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-select\-file=1\-4,8 file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Индекс выводится на консоль при использовании параметра \-S. +.UNINDENT +.UNINDENT +.SS Загрузка файла, используя локальный metalink\-файл с пользовательскими настройками +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-metalink\-location=jp,us \-\-metalink\-version=1.1 \-\-metalink\-language=en\-US file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Загрузка BitTorrent +.SS Загрузка файлов, используя удалённый BitTorrent\-файл +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-follow\-torrent=mem "http://host/file.torrent" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Загрузка, используя локальный torrent\-файл +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-max\-upload\-limit=40K file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +\-\-max\-upload\-limit определяет максимальную скорость отдачи. +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Для остановки загрузки, нажмите \fBCtrl\-C\fP\&. Вы можете возобновить передачу, +запустив aria2c с теми же аргументами в том же каталоге. +.UNINDENT +.UNINDENT +.SS Загрузка, используя BitTorrent Magnet URI +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C&dn=aria2" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Не забывайте заключать BitTorrent Magnet URI, в которых есть символы \fB&\fP, в +одиночные(\fB\(aq\fP) или двойные(\fB"\fP) кавычки, когда указывайте URI в командной строке. +.UNINDENT +.UNINDENT +.SS Загрузка 2\-х торрентов +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-j2 file1.torrent file2.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Параллельная загрузка файла посредством торрента и HTTP/FTP\-сервера +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-Ttest.torrent "http://host1/file" "ftp://host2/file" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Загрузка только определённых файлов (обычно называют "выборочная загрузка") +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-select\-file=1\-4,8 file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Индекс выводится на консоль при использовании параметра \-S. +.UNINDENT +.UNINDENT +.SS Загрузка torrent\-файла, без загрузки торрента +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-follow\-torrent=false "http://host/file.torrent" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Указание имени выходного файла +.sp +Для указания выходного имени файла в BitTorrent\-загрузках, вам нужно узнать +индекс файла в торренте (см.:option:\fI\-\-show\-files <\-S>\fP). Например, вывод +выглядит следующим образом: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +idx|path/length +===+====================== + 1|dist/base\-2.6.18.iso + |99.9MiB +\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- + 2|dist/driver\-2.6.18.iso + |169.0MiB +\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Сохраняет \(aqdist/base\-2.6.18.iso\(aq в \(aq/tmp/mydir/base.iso\(aq и +\(aqdist/driver\-2.6.18.iso\(aq в \(aq/tmp/dir/driver.iso\(aq, при использовании +следующей команды: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-dir=/tmp \-\-index\-out=1=mydir/base.iso \-\-index\-out=2=dir/driver.iso file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Изменение прослушиваемого порта для входящих соединений пиров +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-listen\-port=7000\-7001,8000 file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Т.к. aria2 не настраивает брандмауэры или маршрутизаторы для перенаправления +портов, вам решать, как это сделать вручную. +.UNINDENT +.UNINDENT +.SS Указать условие остановки сидирования после завершения загрузки торрента +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-seed\-time=120 \-\-seed\-ratio=1.0 file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +В приведенном выше примере, сидирование завершается через 120 минут после +завершения загрузки или при достижении рейтинга сидирования 1.0. +.UNINDENT +.UNINDENT +.SS Регулировка скорости отдачи +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-max\-upload\-limit=100K file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Включить IPv4 DHT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-enable\-dht \-\-dht\-listen\-port=6881 file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +DHT использует UDP. Так как aria2 не настраивает брандмауэр или +маршрутизатор для перенаправления портов, вам решать, как это сделать +вручную. +.UNINDENT +.UNINDENT +.SS Включить IPv6 DHT +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-enable\-dht6 \-\-dht\-listen\-port=6881 \-\-dht\-listen\-addr6=YOUR_GLOBAL_UNICAST_IPV6_ADDR +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +aria2 использует те же порты для IPv4 и IPv6 DHT. +.UNINDENT +.UNINDENT +.SS Добавить и удалить URI трекера +.sp +Игнорировать все URI анонса трекеров, определенные в file.torrent и взамен +использовать \fBhttp://tracker1/announce\fP и \fBhttp://tracker2/announce\fP: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-bt\-exclude\-tracker="*" +\-\-bt\-tracker="http://tracker1/announce,http://tracker2/announce" +file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Больше расширенных возможностей для HTTP +.SS Загрузить куки +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-load\-cookies=cookies.txt "http://host/file.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Вы можете использовать без изменения cookie\-файлы Firefox/Mozilla/Chromium. +.UNINDENT +.UNINDENT +.SS Возобновление загрузки, которая начата в браузере или других программах +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-c \-s2 "http://host/partiallydownloadedfile.zip" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Это будет работать только тогда, когда начальная загрузка не была многосегментной. +.UNINDENT +.UNINDENT +.SS Клиентский сертификат авторизации для SSL/TLS +.sp +Указать PKCS12\-файл следующим образом: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-certificate=/path/to/mycert.p12 +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Указанный в \fI\%\-\-certificate\fP файл должен содержать один PKCS12\-закодированный +сертификат и ключ. Пароль должен быть пустым. +.UNINDENT +.UNINDENT +.sp +В качестве альтернативы, если PEM\-файлы поддерживаются, использовать +следующую команду: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-certificate=/path/to/mycert.pem \-\-private\-key=/path/to/mykey.pem https://host/file +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Указанный в \fI\%\-\-private\-key\fP файл должен быть +расшифрован. Режим работы с исходно зашифрованным закрытым ключом не +определен. +.UNINDENT +.UNINDENT +.SS Проверить SSL/TLS\-серверы, используя исходные CA\-сертификаты +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-ca\-certificate=/path/to/ca\-certificates.crt \-\-check\-certificate https://host/file +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Эта возможность доступна только если aria2 была скомпилирована +с GnuTLS или OpenSSL. +WinTLS и AppleTLS всегда будет использовать хранилище сертификатов +системы. Вместо \fB\-\-ca\-certificate\fP установите сертификат в это +хранилище. +.UNINDENT +.UNINDENT +.SS RPC +.SS Шифрование RPC\-трафика с использованием SSL/TLS +.sp +Указать PKC12\-файл сервера: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-enable\-rpc \-\-rpc\-certificate=/path/to/server.p12 \-\-rpc\-secure +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Указанный в \fI\%\-\-rpc\-certificate\fP файл должен содержать один PKCS12\-закодированный +сертификат и ключ. Пароль должен быть пустым. +.UNINDENT +.UNINDENT +.sp +В качестве альтернативы, когда PEM\-файлы поддерживаются (GnuTLS и OpenSSL), +указать файл с сертификатом сервера и файл с закрытым ключом следующим +образом: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-enable\-rpc \-\-rpc\-certificate=/path/to/server.crt \-\-rpc\-private\-key=/path/to/server.key \-\-rpc\-secure +.ft P +.fi +.UNINDENT +.UNINDENT +.SS И ещё больше расширенных возможностей +.SS Регулировка скорости загрузки +.sp +Одной загрузки: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-max\-download\-limit=100K file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Общая: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-max\-overall\-download\-limit=100K file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Исправить поврежденную загрузку +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-V file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +При использовании BitTorrent или Metalink с контрольными суммами блоков +данных можно эффективно исправлять поврежденные загрузки. +.UNINDENT +.UNINDENT +.SS Отклонить соединения, если скорость загрузки ниже указанного предела +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-lowest\-speed\-limit=10K file.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Поддержка параметризованных URI +.sp +Вы можете определить набор частей: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-P "http://{host1,host2,host3}/file.iso" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +Вы можете определить числовую последовательность: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-Z \-P "http://host/image[000\-100].png" +.ft P +.fi +.UNINDENT +.UNINDENT +.sp +\fBПРИМЕЧАНИЕ:\fP +.INDENT 0.0 +.INDENT 3.5 +Параметр \-Z необходим, если все URI не указывают на один и тот же файл, как +в примере указанном выше. +.UNINDENT +.UNINDENT +.sp +Вы можете определить шаг счетчика: +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-Z \-P "http://host/image[A\-Z:2].png" +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Проверка контрольных сумм +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-checksum=sha\-1=0192ba11326fe2298c8cb4de616f4d4140213837 http://example.org/file +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Параллельные загрузки с произвольным числом URI, metalink, torrent +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-j3 \-Z "http://host/file1" file2.torrent file3.metalink +.ft P +.fi +.UNINDENT +.UNINDENT +.SS Шифрование BitTorrent +.sp +Шифровать всю полезную нагрузку используя ARC4 (обфускация): +.INDENT 0.0 +.INDENT 3.5 +.sp +.nf +.ft C +$ aria2c \-\-bt\-min\-crypto\-level=arc4 \-\-bt\-require\-crypto=true file.torrent +.ft P +.fi +.UNINDENT +.UNINDENT +.SH СМОТРИТЕ ТАКЖЕ +.sp +Веб\-сайт проекта: \fI\%https://aria2.github.io/\fP +.sp +Домашняя страница Metalink: \fI\%http://www.metalinker.org/\fP +.sp +Описание формата Metalink: \fI\%RFC 5854\fP +.SH АВТОРСКОЕ ПРАВО +.sp +Авторское право (C) 2006, 2015 Tatsuhiro Tsujikawa +.sp +Эта программа является свободным программным обеспечением; вы можете +распространять его и/или изменять его в соответствии с условиями лицензии +GNU General Public License, опубликованной Free Software Foundation; либо +License версии 2, либо (по вашему выбору) любой более поздней версии. +.sp +Эта программа распространяется в надежде, что она будет полезной, но БЕЗ +КАКИХ\-ЛИБО ГАРАНТИЙ, даже без подразумеваемых гарантий КОММЕРЧЕСКОЙ ЦЕННОСТИ +или ПРИГОДНОСТИ ДЛЯ ОПРЕДЕЛЕННОЙ ЦЕЛИ. См. GNU General Public License для +более подробной информации. +.sp +Вы должны получить копию GNU General Public License вместе с этой +программой; если нет, напишите в Free Software Foundation, Inc., 51 Franklin +Street, Fifth Floor, Boston, MA 02110\-1301 USA +.sp +Кроме того, в качестве особого исключения, владельцы авторских прав дают +разрешение на ссылку части кода этой программы с библиотекой OpenSSL при +определенных условиях, как описано в каждом отдельном исходном файле, а +также распространять эту комбинацию вместе. Вы должны подчиняться GNU +General Public License во всех отношениях для всего используемого кода, +кроме OpenSSL. Если вы измените файл(ы) с этим исключением, вы можете +расширить это исключение для вашей версии файла(ов), но вы не обязаны делать +это. Если вы не хотите сделать это, удалите это заявление об исключении из +вашей версии. Если вы удалите это заявление об исключении из всех исходных +файлов в программе, то удалить его и здесь. +.SH АВТОР ПЕРЕВОДА +.sp +ITriskTI <\fI\%ITriskTI@gmail.com\fP> +.sp +Если вы нашли ошибку, неточность в переводе или считаете, что переведено +неправильно, тогда, пожалуйста, сообщите мне на e\-mail. +.SH ПРИМЕЧАНИЕ +.sp +Эта страница руководства может содержать не обязательно самую последнюю информацию. +Если есть некоторые противоречия между этой страницей руководства и фактическим +программным обеспечением, пожалуйста, обращайтесь к английской версии страницы +руководства. +.\" Generated by docutils manpage writer. +.