explaingit

jayvig79/plex-preroll-automation

Analysis updated 2026-05-18

4ShellAudience · ops devopsComplexity · 2/5LicenseSetup · moderate

TLDR

A set of Bash scripts that automatically keeps a Plex server's preroll trailer list synced with a folder of video files, using cron and the Plex API.

Mindmap

mindmap
  root((repo))
    What it does
      Watches preroll folder
      Regenerates preroll list
      Updates Plex via API
    Tech stack
      Bash
      Plex API
      cron
    Use cases
      Automate Plex prerolls
      Homelab media server
      Scheduled syncing
    Audience
      Plex server owners
      Homelab hobbyists

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Automatically update a Plex server's preroll trailer list whenever a video file is added, removed, or renamed in a folder.

USE CASE 2

Set up scheduled monitoring with cron so preroll changes sync without any manual steps.

USE CASE 3

Run the installer to configure the Plex server URL, preroll folder, and API token in one pass.

What is it built with?

BashShellPlex APIcurlcron

How does it compare?

jayvig79/plex-preroll-automationappleaa123/fable_oskelseyhightower/kubestack-release
Stars444
LanguageShellShellShell
Last pushed2015-06-07
MaintenanceDormant
Setup difficultymoderatemoderatemoderate
Complexity2/53/53/5
Audienceops devopsdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a running Plex Media Server and a Plex API token before the installer can finish.

MIT License: free to use, modify, and distribute, including for commercial purposes, as long as the copyright notice is kept.

In plain English

Plex Preroll Automation is a set of Bash scripts that keeps a Plex media server's Cinema Trailers preroll list automatically synced with a folder of video files. Prerolls are the short clips, similar to movie theater trailers, that Plex can play before the main content starts. Normally, adding or removing these clips means manually editing settings inside Plex, but this project handles that step automatically. A person simply adds, removes, renames, or replaces video files in a designated preroll folder. A watcher script detects the change, regenerates Plex's semicolon separated list of preroll files, and pushes that update to the Plex server through its API, all without any manual editing of Plex settings. Installation is done by cloning the repository and running an included install script, which asks for the preroll folder location, the Plex server's URL, and a Plex API token, then saves those into a single configuration file and makes the other scripts executable. The installer can also generate the initial preroll list and push the first update to Plex right away. To keep everything synced automatically going forward, the watcher script is meant to be scheduled with cron, a standard Linux tool for running tasks on a timer, checking for folder changes every few minutes. From that point on, adding a new video file to the folder is enough to have it appear in Plex's preroll rotation with no further steps. The project requires a running Plex Media Server, Bash, curl, cron, and a Plex API token, but does not require Docker. It is licensed under the MIT License, making it free to use and modify, and was built by Jason Viglione to remove the manual work of maintaining Plex prerolls.

Copy-paste prompts

Prompt 1
Walk me through cloning this repo and running install.sh to set up my Plex preroll folder.
Prompt 2
Help me find my Plex API token so I can configure this project.
Prompt 3
Explain how to schedule watch_prerolls.sh with cron so it checks for changes every 5 minutes.
Prompt 4
What does config.env need to contain for this project to work with my Plex server.

Frequently asked questions

What is plex-preroll-automation?

A set of Bash scripts that automatically keeps a Plex server's preroll trailer list synced with a folder of video files, using cron and the Plex API.

What language is plex-preroll-automation written in?

Mainly Shell. The stack also includes Bash, Shell, Plex API.

What license does plex-preroll-automation use?

MIT License: free to use, modify, and distribute, including for commercial purposes, as long as the copyright notice is kept.

How hard is plex-preroll-automation to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is plex-preroll-automation for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.