# Automatic Pre-roll Switching

**URL:** <https://forums.plex.tv/t/automatic-pre-roll-switching/662882>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [December 8, 2020, 3:14am UTC](https://forums.plex.tv/t/automatic-pre-roll-switching/662882 "2020-12-08T03:14:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hserver1](https://avatars.discourse-cdn.com/v4/letter/h/67e7ee/32.png) [@Hserver1](https://forums.plex.tv/u/Hserver1)\
**Post date:** [December 8, 2020, 3:14am UTC](https://forums.plex.tv/t/automatic-pre-roll-switching/662882/1 "2020-12-08T03:14:43Z")

</div>

**Automatic Pre-roll**

This is a python script intended to allow users to populate a config file with a list of trailers and have the script update their Plex server automatically.

The main branch: [https://github.com/TheHumanRobot/Plex-Automatic-Preroll/tree/main](https://github.com/TheHumanRobot/Plex-Automatic-Preroll/tree/main)  
currently allows for setting **Monthly** pre-rolls. Those can be configured to play back more than one file either randomly or in order depending on how the user configures it.

The dev branch [https://github.com/TheHumanRobot/Plex-Automatic-Preroll/tree/develop](https://github.com/TheHumanRobot/Plex-Automatic-Preroll/tree/develop) allows users to configure a **Monthly, Weekly, Daily, Misc, or Master set of pre-rolls**. The dev branch should be stable however it has not been as thoroughly tested. So if your looking for just monthly pre-roll switching use the main branch otherwise use the dev branch. The GitHub page provides more documentation and an example config. The script will also walk you through creating the config file and importing the PlexAPI if you so desire otherwise you can edit the config template yourself. If you have any questions, suggestions, or issues feel free to let me know.
