Aria2 RPC CLI (a2rpc)
A lightweight Python CLI tool to interact with aria2c's JSON-RPC interface, designed for scripting and automation.
Features ✨
- 📥 Download Management
Add, pause, resume, or remove downloads via HTTP, Magnet, or torrent links. - 🖥️ Server Control
Start/shutdownaria2cRPC server with custom ports and directories. - 📋 Batch Processing
Queue multiple downloads from input files with per-URL options. - 📊 Real-Time Monitoring
List active/waiting/stopped downloads with debug-friendly output. - 🔒 Secure
Supports RPC secret tokens for authenticated access.
☕ Support
If you find this project helpful, consider supporting me:
Installation
Prerequisites
aria2cinstalled (Download aria2)
Via pip
pip install a2rpc
Manual
git clone https://github.com/jet-logic/a2rpc
cd a2rpc
pip install .
Usage
Basic Commands
| Command | Description | Example |
|---|---|---|
a2rpc start |
Start RPC server | a2rpc start --port 6800 |
a2rpc add <URI> |
Add a download | a2rpc add "magnet:?xt=..." -d ~/dl |
a2rpc list |
List downloads | a2rpc list --debug |
a2rpc pause <GID> |
Pause a download | a2rpc pause abc123 |
a2rpc shutdown |
Shutdown server | a2rpc shutdown --force |
Advanced: Batch Downloads
- Create an input file (
downloads.txt):https://example.com/file1.iso dir=/mnt/downloads https://example.com/file2.zip out=backup.zip - Run:
a2rpc input downloads.txt
Configuration
Global Flags
| Flag | Description | Default |
|---|---|---|
--rpc-url |
RPC server URL | http://localhost:6800/jsonrpc |
--rpc-secret |
Authentication token | None |
Example:
a2rpc --rpc-secret mytoken add "https://example.com/large-file.mp4"
Examples
1. Download with Custom Options
a2rpc add "https://ubuntu.com/24.04.iso" \
--dir ~/Downloads \
--out ubuntu-latest.iso \
-s "max-connection-per-server=16"
2. Debug Active Downloads
a2rpc list --debug # Shows detailed YAML output
3. Automate with Scripts
import subprocess
subprocess.run(["a2rpc", "add", "magnet:?xt=..."])
Release files for a2rpc 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| a2rpc-0.0.3.tar.gz | 48.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| a2rpc-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 82.0 kB
Release files / a2rpc-0.0.3.tar.gz
| Download URL | a2rpc-0.0.3.tar.gz |
|---|---|
| Size | 48.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
efe669ee4855e09dba28b087178fc159ac867a1ce7c750fd60f922eee3252ed9
|
|
BLAKE2b-256 checksum How to use checksums |
472e40b57ecb091e8f21b98b13d9bf6021f15da01dfbb36a3c46def922cd1a36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Release files / a2rpc-0.0.3-py3-none-any.whl
| Download URL | a2rpc-0.0.3-py3-none-any.whl |
|---|---|
| Size | 33.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19bf793abcdc8b0c23173121254753405bb62d60a739c9b219f8ba5892f91519
|
|
BLAKE2b-256 checksum How to use checksums |
977120110422653960460f160d6ef3a4af451f3e29f9954573581109f0d9d5e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|