Scrobblarr is a Flask-based application designed to handle media scrobbling events and interact with Sonarr for managing TV series episodes. It listens for Plex webhook events, processes them, and performs actions such as deleting or unmonitoring episodes based on the configuration.
- Webhook Listener: Handles
media.scrobble
events from media servers. - Database Management: Stores scrobbling data in a SQLite database.
- Sonarr Integration: Deletes or unmonitors episodes in Sonarr based on configuration.
- Dynamic Configuration: Watches for changes in
config.json
and reloads automatically.
- Plex
- Sonarr
- Docker
- Docker Compose
-
Create a
config.json
file in the root directory with the following structure:{ "sonarr": { "url": "http://your-sonarr-url", "api_key": "your-sonarr-api-key" }, "grace_days": 2, # Global grace days before deleting episodes "unmonitor_after_delete": true, "series_settings": { # Series-specific settings "Example Series": { "grace_days": 0 } } }
-
Create a
docker-compose.yml
file with the following content:version: '3.8' services: scrobblarr: image: ibooker88/scrobblarr container_name: scrobblarr ports: - "5000:5000" environment: - TIMEZONE=America/New_York volumes: - ./config.json:/app/config.json restart: unless-stopped
-
Start the application using Docker Compose:
docker-compose up -d
To configure Plex to send webhook events to Scrobblarr, follow these steps:
- Open Plex and navigate to
Settings
. - Under
Webhooks
, add a new webhook. - Enter the following URL as the webhook target:
Replace
http://<scrobblarr-host>:5000/webhook
<scrobblarr-host>
with the IP address or hostname of the machine running Scrobblarr. - Save the webhook configuration.
Once configured, Plex will send media.scrobble
events to Scrobblarr, which will process them based on your settings.
The application uses a SQLite database (watched.db
) to store scrobbling data. The database is initialized automatically if it does not exist.
Logs are printed to the console with different levels (INFO, WARNING, ERROR) to help monitor the application's behavior.
Scrobblarr supports hot reloading of the config.json
file. This means that any changes made to the configuration file will be automatically detected and applied without needing to restart the application.
- The application continuously monitors the
config.json
file for changes. - When a change is detected, the configuration is reloaded, and the new settings are applied immediately.
- This allows you to update settings such as Sonarr integration, grace days, or series-specific overrides on the fly.
- No downtime required for configuration updates.
- Simplifies the process of fine-tuning application behavior.
This project is licensed under the MIT License. See the LICENSE
file for details.
The Docker image for Scrobblarr is available on Docker Hub. You can find it here: