This Flask application listens for webhooks from Tautulli and caches the next two episodes in a TV show series using rclone VFS. This helps in preloading the next episodes for smooth playback.
- Listens for webhook events from Tautulli.
- Reads and caches the next two episodes in the current season.
- If the current season ends, it moves to the first episode of the next season.
- Optimized for low memory usage with Alpine-based Docker image.
- Configurable through environment variables.
- Docker
- Docker Compose
- Tautulli for sending webhook events
The following environment variables can be used to configure the application:
FILES_TO_SCAN: Number of files to scan (default: 2)READ_MB: Amount of data to read from each file in MB (default: 64)FLASK_ENV: Flask environment (default:production)FLASK_DEBUG: Enable Flask debug mode (default:false)
-
Clone the repository:
git clone https://github.com/yourusername/cache-tv-show-webhook.git cd cache-tv-show-webhook -
Create and configure the Docker environment:
Create a
.envfile in the project root with the following content:FLASK_ENV=production FLASK_DEBUG=false FILES_TO_SCAN=2 READ_MB=64
-
Build and run the Docker container:
docker-compose build docker-compose up -d
-
Set up the webhook in Tautulli:
- Go to Tautulli's web interface.
- Navigate to
Settings>Notification Agents. - Add a new
Webhookagent. - Set the webhook URL to
http://<your-server-ip>:6969/webhook. - Configure triggers for
Playback Start.
-
Monitor the logs:
You can monitor the logs to see the application in action:
docker-compose logs -f
{
"event": "play",
"file": "/DATA/Media/library/shows/Breaking Bad (2008) {imdb-tt0903747}/Season 02/Breaking Bad (2008) - s02e05 - Breakage.mkv",
"media_type": "episode"
}