### Clone Repository and Setup Development Environment Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Contributing.md Clone the qbit_manage repository, checkout the develop branch, create a virtual environment with all dependencies, and activate it. This also installs pre-commit hooks. ```bash git clone https://github.com/StuffAnThings/qbit_manage.git cd qbit_manage git checkout develop make venv source .venv/bin/activate make install-hooks ``` -------------------------------- ### Install qbit-manage from source Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Install qbit-manage after cloning the repository and ensuring uv is installed. This command installs the package from the local source code. ```bash uv tool install . ``` -------------------------------- ### Install qbit-manage using uv tool Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Install the qbit-manage package directly using the uv tool. This is the simplest method for users who have uv installed. ```bash uv tool install qbit-manage ``` -------------------------------- ### Install qbit-manage in development mode Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Install qbit-manage from source with development dependencies. This command is used for contributing to the project and requires activating a virtual environment. ```bash uv venv source .venv/bin/activate # Linux/macOS # .venv\Scripts\activate # Windows uv pip install -e . ``` -------------------------------- ### Install qBit Manage Desktop App on Linux Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Install the qBit Manage desktop application on Linux using dpkg. This command installs the .deb package and then fixes any potential dependency issues. ```bash sudo dpkg -i qBit.Manage_*-desktop-installer.deb sudo apt-get install -f # Fix any dependency issues ``` -------------------------------- ### Example API Call with API Key Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-UI.md This example demonstrates how to make an API call to run a command using an API key for authentication. Ensure you replace 'your_api_key_here' with your actual API key. ```bash curl -H "X-API-Key: your_api_key_here" http://localhost:8181/api/run-command ``` -------------------------------- ### Clone qbit-manage repository Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Clone the qbit-manage source code from GitHub to install from source. This is useful for development or if direct installation is not possible. ```bash git clone https://github.com/StuffAnThings/qbit_manage.git cd qbit_manage ``` -------------------------------- ### New qbit-manage Configuration Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/v4-Migration-Guide.md Example of the new configuration format for qbit-manage (v4.0.0+), using tag-based groups to define share limits. ```yaml cat: movies: "/data/torrents/movies" tv: "/data/torrents/tv" tracker: Tracker-a: tag: a Tracker-b: tag: b Tracker-c: tag: c nohardlinks: - movies - tv share_limits: group1.noHL: priority: 1 include_any_tags: - a - b include_all_tags: - noHL categories: - movies max_ratio: 2 max_seeding_time: 75 cleanup: true group1: priority: 2 include_any_tags: - a - b categories: - movies max_ratio: 5 max_seeding_time: 100 group2.noHL: priority: 3 include_any_tags: - c include_all_tags: - noHL categories: - tv max_ratio: 1 max_seeding_time: 25 group2: priority: 4 include_any_tags: - c categories: - tv max_ratio: max_seeding_time: ``` -------------------------------- ### Run qBit Manage Web Server via Command Line Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md Starts the qBit Manage web server using command-line arguments. Ensure the script is executable and the port is accessible. ```bash python qbit_manage.py --web-server --host 0.0.0.0 --port 8181 ``` -------------------------------- ### Upgrade qbit-manage tool installation Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Upgrade an existing qbit-manage installation managed by uv tool. This command fetches the latest version of the package. ```bash uv tool upgrade qbit-manage ``` -------------------------------- ### Example Curl POST Request to qBit Manage API Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md This example demonstrates how to send a POST request to the qBit Manage API using curl to execute commands. It includes basic JSON payload structure. ```bash curl -X POST http://localhost:8181/api/run-command \ -H "Content-Type: application/json" \ -d '{ "config_file": "config.yml", "commands": ["cat_update", "tag_update"], "hashes": ["a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0"], "dry_run": false, "skip_cleanup": false, "skip_qb_version_check": false, "log_level": "info" }' ``` -------------------------------- ### Old qbit-manage Configuration Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/v4-Migration-Guide.md Example of the previous configuration format for qbit-manage, defining torrent settings based on trackers and hardlink status. ```yaml cat: movies: "/data/torrents/movies" tv: "/data/torrents/tv" tracker: Tracker-a: tag: a max_seeding_time: 100 max_ratio: 5 Tracker-b: tag: b max_seeding_time: 100 max_ratio: 5 Tracker-c: tag: c max_seeding_time: 50 max_ratio: 3 nohardlinks: movies: cleanup: true max_seeding_time: 75 max_ratio: 2 tv: cleanup: true max_seeding_time: 25 max_ratio: 1 ``` -------------------------------- ### POST /api/run-command Request Body Example Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md Defines the structure for sending commands to the qBit Manage API. Specify commands, optional filters like hashes, and execution flags. ```json { "config_file": "config.yml", // Optional, defaults to "config.yml" "commands": ["cat_update", "tag_update"], // Required, list of commands to run "hashes": ["", ""], // Optional, list of torrent hashes to filter by "dry_run": false, // Optional, defaults to false "skip_cleanup": false, // Optional, defaults to false "skip_qb_version_check": false, // Optional, defaults to false "log_level": null // Optional, defaults to null (e.g., "info", "debug", "error") } ``` -------------------------------- ### Build Tauri Desktop Application Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Contributing.md Installs the Tauri CLI and builds the desktop application for the specified platform. Navigate to the Tauri source directory first. ```bash cd desktop/tauri/src-tauri cargo install tauri-cli --version ^2 --locked cargo tauri build --bundles deb # Linux: produces .deb in target/release/bundle/deb/ cargo tauri build --bundles dmg # macOS: produces .dmg cargo tauri build --bundles nsis # Windows: produces installer .exe ``` -------------------------------- ### POST /api/run-command Success Response Example Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md Illustrates a successful API response after executing commands. Includes status, a confirmation message, and detailed results per configuration file. ```json { "status": "success", "message": "Commands executed successfully for all configs", "results": [ { "config_file": "config.yml", "stats": { "executed_commands": ["cat_update", "tag_update"], "categorized": 5, "tagged": 10 } } ] } ``` -------------------------------- ### POST /api/run-command Error Response Example Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md Example of an error response from the API, containing a 'detail' field with the error message. ```json { "detail": "Error message" } ``` -------------------------------- ### Update qbit-manage development installation Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Update qbit-manage when installed from source for development. This involves pulling the latest changes from git and reinstalling the package in development mode. ```bash cd qbit_manage git pull uv pip install -e . --upgrade ``` -------------------------------- ### Install qbit_manage Python Package via User Script Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Unraid-Installation.md This bash script installs the required Python packages for qbit_manage using pip. Ensure the path to the qbit_manage source code is correct. ```bash #!/bin/bash echo "Installing required packages" python3 -m pip install /mnt/user/data/scripts/qbit/ echo "Required packages installed" ``` -------------------------------- ### Install uv package manager Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Installs the 'uv' package manager using a curl script. This is a prerequisite for installing Python packages with uv. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Build Standalone Binary with PyInstaller Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Contributing.md Build a standalone executable for qbit-manage using PyInstaller. Ensure the virtual environment is activated and PyInstaller is installed. Note platform-specific path separators for --add-data. ```bash source .venv/bin/activate pip install pyinstaller pyinstaller --noconfirm --clean --onefile \ --name qbit-manage \ --add-data "web-ui:web-ui" \ --add-data "config/config.yml.sample:config" \ --add-data "icons/qbm_logo.png:." \ --add-data "VERSION:." \ --add-data "docs:docs" \ qbit_manage.py ./dist/qbit-manage --help ``` -------------------------------- ### qBittorrent External Program Script Example Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md A bash script designed to be executed by qBittorrent after a torrent is added or finished. It sends the torrent hash to the qBit Manage API to trigger specific commands. ```bash #!/bin/bash # run_qbit_manage_commands.sh # # Sends a POST request to qBit Manage with a given torrent hash to trigger # actions like "tag_update" and "share_limits". # # USAGE: # ./run_qbit_manage_commands.sh # # EXAMPLE: # ./run_qbit_manage_commands.sh 123ABC456DEF789XYZ # # NOTES: # - Make sure this script is executable: chmod +x run_qbit_manage_commands.sh # - The torrent hash is typically passed in automatically by qBittorrent via the "%I" variable. # - All output is logged to run_qbit_manage_commands.log in the same directory as the script, ``` -------------------------------- ### POST /api/run-command Queued Response Example Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md Shows the response when a scheduled run is in progress and the request is queued. Indicates the status, message, and the requested commands. ```json { "status": "queued", "message": "Scheduled run in progress. Request queued.", "config_file": "config.yml", "commands": ["cat_update", "tag_update"] } ``` -------------------------------- ### Curl POST Request with Basic Authentication Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md This example demonstrates how to authenticate your curl request to the qBit Manage API using basic username and password authentication. ```bash curl -X POST http://localhost:8181/api/run-command \ -u "username:password" \ -H "Content-Type: application/json" \ -d '{ "config_file": "config.yml", "commands": ["cat_update", "tag_update"], "hashes": ["a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0"], "dry_run": false, "skip_cleanup": false, "skip_qb_version_check": false, "log_level": "info" }' ``` -------------------------------- ### Curl POST Request with API Key Authentication Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md This example shows how to authenticate your curl request to the qBit Manage API using an API key in the request headers. ```bash curl -X POST http://localhost:8181/api/run-command \ -H "Content-Type: application/json" \ -H "X-API-Key: your_api_key_here" \ -d '{ "config_file": "config.yml", "commands": ["cat_update", "tag_update"], "hashes": ["a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0"], "dry_run": false, "skip_cleanup": false, "skip_qb_version_check": false, "log_level": "info" }' ``` -------------------------------- ### Python Requests POST with Basic Authentication Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md This example shows how to authenticate a Python requests POST call to the qBit Manage API using basic HTTP authentication with a username and password. ```python import requests from requests.auth import HTTPBasicAuth response = requests.post( "http://localhost:8181/api/run-command", auth=HTTPBasicAuth("username", "password"), json={ "config_file": "config.yml", "commands": ["cat_update", "tag_update"], "hashes": ["a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0"], "dry_run": False, "skip_cleanup": False, "skip_qb_version_check": False, "log_level": "info" } ) print(response.json()) ``` -------------------------------- ### Python Requests POST with API Key Authentication Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md This example demonstrates how to authenticate a Python requests POST call to the qBit Manage API using an API key in the request headers. ```python import requests headers = {"X-API-Key": "your_api_key_here"} response = requests.post( "http://localhost:8181/api/run-command", headers=headers, json={ "config_file": "config.yml", "commands": ["cat_update", "tag_update"], "hashes": ["a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0"], "dry_run": False, "skip_cleanup": False, "skip_qb_version_check": False, "log_level": "info" } ) print(response.json()) ``` -------------------------------- ### API Request Example with Multiple Commands and Dry Run Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md Demonstrates an API request body specifying multiple commands to be executed with the 'dry_run' option enabled. This is useful for testing command configurations without making changes. ```json { "config_file": "config.yml", "commands": ["cat_update", "tag_update", "share_limits"], "dry_run": true } ``` -------------------------------- ### Python Requests POST Request to qBit Manage API Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md This example shows how to send a POST request to the qBit Manage API using the Python requests library. It includes the JSON payload for executing commands. ```python import requests response = requests.post( "http://localhost:8181/api/run-command", json={ "config_file": "config.yml", "commands": ["cat_update", "tag_update"], "hashes": ["a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0"], "dry_run": False, "skip_cleanup": False, "skip_qb_version_check": False, "log_level": "info" } ) print(response.json()) ``` -------------------------------- ### Run qbit-manage with different options Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Demonstrates various command-line options for running qbit-manage, including showing help, running once, and enabling/disabling the web UI. ```bash qbit-manage --help qbit-manage --run qbit-manage --web-server qbit-manage --web-server=False ``` -------------------------------- ### Display Help Menu Source: https://github.com/stuffanthings/qbit_manage/blob/master/README.md Run this command in an interactive terminal to see all available commands and options for the qbit_manage script. ```bash python qbit_manage.py -h ``` -------------------------------- ### Configure qbit-manage host and base URL via CLI Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Customize the bind address using --host and add a URL path prefix with --base-url when launching qbit-manage via the CLI. These options are lower priority than environment variables. ```bash ./qbit-manage --port 9090 --host 127.0.0.1 --base-url /qbm ``` -------------------------------- ### Install Tauri Build Dependencies on Linux Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Contributing.md Installs system packages required for building Tauri applications on Debian/Ubuntu-based Linux distributions. Requires root privileges. ```bash sudo make tauri-deps ``` -------------------------------- ### Run Standalone Binary on Windows Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Execute the qbit-manage standalone binary on Windows to check its help options. Ensure the executable is in your PATH or run it from its directory. ```cmd qbit-manage-windows-amd64.exe --help ``` -------------------------------- ### Build Docker Image Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Contributing.md Builds a Docker image for qbit-manage using the provided Dockerfile. This command assumes you are in the project's root directory. ```bash docker build -t qbit-manage . ``` -------------------------------- ### Run Start Notification Webhook Payload Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Config-Setup.md This payload is sent at the beginning of every run. It contains information about the run's status, including start time, dry-run status, commands to be executed, and execution options. ```yaml { "function": "run_start", ? // Webhook Trigger keyword "title" : str, ? // Title of the Payload "body" : str, ? // Message of the Payload "start_time" : str, ? // Time Run is started Format "YYYY-mm-dd HH:MM:SS" "dry_run" : bool, ? // Dry-Run "web_api_used" : bool, ? // Indicates whether the run was initiated via the Web API (true) or not (false). "commands" : list, ? // List of commands that that will be ran "execution_options" : list // List of eecution options selected } ``` -------------------------------- ### Project Structure Source: https://github.com/stuffanthings/qbit_manage/blob/master/web-ui/README.md Overview of the directory structure for the qBit Manage Web UI project. ```tree web-ui/ ├── css/ # Stylesheets │ ├── components/ # Component-specific styles │ ├── main.css # Global styles │ ├── responsive.css # Responsive layouts │ └── themes.css # Theme definitions ├── img/ # Application images and icons ├── js/ # Application logic │ ├── api.js # Backend communication │ ├── app.js # Main application │ ├── components/ # UI components │ ├── config-schemas/ # Configuration schemas │ └── utils/ # Helper functions └── index.html # Application entry point ``` -------------------------------- ### Run qBit Manage Web Server via Docker Compose Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md Configures and runs qBit Manage as a Docker container, enabling the web server and mapping ports. Environment variables control host, port, and server enablement. ```yaml version: "3" services: qbit_manage: image: bobokun/qbit_manage:latest container_name: qbit_manage environment: - QBT_WEB_SERVER=true # Enable web server (set to false to disable) - QBT_HOST=0.0.0.0 # Set web server host - QBT_PORT=8181 # Set web server port ports: - "8181:8181" # Map container port to host volumes: - /path/to/config:/config ``` -------------------------------- ### Prepare Tauri Desktop App Build Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Contributing.md Copies the built standalone binary into the Tauri sidecar directory with the correct platform-specific naming convention. Ensure you copy only the binary for your target architecture. ```bash mkdir -p desktop/tauri/src-tauri/bin # Copy only YOUR platform's binary (pick one): cp dist/qbit-manage desktop/tauri/src-tauri/bin/qbit-manage-linux-amd64 # x86_64 Linux # cp dist/qbit-manage desktop/tauri/src-tauri/bin/qbit-manage-linux-arm64 # ARM64 Linux # cp dist/qbit-manage desktop/tauri/src-tauri/bin/qbit-manage-macos-arm64 # Apple Silicon # cp dist/qbit-manage desktop/tauri/src-tauri/bin/qbit-manage-macos-x86_64 # Intel Mac chmod +x desktop/tauri/src-tauri/bin/qbit-manage-* ``` -------------------------------- ### Customize qbit-manage port for Desktop App (macOS/Linux) Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Launch the qbit-manage macOS/Linux desktop application from the Terminal with custom arguments like --port. Alternatively, create a shell alias for convenience. ```bash open -a "qBit Manage" --args --port 9090 ``` -------------------------------- ### Example Error Response for Invalid Command Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md This JSON object illustrates the typical error response when an invalid command is submitted to the API. It includes a 'detail' field specifying the invalid command. ```json { "detail": "Invalid command: invalid_command" } ``` -------------------------------- ### Access qbit_manage Web UI Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Unraid-Installation.md Access the Web UI for qbit_manage if the web server is enabled. Replace [UNRAID-IP] with your Unraid server's IP address. ```bash http://[UNRAID-IP]:8181 ``` -------------------------------- ### POST /api/run-command Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md Executes qBit Manage commands via HTTP POST requests. This endpoint allows for remote triggering of various management tasks on your torrents. ```APIDOC ## POST /api/run-command ### Description Execute qBit Manage commands via the API. ### Method POST ### Endpoint /api/run-command ### Parameters #### Request Body - **config_file** (string) - Optional - Defaults to "config.yml" - **commands** (array of strings) - Required - List of commands to run - **hashes** (array of strings) - Optional - List of torrent hashes to filter by - **dry_run** (boolean) - Optional - Defaults to false - **skip_cleanup** (boolean) - Optional - Defaults to false - **skip_qb_version_check** (boolean) - Optional - Defaults to false - **log_level** (string) - Optional - Defaults to null (e.g., "info", "debug", "error") ### Request Example ```json { "config_file": "config.yml", "commands": ["cat_update", "tag_update"], "hashes": ["", ""], "dry_run": false, "skip_cleanup": false, "skip_qb_version_check": false, "log_level": null } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success status. - **message** (string) - Confirmation message. - **results** (array of objects) - Contains results for each config file processed. - **config_file** (string) - The config file used. - **stats** (object) - Statistics about the executed commands. - **executed_commands** (array of strings) - List of commands that were executed. - **categorized** (integer) - Number of items categorized. - **tagged** (integer) - Number of items tagged. #### Queued Response (200) - **status** (string) - Indicates queued status. - **message** (string) - Message indicating the run is in progress. - **config_file** (string) - The config file being processed. - **commands** (array of strings) - List of commands that were queued. #### Error Response (e.g., 400, 500) - **detail** (string) - Error message describing the issue. ``` -------------------------------- ### Prepare Standalone Binary on macOS Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Remove the quarantine attribute and make the downloaded macOS standalone binary executable. This prepares the binary for use and allows it to be moved to your PATH. ```bash xattr -cr qbit-manage-macos * chmod +x qbit-manage-macos * ``` -------------------------------- ### Bash Script for qBit Manage API Commands Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md This script automates sending commands to the qBit Manage API. It takes a torrent hash as an argument and logs the API call details and response. Ensure the script is executable and configured in qBittorrent's download settings. ```bash set -euo pipefail API_URL="http://qbit_manage:8181/api/run-command" COMMANDS='["tag_update", "share_limits"]' if [[ $# -lt 1 || -z "$1" ]]; then echo "Usage: $0 " >&2 exit 1 fi TORRENT_HASH="$1" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" LOG_FILE="${SCRIPT_DIR}/run_qbit_manage_commands.log" JSON="{"commands":${COMMANDS},"hashes":["${TORRENT_HASH}"]}" { echo "Sending API call for hash: ${TORRENT_HASH}" echo "Payload: ${JSON}" } | tee -a "${LOG_FILE}" if curl -fsSL -X POST \ -H "Content-Type: application/json" \ -d "${JSON}" \ "${API_URL}" | tee -a "${LOG_FILE}"; then echo "Success" | tee -a "${LOG_FILE}" else echo "Error: qBit Manage API call failed for hash ${TORRENT_HASH}" | tee -a "${LOG_FILE}" fi ``` -------------------------------- ### POST /api/run-command Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Web-API.md Executes specified commands on torrents via the qBit Manage API. This endpoint allows for batch command execution and supports various configuration options. ```APIDOC ## POST /api/run-command ### Description Executes specified commands on torrents. This endpoint allows for batch command execution and supports various configuration options. ### Method POST ### Endpoint http://qbit_manage:8181/api/run-command ### Parameters #### Request Body - **config_file** (string) - Optional - Path to a configuration file. - **commands** (array of strings) - Required - A list of commands to execute. - **hashes** (array of strings) - Required - A list of torrent hashes to apply the commands to. - **dry_run** (boolean) - Optional - If true, simulates command execution without making changes. - **skip_cleanup** (boolean) - Optional - If true, skips cleanup operations. - **skip_qb_version_check** (boolean) - Optional - If true, skips the qBittorrent version check. - **log_level** (string) - Optional - Sets the logging level (e.g., "info"). ### Request Example ```json { "config_file": "config.yml", "commands": ["cat_update", "tag_update"], "hashes": ["a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0"], "dry_run": false, "skip_cleanup": false, "skip_qb_version_check": false, "log_level": "info" } ``` ### Response #### Success Response (200) - The response structure for a successful execution is not explicitly defined in the provided text, but it is expected to indicate the outcome of the command execution. #### Response Example (No specific success response example provided in the source text.) ### Authentication - API Key: `X-API-Key: your_api_key_here` - Basic Authentication: `username:password` ``` -------------------------------- ### Run edit_passkey.py Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Standalone-Scripts.md Execute the script to update passkeys for torrents from a specific tracker. Ensure qBittorrent connection details and tracker information are correctly configured in the script. ```bash python scripts/edit_passkey.py ``` -------------------------------- ### JavaScript for Tauri Client-Server Communication Source: https://github.com/stuffanthings/qbit_manage/blob/master/desktop/tauri/src/index.html Initializes the qBit Manage application by logging a loading message and setting up event listeners for server logs and app configuration updates from the Tauri backend. It also periodically updates a status message on the UI. ```javascript console.log('qBit Manage loading...'); if (window.__TAURI__) { const { listen } = window.__TAURI__.event; listen('server-log', (event) => { console.log('Server log:', event.payload); }); listen('app-config', (event) => { console.log('App config:', event.payload); }); } const statusMessages = [ 'Starting server...', 'Initializing qbit_manage...', 'Almost ready...' ]; let currentStatus = 0; setInterval(() => { const statusEl = document.getElementById('status'); if (statusEl && currentStatus < statusMessages.length - 1) { currentStatus++; statusEl.textContent = statusMessages[currentStatus]; } }, 2000); ``` -------------------------------- ### Run edit_tracker.py Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Standalone-Scripts.md Execute the script to change tracker URLs for torrents in qBittorrent. Provide the old and new tracker URLs, along with qBittorrent connection details, within the script. ```bash python scripts/edit_tracker.py ``` -------------------------------- ### Run qbit_manage via User Script Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Unraid-Installation.md This bash script executes the qbit_manage Python application. It specifies the configuration directory, log file, and enables the run mode. Consider using the `--dry-run` flag for initial testing. ```bash #!/bin/bash echo "Running qBitTorrent Management" python3 /mnt/user/data/scripts/qbit/qbit_manage.py \ --config-dir /mnt/user/data/scripts/qbit/ \ --log-file /mnt/user/data/scripts/qbit/activity.log \ --run echo "qBitTorrent Management Completed" ``` -------------------------------- ### Run Standalone Binary on Linux Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Execute the standalone binary on Linux to check its help options. Ensure the binary is in your PATH or run it from its current directory. ```bash ./qbit-manage-linux-amd64 --help ``` -------------------------------- ### Customize qbit-manage port for Desktop App (Windows) Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Modify the shortcut's Target field to append the --port flag for the Windows desktop application. This allows customizing the web server port when launching the app. ```bash qbit-manage-windows-amd64.exe --port 9090 ``` -------------------------------- ### Run Standalone Binary on macOS Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Execute the standalone binary on macOS after preparing it. This command shows the help options for the binary. ```bash ./qbit-manage-macos-* --help ``` -------------------------------- ### Docker Compose Configuration for qbit_manage Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Docker-Installation.md This Docker Compose file defines a service for qbit_manage, including volume mappings for configuration, torrent data, and qbittorrent data, as well as environment variables for API and scheduler settings. ```yaml version: "3.7" services: qbit_manage: container_name: qbit_manage image: ghcr.io/stuffanthings/qbit_manage:latest volumes: - /mnt/user/appdata/qbit_manage/:/config:rw - /mnt/user/data/torrents/:/data/torrents:rw - /mnt/user/appdata/qbittorrent/:/qbittorrent/:ro ports: - "8181:8181" # Web API port (when enabled) environment: # Web API Configuration - QBT_WEB_SERVER=true # Set to true to enable web API and web UI - QBT_PORT=8181 # Web API port (default: 8181) # Scheduler Configuration - QBT_RUN=false - QBT_SCHEDULE=1440 - QBT_CONFIG_DIR=/config - QBT_LOGFILE=qbit_manage.log # Command Flags - QBT_RECHECK=false - QBT_CAT_UPDATE=false - QBT_TAG_UPDATE=false - QBT_REM_UNREGISTERED=false - QBT_REM_ORPHANED=false - QBT_TAG_TRACKER_ERROR=false - QBT_TAG_NOHARDLINKS=false - QBT_SHARE_LIMITS=false - QBT_SKIP_CLEANUP=false - QBT_DRY_RUN=false - QBT_STARTUP_DELAY=0 - QBT_SKIP_QB_VERSION_CHECK=false - QBT_DEBUG=false - QBT_TRACE=false # Logging Configuration - QBT_LOG_LEVEL=INFO - QBT_LOG_SIZE=10 - QBT_LOG_COUNT=5 - QBT_DIVIDER== - QBT_WIDTH=100 restart: on-failure:2 ``` -------------------------------- ### Run qbit_manage Docker Container Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Docker-Installation.md This command runs the qbit_manage Docker image. It mounts a local configuration directory to the container's /config volume for persistent storage and specifies the image to use. ```bash docker run -it -v :/config:rw ghcr.io/stuffanthings/qbit_manage:latest ``` -------------------------------- ### Move Standalone Binary to PATH on macOS Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Move the prepared macOS standalone binary to the /usr/local/bin directory, making it accessible system-wide. This allows you to run 'qbit-manage' from any terminal location. ```bash sudo mv qbit-manage-macos-* /usr/local/bin/qbit-manage ``` -------------------------------- ### API Sequence Diagram Source: https://github.com/stuffanthings/qbit_manage/blob/master/web-ui/README.md Illustrates the communication flow between the Web UI, FastAPI Backend, and qBit Manage. ```mermaid sequenceDiagram participant UI as Web UI participant API as FastAPI Backend participant QBM as qBit Manage UI->>API: HTTP Request (GET/POST) API->>QBM: Process Configuration QBM-->>API: YAML Validation API-->>UI: Response with Status ``` -------------------------------- ### Move Standalone Binary to PATH on Linux Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Move the Linux standalone binary to the /usr/local/bin directory, making it accessible system-wide. This allows you to run 'qbit-manage' from any terminal location. ```bash sudo mv qbit-manage-linux-amd64 /usr/local/bin/qbit-manage ``` -------------------------------- ### Update README Version Information Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Standalone-Scripts.md Updates the SUPPORTED_VERSIONS.json file with the latest qBittorrent and qbittorrent-api versions. Typically used in CI/CD pipelines or pre-commit hooks. ```bash python scripts/update-readme-version.py ``` -------------------------------- ### Make Standalone Binary Executable on Linux Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Grant execute permissions to the downloaded Linux standalone binary. This step is necessary before you can run the binary. ```bash chmod +x qbit-manage-linux-amd64 ``` -------------------------------- ### Run delete_torrents_on_low_disk_space.py Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Standalone-Scripts.md Execute the script to automatically delete torrents when drive space is low. Configure deletion criteria like minimum age, share ratio, and free space thresholds within the script. ```bash python scripts/delete_torrents_on_low_disk_space.py ``` -------------------------------- ### CSS for qBit Manage Theming Source: https://github.com/stuffanthings/qbit_manage/blob/master/desktop/tauri/src/index.html Defines CSS custom properties for theming, supporting both dark and light modes based on system preferences. It also includes styles for body, container, logo, headings, spinner, and status elements. ```css :root { --bg-primary: #0f172a; --bg-secondary: #1e293b; --text-primary: #f9fafb; --text-secondary: #d1d5db; --primary-color: #3b82f6; --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; } @media (prefers-color-scheme: light) { :root { --bg-primary: #ffffff; --bg-secondary: #f8fafc; --text-primary: #1e293b; --text-secondary: #64748b; } } body { margin: 0; padding: 0; font-family: var(--font-family); background-color: var(--bg-primary); display: flex; justify-content: center; align-items: center; height: 100vh; color: var(--text-primary); transition: background-color 0.25s ease-in-out, color 0.25s ease-in-out; } .container { text-align: center; padding: 2rem; } .logo { width: 120px; height: 120px; margin: 0 auto 2rem; display: flex; align-items: center; justify-content: center; } .logo img { width: 100%; height: 100%; object-fit: contain; } h1 { font-size: 2rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-primary); } .spinner { width: 40px; height: 40px; border: 4px solid rgba(59, 130, 246, 0.2); border-top: 4px solid var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; margin: 1rem auto; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .status { margin-top: 1rem; color: var(--text-secondary); font-size: 0.875rem; } ``` -------------------------------- ### Set qbit-manage port using CLI flag Source: https://github.com/stuffanthings/qbit_manage/blob/master/docs/Installation.md Change the web server port for qbit-manage by passing the --port or -p flag directly when launching the binary. This method is lower priority than environment variables. ```bash # Linux / macOS ./qbit-manage --port 9090 # Windows Command Prompt qbit-manage-windows-amd64.exe --port 9090 # Windows PowerShell . qbit-manage-windows-amd64.exe --port 9090 ```