Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BUN_VERSION=1.2.14
ARG BUN_VERSION=1.2.21

FROM oven/bun:${BUN_VERSION}-alpine AS base
WORKDIR /app
Expand Down
152 changes: 79 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,71 @@
# Redirecter
# Redirecterr

## Docker Compose

```yaml
services:
redirecterr:
image: varthe/redirecterr:latest
container_name: redirecterr
hostname: redirecterr
ports:
- 8481:8481
volumes:
- /path/to/config.yaml:/app/config.yaml
- /path/to/logs:/logs
environment:
- LOG_LEVEL=info
redirecterr:
image: varthe/redirecterr:latest
container_name: redirecterr
hostname: redirecterr
ports:
- 8481:8481
volumes:
- /path/to/config.yaml:/app/config.yaml
- /path/to/logs:/logs
environment:
- LOG_LEVEL=info
```

## Webhook setup

> [!IMPORTANT]
> Disable automatic request approval for your users

In Overseerr go to **Settings -> Notifications -> Webhook** and configure the following:

- **Enable Agent**: Enabled
- **Webhook URL**: `http://redirecterr:8481/webhook`
- **Notification Types**: Select **Request Pending Approval**
- **JSON Payload**:
```json
{
"notification_type": "{{notification_type}}",
"media": {
"media_type": "{{media_type}}",
"tmdbId": "{{media_tmdbid}}",
"status": "{{media_status}}",
"status4k": "{{media_status4k}}"
},
"request": {
"request_id": "{{request_id}}",
"requestedBy_email": "{{requestedBy_email}}",
"requestedBy_username": "{{requestedBy_username}}"
},
"{{extra}}": []
}
```
- **Enable Agent**: Enabled
- **Webhook URL**: `http://redirecterr:8481/webhook`
- **Notification Types**: Select **Request Pending Approval**
- **JSON Payload**:
```json
{
"notification_type": "{{notification_type}}",
"media": {
"media_type": "{{media_type}}",
"tmdbId": "{{media_tmdbid}}",
"status": "{{media_status}}",
"status4k": "{{media_status4k}}"
},
"request": {
"request_id": "{{request_id}}",
"requestedBy_email": "{{requestedBy_email}}",
"requestedBy_username": "{{requestedBy_username}}"
},
"{{extra}}": []
}
```

## Config

Create a `config.yaml` file with the following sections:

### Overseerr settings

```yaml
overseerr_url: ""
overseerr_api_token: ""
approve_on_no_match: true # Auto-approve if no filters match
approve_on_no_match: true # Auto-approve if no filters match
```

### Instances

Define your Radarr/Sonarr instances

```yaml
instances:
radarr:
server_id: 0 # Match the order in Overseerr > Settings > Services (example below)
radarr:
server_id: 0 # Match the order in Overseerr > Settings > Services (example below)
root_folder: /mnt/movies
# quality_profile_id: 1 # Optional
# approve: false # Optional (default is true)
Expand All @@ -72,67 +77,68 @@ instances:
```
http://<arr-url>/api/v3/qualityProfile?apiKey=<api-key>
```
- `approve`: Set to false to disable auto-approval.

- `approve`: Set to false to disable auto-approval.

### Filters

Filters route requests based on conditions.

```yaml
filters:
- media_type: movie
# is_4k: true # Optional
conditions:
keywords:
include: ["anime", "animation"]
contentRatings:
exclude: [12, 16]
requestedBy_username: user
max_seasons: 2
apply: radarr_anime
- media_type: movie
# is_4k: true # Optional
conditions:
keywords:
include: ["anime", "animation"]
contentRatings:
exclude: [12, 16]
requestedBy_username: user
max_seasons: 2
apply: radarr_anime
```

#### Fields

- `media_type`: `movie` or `tv`
- `is_4k` (Optional): Set to `true` to only match 4K requests. Set to `false` to only match non-4k requests. Leave empty to match both.
- `conditions`:
- `field`:
- `require`: All values must match
- `exclude`: None of the values must match
- `include`: At least one value matches
- `apply`: One or more instance names
- `media_type`: `movie` or `tv`
- `is_4k` (Optional): Set to `true` to only match 4K requests. Set to `false` to only match non-4k requests. Leave empty to match both.
- `conditions`:
- `field`:
- `require`: All values must match
- `exclude`: None of the values must match
- `include`: At least one value matches
- `apply`: One or more instance names

> [!TIP]
> For a list of possible condition fields see [fields.md](https://github.com/varthe/Redirecterr/blob/main/fields.md)

### Sample config

```yaml
overseerr_url: ""
overseerr_api_token: ""

approve_on_no_match: true

instances:
sonarr:
server_id: 0
root_folder: "/mnt/plex/Shows"
sonarr_4k:
server_id: 1
root_folder: "/mnt/plex/Shows - 4K"
sonarr_anime:
server_id: 2
root_folder: "/mnt/plex/Anime"
sonarr:
server_id: 0
root_folder: "/mnt/plex/Shows"
sonarr_4k:
server_id: 1
root_folder: "/mnt/plex/Shows - 4K"
sonarr_anime:
server_id: 2
root_folder: "/mnt/plex/Anime"

filters:
# Send anime to sonarr_anime
- media_type: tv
conditions:
keywords: anime
apply: sonarr_anime

# Send everything else to sonarr and sonarr_4k instances
- media_type: tv
apply: ["sonarr", "sonarr_4k"]
# Send anime to sonarr_anime
- media_type: tv
conditions:
keywords: anime
apply: sonarr_anime

# Send everything else to sonarr and sonarr_4k instances
- media_type: tv
apply: ["sonarr", "sonarr_4k"]
```
5 changes: 2 additions & 3 deletions fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is a comprehensive list of possible fields that may appear in incoming request data from Overseerr/Jellyseerr and can be used in filters.

Example values for each field can be found in [filters.test.js](https://github.com/varthe/Redirecterr/blob/main/filters.test.js)
Example values for each field can be found in [filters.test.ts](https://github.com/varthe/Redirecterr/blob/main/filters.test.ts)

- `requestedBy_email`
- `requestedBy_username`
Expand Down Expand Up @@ -32,8 +32,7 @@ Example values for each field can be found in [filters.test.js](https://github.c
- `spokenLanguages`
- `productionCompanies`
- `productionCountries`
- `networks`
- `networks`
- `inProduction`
- `numberOfSeasons` / `numberOfEpisodes`
- `contentRatings`

Loading