ManiMatter / decluttarr

Watches radarr, sonarr, lidarr, readarr and whisparr download queues and removes downloads if they become stalled or no longer needed.
GNU General Public License v3.0
99 stars 15 forks source link
amd64 arm64 blocked cleaner cleanup download lidarr qbittorrent queue radarr readarr remove sonarr stalled stuck torrent whisparr

Like this app? Thanks for giving it a ⭐️

Decluttarr

Table of contents

Overview

Decluttarr keeps the radarr & sonarr & lidarr & readarr & whisparr queue free of stalled / redundant downloads

Feature overview:

You may run this locally by launching main.py, or by pulling the docker image. You can find a sample docker-compose.yml in the docker folder.

Dependencies & Hints & FAQ

Getting started

There's two ways to run this:

Both ways are explained below and there's an explanation for the different settings below that

Method 1: Docker

1) Make a docker-compose.yml file 2) Use the following as a base for that and tweak the settings to your needs

version: "3.3"
services:
  decluttarr:
    image: ghcr.io/manimatter/decluttarr:latest
    container_name: decluttarr
    restart: always
    environment:
      - TZ=Europe/Zurich
      - PUID=1000
      - PGID=1000
      ## General
      - LOG_LEVEL=INFO
      #- TEST_RUN=True
      #- SSL_VERIFICATION=False
      ## Features 
      - REMOVE_TIMER=10
      - REMOVE_FAILED=True
      - REMOVE_FAILED_IMPORTS=True
      - REMOVE_METADATA_MISSING=True
      - REMOVE_MISSING_FILES=True     
      - REMOVE_ORPHANS=True
      - REMOVE_SLOW=True
      - REMOVE_STALLED=True
      - REMOVE_UNMONITORED=True
      - MIN_DOWNLOAD_SPEED=100
      - PERMITTED_ATTEMPTS=3
      - NO_STALLED_REMOVAL_QBIT_TAG=Don't Kill
      - IGNORE_PRIVATE_TRACKERS=True
      - FAILED_IMPORT_MESSAGE_PATTERNS=["Not an upgrade for existing", "Not a Custom Format upgrade for existing"]
      ## Radarr
      - RADARR_URL=http://radarr:7878
      - RADARR_KEY=$RADARR_API_KEY
      ## Sonarr
      - SONARR_URL=http://sonarr:8989
      - SONARR_KEY=$SONARR_API_KEY
      ## Lidarr
      - LIDARR_URL=http://lidarr:8686
      - LIDARR_KEY=$LIDARR_API_KEY
      ## Readarr
      - READARR_URL=http://readarr:8787
      - READARR_KEY=$READARR_API_KEY
      ## Whisparr
      - WHISPARR_URL=http://whisparr:6969
      - WHISPARR_KEY=$WHISPARR_API_KEY
      ## qBittorrent
      - QBITTORRENT_URL=http://qbittorrent:8080
      #- QBITTORRENT_USERNAME=Your name
      #- QBITTORRENT_PASSWORD=Your password

3) Run docker-compose up -d in the directory where the file is located to create the docker container Note: Always pull the "latest" version. The "dev" version is for testing only, and should only be pulled when contributing code or supporting with bug fixes

Method 2: Running manually

1) Clone the repository with git clone -b main https://github.com/ManiMatter/decluttarr.git 2) Rename the config.conf-Example inside the config folder to config.conf 3) Tweak config.conf to your needs 4) Install the libraries listed in the docker/requirements.txt (pip install -r requirements.txt) 5) Run the script with python3 main.py Note: The config.conf is disregarded when running via docker-compose.yml

Explanation of the settings

General settings

Configures the general behavior of the application (across all features)

LOG_LEVEL

TEST_RUN

SSL_VERIFICATION


Features settings

Steers which type of cleaning is applied to the downloads queue

REMOVE_TIMER

REMOVE_FAILED

REMOVE_FAILED_IMPORTS

REMOVE_METADATA_MISSING

REMOVE_MISSING_FILES

REMOVE_ORPHANS

REMOVE_SLOW

REMOVE_STALLED

REMOVE_UNMONITORED

MIN_DOWNLOAD_SPEED

PERMITTED_ATTEMPTS

NO_STALLED_REMOVAL_QBIT_TAG

IGNORE_PRIVATE_TRACKERS

FAILED_IMPORT_MESSAGE_PATTERNS


Radarr section

Defines radarr instance on which download queue should be decluttered

RADARR_URL

RADARR_KEY


Sonarr section

Defines sonarr instance on which download queue should be decluttered

SONARR_URL

SONARR_KEY


Lidarr section

Defines lidarr instance on which download queue should be decluttered

LIDARR_URL

LIDARR_KEY


Readarr section

Defines readarr instance on which download queue should be decluttered

READARR_URL

READARR_KEY


Whisparr section

Defines whisparr instance on which download queue should be decluttered

WHISPARR_URL

WHISPARR_KEY


qBittorrent section

Defines settings to connect with qBittorrent If a different torrent manager is used, comment out this section (see above the limitations in functionality that arises from this)

QBITTORRENT_URL

QBITTORRENT_USERNAME

QBITTORRENT_PASSWORD

Credits

Disclaimer

This script comes free of any warranty, and you are using it at your own risk