Skip to content

Checks your Plex library for missing (Plex Pass) trailers and downloads them.

Notifications You must be signed in to change notification settings

netplexflix/Missing-Trailer-Downloader-For-Plex

Repository files navigation

📺 Missing Trailer Downloader for Plex 🎬

I initially bought a Plex Pass because I wanted to have Trailers for my movies and TV Shows.
For a minority of titles, Plex doesn't seem to have trailers however. Especially lesser known and foreign titles.

This script will fill those gaps.


✨ Features

  • 🔍 Detects Missing Trailers: Scans your Plex libraries for items that lack trailers. (either Plex Pass or local)
  • Filters out specified Genres: You may not want trailers for concerts or 3 minute shorts..
  • ℹ️ Informs: Lists trailers missing, downloaded, failed, skipped, or if none are missing.
  • 🎥 Automatic Downloading: Uses YT-DLP to fetch the best available trailer from Youtube.
  • 📂 Organized Storage: Trailers are saved according to Plex guidelines for both Movies and TV Shows.
  • 🔄 Refreshes Metadata: Refreshes metadata of items with new trailer. (Necessary for Plex to 'detect' them)
  • 📝 Logging: Keeps a log of your runs for each library.

🛠️ Installation

1️⃣ Download the script

Clone the repository:

git clone https://github.com/netplexflix/Missing-Trailer-Downloader-for-Plex.git
cd Missing-Trailer-Downloader-for-Plex

#c5f015 Or simply download by pressing the green 'Code' button above and then 'Download Zip'.

2️⃣ Install Dependencies

  • Ensure you have Python installed (>=3.8 recommended).
  • Open a Terminal in the script's directory

Tip

Windows Users:
Go to the script folder (where MTDfP.py is). Right mouse click on an empty space in the folder and click Open in Windows Terminal

  • Install the required dependencies by pasting the following code:
pip install -r requirements.txt

3️⃣ Install ffmpeg

ffmpeg is required by yt-dlp to do postprocessing. Check THIS WIKI for more information on how to install ffmpeg.


🐋 Installation via Docker

This script can also be run in a Docker container, which will run continuously and check your Plex libraries once an hour.

Make sure you update the config.yml file with your Plex details and desired variables before running the container.

1️⃣ Clone the repository

Clone the repository:

git clone git clone https://github.com/netplexflix/Missing-Trailer-Downloader-for-Plex.git
cd Missing-Trailer-Downloader-for-Plex

#c5f015 Or simply download by pressing the green 'Code' button above and then 'Download Zip'.

2️⃣ Build Image

Ensure you have Docker installed. Then, build the Docker image:

docker build -t mtdp .

3️⃣ Run the Container

Run the Docker container:

docker run -d -v /path/to/your/config:/app/config mtdp

Replace /path/to/your/config with the path to your config.yml file.

⚙️ Configuration

Edit the config.yml file to set your Plex details and desired variables:

  • LAUNCH_METHOD: 0 = Choose at runtime, 1 = Movies only, 2 = TV Shows only, 3 = Both
  • PLEX_URL: Change if needed.
  • PLEX_TOKEN: How to find your Plex Token.
  • MOVIE_LIBRARY_NAME: The name of your Movie library in Plex
  • TV_LIBRARY_NAME: The name of your TV Show library in Plex
  • TV_GENRES_TO_SKIP: Add or remove any genres to be skipped when checking your TV Shows
  • MOVIE_GENRES_TO_SKIP: Add or remove any genres to be skipped when checking your Movies
  • CHECK_PLEX_PASS_TRAILERS: Default: true will check for Plex Pass Trailers. If set to false it will download all trailers locally.
  • DOWNLOAD_TRAILERS: true will download the missing trailers. false will simply list them.
  • PREFERRED_LANGUAGE: Default: original. When set to another language (eg: french or german), yt-dlp will attempt to download a trailer in that language
  • SHOW_YT_DLP_PROGRESS: Can be set to true for debugging.
  • MAP_PATH: Default false. Set to true if you need PATH_MAPPINGS in case of NAS storage for example.
  • PATH_MAPPINGS: Used to map paths: eg: If Plex looks for your movies in "/media/movies" and this directory is mapped on your computer as "P:/media/movies" you can map as followed: "/media": "P:/media"

🚀 Usage - Running the Script

Open a Terminal in your script directory and launch the script with:

python MTDfP.py

You’ll be prompted to choose:

  • 1: Run Movie library.
  • 2: Run TV shows library.
  • 3: Scan both consecutively.

Alternatively, pre-set your preferred method in config.yml (LAUNCH_METHOD field) to bypass selection.

Tip

Windows users can create a batch file to quickly launch the script.
Type "[path to your python.exe]" "[path to the script]" -r pause" into a text editor

For example:

"C:\Users\User1\AppData\Local\Programs\Python\Python311\python.exe" "P:\Scripts\Missing Trailer Downloader for Plex\MTDfP.py" -r
pause

Save as a .bat file. You can now double click this batch file to directly launch the script.
You can also use this batch file to schedule the script to run daily/weekly/etc.


⚠️ Do you Need Help or have Feedback?


🤝 Trailarr

Check out Trailarr if you want to ignore Plex Pass Trailers and want a UI, running in Docker!
Requires Radarr and Sonarr.

Trailarr logo with name

❤️ Support the Project

If you like this project, please ⭐ star the repository and share it with the community!


"Buy Me A Coffee"

About

Checks your Plex library for missing (Plex Pass) trailers and downloads them.

Resources

Stars

Watchers

Forks

Packages

No packages published