Skip to content

Commit 5c190f9

Browse files
committed
update
1 parent 8e4a7d5 commit 5c190f9

File tree

1 file changed

+62
-38
lines changed

1 file changed

+62
-38
lines changed

README.md

Lines changed: 62 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</tr>
99
</table>
1010

11-
**NOTE**: This utilizes Radarr API Version - `3`. The Script: [huntarr.sh](huntarr.sh)
11+
**NOTE**: This utilizes Radarr API Version - `3`.
1212

1313
## Table of Contents
1414
- [Overview](#overview)
@@ -27,12 +27,12 @@
2727

2828
## Overview
2929

30-
This script continually searches your Radarr library for missing movies and movies that need quality upgrades. It automatically triggers searches for both missing movies and movies below your quality cutoff. It's designed to run continuously while being gentle on your indexers, helping you gradually complete your movie collection with the best available quality.
30+
This script continually searches your Radarr library for movies with missing files and movies that need quality upgrades. It automatically triggers searches for both missing movies and movies below your quality cutoff. It's designed to run continuously while being gentle on your indexers, helping you gradually complete your movie collection with the best available quality.
3131

3232
## Related Projects
3333

34-
* [Huntarr - Sonarr Edition](https://github.com/plexguide/Sonarr-Hunter) - Sister version for TV shows
35-
* [Huntarr - Lidarr Edition](https://github.com/plexguide/Lidarr-Hunter) - Sister version for music
34+
* [Huntarr - Sonarr Edition](https://github.com/plexguide/Huntarr-Sonarr) - Sister version for TV shows
35+
* [Huntarr - Lidarr Edition](https://github.com/plexguide/Huntarr-Lidarr) - Sister version for music
3636
* [Unraid Intel ARC Deployment](https://github.com/plexguide/Unraid_Intel-ARC_Deployment) - Convert videos to AV1 Format (I've saved 325TB encoding to AV1)
3737
* Visit [PlexGuide](https://plexguide.com) for more great scripts
3838

@@ -52,6 +52,9 @@ My 12-year-old daughter is passionate about singing, dancing, and exploring STEM
5252
- 🛡️ **Error Handling**: Gracefully handles connection issues and API failures
5353
- 🔁 **State Tracking**: Remembers which movies have been processed to avoid duplicate searches
5454
- ⚙️ **Configurable Reset Timer**: Automatically resets search history after a configurable period
55+
- 📦 **Modular Design**: Modern codebase with separated concerns for easier maintenance
56+
- ⏲️ **Configurable Timeouts**: Adjustable API timeout for large libraries
57+
- 🗓️ **Future Release Filtering**: Option to skip movies with future release dates
5558

5659
## Indexers Approving of Huntarr:
5760
* https://ninjacentral.co.za
@@ -61,6 +64,7 @@ My 12-year-old daughter is passionate about singing, dancing, and exploring STEM
6164
1. **Initialization**: Connects to your Radarr instance and analyzes your library
6265
2. **Missing Movies**:
6366
- Identifies movies without files
67+
- Optionally filters out future releases
6468
- Randomly selects movies to process (up to configurable limit)
6569
- Refreshes metadata and triggers searches
6670
3. **Quality Upgrades**:
@@ -99,31 +103,40 @@ The following environment variables can be configured:
99103
|------------------------------|-----------------------------------------------------------------------|---------------|
100104
| `API_KEY` | Your Radarr API key | Required |
101105
| `API_URL` | URL to your Radarr instance | Required |
106+
| `API_TIMEOUT` | Timeout in seconds for API requests to Radarr | 60 |
102107
| `MONITORED_ONLY` | Only process monitored movies | true |
103-
| `SEARCH_TYPE` | Which search to perform: `"missing"`, `"upgrade"`, or `"both"` | both |
104-
| `MAX_MISSING` | Maximum missing movies to process per cycle | 1 |
105-
| `MAX_UPGRADES` | Maximum upgrade movies to process per cycle | 5 |
108+
| `SKIP_FUTURE_RELEASES` | Skip processing movies with release dates in the future | true |
109+
| `HUNT_MISSING_MOVIES` | Maximum missing movies to process per cycle | 1 |
110+
| `HUNT_UPGRADE_MOVIES` | Maximum upgrade movies to process per cycle | 5 |
106111
| `SLEEP_DURATION` | Seconds to wait after completing a cycle (900 = 15 minutes) | 900 |
107112
| `RANDOM_SELECTION` | Use random selection (`true`) or sequential (`false`) | true |
108113
| `STATE_RESET_INTERVAL_HOURS` | Hours which the processed state files reset (168=1 week, 0=never reset) | 168 |
109114
| `DEBUG_MODE` | Enable detailed debug logging (`true` or `false`) | false |
110115

111116
### Detailed Configuration Explanation
112117

113-
- **SEARCH_TYPE**
114-
- Determines which type of search the script performs.
115-
- Options:
116-
- `"missing"`: Only processes missing movies (movies that haven't been downloaded yet).
117-
- `"upgrade"`: Only processes movies that need quality upgrades (do not meet the quality cutoff).
118-
- `"both"`: First processes missing movies and then processes upgrade movies in one cycle.
118+
- **API_TIMEOUT**
119+
- Sets the maximum number of seconds to wait for Radarr API responses before timing out.
120+
- This is particularly important when working with large libraries.
121+
- If you experience timeout errors, increase this value.
122+
- For libraries with thousands of movies, values of 90-120 seconds may be necessary.
123+
- Default is 60 seconds, which works well for most medium-sized libraries.
119124

120-
- **MAX_MISSING**
125+
- **SKIP_FUTURE_RELEASES**
126+
- When set to `true`, movies with release dates in the future will be skipped during missing movie processing.
127+
- This prevents searching for content that isn't yet available.
128+
- The script checks physical, digital, and theater release dates.
129+
- Set to `false` if you want to process all missing movies regardless of release date.
130+
131+
- **HUNT_MISSING_MOVIES**
121132
- Sets the maximum number of missing movies to process in each cycle.
122133
- Once this limit is reached, the script stops processing further missing movies until the next cycle.
134+
- Set to `0` to disable missing movie processing completely.
123135

124-
- **MAX_UPGRADES**
136+
- **HUNT_UPGRADE_MOVIES**
125137
- Sets the maximum number of upgrade movies to process in each cycle.
126-
- When this limit is reached, the upgrade portion of the cycle stops and the script waits for the next cycle.
138+
- When this limit is reached, the upgrade portion of the cycle stops.
139+
- Set to `0` to disable quality upgrade processing completely.
127140

128141
- **RANDOM_SELECTION**
129142
- When `true`, selects movies randomly, which helps distribute searches across your library.
@@ -133,9 +146,9 @@ The following environment variables can be configured:
133146
- Controls how often the script "forgets" which movies it has already processed.
134147
- The script records the IDs of missing movies and upgrade movies that have been processed.
135148
- When the age of these records exceeds the number of hours set by this variable, the records are cleared automatically.
136-
- This reset allows the script to re-check movies that were previously processed, so if there are changes (such as improved quality), they can be processed again.
149+
- This reset allows the script to re-check movies that were previously processed, so if there are changes (such as improved quality), they can be processed again.
137150
- Setting this to `0` will disable the reset functionality entirely - processed items will be remembered indefinitely.
138-
- Default is 168 hours (one week) - meaning the script will start fresh and re-check everything weekly.
151+
- Default is 168 hours (one week) - meaning the script will start fresh weekly.
139152

140153
- **DEBUG_MODE**
141154
- When set to `true`, the script will output detailed debugging information about API responses and internal operations.
@@ -154,16 +167,16 @@ docker run -d --name huntarr-radarr \
154167
--restart always \
155168
-e API_KEY="your-api-key" \
156169
-e API_URL="http://your-radarr-address:7878" \
170+
-e API_TIMEOUT="90" \
157171
-e MONITORED_ONLY="true" \
158-
-e SEARCH_TYPE="both" \
159-
-e MAX_MISSING="1" \
160-
-e MAX_UPGRADES="5" \
172+
-e SKIP_FUTURE_RELEASES="true" \
173+
-e HUNT_MISSING_MOVIES="1" \
174+
-e HUNT_UPGRADE_MOVIES="5" \
161175
-e SLEEP_DURATION="900" \
162176
-e RANDOM_SELECTION="true" \
163177
-e STATE_RESET_INTERVAL_HOURS="168" \
164178
-e DEBUG_MODE="false" \
165-
huntarr/4radarr:latest
166-
```
179+
huntarr/huntarr-radarr:3.1
167180

168181
To check on the status of the program, you should see new files downloading or you can type:
169182
```bash
@@ -178,16 +191,17 @@ For those who prefer Docker Compose, add this to your `docker-compose.yml` file:
178191
version: "3.8"
179192
services:
180193
huntarr-radarr:
181-
image: huntarr/4radarr:latest
194+
image: huntarr/huntarr-radarr:3.1
182195
container_name: huntarr-radarr
183196
restart: always
184197
environment:
185198
API_KEY: "your-api-key"
186199
API_URL: "http://your-radarr-address:7878"
200+
API_TIMEOUT: "90"
187201
MONITORED_ONLY: "true"
188-
SEARCH_TYPE: "both"
189-
MAX_MISSING: "1"
190-
MAX_UPGRADES: "5"
202+
SKIP_FUTURE_RELEASES: "true"
203+
HUNT_MISSING_MOVIES: "1"
204+
HUNT_UPGRADE_MOVIES: "5"
191205
SLEEP_DURATION: "900"
192206
RANDOM_SELECTION: "true"
193207
STATE_RESET_INTERVAL_HOURS: "168"
@@ -213,15 +227,16 @@ docker run -d --name huntarr-radarr \
213227
--restart always \
214228
-e API_KEY="your-api-key" \
215229
-e API_URL="http://your-radarr-address:7878" \
230+
-e API_TIMEOUT="90" \
216231
-e MONITORED_ONLY="true" \
217-
-e SEARCH_TYPE="both" \
218-
-e MAX_MISSING="1" \
219-
-e MAX_UPGRADES="5" \
232+
-e SKIP_FUTURE_RELEASES="true" \
233+
-e HUNT_MISSING_MOVIES="1" \
234+
-e HUNT_UPGRADE_MOVIES="5" \
220235
-e SLEEP_DURATION="900" \
221236
-e RANDOM_SELECTION="true" \
222237
-e STATE_RESET_INTERVAL_HOURS="168" \
223238
-e DEBUG_MODE="false" \
224-
huntarr/4radarr:latest
239+
huntarr/huntarr-radarr:3.1
225240

226241
### SystemD Service
227242

@@ -241,10 +256,11 @@ Type=simple
241256
User=your-username
242257
Environment="API_KEY=your-api-key"
243258
Environment="API_URL=http://localhost:7878"
259+
Environment="API_TIMEOUT=90"
244260
Environment="MONITORED_ONLY=true"
245-
Environment="SEARCH_TYPE=both"
246-
Environment="MAX_MISSING=1"
247-
Environment="MAX_UPGRADES=5"
261+
Environment="SKIP_FUTURE_RELEASES=true"
262+
Environment="HUNT_MISSING_MOVIES=1"
263+
Environment="HUNT_UPGRADE_MOVIES=5"
248264
Environment="SLEEP_DURATION=900"
249265
Environment="RANDOM_SELECTION=true"
250266
Environment="STATE_RESET_INTERVAL_HOURS=168"
@@ -271,16 +287,19 @@ sudo systemctl start huntarr
271287
- **New Movie Setup**: Automatically find newly added movies
272288
- **Background Service**: Run it in the background to continuously maintain your library
273289
- **Smart Rotation**: With state tracking, ensures all content gets attention over time
290+
- **Large Library Management**: With optimized performance and configurable timeouts, handles even the largest libraries
291+
- **Release Date Awareness**: Skip movies that aren't released yet, focusing only on currently available content
274292
275293
## Tips
276294
277295
- **First-Time Use**: Start with default settings to ensure it works with your setup
278296
- **Adjusting Speed**: Lower the `SLEEP_DURATION` to search more frequently (be careful with indexer limits)
279-
- **Focus on Missing or Upgrades**: Use the `SEARCH_TYPE` setting to focus on what matters to you
280-
- **Batch Size Control**: Adjust `MAX_MISSING` and `MAX_UPGRADES` based on your indexer's rate limits
297+
- **Batch Size Control**: Adjust `HUNT_MISSING_MOVIES` and `HUNT_UPGRADE_MOVIES` based on your indexer's rate limits
281298
- **Monitored Status**: Set `MONITORED_ONLY=false` if you want to download all missing movies regardless of monitored status
282299
- **System Resources**: The script uses minimal resources and can run continuously on even low-powered systems
283300
- **Debugging Issues**: Enable `DEBUG_MODE=true` temporarily to see detailed logs when troubleshooting
301+
- **API Timeouts**: If you have a large library, increase the `API_TIMEOUT` value to 90-120 seconds to prevent timeout errors
302+
- **Future Releases**: Use `SKIP_FUTURE_RELEASES=true` to avoid searching for movies not yet released
284303

285304
## Troubleshooting
286305

@@ -289,7 +308,8 @@ sudo systemctl start huntarr
289308
- **Command Failures**: If search commands fail, try using the Radarr UI to verify what commands are available in your version
290309
- **Logs**: Check the container logs with `docker logs huntarr-radarr` if running in Docker
291310
- **Debug Mode**: Enable `DEBUG_MODE=true` to see detailed API responses and process flow
292-
- **State Files**: The script stores state in `/tmp/huntarr-radarr-state/` - if something seems stuck, you can try deleting these files
311+
- **State Files**: The script stores state in `/tmp/huntarr-state/` - if something seems stuck, you can try deleting these files
312+
- **Timeout Errors**: If you see "Read timed out" errors, increase the `API_TIMEOUT` value to give Radarr more time to respond
293313
294314
---
295315
@@ -301,6 +321,10 @@ sudo systemctl start huntarr
301321
- **v5**: Added debug mode and improved error handling
302322
- **v6**: Enhanced random selection mode for better distribution
303323
- **v7**: Renamed from "Radarr Hunter" to "Huntarr [Radarr Edition]"
324+
- **v8**: Complete modular refactoring for better maintainability
325+
- **v9**: Added configurable API timeout and standardized parameter naming with HUNT_ prefix
326+
- **v10**: Added version tags for improved stability and predictable updates
327+
- **v11**: Added SKIP_FUTURE_RELEASES option to prevent searching for unreleased movies
304328
305329
---
306330
@@ -310,4 +334,4 @@ This script helps automate the tedious process of finding missing movies and qua
310334

311335
Thanks to:
312336

313-
[IntensiveCareCub](https://www.reddit.com/user/IntensiveCareCub/) for the Hunter to Huntarr idea!
337+
[IntensiveCareCub](https://www.reddit.com/user/IntensiveCareCub/) for the Hunter to Huntarr idea!

0 commit comments

Comments
 (0)