Automatically manage IMDb trailers for your media library.
Trailerfin is a tool for automatically retrieving and refreshing IMDb trailer links for your media library as the backdrop video.
Instead of downloading the trailer locally, it will create a .strm file that Jellyfin can use to play the video.
It will check the expiration of the link and only update when the link has expired.
- Scans directories for IMDb IDs and updates trailer links
- Fetches the latest trailer or video from IMDb
- Prioritizes trailers over clips when both are available
- Maintains an ignore list for movies without trailers
- Continuous monitoring mode for automatic updates
- Configurable via environment variables
- Docker and Docker Compose support
- Robust logging for monitoring and troubleshooting
- Python 3.11+
- Docker (recommended)
- IMDb IDs in your media folder structure
- Make sure Theme videos are enabled in Settings > Display > Libraies per device
git clone https://github.com/Pukabyte/trailerfin.git
cd trailerfinCreate a .env file in the project root with the following variables:
SCAN_PATH=/path/to/your/media
VIDEO_FILENAME=trailer.strm
WORKERS=4
VIDEO_START_TIME=10SCAN_PATH: Directory to scan for IMDb IDsVIDEO_FILENAME: Name of the .strm file to updateWORKERS: Amount of workers to useVIDEO_START_TIME: Start time in seconds for the video (default: 10)
docker build -t trailerfin .docker run --env-file .env -v /path/to/your/media:/mnt/plex trailerfinA sample docker-compose.yml is provided:
services:
trailerfin:
build: .
container_name: trailerfin
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
volumes:
- /mnt:/mnt # Make sure this directory is where your content can be found in
- /opt/trailerfin:/app
- /etc/localtime:/etc/localtime:ro
restart: unless-stoppedStart with:
docker-compose up -dpython trailerfin.py --dir /path/to/your/mediapython trailerfin.py --dir /path/to/your/media --monitorThis mode will:
- Continuously monitor for new media
- Check for expiring links
- Automatically refresh links before they expire
- Skip movies without trailers
- Run in the background
- Automatically maintains a list of movies without trailers
- Prevents repeated attempts to fetch non-existent trailers
- Stored in
ignored_titles.json - Can be manually edited to retry specific movies
- Prioritizes trailers over clips
- Falls back to clips if no trailer is available
- Ensures best quality video content
- Tracks expiration times for all links
- Shows remaining time in minutes and seconds
- Automatically refreshes links before they expire
- Maintains state between runs
Logs are output to stdout and can be viewed with Docker logs or Compose logs. The logging includes:
- Link expiration times in readable format
- New media detection
- Ignored titles
- Error handling and troubleshooting information
MIT License