Skip to content

Restore grabbed releases custom formats to imported releases in Radarr

License

Notifications You must be signed in to change notification settings

notorius28/radarr-custom-format-sync

 
 

Repository files navigation

Radarr Custom Format Sync

docker-data docker-commit docker-version

Code Quality

Description

Radarr Custom Format Sync checks Radarr history to correlate downloaded releases with the imported ones in order to put back all custom formats that might have been lost after the importing process.

Why

Radarr custom formats are very useful for use cases such as downloading a movie in original version as soon as it's available and upgrading it once a Dual version is released. In order to work with trackers that don't have standardized namings, Jackett is able to append some information such as language codes to the release name so then Radarr can pick the best release.

The problem is that any information that Jackett adds to the release name is not reflected on the imported release once it's downloaded and imported by Radarr as Radarr only uses the filename for assigning the custom formats.

Example:

Assuming a custom format named Dual applied to movies that are both [spanish] and [english] and a release named DeadPool (2016):

  1. Jackett finds DeadPool (2016) in a custom tracker and appends the language flags returning to Radarr the release name DeadPool (2016) [spanish] [english]
  2. Radarr decides to download DeadPool (2016) [spanish] [english] as it's the one that matches the Dual custom format
  3. After the download is finished Radarr imports the release, but its release name is DeadPool (2016) so it doesn't add the Dual custom format to it.

This script solves this problem, checking the custom formats of each imported movie in the Radarr library and replacing it by the custom formats of the grabbed release instead.

Optionally, it's possible to append strings to the filenames when they match a custom format. This is very useful to guarantee that, in case of reimporting the file, the custom formats won't be lost.

Configuration

Example Config.txt

[Radarr]
url = http://changeme.com:3333
key = 4384803r2808rvsvj023r9fjvvd0fjv3
[Append]
english = [english]
spanish = [spanish]
dual = [dual]

Configuration steps

Standalone

  1. Edit the Config.txt file and replace your servers URL and API key for Radarr under the [Radarr] section.
  2. Optionally, add flags to append to the file names per custom format (useful for possible reimports where history gets lost)

Docker

  1. Alternatively, if running the application with Docker, provide the values as the envars RADARR_URLand RADARR_KEY (The Config.txt file will be generated automatically inside the container)
  2. Optionally, add the flags to append to the file names as envars APPEND_X being X the custom format name (case insensitive). For example: APPEND_ENGLISH=[english] will append [english] to file names with custom format english

How to Run

Standalone

Recomended to run using cron every 15 minutes or an interval of your preference.

pip install -r requirements.txt
python CustomFormatSync.py

Docker

docker run -d --name radarr-custom-format-sync \
        --restart=unless-stopped \
        -v /path/to/logs:/logs \
        -e RADARR_URL=yourRadarrUrl \
        -e RADARR_KEY=yourRadarrKey \
        -e DELAY=15m \
        rubasace/radarr-custom-format-sync

Requirements

  • Python 3.4 or greater
    • Radarr server

About

Restore grabbed releases custom formats to imported releases in Radarr

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 84.6%
  • Dockerfile 7.9%
  • Shell 7.5%