Skip to content

Quick Start

Stephen Cox edited this page Dec 10, 2025 · 2 revisions

Installation

# 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

Basic Configuration

  1. Set qBittorrent Connection

    Edit config/config.yml or set environment variables:

    export QBITTORRENT_HOST="http://localhost:8080"
    export QBITTORRENT_USER="admin"
    export QBITTORRENT_PASS="your_password"
  2. 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)

Your First Rule

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-categorized

What this rule does:

  1. Matches: Torrents with "1080p", "2160p", or "4k" in the name (case-insensitive)
  2. AND: Currently have no category assigned
  3. Actions: Sets category to "movies-hd" and adds tags

Important: Create the "movies-hd" category in qBittorrent first!

Testing Your Setup

Dry-run mode (see what would happen without making changes):

python3 triggers/manual.py --dry-run

Expected 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.py

Other 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 DEBUG

Congratulations! You've created your first automation rule. Continue reading for comprehensive documentation.

🎯 qbt-rules

v0.3.0 | GitHub


📚 Getting Started

📖 Core Concepts

🔧 Configuration

🆘 Help & Support

🤝 Contributing


🆕 What's New (v0.3.0)

  • ✅ Unified CLI (qbt-rules)
  • ✅ Custom triggers
  • ✅ Trigger-agnostic mode
  • ✅ Size operators (50GB)

🔗 Quick Links

Clone this wiki locally