-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtagarr_import.conf.sample
More file actions
255 lines (238 loc) · 11.6 KB
/
tagarr_import.conf.sample
File metadata and controls
255 lines (238 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# ========== CONFIGURATION ==========
# Config version: 1.5
# Config for tagarr_import.sh — Event-Driven Radarr Tagger with Discovery
#
# Radarr Connect handler that tags movies on import, recovers missing
# release groups, and discovers new groups. Runs automatically — do NOT
# run this script manually.
#
# For detailed explanations of every option, see docs/tagarr-import-guide.md
#
# Setup: Radarr > Settings > Connect > Custom Script
# Path: /scripts/tagarr_import.sh
# Events: On Grab (optional), On Download, On Upgrade, On Movie File Delete
#
# This config is separate from tagarr.conf — both are independent and
# can have different release groups, webhooks, and filter settings.
# Most users keep them identical.
# Copy this file to tagarr_import.conf and fill in your values.
# === PRIMARY RADARR ===
# The Radarr instance this script runs in (Connect > Custom Script).
# URL: if running inside the Radarr container, use http://localhost:7878.
# If running on the host or another container, use the appropriate address.
# API key: found in Radarr > Settings > General > API Key.
# Name: display label for logs and Discord (can be anything).
PRIMARY_RADARR_URL="http://localhost:7878"
PRIMARY_RADARR_API_KEY="your-api-key-here"
PRIMARY_RADARR_NAME="Radarr"
# === SECONDARY RADARR ===
# Optional second Radarr instance (e.g., 4K). When enabled, every tag
# add/remove is mirrored to the secondary for movies that exist in both
# (matched by TMDb ID). Set to false if you only have one instance.
ENABLE_SYNC_TO_SECONDARY=false
SECONDARY_RADARR_URL="http://localhost:7979"
SECONDARY_RADARR_API_KEY="your-api-key-here"
SECONDARY_RADARR_NAME="Radarr 4K"
# === RELEASE GROUPS ===
# Each entry defines a release group to tag. Format:
# "search_string:tag_name:display_name:mode"
#
# Fields:
# search_string — Text to match against Radarr's releaseGroup field.
# Case-insensitive, checked against: filename, scene name,
# and releaseGroup field.
# tag_name — Tag label created in Radarr (lowercase, no spaces).
# display_name — Human-readable name for logs and Discord (any casing).
# mode — "filtered" = must pass quality+audio filters below.
# "simple" = tags every release from this group.
#
# Commented entries (#) are ignored for tagging but counted as "known" by
# discovery — the group won't be re-discovered.
# See docs/tagarr-guide.md for full details on each field.
RELEASE_GROUPS=(
"thefarm:thefarm:TheFarm:filtered" # Only MA/Play + lossless
"flux:flux:FLUX:filtered" # Only MA/Play + lossless
"sic:sic:SIC:filtered" # Only MA/Play + lossless
"126811:126811:126811:filtered" # Only MA/Play + lossless
"xebec:xebec:XEBEC:filtered" # Only MA/Play + lossless
#"groupname:tagname:DisplayName:filtered"
)
# === QUALITY FILTERS ===
# Only applies to "filtered" mode groups. When enabled, the release must
# come from one of the enabled WEB-DL sources. MA and Play are premium
# sources that preserve original studio master audio.
# Set ENABLE_QUALITY_FILTER=false to skip quality checks entirely.
# See docs/tagarr-guide.md for why MA/Play are special.
ENABLE_QUALITY_FILTER=true
ENABLE_MA_WEBDL=true # Movies Anywhere WEB-DL (studio master source)
ENABLE_PLAY_WEBDL=true # Google Play WEB-DL (comparable to MA)
# === AUDIO FILTERS ===
# Only applies to "filtered" mode groups. When enabled, the release must
# contain one of the enabled lossless codecs. Lossy codecs (EAC3, AAC, AC3)
# and upmixed/transcoded audio are automatically rejected.
# Set ENABLE_AUDIO_FILTER=false to skip audio checks entirely.
# See docs/tagarr-guide.md for codec details.
ENABLE_AUDIO_FILTER=true
ENABLE_TRUEHD=true # Dolby TrueHD (lossless, typically 7.1)
ENABLE_TRUEHD_ATMOS=true # Dolby TrueHD Atmos (lossless + spatial audio)
ENABLE_DTS_X=true # DTS:X (lossless + spatial, DTS equivalent of Atmos)
ENABLE_DTS_HD_MA=true # DTS-HD Master Audio (lossless surround)
# === RELEASE GROUP RECOVERY (post-import fix) ===
# When the imported movie has an empty/unknown release group, recover it
# using the download ID from the Radarr Connect event. The download ID
# matches the exact grab that produced this import — no guessing needed.
# Recovery runs before tagging so the recovered group is available for
# tag matching. A rename is triggered after recovery.
#
# This is a POST-IMPORT fix: it only helps when import succeeded but the
# release group field ended up empty. For releases that fail to import
# entirely (e.g., due to score drops from stripped filenames), see the
# GRAB-TIME RENAME section below — it prevents the problem at the source.
# The two are complementary; with grab rename active for whitelisted groups,
# recovery rarely needs to fire for those groups.
ENABLE_RECOVER=true
# === GRAB-TIME RENAME (pre-import metadata fix) [EXPERIMENTAL] ===
# When Radarr grabs a release, this renames the qBit display name to
# match radarr_release_title. This ensures Radarr's import parser sees
# the full release name with all CF-relevant tokens (release group,
# WEB-DL, IMAX, audio codecs etc.), preventing download loops where
# stripped torrent names cause score drops below the upgrade threshold.
#
# Runs on ALL grabs when enabled. The rename is purely cosmetic (qBit
# display name only, never touches files on disk), but Radarr uses it
# as sceneName for import scoring.
#
# Discord notification is only sent when meaningful tokens were recovered
# (e.g. release group added, WEB→WEB-DL, IMAX recovered). Plain cosmetic
# renames (dots vs spaces) are silent — no notification spam.
#
# IMPORTANT — Prowlarr setting:
# This feature works best when Prowlarr is set to use the RELEASE NAME
# from the indexer, not the actual filename. This is configured per
# indexer in Prowlarr under Settings > Indexers > (edit) > "Use File
# Names for Single Episode Results" = OFF (or equivalent setting).
#
# Why: Many release groups (e.g. 126811) strip metadata from their
# filenames — the actual torrent file might be named just
# "Movie.2024.1080p.WEB.H264" while the indexer's release name is
# "Movie.2024.1080p.MA.WEB-DL.TrueHD.Atmos.H.265-126811". Using the
# release name gives Radarr (and this script) the full metadata.
#
# Trade-off: Some trackers rename scene "WEB" releases to "WEB-DL" in
# their release names. This means scene releases may appear as WEB-DL
# instead of WEB, which bypasses the Scene Custom Format penalty. See
# GRAB_RENAME_EXCLUDE_SCENE below to control this behavior.
#
# To enable: Add "On Grab" to the Connect handler events in Radarr UI.
ENABLE_GRAB_RENAME=false
# Scene release handling for grab rename.
# Scene releases are detected from the original torrent name using the
# same pattern as TRaSH Scene CF (WEB without DL, or known scene groups).
#
# false (default) = Rename ALL grabs including scene. If the rename
# changes Scene CF matching (e.g. torrent has WEB, grab title has
# WEB-DL), a Discord notification is sent with a Scene CF warning.
# This gives consistent import scoring but means the Scene CF penalty
# (-10000) won't apply to renamed scene releases.
#
# true = Skip rename for detected scene releases. Preserves accurate
# scene detection but may cause download loops if the tracker renamed
# WEB to WEB-DL in the release name — Radarr grabs at WEB-DL score
# but imports at WEB score (lower), triggering re-grab.
GRAB_RENAME_EXCLUDE_SCENE=false
# Optional Movie Version tokens to track for grab rename.
# These are Custom Formats that score based on release title text
# (not file metadata), so the token can be lost if the torrent name
# is stripped. When enabled, the script checks if the token is present
# in the grab title but missing from the qBit name, and includes it
# as a reason to rename. Default: true (enabled).
GRAB_RENAME_IMAX=false # IMAX / IMAX Enhanced (TRaSH CF)
GRAB_RENAME_OPEN_MATTE=false # Open Matte (TRaSH CF, +25 default)
# === CUSTOM RENAME TOKENS ===
# You probably don't need to touch this. The rename already handles
# the most common tokens automatically:
#
# Release group, WEB-DL, MA/Play WEB-DL, TrueHD, Atmos, DTS-X,
# DTS-HD MA, IMAX, Open Matte
#
# Only add a token here if you notice a specific Custom Format NOT
# being picked up after a grab rename. Format: "Label:regex".
#
# Example — if you score "Remaster" or "Criterion Collection" in your
# quality profile and notice those tokens getting lost:
# "Remaster:\\bremaster(ed)?\\b"
# "Criterion:\\bcriterion\\b"
GRAB_RENAME_CUSTOM_TOKENS=(
# "Remaster:\\bremaster(ed)?\\b"
# "Criterion:\\bcriterion\\b"
)
# === QBIT CONNECTION ===
# Tell the script how to reach your qBittorrent Web UI.
# Format: "Name:URL"
#
# How to fill this in:
# 1. Open Radarr → Settings → Download Clients
# 2. Find the Name of your qBit client (e.g. "qBittorrent")
# 3. Use that exact name as the first part, before the colon
# 4. Put your qBit Web UI address as the second part, after the colon
#
# Example — your Radarr download client is named "qBittorrent"
# and qBit runs at http://192.168.1.100:8080:
#
# QBIT_CLIENTS=(
# "qBittorrent:http://192.168.1.100:8080"
# )
#
# If your client name has spaces (e.g. "qBit Movies"), make sure to
# keep the quotes around the whole entry — they're required:
#
# QBIT_CLIENTS=(
# "qBit Movies:http://192.168.1.100:8080"
# )
#
# If you only have one qBit, the name doesn't strictly need to match —
# the script will use the only URL it finds. But setting it correctly
# avoids confusing log messages.
#
# Multiple qBit instances: add one line per client. The name MUST match
# so the script knows which qBit handled each grab.
#
# Note: qBit must allow API access without login (subnet whitelist or
# auth bypass). This script does not support username/password auth.
QBIT_CLIENTS=(
"qBittorrent:http://your-host:8080"
# "qBit-tv:http://your-host:8081"
)
# === DISCOVERY ===
# When the imported movie's release group is not in RELEASE_GROUPS (active
# or commented) and passes both quality and audio filters, it's written to
# this config as a commented entry. Discovery requires a release group to
# exist — movies with no group (and failed/disabled recovery) are skipped.
# Concurrent writes are protected by flock to prevent corruption.
ENABLE_DISCOVERY=true
# === AUTO-TAG DISCOVERED GROUPS ===
# When true, discovered groups are added as active entries (without #)
# AND the triggering movie is tagged immediately in the same run.
# Unlike tagarr.sh where two runs are needed, the import script can
# tag immediately because it handles a single movie at a time.
# When false, groups are added as commented entries for manual review.
AUTO_TAG_DISCOVERED=false
# === DISCORD NOTIFICATIONS ===
# Smart notifications: only sends when something happened (tag applied,
# group discovered, or release group recovered). Silent imports produce
# no notification. Includes movie poster thumbnail.
# Create a webhook: Server Settings > Integrations > Webhooks > New Webhook.
DISCORD_ENABLED=false
DISCORD_WEBHOOK_URL=""
# === DEBUG ===
# Logs every filter decision for each event: which groups matched, via
# which field, quality/audio filter pass/fail, skip reasons, discovery
# decisions. Enable when a movie isn't being tagged and you want to
# understand why. Check the log file after the next import.
ENABLE_DEBUG=false
# === LOGGING ===
# Log file for all output (timestamped). Since the script runs automatically
# in the background, logging is the primary way to verify it's working.
# Rotated at 2 MiB (keeps one .old backup).
ENABLE_LOGGING=true
LOG_FILE="${SCRIPT_DIR}/logs/tagarr_import.log"