This is a Python script that automates the downloading of movie trailers from YouTube using youtube-dl. Moive trailers are downloaded if their release date hasn't been reached. The videos will auto-delete when the movie is released. Files and folders are named with the standard naming convetions of Plex and The Movie DB. A "Coming Soon" image is copied in as poster.jpg
and two versions of the trailer are stored. One is stored with -trailer
in the name so Plex recognizes it as the trailer and the other is recognized as the movie.
This application adds to the cinematic feel of your Plex setup by adding trailers of unreleased movies to your library.
- Install Python. This module supports 2.7.x. 3.x support can be spotty. Raise a github issue if you spot a compatibility error
- Python for Windows can be found here
- Install PIP if it isn't already present
- Check this out for help
- Install youtube_dl
pip install --upgrade youtube_dl
- Install tmdbsimple
pip install tmdbsimple
- Sign up at The Movie DB for an account and get a personal api key
- A walk-through can be found here
- (Optional) Get your Plex token off of Plex Web
- Clone this repository or download it where you want it
- git clone suggested
- Edit the config file to include your API keys. Remove
example
from thetrailers.conf
file title. Adjust other settings as necessary - This script can be run manually like any other script or configured with Cron/Windows Task Scheduler.
- Cron examples can be found here
-
Add a folder inside of the Movie library that you want trailers, to
/directoryTo/TheaterTrailers/Trailers/
orC:\directoryTo\TheaterTrailers\Trailers
- Note that trailers in different libraries are not shared
-
Enable trailers on your server
- Check the option in
Settings > Server > Extras > Include Cinema Trailers from movies in my library
- Check the option in
-
Enable trailers on your client
- Plex Web: Set the number of trailers in
Settings > Web > Player > Cinema Trailers to Play Before Movies
- Plex Web: Set the number of trailers in
-
(Optional) TheaterTrailers copies over a "Coming Soon" poster so that users know it's a trailer. For that to be set to default, local media assets needs to be set as priority within your agents. Go to
Settings > Server > Agents
then adjust within each agent
Vote on new features here!
Thank you to the youtube-dl team
This product uses the TMDb API but is not endorsed or certified by TMDb