just a simple python script to build a recently added preroll for your plex server. piggybacking off far smarter people to automate a basic trailer builder based on the metadata of recently added movies.
Python 3.6
pip
FFMPEG
PLEX-API
Pytube3
python-dotenv
flask
- Set up your plex to speak to prerolls On the plex admin panel go to settings:
general -> turn on push notifications
webhooks -> Serverip/plexpreroll
- Install ffmpeg
sudo apt-get install ffmpeg -y
https://www.ffmpeg.org/download.html
- Install the python 4 packages
( server headless )
sudo pip3 install \
opencv-contrib-python-headless \
git+https://github.com/pytube/pytube
ffmpeg-python \
plexapi \
python-dotenv \
flask \
( standard desktop environments )
sudo pip3 install \
opencv-python
git+https://github.com/pytube/pytube
ffmpeg-python \
plexapi \
python-dotenv \
flask \
- download the project
Download and put the folder where you want the prerolls to be generated.
- configure preroll.py to your plex server
change the below fields to the details of your plex server
baseurl = 'Input Your Plex URL'
token = 'Input Your Plex Token'
folder = "Input the directory that this is going to sit in"
- run preroll.py
python3 preroll.py
it will then begin listening to your server for new files to be added. this is shown when library.new gets sent to the script