Plex Prerolls

GPL-3.0
Platform
Docker Self-hosted
Licence
GPL-3.0 Open source
Plex Prerolls

Plex Prerolls

Website: codeberg.org/nwithan8/plex-prerolls

Plex Prerolls is a small Python service that keeps Plex’s pre-roll setting in step with a schedule you write in YAML. Instead of editing the list of intro videos by hand, you describe which files should play on which dates, and the service rewrites Plex’s cinemaTrailersPrerollID setting on each run. It is configured through config.yaml; there is no browser interface, and logs and rendered files stay on disk.

It is free and open source under GPL-3.0. The useful part is the scheduling model. Entries can be permanent, tied to a date range (with wildcards), tied to a week or month, weighted so seasonal clips appear more often, or calculated from floating holidays such as Thanksgiving. Path globbing lets you point at a local preroll directory and have the container translate the matches into the paths Plex sees. The optional webhook feature goes further: when Plex reports a newly added item, it can fetch a trailer and poster, render a short “recently added” clip with ffmpeg, and add it to the rotation. That needs Plex Pass, yt-dlp cookies and the container running beside Plex. The project does not automate Jellyfin or Emby; the README points to those servers’ own intro plugins instead.

Key Features

  • Always-on pool: list prerolls that every active schedule includes by default, optionally using count to pick a random subset on each run.
  • Date-range scheduling: start and end values accept dates, datetimes and wildcards, so a range can cover a single evening, an annual holiday or the second day of every month.
  • Weekly and monthly rules: target a week or month of the year without writing explicit dates, which suits annual rotations.
  • Weighting and overrides: give a schedule a higher weight so its clips are repeated in Plex’s random pool, and use disable_always to suppress the permanent list while a holiday schedule is active.
  • Floating holidays: name a holiday, country and optional subdivision, then offset the start or end by a number of days; the dates are calculated for the current year.
  • Path globbing: match files by pattern under a local root, such as *.mp4 or subdir/**/*.mkv, and translate them to the corresponding Plex path. This requires the container to run on the same machine as Plex.
  • Recently added prerolls: accept Plex webhooks at /recently-added, pull a trailer with yt-dlp and render a preroll for new media, keeping a rolling total of ten items by default.
  • Container deployment: run one Docker image on port 8283 with mounted paths for config, logs, preroll files, renders and auto-generated rolls; the image exposes a /ping healthcheck endpoint.

Licence

GPL-3.0. You can run it, change it and redistribute it, but if you distribute a modified version you must make the source available under the same licence. That suits a self-hosted helper like this.

Explore More Categories

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.