aria2p


Namearia2p JSON
Version 0.12.0 PyPI version JSON
download
home_page
SummaryCommand-line tool and library to interact with an aria2c daemon process with JSON-RPC.
upload_time2024-01-11 18:01:18
maintainer
docs_urlNone
author
requires_python>=3.8
licenseISC
keywords aria2 aria2c aria2-cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!--
IMPORTANT: This file is generated from the template at 'scripts/templates/README.md'.
           Please update the template instead of this file.
-->

# aria2p
[![ci](https://github.com/pawamoy/aria2p/workflows/ci/badge.svg)](https://github.com/pawamoy/aria2p/actions?query=workflow%3Aci)
[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://pawamoy.github.io/aria2p/)
[![pypi version](https://img.shields.io/pypi/v/aria2p.svg)](https://pypi.org/project/aria2p/)
[![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/pawamoy/aria2p)
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#aria2p:gitter.im)

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

![demo](https://user-images.githubusercontent.com/3999221/72664104-41658180-39fa-11ea-838e-022ed29d8c0b.gif)

To avoid confusion:

- [*aria2*][1] is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line.
It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.
- `aria2c` is the name of the command-line executable provided by *aria2*. It can act as a daemon.
- `aria2p` (`p` for Python) is a command-line client that can interact with an `aria2c` daemon.
  It is not an official client. There are other Python packages allowing you to interact with an `aria2c` daemon.
  These other packages do not offer enough usability (in my opinion), this is why I'm developing `aria2p`.

**Purpose**: `aria2c` can run in the foreground, for one-time downloads, or in the background, as a daemon.
This is where `aria2p` intervenes: when an instance of `aria2c` is running in the background,
`aria2p` will be able to communicate with it to add downloads to the queue, remove, pause or resume them, etc.

In order for `aria2p` to be able to communicate with the `aria2c` process, RPC mode must be enabled
with the `--enable-rpc` option of `aria2c`. RPC stands for [Remote Procedure Call][2].
Although `aria2c` supports both JSON-RPC and XML-RPC protocols, `aria2p` **works with JSON only** (not XML).
More information about how to configure `aria2c` to run as a daemon with RPC mode enabled
can be found in the [Configuration section][conf doc] of the documentation.

[conf doc]: https://aria2p.readthedocs.io/en/latest/configuration.html

**Table of contents**

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage as a library](#usage-as-a-library)
- [Usage on the command line](#usage-command-line)
- [Troubleshoot](#troubleshoot)
- [Support](#support)

## Requirements

[*aria2*][1] must be installed. On systems with `apt-get`:

```bash
sudo apt-get install aria2
```

[1]: https://github.com/aria2/aria2
[2]: https://en.wikipedia.org/wiki/Remote_procedure_call

## Installation

With `pip`:

```bash
python3.6 -m pip install aria2p[tui]
```

With [`pipx`](https://github.com/pipxproject/pipx):

```bash
python3.8 -m pip install --user pipx
pipx install aria2p[tui]
```

The `tui` extra is needed for the interactive interface. If you don't need the interface (for example when you are
writing a Python package with a dependency to aria2p), simply install `aria2p` without any extra.

## Usage (as a library)

**This library is still a work in progress. More examples will be added later.
In the meantime, you can read the [Reference section](https://aria2p.readthedocs.io/en/latest/reference.html) on the official documentation.**

```python
import aria2p

# initialization, these are the default values
aria2 = aria2p.API(
    aria2p.Client(
        host="http://localhost",
        port=6800,
        secret=""
    )
)

# list downloads
downloads = aria2.get_downloads()

for download in downloads:
    print(download.name, download.download_speed)

# add downloads
magnet_uri = "magnet:?xt=urn:..."

download = aria2.add_magnet(magnet_uri)
```

## Usage (command-line)

```
usage: aria2p [GLOBAL_OPTS...] COMMAND [COMMAND_OPTS...]

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

Global options:
  -h, --help            Show this help message and exit. Commands also accept
                        the -h/--help option.
  -p PORT, --port PORT  Port to use to connect to the remote server.
  -H HOST, --host HOST  Host address for the remote server.
  -s SECRET, --secret SECRET
                        Secret token to use to connect to the remote server.
  -L {TRACE,DEBUG,INFO,SUCCESS,WARNING,ERROR,CRITICAL}, --log-level {TRACE,DEBUG,INFO,SUCCESS,WARNING,ERROR,CRITICAL}
                        Log level to use
  -P LOG_PATH, --log-path LOG_PATH
                        Log path to use. Can be a directory or a file.
  -T CLIENT_TIMEOUT, --client-timeout CLIENT_TIMEOUT
                        Timeout in seconds for requests to the remote server.
                        Floats supported. Default: 60.0.

Commands:
  
    add                 Add downloads with URIs/Magnets/torrents/Metalinks.
    add-magnets (add-magnet)
                        Add downloads with Magnet URIs.
    add-metalinks (add-metalink)
                        Add downloads with Metalink files.
    add-torrents (add-torrent)
                        Add downloads with torrent files.
    autopurge (autoclear)
                        Automatically purge completed/removed/failed
                        downloads.
    call                Call a remote method through the JSON-RPC client.
    pause (stop)        Pause downloads.
    remove (rm, del, delete)
                        Remove downloads.
    resume (start)      Resume downloads.
    show                Show the download progression.
    top                 Launch the top-like interactive interface.
    listen              Listen to notifications.

```

Calling `aria2p` without any arguments will by default call the `top` command,
which is a console interactive interface.

Commands:


- [`add`](#add)
- [`add-magnets`](#add-magnets)
- [`add-metalinks`](#add-metalinks)
- [`add-torrents`](#add-torrents)
- [`autopurge`](#autopurge)
- [`call`](#call)
- [`listen`](#listen)
- [`pause`](#pause)
- [`remove`](#remove)
- [`resume`](#resume)
- [`show`](#show)
- [`top`](#top)


---

### `add`

```
usage: aria2p add [-h] [-f FROM_FILE] [uris [uris ...]]

Add downloads with URIs/Magnets/torrents/Metalinks.

positional arguments:
  uris                  The URIs/file-paths to add.

optional arguments:
  -h, --help            Show this help message and exit.
  -f FROM_FILE, --from-file FROM_FILE
                        Load URIs from a file.

```



---

### `add-magnets`

```
usage: aria2p add-magnets [-h] [-f FROM_FILE] [uris [uris ...]]

Add downloads with Magnet URIs.

positional arguments:
  uris                  The magnet URIs to add.

optional arguments:
  -h, --help            Show this help message and exit.
  -f FROM_FILE, --from-file FROM_FILE
                        Load URIs from a file.

```



---

### `add-metalinks`

```
usage: aria2p add-metalinks [-h] [-f FROM_FILE]
                            [metalink_files [metalink_files ...]]

Add downloads with Metalink files.

positional arguments:
  metalink_files        The paths to the metalink files.

optional arguments:
  -h, --help            Show this help message and exit.
  -f FROM_FILE, --from-file FROM_FILE
                        Load file paths from a file.

```



---

### `add-torrents`

```
usage: aria2p add-torrents [-h] [-f FROM_FILE]
                           [torrent_files [torrent_files ...]]

Add downloads with torrent files.

positional arguments:
  torrent_files         The paths to the torrent files.

optional arguments:
  -h, --help            Show this help message and exit.
  -f FROM_FILE, --from-file FROM_FILE
                        Load file paths from a file.

```



---

### `autopurge`

```
usage: aria2p autopurge [-h]

Automatically purge completed/removed/failed downloads.

optional arguments:
  -h, --help  Show this help message and exit.

```



---

### `call`

```
usage: aria2p call [-h] [-P PARAMS [PARAMS ...] | -J PARAMS] method

Call a remote method through the JSON-RPC client.

positional arguments:
  method                The method to call (case insensitive). Dashes and
                        underscores will be removed so you can use as many as
                        you want, or none. Prefixes like 'aria2.' or 'system.'
                        are also optional.

optional arguments:
  -h, --help            Show this help message and exit.
  -P PARAMS [PARAMS ...], --params-list PARAMS [PARAMS ...]
                        Parameters as a list of strings.
  -J PARAMS, --json-params PARAMS
                        Parameters as a JSON string. You should always wrap it
                        at least once in an array '[]'.

```

As explained in the help text,
the `method` 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`
- `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...

#### Examples
List all available methods.
*This example uses [`jq`](https://github.com/stedolan/jq).*
```console
$ aria2p call listmethods | jq
[
  "aria2.addUri",
  "aria2.addTorrent",
  "aria2.getPeers",
  "aria2.addMetalink",
  "aria2.remove",
  "aria2.pause",
  "aria2.forcePause",
  "aria2.pauseAll",
  "aria2.forcePauseAll",
  "aria2.unpause",
  "aria2.unpauseAll",
  "aria2.forceRemove",
  "aria2.changePosition",
  "aria2.tellStatus",
  "aria2.getUris",
  "aria2.getFiles",
  "aria2.getServers",
  "aria2.tellActive",
  "aria2.tellWaiting",
  "aria2.tellStopped",
  "aria2.getOption",
  "aria2.changeUri",
  "aria2.changeOption",
  "aria2.getGlobalOption",
  "aria2.changeGlobalOption",
  "aria2.purgeDownloadResult",
  "aria2.removeDownloadResult",
  "aria2.getVersion",
  "aria2.getSessionInfo",
  "aria2.shutdown",
  "aria2.forceShutdown",
  "aria2.getGlobalStat",
  "aria2.saveSession",
  "system.multicall",
  "system.listMethods",
  "system.listNotifications"
]
```

List the GIDs (identifiers) of all active downloads.
*Note that we must give the parameters as a JSON string.*
```console
$ aria2p call 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`.*
```console
$ aria2p call pause -P b686cad55029d4df
"b686cad55029d4df"
```

Add a download using magnet URIs.
*This example uses `jq -r` to remove the quotation marks around the result.*
```console
$ aria2p call adduri -J '[["magnet:?xt=urn:..."]]' | jq -r
4b39a1ad8fd94e26f
```

Purge download results (remove completed downloads from the list).
```console
$ aria2p call purge_download_result
"OK"
```

---

### `listen`

```
usage: aria2p listen [-h] [-c CALLBACKS_MODULE] [-t TIMEOUT]
                     [event_types [event_types ...]]

Listen to notifications.

positional arguments:
  event_types           The types of notifications to process: start, pause,
                        stop, error, complete or btcomplete. Example: aria2p
                        listen error btcomplete. Useful if you want to spawn
                        multiple specialized aria2p listener, for example one
                        for each type of notification, but still want to use
                        only one callback file.

optional arguments:
  -h, --help            Show this help message and exit.
  -c CALLBACKS_MODULE, --callbacks-module CALLBACKS_MODULE
                        Path to the Python module defining your notifications
                        callbacks.
  -t TIMEOUT, --timeout TIMEOUT
                        Timeout in seconds to use when waiting for data over
                        the WebSocket at each iteration. Use small values for
                        faster reactivity when stopping to listen.

```



---

### `pause`

```
usage: aria2p pause [-h] [-a] [-f] [gids [gids ...]]

Pause downloads.

positional arguments:
  gids         The GIDs of the downloads to pause.

optional arguments:
  -h, --help   Show this help message and exit.
  -a, --all    Pause all the downloads.
  -f, --force  Pause without contacting servers first.

```



---

### `remove`

```
usage: aria2p remove [-h] [-a] [-f] [gids [gids ...]]

Remove downloads.

positional arguments:
  gids         The GIDs of the downloads to remove.

optional arguments:
  -h, --help   Show this help message and exit.
  -a, --all    Remove all the downloads.
  -f, --force  Remove without contacting servers first.

```



---

### `resume`

```
usage: aria2p resume [-h] [-a] [gids [gids ...]]

Resume downloads.

positional arguments:
  gids        The GIDs of the downloads to resume.

optional arguments:
  -h, --help  Show this help message and exit.
  -a, --all   Resume all the downloads.

```



---

### `show`

```
usage: aria2p show [-h]

Show the download progression.

optional arguments:
  -h, --help  Show this help message and exit.

```



---

### `top`

```
usage: aria2p top [-h]

Launch the top-like interactive interface.

optional arguments:
  -h, --help  Show this help message and exit.

```




## Troubleshooting

- Error outputs like below when using `aria2p` as a Python library:

  ```
  requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=6800): Max retries exceeded with url: /jsonrpc (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1115b1908>: Failed to establish a new connection: [Errno 61] Connection refused',))
  ```

  Solution: `aria2c` needs to be up and running first.

## Support

To support me as an open-source software author,
consider donating or be a supporter through one of the following platforms

- [GitHub](https://github.com/sponsors/pawamoy)
- [Ko-fi](https://www.ko-fi.com/pawamoy)
- [Liberapay](https://liberapay.com/pawamoy/)
- [Patreon](https://www.patreon.com/pawamoy)
- [Paypal](https://www.paypal.me/pawamoy)

Thank you!
            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "aria2p",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "aria2 aria2c aria2-cli",
    "author": "",
    "author_email": "Timoth\u00e9e Mazzucotelli <pawamoy@pm.me>",
    "download_url": "https://files.pythonhosted.org/packages/fa/07/78b8a14804c8dd607745f36f1265c609e83d076c962d4d9be4b90bde13ea/aria2p-0.12.0.tar.gz",
    "platform": null,
    "description": "<!--\nIMPORTANT: This file is generated from the template at 'scripts/templates/README.md'.\n           Please update the template instead of this file.\n-->\n\n# aria2p\n[![ci](https://github.com/pawamoy/aria2p/workflows/ci/badge.svg)](https://github.com/pawamoy/aria2p/actions?query=workflow%3Aci)\n[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://pawamoy.github.io/aria2p/)\n[![pypi version](https://img.shields.io/pypi/v/aria2p.svg)](https://pypi.org/project/aria2p/)\n[![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/pawamoy/aria2p)\n[![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#aria2p:gitter.im)\n\nCommand-line tool and Python library to interact with an [`aria2c`][1] daemon process through JSON-RPC.\n\n![demo](https://user-images.githubusercontent.com/3999221/72664104-41658180-39fa-11ea-838e-022ed29d8c0b.gif)\n\nTo avoid confusion:\n\n- [*aria2*][1] is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line.\nIt supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.\n- `aria2c` is the name of the command-line executable provided by *aria2*. It can act as a daemon.\n- `aria2p` (`p` for Python) is a command-line client that can interact with an `aria2c` daemon.\n  It is not an official client. There are other Python packages allowing you to interact with an `aria2c` daemon.\n  These other packages do not offer enough usability (in my opinion), this is why I'm developing `aria2p`.\n\n**Purpose**: `aria2c` can run in the foreground, for one-time downloads, or in the background, as a daemon.\nThis is where `aria2p` intervenes: when an instance of `aria2c` is running in the background,\n`aria2p` will be able to communicate with it to add downloads to the queue, remove, pause or resume them, etc.\n\nIn order for `aria2p` to be able to communicate with the `aria2c` process, RPC mode must be enabled\nwith the `--enable-rpc` option of `aria2c`. RPC stands for [Remote Procedure Call][2].\nAlthough `aria2c` supports both JSON-RPC and XML-RPC protocols, `aria2p` **works with JSON only** (not XML).\nMore information about how to configure `aria2c` to run as a daemon with RPC mode enabled\ncan be found in the [Configuration section][conf doc] of the documentation.\n\n[conf doc]: https://aria2p.readthedocs.io/en/latest/configuration.html\n\n**Table of contents**\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage as a library](#usage-as-a-library)\n- [Usage on the command line](#usage-command-line)\n- [Troubleshoot](#troubleshoot)\n- [Support](#support)\n\n## Requirements\n\n[*aria2*][1] must be installed. On systems with `apt-get`:\n\n```bash\nsudo apt-get install aria2\n```\n\n[1]: https://github.com/aria2/aria2\n[2]: https://en.wikipedia.org/wiki/Remote_procedure_call\n\n## Installation\n\nWith `pip`:\n\n```bash\npython3.6 -m pip install aria2p[tui]\n```\n\nWith [`pipx`](https://github.com/pipxproject/pipx):\n\n```bash\npython3.8 -m pip install --user pipx\npipx install aria2p[tui]\n```\n\nThe `tui` extra is needed for the interactive interface. If you don't need the interface (for example when you are\nwriting a Python package with a dependency to aria2p), simply install `aria2p` without any extra.\n\n## Usage (as a library)\n\n**This library is still a work in progress. More examples will be added later.\nIn the meantime, you can read the [Reference section](https://aria2p.readthedocs.io/en/latest/reference.html) on the official documentation.**\n\n```python\nimport aria2p\n\n# initialization, these are the default values\naria2 = aria2p.API(\n    aria2p.Client(\n        host=\"http://localhost\",\n        port=6800,\n        secret=\"\"\n    )\n)\n\n# list downloads\ndownloads = aria2.get_downloads()\n\nfor download in downloads:\n    print(download.name, download.download_speed)\n\n# add downloads\nmagnet_uri = \"magnet:?xt=urn:...\"\n\ndownload = aria2.add_magnet(magnet_uri)\n```\n\n## Usage (command-line)\n\n```\nusage: aria2p [GLOBAL_OPTS...] COMMAND [COMMAND_OPTS...]\n\nCommand-line tool and Python library to interact with an `aria2c` daemon\nprocess through JSON-RPC.\n\nGlobal options:\n  -h, --help            Show this help message and exit. Commands also accept\n                        the -h/--help option.\n  -p PORT, --port PORT  Port to use to connect to the remote server.\n  -H HOST, --host HOST  Host address for the remote server.\n  -s SECRET, --secret SECRET\n                        Secret token to use to connect to the remote server.\n  -L {TRACE,DEBUG,INFO,SUCCESS,WARNING,ERROR,CRITICAL}, --log-level {TRACE,DEBUG,INFO,SUCCESS,WARNING,ERROR,CRITICAL}\n                        Log level to use\n  -P LOG_PATH, --log-path LOG_PATH\n                        Log path to use. Can be a directory or a file.\n  -T CLIENT_TIMEOUT, --client-timeout CLIENT_TIMEOUT\n                        Timeout in seconds for requests to the remote server.\n                        Floats supported. Default: 60.0.\n\nCommands:\n  \n    add                 Add downloads with URIs/Magnets/torrents/Metalinks.\n    add-magnets (add-magnet)\n                        Add downloads with Magnet URIs.\n    add-metalinks (add-metalink)\n                        Add downloads with Metalink files.\n    add-torrents (add-torrent)\n                        Add downloads with torrent files.\n    autopurge (autoclear)\n                        Automatically purge completed/removed/failed\n                        downloads.\n    call                Call a remote method through the JSON-RPC client.\n    pause (stop)        Pause downloads.\n    remove (rm, del, delete)\n                        Remove downloads.\n    resume (start)      Resume downloads.\n    show                Show the download progression.\n    top                 Launch the top-like interactive interface.\n    listen              Listen to notifications.\n\n```\n\nCalling `aria2p` without any arguments will by default call the `top` command,\nwhich is a console interactive interface.\n\nCommands:\n\n\n- [`add`](#add)\n- [`add-magnets`](#add-magnets)\n- [`add-metalinks`](#add-metalinks)\n- [`add-torrents`](#add-torrents)\n- [`autopurge`](#autopurge)\n- [`call`](#call)\n- [`listen`](#listen)\n- [`pause`](#pause)\n- [`remove`](#remove)\n- [`resume`](#resume)\n- [`show`](#show)\n- [`top`](#top)\n\n\n---\n\n### `add`\n\n```\nusage: aria2p add [-h] [-f FROM_FILE] [uris [uris ...]]\n\nAdd downloads with URIs/Magnets/torrents/Metalinks.\n\npositional arguments:\n  uris                  The URIs/file-paths to add.\n\noptional arguments:\n  -h, --help            Show this help message and exit.\n  -f FROM_FILE, --from-file FROM_FILE\n                        Load URIs from a file.\n\n```\n\n\n\n---\n\n### `add-magnets`\n\n```\nusage: aria2p add-magnets [-h] [-f FROM_FILE] [uris [uris ...]]\n\nAdd downloads with Magnet URIs.\n\npositional arguments:\n  uris                  The magnet URIs to add.\n\noptional arguments:\n  -h, --help            Show this help message and exit.\n  -f FROM_FILE, --from-file FROM_FILE\n                        Load URIs from a file.\n\n```\n\n\n\n---\n\n### `add-metalinks`\n\n```\nusage: aria2p add-metalinks [-h] [-f FROM_FILE]\n                            [metalink_files [metalink_files ...]]\n\nAdd downloads with Metalink files.\n\npositional arguments:\n  metalink_files        The paths to the metalink files.\n\noptional arguments:\n  -h, --help            Show this help message and exit.\n  -f FROM_FILE, --from-file FROM_FILE\n                        Load file paths from a file.\n\n```\n\n\n\n---\n\n### `add-torrents`\n\n```\nusage: aria2p add-torrents [-h] [-f FROM_FILE]\n                           [torrent_files [torrent_files ...]]\n\nAdd downloads with torrent files.\n\npositional arguments:\n  torrent_files         The paths to the torrent files.\n\noptional arguments:\n  -h, --help            Show this help message and exit.\n  -f FROM_FILE, --from-file FROM_FILE\n                        Load file paths from a file.\n\n```\n\n\n\n---\n\n### `autopurge`\n\n```\nusage: aria2p autopurge [-h]\n\nAutomatically purge completed/removed/failed downloads.\n\noptional arguments:\n  -h, --help  Show this help message and exit.\n\n```\n\n\n\n---\n\n### `call`\n\n```\nusage: aria2p call [-h] [-P PARAMS [PARAMS ...] | -J PARAMS] method\n\nCall a remote method through the JSON-RPC client.\n\npositional arguments:\n  method                The method to call (case insensitive). Dashes and\n                        underscores will be removed so you can use as many as\n                        you want, or none. Prefixes like 'aria2.' or 'system.'\n                        are also optional.\n\noptional arguments:\n  -h, --help            Show this help message and exit.\n  -P PARAMS [PARAMS ...], --params-list PARAMS [PARAMS ...]\n                        Parameters as a list of strings.\n  -J PARAMS, --json-params PARAMS\n                        Parameters as a JSON string. You should always wrap it\n                        at least once in an array '[]'.\n\n```\n\nAs explained in the help text,\nthe `method` can be the exact method name,\nor just the name without the prefix.\nIt is case-insensitive, and dashes and underscores will be removed.\n\nThe following are all equivalent:\n- `aria2.addUri`\n- `aria2.adduri`\n- `addUri`\n- `ADDURI`\n- `aria2.ADD-URI`\n- `add_uri`\n- `A-d_D-u_R-i` (yes it's valid)\n- `A---R---I---A---2.a__d__d__u__r__i` (I think you got it)\n- and even more ugly forms...\n\n#### Examples\nList all available methods.\n*This example uses [`jq`](https://github.com/stedolan/jq).*\n```console\n$ aria2p call listmethods | jq\n[\n  \"aria2.addUri\",\n  \"aria2.addTorrent\",\n  \"aria2.getPeers\",\n  \"aria2.addMetalink\",\n  \"aria2.remove\",\n  \"aria2.pause\",\n  \"aria2.forcePause\",\n  \"aria2.pauseAll\",\n  \"aria2.forcePauseAll\",\n  \"aria2.unpause\",\n  \"aria2.unpauseAll\",\n  \"aria2.forceRemove\",\n  \"aria2.changePosition\",\n  \"aria2.tellStatus\",\n  \"aria2.getUris\",\n  \"aria2.getFiles\",\n  \"aria2.getServers\",\n  \"aria2.tellActive\",\n  \"aria2.tellWaiting\",\n  \"aria2.tellStopped\",\n  \"aria2.getOption\",\n  \"aria2.changeUri\",\n  \"aria2.changeOption\",\n  \"aria2.getGlobalOption\",\n  \"aria2.changeGlobalOption\",\n  \"aria2.purgeDownloadResult\",\n  \"aria2.removeDownloadResult\",\n  \"aria2.getVersion\",\n  \"aria2.getSessionInfo\",\n  \"aria2.shutdown\",\n  \"aria2.forceShutdown\",\n  \"aria2.getGlobalStat\",\n  \"aria2.saveSession\",\n  \"system.multicall\",\n  \"system.listMethods\",\n  \"system.listNotifications\"\n]\n```\n\nList the GIDs (identifiers) of all active downloads.\n*Note that we must give the parameters as a JSON string.*\n```console\n$ aria2p call tellactive -J '[[\"gid\"]]'\n[{\"gid\": \"b686cad55029d4df\"}, {\"gid\": \"4b39a1ad8fd94e26\"}, {\"gid\": \"9d331cc4b287e5df\"}, {\"gid\": \"8c9de0df753a5195\"}]\n```\n\nPause a download using its GID.\n*Note that when a single string argument is required, it can be passed directly with `-P`.*\n```console\n$ aria2p call pause -P b686cad55029d4df\n\"b686cad55029d4df\"\n```\n\nAdd a download using magnet URIs.\n*This example uses `jq -r` to remove the quotation marks around the result.*\n```console\n$ aria2p call adduri -J '[[\"magnet:?xt=urn:...\"]]' | jq -r\n4b39a1ad8fd94e26f\n```\n\nPurge download results (remove completed downloads from the list).\n```console\n$ aria2p call purge_download_result\n\"OK\"\n```\n\n---\n\n### `listen`\n\n```\nusage: aria2p listen [-h] [-c CALLBACKS_MODULE] [-t TIMEOUT]\n                     [event_types [event_types ...]]\n\nListen to notifications.\n\npositional arguments:\n  event_types           The types of notifications to process: start, pause,\n                        stop, error, complete or btcomplete. Example: aria2p\n                        listen error btcomplete. Useful if you want to spawn\n                        multiple specialized aria2p listener, for example one\n                        for each type of notification, but still want to use\n                        only one callback file.\n\noptional arguments:\n  -h, --help            Show this help message and exit.\n  -c CALLBACKS_MODULE, --callbacks-module CALLBACKS_MODULE\n                        Path to the Python module defining your notifications\n                        callbacks.\n  -t TIMEOUT, --timeout TIMEOUT\n                        Timeout in seconds to use when waiting for data over\n                        the WebSocket at each iteration. Use small values for\n                        faster reactivity when stopping to listen.\n\n```\n\n\n\n---\n\n### `pause`\n\n```\nusage: aria2p pause [-h] [-a] [-f] [gids [gids ...]]\n\nPause downloads.\n\npositional arguments:\n  gids         The GIDs of the downloads to pause.\n\noptional arguments:\n  -h, --help   Show this help message and exit.\n  -a, --all    Pause all the downloads.\n  -f, --force  Pause without contacting servers first.\n\n```\n\n\n\n---\n\n### `remove`\n\n```\nusage: aria2p remove [-h] [-a] [-f] [gids [gids ...]]\n\nRemove downloads.\n\npositional arguments:\n  gids         The GIDs of the downloads to remove.\n\noptional arguments:\n  -h, --help   Show this help message and exit.\n  -a, --all    Remove all the downloads.\n  -f, --force  Remove without contacting servers first.\n\n```\n\n\n\n---\n\n### `resume`\n\n```\nusage: aria2p resume [-h] [-a] [gids [gids ...]]\n\nResume downloads.\n\npositional arguments:\n  gids        The GIDs of the downloads to resume.\n\noptional arguments:\n  -h, --help  Show this help message and exit.\n  -a, --all   Resume all the downloads.\n\n```\n\n\n\n---\n\n### `show`\n\n```\nusage: aria2p show [-h]\n\nShow the download progression.\n\noptional arguments:\n  -h, --help  Show this help message and exit.\n\n```\n\n\n\n---\n\n### `top`\n\n```\nusage: aria2p top [-h]\n\nLaunch the top-like interactive interface.\n\noptional arguments:\n  -h, --help  Show this help message and exit.\n\n```\n\n\n\n\n## Troubleshooting\n\n- Error outputs like below when using `aria2p` as a Python library:\n\n  ```\n  requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=6800): Max retries exceeded with url: /jsonrpc (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1115b1908>: Failed to establish a new connection: [Errno 61] Connection refused',))\n  ```\n\n  Solution: `aria2c` needs to be up and running first.\n\n## Support\n\nTo support me as an open-source software author,\nconsider donating or be a supporter through one of the following platforms\n\n- [GitHub](https://github.com/sponsors/pawamoy)\n- [Ko-fi](https://www.ko-fi.com/pawamoy)\n- [Liberapay](https://liberapay.com/pawamoy/)\n- [Patreon](https://www.patreon.com/pawamoy)\n- [Paypal](https://www.paypal.me/pawamoy)\n\nThank you!",
    "bugtrack_url": null,
    "license": "ISC",
    "summary": "Command-line tool and library to interact with an aria2c daemon process with JSON-RPC.",
    "version": "0.12.0",
    "project_urls": {
        "Changelog": "https://pawamoy.github.io/aria2p/changelog",
        "Discussions": "https://github.com/pawamoy/aria2p/discussions",
        "Documentation": "https://pawamoy.github.io/aria2p",
        "Funding": "https://github.com/sponsors/pawamoy",
        "Gitter": "https://gitter.im/aria2p/community",
        "Homepage": "https://pawamoy.github.io/aria2p",
        "Issues": "https://github.com/pawamoy/aria2p/issues",
        "Repository": "https://github.com/pawamoy/aria2p"
    },
    "split_keywords": [
        "aria2",
        "aria2c",
        "aria2-cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9a56a1ba3e0fe737b9b20a45c10266ab88a0f44e5779fa751a7484259d8845ea",
                "md5": "15f1aab0754986b4e4c74b42f7ed28cc",
                "sha256": "476171257cdd8d74d888bcb983ecba5e9db19c2d8ecf9ef22547f88080b7bea8"
            },
            "downloads": -1,
            "filename": "aria2p-0.12.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "15f1aab0754986b4e4c74b42f7ed28cc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 88014,
            "upload_time": "2024-01-11T18:01:16",
            "upload_time_iso_8601": "2024-01-11T18:01:16.406678Z",
            "url": "https://files.pythonhosted.org/packages/9a/56/a1ba3e0fe737b9b20a45c10266ab88a0f44e5779fa751a7484259d8845ea/aria2p-0.12.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fa0778b8a14804c8dd607745f36f1265c609e83d076c962d4d9be4b90bde13ea",
                "md5": "b59365cb7ff3e21dc1ad891720d079ba",
                "sha256": "ac42d2b67b819994df75c79be461ee6adf71be8616105275bce7e8794372c0b7"
            },
            "downloads": -1,
            "filename": "aria2p-0.12.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b59365cb7ff3e21dc1ad891720d079ba",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 261619,
            "upload_time": "2024-01-11T18:01:18",
            "upload_time_iso_8601": "2024-01-11T18:01:18.731727Z",
            "url": "https://files.pythonhosted.org/packages/fa/07/78b8a14804c8dd607745f36f1265c609e83d076c962d4d9be4b90bde13ea/aria2p-0.12.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-11 18:01:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pawamoy",
    "github_project": "aria2p",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aria2p"
}
        
Elapsed time: 0.16715s