Skip to main content

"A simple Python script to talk to qBittorrent and Arr's"

Project description

qBitrr

PyPI - License PyPI Downloads Pulls

PyPI - Python Version Platforms

pre-commit.ci status CodeQL Create a Release Update dockerhub

Code Style: Black Imports: isort

A simple script to monitor qBit and communicate with Radarr and Sonarr

Features

  • Monitor qBit for Stalled/bad entries and delete them then blacklist them on Arrs (Option to also trigger a re-search action).
  • Monitor qBit for completed entries and tell the appropriate Arr instance to import it:
    • qbitrr DownloadedMoviesScan for Radarr
    • qbitrr DownloadedEpisodesScan for Sonarr
  • Skip files in qBit entries by extension, folder or regex.
  • Monitor completed folder and clean it up.
  • Usage of ffprobe to ensure downloaded entries are valid media.
  • Trigger periodic Rss Syncs on the appropriate Arr instances.
  • Trigger Queue update on appropriate Arr instances.
  • Search requests from Overseerr or Ombi.
  • Auto add/remove trackers
  • Set per tracker values
  • Sonarr v4 support
  • Radarr v4 and v5 support
  • Available if provided with a Sonarr/Radarr database file:
    • Monitor Arr's databases to trigger missing episode searches.
    • Searches Radarr missing movies based on Minimum Availability
    • Customizable searching by series or singular episodes
    • Optionally searches year by year is ascending or descending order (config option available)

Tested with

Some things to know before using it.

  • qBittorrent >= 4.5.x
  • Sonarr and Radarr both setup to add tags to all downloads.
  • qBit set to create sub-folders for tag.

Usage

Native

  • python -m pip install qBitrr2 (I would recommend in a dedicated venv but that's out of scope.

Alternatively:

Run the script

  1. Activate your venv
  2. Run qBitrr2 to generate a config file
  3. Edit the config file (located at ~/config/config.toml (~ is your current directory)
  4. Run qBitrr2 if installed through pip again to start the script

Alternatively:

  1. Unzip the downloaded release and run it
  2. Run qBitrr to generate a config file
  3. Edit the config file (located at ~/config/config.toml (~ is your current directory)
  4. Run qBitrr if installed through pip again to start the script

How to update the script

  1. Activate your venv
  2. Run python -m pip install -U qBitrr2

Alternatively:

  1. Download on the latest release
  2. Unzip the downloaded release and run it
  3. Run qBitrr to generate a config file
  4. Edit the config file (located at ~/config/config.toml (~ is your current directory)
  5. Run qBitrr if installed through pip again to start the script

There is no auto-update feature, you will need to manually download the latest release and replace the old one.

Docker

Docker Image

  • The docker image can be found here

Docker Run

docker run -d \
  --name=qbitrr \
  -e TZ=Europe/London \
  -e RESTART_TIMER=0 \
  -v /etc/localtime:/etc/localtime:ro \
  -v /path/to/appdata/qbitrr:/config \
  -v /path/to/sonarr/db:/databases/sonarr.db:ro \
  -v /path/to/radarr/db:/databases/radarr.db:ro \
  -v /path/to/completed/downloads/folder:/completed_downloads:rw \
  --restart unless-stopped \
  feramance/qbitrr

Docker Compose

version: "3"
services:
  qbitrr:
    image: feramance/qbitrr
    user: 1000:1000 # Required to ensure teh container is run as the user who has perms to see the 2 mount points and the ability to write to the CompletedDownloadFolder mount
    tty: true # Ensure the output of docker-compose logs qBitrr are properly colored.
    restart: unless-stopped
    # networks: This container MUST share a network with your Sonarr/Radarr instances
    environment:
      - TZ=Europe/London
      - RESTART_TIMER=0 #Number of hours after which to restart the child processes (default=0, set 0 to disable)
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /path/to/appdata/qbitrr:/config  # Config folder for qBitrr
      - /path/to/sonarr/db:/sonarr.db:ro # This is only needed if you want episode search handling :ro means it is only ever mounted as a read-only folder, the script never needs more than read access
      - /path/to/radarr/db:/radarr.db:ro # This is only needed if you want movie search handling, :ro means it is only ever mounted as a read-only folder, the script never needs more than read access
      - /path/to/completed/downloads/folder:/completed_downloads:rw # The script will ALWAYS require write permission in this folder if mounted, this folder is used to monitor completed downloads and if not present will cause the script to ignore downloaded file monitoring.
      # Now just to make sure it is clean, when using this script in a docker you will need to ensure you config.toml values reflect the mounted folders.#
      # For example, for your Sonarr.DatabaseFile value using the values above you'd add
      # DatabaseFile = /sonarr.db/path/in/container/sonarr.db
      # Because this is where you mounted it to
      # The same would apply to Settings.CompletedDownloadFolder
      # e.g CompletedDownloadFolder = /completed_downloads/folder/in/container

    logging: # this script will generate a LOT of logs - so it is up to you to decide how much of it you want to store
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: 3
    depends_on: # Not needed but this ensures qBitrr only starts if the dependencies are up and running
      - qbittorrent
      - radarr-1080p
      - radarr-4k
      - sonarr-1080p
      - sonarr-anime
      - overseerr
      - ombi
Important mentions for docker
  • The script will always expect a completed config.toml file
  • When you first start the container a "config.rename_me.toml" will be added to /path/to/appdata/qbitrr
    • Make sure to rename it to 'config.toml' then edit it to your desired values

Feature Suggestions

Please do not hesitate to open an issue for feature requests or any suggestions you may have. I plan on periodically adding any features I might feel I want to add but welcome to other suggestions I might not have thought of yet.

Reporting an Issue

When reporting an issue, please ensure that log files are enabled while running qBitrr and attach them to the issue. Thank you.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qBitrr2-3.7.16.tar.gz (52.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qBitrr2-3.7.16-py3-none-any.whl (52.4 kB view details)

Uploaded Python 3

File details

Details for the file qBitrr2-3.7.16.tar.gz.

File metadata

  • Download URL: qBitrr2-3.7.16.tar.gz
  • Upload date:
  • Size: 52.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for qBitrr2-3.7.16.tar.gz
Algorithm Hash digest
SHA256 66abefe2ce9cc5b898879a65a70fa56833cbee17a5f750be37e657e07952e31b
MD5 5cd349f3591f230664c4b846e836821a
BLAKE2b-256 684d91a34920d974cf1ac2e028079bcb49551386cdf1da280312b937e61f60c2

See more details on using hashes here.

File details

Details for the file qBitrr2-3.7.16-py3-none-any.whl.

File metadata

  • Download URL: qBitrr2-3.7.16-py3-none-any.whl
  • Upload date:
  • Size: 52.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for qBitrr2-3.7.16-py3-none-any.whl
Algorithm Hash digest
SHA256 f049b3bf8ba7d0bce6ee4da44bd6885ec409be9a95828180e8c35aea126be668
MD5 1c400d303e3473798b65ae81df4a4d6a
BLAKE2b-256 85c69bb73bec51133769849e316fb9d91632aa72649b5897787b04826e75bcba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page