Radarr Folder Organizer assignes folders to movies given their custom formats, moving the files to the desired folder and updating Radarr to reflect such changes.
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. Radarr doesn't support the assignment of alternative folders for custom formats. This script solves that, checking the custom formats of each downloaded movie in the Radarr library and changing its folder to the desired one.
[Radarr]
url = http://changeme.com:3333
key = 4384803r2808rvsvj023r9fjvvd0fjv3
[CustomFormatMappings]
__default = /the/default/folder
custom_format1 = /custom/format/1/folder
custom_format2 = /custom/format/2/folder
- Copy the
Config.example.txt
file intoConfig.txt
file under the same directory - Edit the
Config.txt
file and replace your servers URL and API key for Radarr under the[Radarr]
section. - Edit the
Config.txt
file and replace the__default
mapping with the default folder for Radarr movies under the[CustomFormatMappings]
section (mandatory). - Edit the
Config.txt
file and add any other mapping for the custom formats just bellow the__default
one, where the key is the custom format name (case sensitive) and the value is the desired folder for such format. Both key and value allow spaces.
Recomended to run using cron every 15 minutes or an interval of your preference.
pip install -r requirements.txt
python FolderOrganizer.py
If running on Windows and getting the error ImportError : no module named 'requests'
you'll need to install the requirements via the python
command.
python -m pip install -r requirements.txt
python FolderOrganizer.py
docker run -d --name radarr-folder-organizer \
--restart=unless-stopped \
-v /path/to/Config.txt:/Config.txt \
-v /path/to/logs:/logs \
-v /your/media/folder:/same/media/folder/as/radarr:shared \
-e DELAY=15m \
-e LOG_LEVEL=INFO \
-e MOVE_DEFAULT=false \
rubasace/radarr-folder-organizer
Name | Default | Description | |
---|---|---|---|
LOG_LEVEL | INFO |
Level that the logger will use. Can be set to DEBUG for troubleshooting. | |
MOVE_DEFAULT | False |
If true files that don't match any custom mapping will be moved to the __default folder. This can mess up your folders if you manually organized files that don't have custom formats. |
|
DELAY* | 15m |
Argument passed to the sleep command between executions of the script. Only used if running via docker |
|
RADARR_URL | None | Alternative way of passing the radarr url (has precedence over config file) | |
RADARR_KEY | None | Alternative way of passing the radarr password (has precedence over config file) |
By default, the Docker entrypoint will keep the script looping every 15m (or the configured interval). This behaviour might not be the desired one if the image is run as part of a cronjob (for example, via Kubernetes).
In that case, a value of DISABLED
can be passed to the environment variable DELAY
, causing the script to just execute once and exit.
This script will only affect movies that are located in folders explicitly included in the Config.txt
. In case any movie is found in another folder you'll receive the message Current path ${Path} from movie ${MovieName} is not in the configuration file. Skipping to avoid possible errors
.
If you want those movies to be moved by the script you can add another for it (the custom format doesn't need to exist).
Assuming the example Config.txt
file, if receive the message Current path /media/cool_movies from movie Deadpool (2016) is not in the configuration file. Skipping to avoid possible errors
, you can add a line for the new folder, such as:
[CustomFormatMappings]
__default = /the/default/folder
custom_format1 = /custom/format/1/folder
custom_format2 = /custom/format/2/folder
whatever_you_want = /media/cool_movies
- Python 3.4 or greater
- Radarr server v2 or v3
Log level is set to INFO by default, with the bare minimum information logged. In case of an issue it's recommended to set the log level to DEBUG. Feel free to open an issue if something is not working as expected.
- Radarr Folder Organizer will try to move your files and abort the movie update if it can't, so it should have access to the movies library files.
- When using Docker, be sure that the mounted volume is the same as the Radarr one