Skip to content

RiffSphere/Collectarr

Repository files navigation

Collectarr

A Python script for checking your Radarr database and setting up collection lists. Also supports "smart" actor lists based on TMDB.

While Radarr has the tmdb collection id for each movie (that is part of a collection), and allows to quickly setup a collection list for monitoring from the movie page, there is no quick way to do so for all movies. This script will poll Radarr for all movies, get the tmdb collection id, and set up a collection list for it.

The script can also set up lists for actors. To do so, it will check all your movies, get the actors for each movie from TMDB, keep track how many movies your have with each actor, and add a list if that's more than a configured number.

Jump to:

Features:

  • Automatically added into Radarr.
    • Using the list function: automatically updates when TMDB does.
    • Add Monitored or Unmonitored.
    • Allow to automatically search when added or not (Radarr list setting).
  • List for movies and actors.
    • List contains (configurable) description it's been added by Collectarr.
    • Different descriptions for collections and actors.
  • Really fast when adding collections: All data is already in Radarr, just enabling it.
  • Remove lists.
    • Remove all actor lists added by Collectarr.
    • Remove all collection lists added by Collectarr.
    • Remove all lists from Radarr.

Requirements:

  • Radarr
  • Your own TMDB API key.

Getting a TMDB API key: TMDB offers free API keys to anyone with an account. Simply sign up and request a key via your account settings.

Setting up the configuration files

The config folder can be named and placed anywhere on your computer. The directory path can be specified when running the command. If not specified, the script path will be used as config folder.

In the config folder, make a copy of collectarr.conf.example, rename it collectarr.conf and open it with any text editor.

tmdb settings

  • apiKey - Set your tmdb api key. If you don't plan on using the "smart" actor feature, this can be empty

Radarr settings

  • host - The hostname or IP of Radarr
  • port - The port Radarr is using (7878 by default)
  • URLbase - If you use URL Base in Radarr, can be found under Settings > General.
  • apiKey - Can be found under Settings > General.
  • https - [True|False] - Add https:// instead of http:// before the server setting when putting the Radarr URL together. only http tested

Collectarr settings (actions taken in listed order)

  • dryrun - [True|False] - Execute and log information as normally, but don't ask Radarr to make changes. Useful to test actor numbers or see how many collections you can complete
  • removealllists - [True|False] - Delete all lists currently in Radarr. SHOULD BE USED WITH CARE. Created to clean up your lists if you started manually. Will delete all lists, including IMDB lists
  • removeblacklistedlists - [True|False] - Remove blacklisted lists, that were previously added, from Radarr. Only supports remving the list, will not remove movies.
  • removeCollectarractorlists - [True|False] - Delete actor lists added by Collectarr (*actorlistnameaddon will be used to determine)
  • removeCollectarrcollectionlists - [True|False] - Delete collection lists added by Collectarr (*movielistnameaddon will be used to determine)
  • addcollections - [True|False] - Add lists for all collections Radarr has at least 1 movie from, ignoring existing ones
  • addactors - [True|False] - Add lists for actors that appear in a lot (actormin) of movies you have, ignoring existings ones
  • rootfolder - ['first'|'movie'] - More info
  • movielistnameaddon - List name will be collection name and what is set here. Used by removeCollectarrcollectionlists. Try to keep it specific
  • actorlistnameaddon - List name will be actor name and what is set here. Used by removeCollectarractorlists. Try to keep it specific

Log settings

  • quiet - [False|True] - Log to console, useful for debugging or docker
  • nolog - [True|False] - Disable all logging if you just don't care
  • nocollectionlog - [True|False] - Log all movies that are not part of a collection
  • loginfo - [True|False] - Log more information

Movie/collection settings

  • monitoredonly - [True|False] - Only scan movies monitored in Radarr
  • enabled - [True|False] - Enable the list when added. Should probably be True
  • *enableAuto - [True|False] - Automatically add movies from the list. Should probably be True
  • shouldMonitor - [True|False] - Monitor movies added by the list
  • searchOnAdd - [True|False] - Search for movie when added

Actor settings

  • monitoredonly - [True|False] - Only scan movies monitored in Radarr
  • enabled - [True|False] - Enable the list when added. Should probably be True
  • *enableAuto - [True|False] - Automatically add movies from the list. Should probably be True
  • shouldMonitor - [True|False] - Monitor movies added by the list
  • searchOnAdd - [True|False] - Search for movie when added
  • actormin - How many movies in your Radarr database should an actor be in before adding a list?
    • Start high to prevent too many actors being added
    • All movies are scanned on each run, so newly added movies can/will add more actor lists
  • countvoice - [False|True] - Count an actor for a movie if he is listed as (voice)
  • countuncredited - [False|True] - Count an actor for a movie is he is listed as (uncredited)

Installation and Running

Local

  • Download and extract the zip or clone with git to a location of your choice.
  • You may name and place the config folder anywhere on the computer, if not passed the config file is expected to be the same as the script folder.
  • In the config folder, make a copy of collectarr.conf.example and rename it collectarr.conf, edit collectarr.conf for your values.
  • In Command Prompt or Terminal, navigate into the downloaded folder and run python collectarr.py ./config (./config part can be dropped) to begin.

Docker Container

docker create \
  --name=collectarr \
  -v <path to data>:/config \
  riffsphere/collectarr

Blacklists

Two files exist in the config directory:

  • blacklist_collection.conf - Contains the tmdb number for collections you don't want, 1 per line
  • blacklist_actor.conf - Contains the tmdb number for actors you don't want, 1 per line

Rootfolder information

The rootfolder is where movies from a list will get added. The same setting will be used for collections and actors. There are 2 options to configure your rootfolder:

Special thanks

Special thanks to RhinoRhys. This script is inspired by his original radarr-collections. Some of his code has been "reused" (aka stolen) for this project, as well as this layout being based on his.

Also thanks to the Radarr project for their amazing tool, and TMDB for the great api.

Feel free to clone and change all you want!

Disclaimer

This tool is provided as-is. You are free to use, edit or distribute it in any way you want. Using the tool is at your own risk. While I will try to fix reported errors, there is no guarantee I will. I can not be held responsible for any results from using this tool. This includes, but is not limited to, messing up your Radarr database, losing data or burning down your house.

Making a Radarr backup before using this tool, and running with dryrun set to True a couple times, is highly suggested. Good luck!