Skip to main content

Command-line tool and library to interact with an aria2c daemon process with JSON-RPC.

Project description


Command-line tool and Python library to interact with an aria2c daemon process through JSON-RPC.


No packaging yet. Clone the repo and install requests with [sudo] pip install requests, or create a dedicated Python virtualenv with Python 3.6.

Usage (as a library)

This library is still a work in progress. Some things listed here might not be implemented yet.

import aria2p

# initialization, these are the default values
aria2 = aria2p.API(

# list downloads
downloads = aria2.get_downloads()

for download in downloads:
    print(, download.download_speed)
# add downloads
magnet_uri = "magnet:?xt=urn:..."

download = aria2.add_magnet(magnet_uri)

Usage (command-line)

For now, the command-line tool can only call methods using the client. More options directly using the API will come later.

./ -m,--method METHOD_NAME [-p,--params PARAMS... | -j,--json-params JSON_STRING]

The METHOD_NAME can be the exact method name, or just the name without the prefix. It is case-insensitive, and dashes and underscores will be removed. The following are all equivalent:

  • aria2.addUri
  • aria2.adduri
  • addUri
  • aria2.ADD-URI
  • add_uri
  • A-d_D-u_R-i (yes it's valid)
  • A---R---I---A---2.a__d__d__u__r__i (I think you got it)
  • and even more ugly forms...


List all available methods. This example uses jq.

$ ./ -m listmethods | jq

List the GIDs (identifiers) of all active downloads. Note that we must give the parameters as a JSON string.

$ ./ -m tellactive -j '[["gid"]]'
[{"gid": "b686cad55029d4df"}, {"gid": "4b39a1ad8fd94e26"}, {"gid": "9d331cc4b287e5df"}, {"gid": "8c9de0df753a5195"}]

Pause a download using its GID. Note that when a single string argument is required, it can be passed directly with -p.

$ ./ -m pause -p b686cad55029d4df

Add a download using magnet URIs. This example uses jq -r to remove the quotation marks around the result.

$ ./ -m adduri -j '[["magnet:?xt=urn:..."]]' | jq -r

Purge download results (remove completed downloads from the list).

$ ./ -m purge_download_result

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aria2p-0.1.2.tar.gz (36.9 kB view hashes)

Uploaded Source

Built Distribution

aria2p-0.1.2-py3-none-any.whl (153.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page