-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
# Clone the repository
git clone https://github.com/andronics/qbittorrent-automation.git
cd qbittorrent-automation
# Install Python dependencies
pip install requests pyyaml
# Copy example configurations
cp config/config.example.yml config/config.yml
cp config/rules.example.yml config/rules.yml-
Set qBittorrent Connection
Edit
config/config.ymlor set environment variables:export QBITTORRENT_HOST="http://localhost:8080" export QBITTORRENT_USER="admin" export QBITTORRENT_PASS="your_password"
-
Enable qBittorrent Web UI
- Open qBittorrent → Tools → Options → Web UI
- Check "Web User Interface (Remote control)"
- Set username and password
- Note the port (default: 8080)
Let's create a simple rule to auto-categorize HD movies.
Edit config/rules.yml:
rules:
- name: "Auto-categorize HD movies"
enabled: true
stop_on_match: false
conditions:
all:
- field: info.name
operator: matches
value: '(?i).*(1080p|2160p|4k).*'
- field: info.category
operator: ==
value: ""
actions:
- type: set_category
params:
category: movies-hd
- type: add_tag
params:
tags:
- hd
- auto-categorizedWhat this rule does:
- Matches: Torrents with "1080p", "2160p", or "4k" in the name (case-insensitive)
- AND: Currently have no category assigned
- Actions: Sets category to "movies-hd" and adds tags
Important: Create the "movies-hd" category in qBittorrent first!
Dry-run mode (see what would happen without making changes):
python3 triggers/manual.py --dry-runExpected output:
2024-12-10 12:00:00 | INFO | Successfully authenticated with qBittorrent
2024-12-10 12:00:00 | INFO | Loaded 1 rules (execute in file order)
2024-12-10 12:00:00 | INFO | Would set_category Movie.2160p.BluRay to movies-hd (params={'category': 'movies-hd'})
2024-12-10 12:00:00 | INFO | Would add_tag Movie.2160p.BluRay (params={'tags': ['hd', 'auto-categorized']})
2024-12-10 12:00:00 | INFO | Rule 'Auto-categorize HD movies' matched 1 torrent(s)
Run for real (remove --dry-run):
python3 triggers/manual.pyOther useful commands:
# Validate rules syntax
python3 triggers/manual.py --validate
# List all enabled rules
python3 triggers/manual.py --list-rules
# Debug with verbose logging
python3 triggers/manual.py --dry-run --log-level DEBUGCongratulations! You've created your first automation rule. Continue reading for comprehensive documentation.
qbt-rules v0.3.0 | Python-based rules engine for qBittorrent automation
GitHub • PyPI • Issues • Discussions • Contributing • License
Requirements: Python 3.8+ • qBittorrent 5.0+
Made with ❤️ by the qbt-rules community | Licensed under MIT
v0.3.0 | GitHub
- ✅ Unified CLI (
qbt-rules) - ✅ Custom triggers
- ✅ Trigger-agnostic mode
- ✅ Size operators (
50GB)