qBittorrent WebUI API
Manage torrents via qBittorrent's WebUI API (v5.0+).
Setup
Config: ~/.openclaw/credentials/qbittorrent/config.json
json
{
"url": "http://localhost:8080",
"username": "admin",
"password": "adminadmin"
}
Quick Reference
List Torrents
bash
./scripts/qbit-api.sh list [--filter downloading] ./scripts/qbit-api.sh list --category movies
Torrent Info
bash
./scripts/qbit-api.sh info <hash> ./scripts/qbit-api.sh files <hash>
Add Torrent
bash
./scripts/qbit-api.sh add "magnet:?xt=..." --category movies ./scripts/qbit-api.sh add "URL" --paused
File Priority
bash
# Set single file priority ./scripts/qbit-api.sh set-file-priority <hash> <file_id> <priority>
Control
bash
./scripts/qbit-api.sh pause <hash|all> ./scripts/qbit-api.sh resume <hash> ./scripts/qbit-api.sh delete <hash> ./scripts/qbit-api.sh add-tags <hash> "tag1,tag2"
File Priority API
Set single file priority:
bash
./scripts/qbit-api.sh set-file-priority <hash> <file_id> <priority>
Priority Values:
| Value | Meaning | Action |
|---|---|---|
| 0 | Skip | Do not download |
| 1 | Normal | Download normally |
| 6 | High | Download first |
File ID: Index from files <hash> output (0-based)
Response Format
Torrent Info
json
{
"hash": "...",
"name": "...",
"state": "downloading",
"progress": 0.45,
"size": 5368709120,
"downloaded": 2415919104,
"dlspeed": 5242880
}
Files List
json
[
{"index": 0, "name": "video.mp4", "size": 4294967296, "priority": 1, "progress": 0.5},
{"index": 1, "name": "sample.mp4", "size": 10485760, "priority": 0, "progress": 0}
]
All Commands
| Command | Description |
|---|---|
list | List torrents |
info <hash> | Get torrent properties |
files <hash> | Get file list |
add <url> | Add torrent by URL |
add-file <path> | Add torrent file |
pause <hash|all> | Pause torrent(s) |
resume <hash|all> | Resume torrent(s) |
delete <hash> | Delete torrent |
recheck <hash> | Recheck files |
set-file-priority <hash> <id> <prio> | Set file priority |
set-category <hash> <cat> | Set category |
add-tags <hash> <tags> | Add tags |
remove-tags <hash> <tags> | Remove tags |
categories | List categories |
tags | List tags |
transfer | Transfer info |
version | App version |
Notes
- •File ID: Use the
indexfield fromfiles <hash>output - •Filtering logic: Should be implemented in calling skill (e.g., nyaa-search)
- •Pause before filter: Add with
--pausedfor cleaner filtering