Skip to content
Timothée Mazzucotelli edited this page Oct 26, 2019 · 1 revision

Common knowledge

Add downloads with specific options

While waiting for issue #33 to be implemented, one way to specify options when adding a download is to use a direct call (see aria2p call -h on the command-line).

For example, to specify another output directory and file-name:

aria2p call add_uris --json-params '[["URI"], {"dir": "/PATH/TO/DIR", "out": "MY_NAME"}]'

Of course you must replace URI, /PATH/TO/DIR and MY_NAME with your own values.

If you are using the API class, you can specify options with the options parameters of these methods: add_magnet, add_torrent, add_metalink, and add_uris.

Get the downloads created by a metalink

Using the library:

import time
import aria2p

aria2 = aria2p.API()

# assuming you have enabled the follow-metalink option in aria2 config
metalink_download = aria2.add_uris(["https://domain.com/metalink_url"])
while not metalink_download.is_complete:
    time.sleep(0.5)
    metalink_download.update()

time.sleep(0.5)
children_downloads = metalink_download.followed_by()
# all the downloads generated by the metalink file will be in children_downloads
# if not, give it a bit more time before retrieving them

On the command-line:

aria2p call tellstatus -P MY_DOWNLOAD_GID | jq '.followedBy'

Common knowledge


Advanced examples

  • ⚠️ TODO
Clone this wiki locally