Skip to main content

A CLI tool to interact with aria2c's RPC interface

Project description

Aria2 RPC CLI (a2rpc)

Python Version Tests Status PyPI version fury.io

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/shutdown aria2c RPC 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:

ko-fi

Installation

Prerequisites

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

  1. Create an input file (downloads.txt):
    https://example.com/file1.iso
        dir=/mnt/downloads
    https://example.com/file2.zip
        out=backup.zip
    
  2. 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=..."])

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

a2rpc-0.0.3.tar.gz (48.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a2rpc-0.0.3-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file a2rpc-0.0.3.tar.gz.

File metadata

  • Download URL: a2rpc-0.0.3.tar.gz
  • Upload date:
  • Size: 48.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for a2rpc-0.0.3.tar.gz
Algorithm Hash digest
SHA256 efe669ee4855e09dba28b087178fc159ac867a1ce7c750fd60f922eee3252ed9
MD5 a7891f7eb3db160c68b46d687f607ac8
BLAKE2b-256 472e40b57ecb091e8f21b98b13d9bf6021f15da01dfbb36a3c46def922cd1a36

See more details on using hashes here.

File details

Details for the file a2rpc-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: a2rpc-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for a2rpc-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 19bf793abcdc8b0c23173121254753405bb62d60a739c9b219f8ba5892f91519
MD5 cd7faab4a4fbe913c2c631c89b381ac5
BLAKE2b-256 977120110422653960460f160d6ef3a4af451f3e29f9954573581109f0d9d5e9

See more details on using hashes here.

Supported by

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