mirror of https://github.com/aria2/aria2
Added Hook Event subsection and described about COMMAND specified in
--on-download-* options. Made all --on-download-* option refer this subsection.pull/1/head
parent
c1a130fdf5
commit
4747c3a2da
|
@ -924,50 +924,45 @@ name.
|
||||||
[[aria2_optref_on_bt_download_complete]]*--on-bt-download-complete*=COMMAND::
|
[[aria2_optref_on_bt_download_complete]]*--on-bt-download-complete*=COMMAND::
|
||||||
|
|
||||||
For BitTorrent, a command specified in *<<aria2_optref_on_download_complete, --on-download-complete>>* is
|
For BitTorrent, a command specified in *<<aria2_optref_on_download_complete, --on-download-complete>>* is
|
||||||
called when download completes and seeding is over. On the other
|
called after download completed and seeding is over. On the other
|
||||||
hand, this option set the command to be executed when download
|
hand, this option set the command to be executed after download
|
||||||
completes but before seeding. See *<<aria2_optref_on_download_start, --on-download-start>>* option for
|
completed but before seeding.
|
||||||
the requirement of COMMAND. Possible Values: '/path/to/command'
|
See *<<_event_hook, Event Hook>>* for more details about COMMAND.
|
||||||
|
Possible Values: '/path/to/command'
|
||||||
|
|
||||||
[[aria2_optref_on_download_complete]]*--on-download-complete*=COMMAND::
|
[[aria2_optref_on_download_complete]]*--on-download-complete*=COMMAND::
|
||||||
|
|
||||||
Set the command to be executed when download completes. See
|
Set the command to be executed after download completed. See
|
||||||
*<<aria2_optref_on_download_start, --on-download-start>>* option for the requirement of COMMAND. See
|
See *<<_event_hook, Event Hook>>* for more details about COMMAND.
|
||||||
also *<<aria2_optref_on_download_stop, --on-download-stop>>* option. Possible Values:
|
See also *<<aria2_optref_on_download_stop, --on-download-stop>>* option.
|
||||||
'/path/to/command'
|
Possible Values: '/path/to/command'
|
||||||
|
|
||||||
[[aria2_optref_on_download_error]]*--on-download-error*=COMMAND::
|
[[aria2_optref_on_download_error]]*--on-download-error*=COMMAND::
|
||||||
|
|
||||||
Set the command to be executed when download aborts due to error.
|
Set the command to be executed after download aborted due to error.
|
||||||
See *<<aria2_optref_on_download_start, --on-download-start>>* option for the requirement of COMMAND.
|
See *<<_event_hook, Event Hook>>* for more details about COMMAND.
|
||||||
See also *<<aria2_optref_on_download_stop, --on-download-stop>>* option. Possible Values:
|
See also *<<aria2_optref_on_download_stop, --on-download-stop>>* option. Possible Values:
|
||||||
'/path/to/command'
|
'/path/to/command'
|
||||||
|
|
||||||
[[aria2_optref_on_download_pause]]*--on-download-pause*=COMMAND::
|
[[aria2_optref_on_download_pause]]*--on-download-pause*=COMMAND::
|
||||||
|
|
||||||
Set the command to be executed when download is paused. See
|
Set the command to be executed after download was paused.
|
||||||
*<<aria2_optref_on_download_start, --on-download-start>>* option for the requirement of COMMAND.
|
See *<<_event_hook, Event Hook>>* for more details about COMMAND.
|
||||||
Possible Values: '/path/to/command'
|
Possible Values: '/path/to/command'
|
||||||
|
|
||||||
[[aria2_optref_on_download_start]]*--on-download-start*=COMMAND::
|
[[aria2_optref_on_download_start]]*--on-download-start*=COMMAND::
|
||||||
|
|
||||||
Set the command to be executed when download starts up. aria2
|
Set the command to be executed after download got started.
|
||||||
passes GID, number of files and file path in this order to COMMAND.
|
See *<<_event_hook, Event Hook>>* for more details about COMMAND.
|
||||||
If number of files is more than one, file path is first one. In
|
Possible Values: '/path/to/command'
|
||||||
other words, this is the value of path key of first struct whose
|
|
||||||
selected key is true in the response of
|
|
||||||
*<<aria2_xmlrpc_aria2_getFiles, aria2.getFiles>>*
|
|
||||||
XML-RPC method. Please note that file path may change during download in
|
|
||||||
HTTP because of redirection or Content-Disposition header. Possible
|
|
||||||
Values: '/path/to/command'
|
|
||||||
|
|
||||||
[[aria2_optref_on_download_stop]]*--on-download-stop*=COMMAND::
|
[[aria2_optref_on_download_stop]]*--on-download-stop*=COMMAND::
|
||||||
|
|
||||||
Set the command to be executed when download stops. You can override
|
Set the command to be executed when download stops. You can override
|
||||||
the command to be executed for particular download result using
|
the command to be executed for particular download result using
|
||||||
*<<aria2_optref_on_download_complete, --on-download-complete>>* and *<<aria2_optref_on_download_error, --on-download-error>>*. If they are
|
*<<aria2_optref_on_download_complete, --on-download-complete>>* and *<<aria2_optref_on_download_error, --on-download-error>>*. If they are
|
||||||
specified, command specified in this option is not executed. See
|
specified, command specified in this option is not executed.
|
||||||
*<<aria2_optref_on_download_start, --on-download-start>>* option for the requirement of COMMAND.
|
See *<<_event_hook, Event Hook>>* for more details about COMMAND.
|
||||||
Possible Values: '/path/to/command'
|
Possible Values: '/path/to/command'
|
||||||
|
|
||||||
[[aria2_optref_summary_interval]]*--summary-interval*=SEC::
|
[[aria2_optref_summary_interval]]*--summary-interval*=SEC::
|
||||||
|
@ -1107,6 +1102,37 @@ If the previous transfer is made by a browser or wget like sequential
|
||||||
download manager, then use -c option to continue the transfer(aria2c
|
download manager, then use -c option to continue the transfer(aria2c
|
||||||
*<<aria2_optref_continue, -c>>* URI).
|
*<<aria2_optref_continue, -c>>* URI).
|
||||||
|
|
||||||
|
Event Hook
|
||||||
|
~~~~~~~~~~
|
||||||
|
|
||||||
|
aria2 provides options to specify arbitrary command after specific event
|
||||||
|
occurred. Currently following options are available:
|
||||||
|
*<<aria2_optref_on_bt_download_complete, --on-bt-download-complete>>*,
|
||||||
|
*<<aria2_optref_on_download_pause, --on-download-pause>>*,
|
||||||
|
*<<aria2_optref_on_download_complete, --on-download-complete>>*.
|
||||||
|
*<<aria2_optref_on_download_start, --on-download-start>>*,
|
||||||
|
*<<aria2_optref_on_download_error, --on-download-error>>*,
|
||||||
|
*<<aria2_optref_on_download_stop, --on-download-stop>>*.
|
||||||
|
|
||||||
|
aria2 passes 3 arguments to specified command when it is executed.
|
||||||
|
These arguments are: GID, the number of files and file path. For
|
||||||
|
HTTP, FTP downloads, usually the number of files is 1. BitTorrent
|
||||||
|
download can contain multiple files.
|
||||||
|
If number of files is more than one, file path is first one. In
|
||||||
|
other words, this is the value of path key of first struct whose
|
||||||
|
selected key is true in the response of
|
||||||
|
*<<aria2_xmlrpc_aria2_getFiles, aria2.getFiles>>*
|
||||||
|
XML-RPC method. Please note that file path may change during download in
|
||||||
|
HTTP because of redirection or Content-Disposition header.
|
||||||
|
|
||||||
|
Let's see an example of how arguments are passed to command.
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
$ cat hook.sh
|
||||||
|
#!/bin/sh
|
||||||
|
echo "Called with [$1] [$2] [$3]"
|
||||||
|
$ aria2c --on-download-complete hook.sh http://example.org/file.iso
|
||||||
|
Called with [1] [1] [/path/to/file.iso]
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
EXIT STATUS
|
EXIT STATUS
|
||||||
-----------
|
-----------
|
||||||
|
|
Loading…
Reference in New Issue