Update doc

pull/384/head
Tatsuhiro Tsujikawa 2015-05-12 22:52:09 +09:00
parent 62826d691d
commit 5100f96bfa
2 changed files with 64 additions and 50 deletions

View File

@ -10,14 +10,15 @@ You must use this program at your own risk.
Introduction Introduction
------------ ------------
aria2 is a utility for downloading files. The supported protocols are aria2 is a utility for downloading files. The supported protocols are
HTTP(S), FTP, BitTorrent, and Metalink. aria2 can download a file from HTTP(S), FTP, SFTP, BitTorrent, and Metalink. aria2 can download a
multiple sources/protocols and tries to utilize your maximum download file from multiple sources/protocols and tries to utilize your maximum
bandwidth. It supports downloading a file from HTTP(S)/FTP and download bandwidth. It supports downloading a file from
BitTorrent at the same time, while the data downloaded from HTTP(S)/FTP/SFTP and BitTorrent at the same time, while the data
HTTP(S)/FTP is uploaded to the BitTorrent swarm. Using Metalink's downloaded from HTTP(S)/FTP/SFTP is uploaded to the BitTorrent
chunk checksums, aria2 automatically validates chunks of data while swarm. Using Metalink's chunk checksums, aria2 automatically validates
downloading a file like BitTorrent. chunks of data while downloading a file like BitTorrent.
The project page is located at http://aria2.sourceforge.net/. The project page is located at http://aria2.sourceforge.net/.

View File

@ -9,17 +9,22 @@ DESCRIPTION
----------- -----------
aria2 is a utility for downloading files. The supported protocols are aria2 is a utility for downloading files. The supported protocols are
HTTP(S), FTP, BitTorrent, and Metalink. aria2 can download a file from HTTP(S), FTP, SFTP, BitTorrent, and Metalink. aria2 can download a
multiple sources/protocols and tries to utilize your maximum download file from multiple sources/protocols and tries to utilize your maximum
bandwidth. It supports downloading a file from HTTP(S)/FTP and download bandwidth. It supports downloading a file from HTTP(S)/FTP
BitTorrent at the same time, while the data downloaded from /SFTP and BitTorrent at the same time, while the data downloaded from
HTTP(S)/FTP is uploaded to the BitTorrent swarm. Using Metalink HTTP(S)/FTP/SFTP is uploaded to the BitTorrent swarm. Using Metalink
chunk checksums, aria2 automatically validates chunks of data while chunk checksums, aria2 automatically validates chunks of data while
downloading a file. downloading a file.
OPTIONS OPTIONS
------- -------
.. note::
Most FTP related options are applicable to SFTP as well.
Some options are not effective against SFTP (e.g., :option:`--ftp-pasv`)
Basic Options Basic Options
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
.. option:: -d, --dir=<DIR> .. option:: -d, --dir=<DIR>
@ -84,8 +89,9 @@ Basic Options
``#checksum``, ``#experimental``, ``#deprecated``, ``#help``, ``#all`` ``#checksum``, ``#experimental``, ``#deprecated``, ``#help``, ``#all``
Default: ``#basic`` Default: ``#basic``
HTTP/FTP Options HTTP/FTP/SFTP Options
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
.. option:: --all-proxy=<PROXY> .. option:: --all-proxy=<PROXY>
Use a proxy server for all protocols. To override a previously Use a proxy server for all protocols. To override a previously
@ -520,8 +526,8 @@ HTTP Specific Options
Set user agent for HTTP(S) downloads. Set user agent for HTTP(S) downloads.
Default: ``aria2/$VERSION``, $VERSION is replaced by package version. Default: ``aria2/$VERSION``, $VERSION is replaced by package version.
FTP Specific Options FTP/SFTP Specific Options
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
.. option:: --ftp-user=<USER> .. option:: --ftp-user=<USER>
Set FTP user. This affects all URIs. Set FTP user. This affects all URIs.
@ -542,6 +548,10 @@ FTP Specific Options
If ``false`` is given, the active mode will be used. If ``false`` is given, the active mode will be used.
Default: ``true`` Default: ``true``
.. note::
This option is ignored for SFTP transfer.
.. option:: --ftp-proxy=<PROXY> .. option:: --ftp-proxy=<PROXY>
Use a proxy server for FTP. To override a previously defined proxy, Use a proxy server for FTP. To override a previously defined proxy,
@ -562,6 +572,10 @@ FTP Specific Options
Set FTP transfer type. TYPE is either ``binary`` or ``ascii``. Set FTP transfer type. TYPE is either ``binary`` or ``ascii``.
Default: ``binary`` Default: ``binary``
.. note::
This option is ignored for SFTP transfer.
.. option:: --ftp-reuse-connection[=true|false] .. option:: --ftp-reuse-connection[=true|false]
Reuse connection in FTP. Reuse connection in FTP.
@ -1587,12 +1601,12 @@ treated as a separate download. Both Metalink4 and Metalink version
3.0 are supported. 3.0 are supported.
You can specify both torrent file with -T option and URIs. By doing 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 this, you can download a file from both torrent swarm and
server at the same time, while the data from HTTP(S)/FTP are uploaded HTTP(S)/FTP/SFTP server at the same time, while the data from
to the torrent swarm. For single file torrents, URI can be a complete HTTP(S)/FTP/SFTP are uploaded to the torrent swarm. For single file
URI pointing to the resource or if URI ends with /, name in torrent torrents, URI can be a complete URI pointing to the resource or if URI
file in torrent is added. For multi-file torrents, name and path are ends with /, name in torrent file in torrent is added. For multi-file
added to form a URI for each file. torrents, name and path are added to form a URI for each file.
.. note:: .. note::
@ -1623,15 +1637,14 @@ occurred. Currently following options are available:
aria2 passes 3 arguments to specified command when it is executed. aria2 passes 3 arguments to specified command when it is executed.
These arguments are: GID, the number of files and file path. For These arguments are: GID, the number of files and file path. For
HTTP, FTP downloads, usually the number of files is 1. BitTorrent HTTP, FTP, and SFTP downloads, usually the number of files is 1.
download can contain multiple files. BitTorrent download can contain multiple files. If number of files is
If number of files is more than one, file path is first one. In more than one, file path is first one. In other words, this is the
other words, this is the value of path key of first struct whose value of path key of first struct whose selected key is true in the
selected key is true in the response of :func:`aria2.getFiles` response of :func:`aria2.getFiles` RPC method. If you want to get all
RPC method. file paths, consider to use JSON-RPC/XML-RPC. Please note that file
If you want to get all file paths, consider to use JSON-RPC/XML-RPC. Please path may change during download in HTTP because of redirection or
note that file path may change during download in HTTP because of Content-Disposition header.
redirection or Content-Disposition header.
Let's see an example of how arguments are passed to command: Let's see an example of how arguments are passed to command:
@ -1835,9 +1848,9 @@ the path ``$HOME/.aria2/dht6.dat``.
Netrc Netrc
~~~~~ ~~~~~
Netrc support is enabled by default for HTTP(S)/FTP. To disable netrc Netrc support is enabled by default for HTTP(S)/FTP/SFTP. To disable
support, specify :option:`--no-netrc <-n>` option. Your .netrc file should have correct netrc support, specify :option:`--no-netrc <-n>` option. Your .netrc
permissions(600). file should have correct permissions(600).
If machine name starts ``.``, aria2 performs domain-match instead of If machine name starts ``.``, aria2 performs domain-match instead of
exact match. This is an extension of aria2. For example of domain exact match. This is an extension of aria2. For example of domain
@ -2164,19 +2177,19 @@ For information on the *secret* parameter, see :ref:`rpc_auth`.
.. function:: aria2.addUri([secret], uris[, options[, position]]) .. function:: aria2.addUri([secret], uris[, options[, position]])
This method adds a new download. *uris* is an array of HTTP/FTP/BitTorrent This method adds a new download. *uris* is an array of
URIs (strings) pointing to the same resource. If you mix URIs pointing to HTTP/FTP/SFTP/BitTorrent URIs (strings) pointing to the same
different resources, then the download may fail or be corrupted without aria2 resource. If you mix URIs pointing to different resources, then the
complaining. download may fail or be corrupted without aria2 complaining. When
When adding BitTorrent Magnet URIs, *uris* must have only one element and it adding BitTorrent Magnet URIs, *uris* must have only one element and
should be BitTorrent Magnet URI. it should be BitTorrent Magnet URI. *options* is a struct and its
*options* is a struct and its members are pairs of option name and value. members are pairs of option name and value. See :ref:`rpc_options`
See :ref:`rpc_options` below for more details. below for more details. If *position* is given, it must be an
If *position* is given, it must be an integer starting from 0. The new integer starting from 0. The new download will be inserted at
download will be inserted at *position* in the waiting queue. If *position* in the waiting queue. If *position* is omitted or
*position* is omitted or *position* is larger than the current size of the *position* is larger than the current size of the queue, the new
queue, the new download is appended to the end of the queue. download is appended to the end of the queue. This method returns
This method returns the GID of the newly registered download. the GID of the newly registered download.
**JSON-RPC Example** **JSON-RPC Example**
@ -2783,9 +2796,9 @@ For information on the *secret* parameter, see :ref:`rpc_auth`.
.. function:: aria2.getServers([secret], gid) .. function:: aria2.getServers([secret], gid)
This method returns currently connected HTTP(S)/FTP servers of the download This method returns currently connected HTTP(S)/FTP/SFTP servers of
denoted by *gid* (string). The response is an array of structs and contains the download denoted by *gid* (string). The response is an array of
the following keys. Values are strings. structs and contains the following keys. Values are strings.
``index`` ``index``
Index of the file, starting at 1, in the same order as files appear in the Index of the file, starting at 1, in the same order as files appear in the