Skip to content

configuration

zhdenny edited this page May 18, 2024 · 7 revisions

Configuration File

Note: this may be out of date please be sure to look at the config.sample.yml file for the most current version. Found HERE

# Options:
# run - will run a single time per run of main.py (mainly useful for testing with dry_run)
# hourly(XX)
#   Examples: hourly(00) or hourly(18) - Will perform the action every hour at the specified time
# daily(XX:XX) 
#  Examples: daily(12:23) or daily(18:15) - Will perform the action every day at the specified time
#  Examples: daily(10:18|12:23) - Will perform the action every day at the specified times
# weekly(day_of_week@XX:XX)
#   Examples: weekly(monday@12:00) or weekly(monday@18:15) - Will perform the action on the specified day of the week at the specified time
#   Examples: weekly(monday@12:23)
# monthly(day_of_month@XX:XX)
#   Examples: monthly(15@12:00) or monthly(15@18:15) - Will perform the action on the specified day of the month at the specified time
# cron(<cron_expression>)
#   Examples: cron(0 0 * * *) - Will perform the action every day at midnight
#   Examples: cron(*/5 * * * *) - Will perform the action every 5 minutes
#   Examples: cron(0 */3 * * *) - Will perform the action every 3rd hour
#   Please visit https://crontab.guru/ for more information on cron expressions
# Note: You cannot use both cron and human readable expressions in the same schedule

# If using the scripts through crontab or another scheduler, I would not recommend using the schedule w/in the config. 
# The schedule is intended for use with Docker. If you want to use the schedule w/in the config, you will need to run the main.py script in the background.
# Schedule only supports the following options: hourly, daily, weekly, monthly, all
schedule:
  border_replacerr:
  health_checkarr:
  labelarr: 
  nohl:
  sync_gdrive: 
  poster_cleanarr:
  poster_renamerr:
  queinatorr:
  renameinatorr:
  unmatched_assets: 
  upgradinatorr:
  backup_folder:
    # Include as many backup folder instances as you want, name must match the name of the backup_folder instance
    backup_folder_1: 
    backup_folder_2: 
  backup_plex: 
  backup_appdata: 
  nohl_bash:
  jduparr:

instances:schedule:
  # Options:
  # run - will run a single time per run of main.py (mainly useful for testing with dry_run)
  # hourly(XX)
  #   Examples: hourly(00) or hourly(18) - Will perform the action every hour at the specified time
  # daily(XX:XX) 
  #  Examples: daily(12:23) or daily(18:15) - Will perform the action every day at the specified time
  #  Examples: daily(10:18|12:23) - Will perform the action every day at the specified times
  # weekly(day_of_week@XX:XX)
  #   Examples: weekly(monday@12:00) or weekly(monday@18:15) - Will perform the action on the specified day of the week at the specified time
  #   Examples: weekly(monday@12:23)
  # monthly(day_of_month@XX:XX)
  #   Examples: monthly(15@12:00) or monthly(15@18:15) - Will perform the action on the specified day of the month at the specified time
  # cron(<cron_expression>)
  #   Examples: cron(0 0 * * *) - Will perform the action every day at midnight
  #   Examples: cron(*/5 * * * *) - Will perform the action every 5 minutes
  #   Examples: cron(0 */3 * * *) - Will perform the action every 3rd hour
  #   Please visit https://crontab.guru/ for more information on cron expressions
  # Note: You cannot use both cron and human readable expressions in the same schedule

  # If using the scripts through crontab or another scheduler, I would not recommend using the schedule w/in the config. 
  # The schedule is intended for use with Docker. If you want to use the schedule w/in the config, you will need to run the main.py script in the background.
  # Schedule only supports the following options: hourly, daily, weekly, monthly, all
  border_replacerr:
  health_checkarr:
  labelarr: 
  nohl:
  sync_gdrive: 
  poster_cleanarr:
  poster_renamerr:
  queinatorr:
  renameinatorr:
  unmatched_assets: 
  upgradinatorr:
  nohl_bash:
  jduparr:

instances:
  radarr:
    # Instance name can be whatever you want, it just needs to match the name used in other sections
    radarr_1:
      url: http://localhost:7878
      api: abcdefghijklmnopqrstuvwxyz1234567890
    radarr_2:
      url: http://localhost:7878
      api: abcdefghijklmnopqrstuvwxyz1234567890
    radarr_4K:
      url: http://localhost:7878
      api: abcdefghijklmnopqrstuvwxyz1234567890
    anime_radarr:
      url: http://localhost:7878
      api: abcdefghijklmnopqrstuvwxyz1234567890
  sonarr:
    # Instance name can be whatever you want, it just needs to match the name used in other sections
    sonarr_1: 
      url: http://localhost:8989
      api: abcdefghijklmnopqrstuvwxyz1234567890
    sonarr_anime:
      url: http://localhost:8989
      api: abcdefghijklmnopqrstuvwxyz1234567890
    sonarr_3:
      url: http://localhost:8989
      api: abcdefghijklmnopqrstuvwxyz1234567890
    4K_sonarr:
      url: http://localhost:8989
      api: abcdefghijklmnopqrstuvwxyz1234567890
  plex:
    plex_1:
      # API key can be found here: https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
      url: http://localhost:32400
      api: abcdefghijklmnopqrstuvwxyz1234567890
  qbittorrent:
    # Instance name can be whatever you want, it just needs to match the name used in other sections
    qbittorrent_1:
      url: http://localhost:8080
      username: admin
      password: adminadmin
    qbittorrent_2:
      url: 
      username: 
      password: 

discord:
  # Discord notifications:
  # You can use either Notifiarr or Discord's webhook
  # Notifiarr:
  # Use Notifiarr Passthrough
  # Use channel ID so notifiarr knows what channel to send the message to
  # Discord Webhook:
  # Use Discord's webhook
  # Channel ID not used
  notifiarr_webhook:
  # Main is used for version notifications 
  main:
    discord_webhook: 
    channel_id:
  renameinatorr:
    # Will notify items that have been renamed
    discord_webhook: 
    channel_id: 
  upgradinatorr:
    # Will notify if an upgrade has been found
    discord_webhook: 
    channel_id: 
  poster_renamerr:
    # Note: It is recommended for a fresh run to not use a notifications channel, as it will spam the channel with all the matched assets
    discord_webhook: 
    channel_id: 
  nohl:
    # Will notify if non-hardlinked files are found/searched for
    discord_webhook: 
    channel_id: 
  queinatorr:
    # Will notify if a torrent/queue item has been handled
    discord_webhook: 
    channel_id: 
  labelarr:
    # Will notify if a label has been added/removed to a movie or series
    discord_webhook: 
    channel_id: 
  nohl_bash:
    # Will notify if a non-hardlinked file has been found
    discord_webhook: 
    channel_id: 
  jduparr:
    # Will notify if a duplicate file has been found and relinked
    discord_webhook: 
    channel_id: 

sync_gdrive:
  # THIS SCRIPT SYNCS GDRIVE TO A LOCAL FOLDER. ANYTHING UNIQUE IN THE FOLDER WILL BE DELETED.
  # -> You can use client_id, client_secret, and token to authenticate, or you can use gdrive_sa_location to use a service account.
  # DRAZZILB GDRIVE ID: 1VeeQ_frBFpp6AZLimaJSSr0Qsrl6Tb7z
  # Below are others that have been shared around Discord. If you have your own and would like to share it please contact me.
  # This script is meant to be used in conjunction with kometa, however, it can be used on its own.
  # This is a script base of this one: https://discord.com/channels/492590071455940612/1124032073557086258/1126226814629576858
  log_level: info # debug, info, warning, error, critical
  # Client ID for rclone usually ends with .apps.googleusercontent.com
  client_id: asdasds.apps.googleusercontent.com
  # Client Secret for rclone, usually starts with GOCSPX-
  client_secret: GOCSPX-asda123
  # The token for rclone, this is the output of rclone config dump that needs to run manually
  # Token looks like this: { "access_token": "value", "token_type": "Bearer", "refresh_token": "value", "expiry": "value" }
  # NOTE: Include the curly braces
  token: { "access_token": "value", "token_type": "Bearer", "refresh_token": "value", "expiry": "value" }
  # The location of your rclone service account file (JSON)
  gdrive_sa_location: /config/rclone_sa.json 
  gdrive_sync: # example of multiple gdrive_id's with multiple sync_locations as objects, we have deprecated gdrive_id and sync_location so please use this instead
      # id: The ID of the folder you want to sync from
      # location: Where you want to sync the posters to
    - id: 1VeeQ_frBFpp6AZLimaJSSr0Qsrl6Tb7z # drazzilb
      location: /path/to/location # Where you want to sync the posters to
    - id: 1wrSru-46iIN1iqCl2Cjhj5ofdazPgbsz # dsaq
      location: /path/to/location # Where you want to sync the posters to
    - id: 1zWY-ORtJkOLcQChV--oHquxW3JCow1zm # solen
      location: /path/to/location # Where you want to sync the posters to
    - id: 1Xg9Huh7THDbmjeanW0KyRbEm6mGn_jm8 # BZ
      location: /path/to/location # Where you want to sync the posters to
    - id: 1oBzEOXXrTHGq6sUY_4RMtzMTt4VHyeJp # chrisdc
      location: /path/to/location # Where you want to sync the posters to
    - id: 1G77TLQvgs_R7HdMWkMcwHL6vd_96cMp7 # Quafley
      location: /path/to/location # Where you want to sync the posters to
    - id: 1bBbK_3JeXCy3ElqTwkFHaNoNxYgqtLug # Stupifier
      location: /path/to/location # Where you want to sync the posters to
    - id: 1KnwxzwBUQzQyKF1e24q_wlFqcER9xYHM # Sahara
      location: /path/to/location # Where you want to sync the posters to
    - id: 1alseEnUBjH6CjXh77b5L4R-ZDGdtOMFr # Lion City Gaming
      location: /path/to/location # Where you want to sync the posters to

poster_renamerr:
  # This script will rename your posters to match kometa's naming scheme from TPDB's naming utilizing Radarr/Sonarr as a source.
  #
  # NOTE: If you're planning to run border_replacerr and/or sync_posters it will appear that this script has hung. It's simply waiting
  # for the other scripts to finish. You can monitor progress and/or actions on their respective logs.
  # Logging for poster_renamer and border_replacerr scripts happens mostly at the end of the run, so you may not see anything until the end.
  # sync_posters is a bit more verbose as it utilizes the rclone sync command.
  log_level: info
  dry_run: false
  sync_posters: true # <- This will run sync_gdrive before renaming
  action_type: copy # <- Options: copy, move
  asset_folders: false # <- This will copy the folder structure of the source_dir to the destination_dir, this MUST be the same as you use in kometa
  print_only_renames: false # <- This will print the renames to the log, but will not actually rename anything
  # This will integrate border_replacer with poster_renamerr, set this to true if you want to use them at the same time (no need to schedule border_replacer)
  # Note: This will create a tmp dir in your output directory for border_replacer to use and for poster_renamer to have accurate account of what has been added
  # Note: All of border_replacer's settings will be used, except for the input_dir and output_dir
  border_replacerr: false
  # Libraries are ONLY used for collections
  library_names:
    - Movies
    - Anime Movies
  # The order from lowest to highest priority
  # The order is 100% personal preference
  source_dirs: 
    - /path/to/stupifier/posters/ # <- This is the lowest priority
    - /path/to/dsaq/posters/
    - /path/to/solen/posters/
    - /path/to/chrisdc/posters/
    - /path/to/Quafley/posters/
    - /path/to/drazzilb/posters/ # <- This is the highest priority
  destination_dir: /path/to/output/ 
  instances:
    - plex_1
    - radarr_1
    - sonarr_1
    # - sonarr_anime
    # - radarr_2
    # - sonarr_3

border_replacerr:
  # This script replaces the border on the posters or removes the border
  # WARNING: If you have overlays that are carefully position and choose to remove the border around the poster, the overlay
  # will not be in the correct position. This is because the overlay is positioned based on the border width.
  # Colors: https://www.w3schools.com/colors/colors_picker.asp
  log_level: info
  dry_run: true
  source_dirs:  # <--- Not used if using with poster_renamerr only used if running border_replacer by itself
    - /path/to/posters/
  destination_dir: /path/to/output/ # <---- Not used if using with poster_renamerr only used if running border_replacer by itself
  # If you want to adjust the border width (not all MM2K posters are 25px borders some are 26-27)
  border_width: 26
  # skip - This will skip border replacement until the next schedule/holiday
  skip: false
  # Setting a border color of nothing will remove the border, else it will add the border color
  # Examples: Must include everything from double quotes to double quotes such as "#FF0000"
  # "#FF0000" - Red
  # "#00FF00" - Green
  # "#0000FF" - Blue
  # "#FFA500" - Orange
  # "#FFFF00" - Yellow
  # "#800080" - Purple
  # "#FFC0CB" - Pink
  # "#FFFFFF" - White
  # "#000000" - Black
  # "#808080" - Gray
  # To remove borders set the border_colors to nothing.
  # Example: border_colors:
  border_colors: 
  schedule:
    # You can make any holiday you want for any occasion. For the schedule please use the range(month/date-month/date) option
    christmas:
      schedule: range(12/01-12/31)
      color: 
        - "#FF0000"
        - "#00FF00"
    halloween:
      schedule: range(10/01-10/31)
      color: "#FFA500"
    thanksgiving:
      schedule: range(11/01-11/30)
      color: "#FFA500"
    valentine:
      schedule: range(2/5-2/15)
      color:
        - "#D41F3A"

unmatched_assets:
  # There is a limitation to how this script works with regards to it matching series assets the
  # main series poster requires seasonal posters to be present. If you have a series that does
  # not have a seasonal poster then it will not match the series poster. If you don't have a season poster
  # your series will appear in the movies section.
  log_level: info
  instances:
    - plex_1
    - radarr_1
    - sonarr_1
    - sonarr_anime
  # Supports both data path as well as base_name of folder path
  # Note: If you use base_name, the name must match exactly just without the "/"
  ignore_root_folders:
    - anime movies
    - /data/Kids Shows
  # Libraries are ONLY used for collections
  library_names:
    - Movies
    - Anime Movies
  ignore_collections:
    - "Star Wars Universe"
    - "DC Animated Universe"
    - "Alien / Predator"
    - "Rocky / Creed"
    - "MonsterVerse"
    - "Star Trek"
    - "X-Men Universe"
    - "In Association With Marvel"
    - "View Askewniverse"
    - "The Mummy Universe"
    - "Middle Earth"
    - "In Association With DC"
    - "Wizarding World"
    - "Fast & Furious"
    - "The Spiderverse"
    - "Marvel Cinematic Universe"
    - "The Conjuring Universe"
    - "The Batman Universe"
    - "DC Extended Universe"
  source_dirs: 
    - /path/to/assets

poster_cleanarr:
  # This script will remove any assets from your kometa asset directory that are not being used by your media.
  # Note: This script will remove things that renamer has put in to the assets directory that do not have a folder in your
  # Media directory and cause a loop. I wouldn't recommend running this script very often (weekly at most, monthly is probably)
  log_level: info
  dry_run: true
  instances:
    - plex_1
    - radarr_1
    - sonarr_1
    - sonarr_anime
  # Libraries are ONLY used for collections
  library_names:
    - Movies
    - Anime Movies
  ignore_collections:
    - "Random Collection in assets you want to keep"
  # If using poster_renamer with border_replacer, include the tmp folder that border_replacer uses
  source_dirs: 
    - /path/to/assets

upgradinatorr:
  # A script to upgrade Sonarr/Radarr libraries to the keep in line with trash-guides
  log_level: info
  dry_run: false
  instances:
    radarr_1:
      count: 3
      tag_name: checked
      unattended: true
    radarr_2:
      count: 10
      tag_name: checked
      unattended: true
    sonarr_1:
      count: 1
      tag_name: checked
      unattended: true
    sonarr_anime:
      count: 1
      tag_name: checked
      unattended: true
    sonarr_3:
      count: 20
      tag_name: checked
      unattended: true

renameinatorr:
  # This script will rename all series in Sonarr/Radarr to match the naming scheme of the
  # Naming Convention within Radarr/Sonarr. It will also add a tag to the series so that it can be easily
  # identified as having been renamed.
  # 
  # Warning: With a large library this script can take a while as it wait's for all API calls to finish before moving on to the next instance
  # Note If you see something along the lines of Unable to move series from '<Insert path/name>'. Try moving files manually: Source and destination can't be the same <insert_path/name>
  # This is normal and you'll even see this error if you perform the same action the script does manually.
  log_level: info
  dry_run: false
  rename_folders: true
  # Tag name and count are optional, if you don't want to use them leave them blank
  # The reason for count and tag is if you want to perform renaming actions in batches or in bulk
  count: 10
  tag_name: renamed
  instances:
    - radarr_2
    - sonarr_3

nohl:
  # This script will find all files that are not hardlinked and will process them in radarr
  # and sonarr. This is useful for finding files that are not hardlinked and wish to have 100%
  # hardlinks seeding.
  dry_run: true
  log_level: info
  maximum_searches: 10 # Please keep this number low to avoid bans
  print_files: false # Will not respect excludes for simply printing the files
  instances:
    - radarr_1
    - sonarr_1
  paths:
    - /path/to/media/movies
    - /path/to/media/series
  filters:
    exclude_profiles: test3, test4
    # Do not include year in the exclude list
    # The title should be exactly as it appears in `Radarr` or `Sonarr`
    exclude_movies:
      - "The Matrix"
      - "The Matrix Reloaded"
      - "The Matrix Revolutions"
    exclude_series:
      - Diners, Drive-ins and Dives
      - Marvel's Spider-Man
      - M*A*S*H

queinatorr:
  # This script will move torrents from one category to another in qBittorrent based on
  # the title of the torrent. This is useful for moving torrents from a category that are stuck 
  # in a queue due to a missing file or not being an upgrade for existing episode file(s).
  log_level: info
  dry_run: true
  days_to_keep: 14 # The number of days to keep in the pre_import_category prior to moving to the post_import_category
  instances:
    radarr_1:
      qbit_instance: qbittorrent_1
      pre_import_category: movies
      post_import_category: completed-movies
    sonarr_1:
      qbit_instance: qbittorrent_2
      pre_import_category: series
      post_import_category: completed-series
    sonarr_anime:
      qbit_instance: qbittorrent_2
      pre_import_category: anime
      post_import_category: completed-anime

labelarr:
  # A script to sync labels between Plex and Radarr/Sonarr
  # Warning: Due to the way that Plex API works, this script can take a while to run with a large library
  dry_run: true
  log_level: info
  instances:
    radarr_2: 
      library_names:
        - Movies
      plex_instances:
        - plex_1
      # Labels/tags to sync between Radarr/Sonarr and Plex
      labels:
        - kids
    sonarr_3:
      library_names:
        - Animated Series
        - Childrens Series
      plex_instances:
        - plex_1
      labels:
        - kids

health_checkarr:
  # This script will delete movies and shows from Radarr and Sonarr based on the if they show
  # up in the health check. This is useful for removing movies and shows that have been removed
  # from TMDB or TVDB.
  log_level: info
  dry_run: true
  instances:
    - radarr_1
    - sonarr_1
    - sonarr_anime

bash_scripts:
  # Bash Scripts
  # This is a collection of BASH scripts that can be run by the script.
  log_level: info
  nohl_bash:
    source:
    include:
      - 
      - 
    # Exclude certain movie/series folders from being searched
    # NOTE: It must be exactly as the folder is listed in your file system
    exclude:
      - 
      - 
  jduparr:
    data_dir: 

main:
  log_level: info

Items of note

MM2K Style Posters Process

Here is the general flow of DAPS process to acquire posters, match and rename those posters specific to your setup, and then feed them to kometa. In order DAPS uses gdrive_sync then poster_renamerr then border_replacerr [optional] to prepare a final output directory which kometa calls the asset_directory: in the Kometa config file.

  1. gdrive_sync script runs and will download ALL posters from each of the gdrive sync id's you have in your config.yml. Use Separate folders for EACH gdrive id. The very first sync will take up to couple hours. Be patient.

  2. poster_renamerr script runs. The source_dirs for this script are the various location paths from gdrive_sync. This script analyzes all of the source_dirs against your *Arr instances and Plex and then copies and renames all the matching posters into a single destination_dir.

  3. border_replacerr script runs. This is an optional step. By default, all posters have a white border - The standard MM2K-style. border_replacerr simply changes that border to another color or removes it entirely based upon your config.

  4. The product of this is the destination_dir:. You'll want kometa to be able to see this directory and call it in the Kometa config file as asset_directory:.

See HERE for basic tips for how to get Kometa to apply these posters.

See HERE for Kometa documentation on the Kometa asset_directory

Special Note: READ the comments for poster_renamerr in the config file. All three of these scripts can be ran in sequence using the settings in that section.

Discord and Notifiarr

This is the section for discord and notifiarr. If you don't use any of them, you can leave this blank.

discord:
  # This is the webhook for Notifiarr. if you don't use Notifiarr, you can leave this blank
  notifiarr_webhook:
  # These are the webhooks for the discord scripts. if you don't use discord, you can leave these blanks
  renamer:
    # This is the discord webhook for this script
    discord_webhook:
    # This is the channel id for the discord script. Channel id is only needed if using Notifiarr
    channel_id:
  unmatched-assets:
    discord_webhook:
    channel_id:

Sync Google Drive

Refer to the rclone configuration page of the wiki to acquire your own client ID, secret and either a token or service account json file.

sync_gdrive:
  log_level: info # debug, info, warning, error, critical
  # Client ID for rclone usually ends with .apps.googleusercontent.com
  client_id: asdasds.apps.googleusercontent.com
  # Client Secret for rclone, usually starts with GOCSPX-
  client_secret: GOCSPX-asda123
  # The token for rclone, this is the output of rclone config dump that needs to run manually
  # Token looks like this: { "access_token": "value", "token_type": "Bearer", "refresh_token": "value", "expiry": "value" }
  # NOTE: Include the curly braces
  token: { "access_token": "value", "token_type": "Bearer", "refresh_token": "value", "expiry": "value" }
  # The location of your rclone service account file (JSON)
  gdrive_sa_location: /config/rclone_sa.json 
  gdrive_sync: # example of multiple gdrive_id's with multiple sync_locations as objects, we have deprecated gdrive_id and sync_location so please use this instead
      # id: The ID of the folder you want to sync from
      # location: Where you want to sync the posters to
    - id: 1VeeQ_frBFpp6AZLimaJSSr0Qsrl6Tb7z # Drazzib
      location: /path/to/location # Where you want to sync the posters to
    - id: 1wrSru-46iIN1iqCl2Cjhj5ofdazPgbsz # dsaq
      location: /path/to/location # Where you want to sync the posters to
    - id: 1zWY-ORtJkOLcQChV--oHquxW3JCow1zm # solen
      location: /path/to/location # Where you want to sync the posters to
    - id: 1Xg9Huh7THDbmjeanW0KyRbEm6mGn_jm8 # BZ
      location: /path/to/location # Where you want to sync the posters to
    - id: 1oBzEOXXrTHGq6sUY_4RMtzMTt4VHyeJp # chrisdc
      location: /path/to/location # Where you want to sync the posters to
    - id: 1G77TLQvgs_R7HdMWkMcwHL6vd_96cMp7 # Quafley
      location: /path/to/location # Where you want to sync the posters to
    - id: 1bBbK_3JeXCy3ElqTwkFHaNoNxYgqtLug # Stupifier
      location: /path/to/location # Where you want to sync the posters to