askill
qbittorrent

qbittorrentSafety 95Repository

Manage qBittorrent Web UI end-to-end (add, monitor, control torrents)

7 stars
1.2k downloads
Updated 2/8/2026

Package Files

Loading files...
SKILL.md

Credential Check

Before using this skill, verify credentials are configured:

source .env && echo "QB URL: $QB_URL" && echo "User: $QB_USER"

If this shows nothing or errors, guide the user through First-Time Setup below.


Environment Setup

Credentials are stored in .env (gitignored):

QB_URL=http://localhost:8080
QB_USER=admin
QB_PASS=your-password

Torrent Sources (Vanilla)

The tracked, portable template is .opencode/skill/qbittorrent/torrent-sources.example.json.

During setup, copy it to .opencode/skill/qbittorrent/torrent-sources.json (gitignored) and customize it for your environment:

cp .opencode/skill/qbittorrent/torrent-sources.example.json .opencode/skill/qbittorrent/torrent-sources.json

List the configured sources:

jq -r '.sources[] | "\(.name)\t\(.url)\(.searchPath)"' .opencode/skill/qbittorrent/torrent-sources.json

Quick Usage

End-to-end flow

  1. Pick a source from .opencode/skill/qbittorrent/torrent-sources.json (create it from the example if missing) and grab a magnet link or .torrent file from the official page.
  2. Login to the Web API (stores a SID cookie in /tmp/qb.txt).
  3. Add the torrent (magnet or .torrent).
  4. Monitor progress/state until complete.

Login and store session

source .env && curl -s -c /tmp/qb.txt -b /tmp/qb.txt \
  "$QB_URL/api/v2/auth/login" \
  -d "username=$QB_USER&password=$QB_PASS"

Add a magnet link

# IMPORTANT: Must use -F (multipart/form-data), NOT -d!
curl -s -c /tmp/qb.txt -b /tmp/qb.txt \
  "$QB_URL/api/v2/torrents/add" \
  -F "urls=magnet:?xt=urn:btih:HASH&dn=NAME"

Add a .torrent file

curl -s -c /tmp/qb.txt -b /tmp/qb.txt \
  "$QB_URL/api/v2/torrents/add" \
  -F "torrents=@/path/to/file.torrent"

Response meanings:

  • Ok. = Successfully added
  • Fails. = Torrent already exists (duplicate) - NOT an error!

Add with save path and category

curl -s -c /tmp/qb.txt -b /tmp/qb.txt \
  "$QB_URL/api/v2/torrents/add" \
  -F "urls=MAGNET_LINK" \
  -F "savepath=/downloads/movies" \
  -F "category=movies"

List all torrents

curl -s -b /tmp/qb.txt "$QB_URL/api/v2/torrents/info"

Check torrent status by hash

curl -s -b /tmp/qb.txt "$QB_URL/api/v2/torrents/info?hashes=HASH_LOWERCASE"

Latest torrent + completion

curl -s -b /tmp/qb.txt "$QB_URL/api/v2/torrents/info" | jq -r '
  if length==0 then "No torrents"
  else (sort_by(.added_on) | last) as $t
  | "name=\($t.name)\nhash=\($t.hash)\nstate=\($t.state)\nprogress=\($t.progress)\nadded_on=\($t.added_on)\ncompletion_on=\($t.completion_on)\nsave_path=\($t.save_path)"
  end'

Rule of thumb: a torrent is finished when progress is 1 and state is uploading/stoppedUP/pausedUP.


One-liner: Login and add torrent

source .env && \
curl -s -c /tmp/qb.txt "$QB_URL/api/v2/auth/login" -d "username=$QB_USER&password=$QB_PASS" && \
curl -s -b /tmp/qb.txt "$QB_URL/api/v2/torrents/add" -F "urls=MAGNET_LINK_HERE"

Torrent States

StateMeaning
downloadingCurrently downloading
stoppedDLPaused while downloading
uploadingCurrently seeding
stoppedUPCompleted, seeding stopped
stalledDLNo peers available
errorError occurred

Common Gotchas

  • Must use -F not -d for adding torrents (multipart/form-data required)
  • Fails. response = duplicate torrent, not an error
  • Some endpoints (including /api/v2/app/version) may return 403 Forbidden until you authenticate and send the SID cookie
  • Session cookie stored in /tmp/qb.txt - re-login if expired
  • Hash must be lowercase when querying

Manage Torrents

Pause torrent

curl -s -b /tmp/qb.txt -X POST "$QB_URL/api/v2/torrents/pause" \
  -d "hashes=HASH"

Resume torrent

curl -s -b /tmp/qb.txt -X POST "$QB_URL/api/v2/torrents/resume" \
  -d "hashes=HASH"

Delete torrent (keep files)

curl -s -b /tmp/qb.txt -X POST "$QB_URL/api/v2/torrents/delete" \
  -d "hashes=HASH&deleteFiles=false"

Delete torrent and files

curl -s -b /tmp/qb.txt -X POST "$QB_URL/api/v2/torrents/delete" \
  -d "hashes=HASH&deleteFiles=true"

First-Time Setup (If Credentials Missing)

What you need from the user

  1. Web UI URL - Default is http://localhost:8080
  2. Username - Default is admin
  3. Password - Set in qBittorrent preferences
  4. Torrent sources config - Copy the example to a local config (gitignored)
cp .opencode/skill/qbittorrent/torrent-sources.example.json .opencode/skill/qbittorrent/torrent-sources.json

Step 1: Enable Web UI in qBittorrent

Tell the user:

  1. Open qBittorrent
  2. Go to Tools > Options > Web UI
  3. Check "Web User Interface (Remote control)"
  4. Set port (default 8080)
  5. Set username and password
  6. Click OK

Step 2: Add credentials to .env

cat >> .env << 'EOF'
# qBittorrent
QB_URL=http://localhost:8080
QB_USER=admin
QB_PASS=your-password-here
EOF

Step 3: Test it works

source .env && \
curl -s -c /tmp/qb.txt "$QB_URL/api/v2/auth/login" -d "username=$QB_USER&password=$QB_PASS" >/dev/null && \
curl -s -b /tmp/qb.txt "$QB_URL/api/v2/app/version"
# Should return version like "v5.1.2" (some setups return 403 until authenticated)

API Reference

EndpointMethodDescription
/api/v2/auth/loginPOSTLogin (username, password)
/api/v2/torrents/addPOSTAdd torrent (-F urls=magnet)
/api/v2/torrents/infoGETList all torrents
/api/v2/torrents/info?hashes=XGETGet specific torrent
/api/v2/torrents/pausePOSTPause (hashes=X)
/api/v2/torrents/resumePOSTResume (hashes=X)
/api/v2/torrents/deletePOSTDelete (hashes=X, deleteFiles=bool)
/api/v2/app/versionGETGet qBittorrent version

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/11/2026

An exceptionally well-documented skill for managing qBittorrent via its Web API. It provides precise CLI commands, environment setup instructions, state definitions, and common pitfalls, making it highly actionable for an AI agent.

95
100
85
100
100

Metadata

Licenseunknown
Version-
Updated2/8/2026
Publisherbenjaminshafii

Tags

apisecuritytesting