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.
- 🔍 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.
Clone the repository:
git clone https://github.com/netplexflix/Missing-Trailer-Downloader-for-Plex.git
cd Missing-Trailer-Downloader-for-Plex
- Ensure you have Python installed (
>=3.8recommended). - 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.txtffmpeg is required by yt-dlp to do postprocessing. Check THIS WIKI for more information on how to install ffmpeg.
- Download Docker Desktop from docker.com
- Install and start Docker Desktop on your computer
- Verify installation: Open a terminal/command prompt and type
docker --version- you should see a version number
- Create a new folder for MTDP on your computer (e.g.,
C:\MTDPor/home/user/MTDP) - Create a new file called
docker-compose.ymlin that folder - Copy and paste this content into the file:
version: '3.8'
services:
mtdp:
image: netplexflix/mtdp:latest
container_name: mtdp
environment:
- PUID=1000 # Change to your user ID
- PGID=1000 # Change to your group ID
- TZ=America/New_York # Change to your timezone
- SCHEDULE_HOURS=24 # Run every X hours (default: 24)
volumes:
- ./config:/config # Mount your config directory
- ./logs:/app/Logs # Optional: persist logs
- /path/to/media:/media # Mount your media directory (same as Plex sees it)
restart: unless-stopped- Update the timezone in the
TZenvironment variable to match your location (e.g.:America/New_York,Europe/London,Asia/Tokyo) - Update PUID/PGID to match your system user (optional - defaults to 1000:1000)
- You must update the media paths in the existing
docker-compose.ymlfile. - The media path in the container (/media) must match how Plex sees the files
- Example: On thehost system your Movies are at /mnt/storage/movies Plex sees them at: /media/movies The mount:
volumes:
- /mnt/storage:/media
Important
If Plex returns Windows volumes, e.g. P:\movies then remove the colon and use forward slash.
example: - P:\Movies:/P/Movies
- create a
configdirectory and download the example config to it - Configure your settings. See ⚙️ Configuration
- Open a terminal/command prompt in your MTDP folder
- Type this command and press Enter:
docker-compose pull
- Type this command and press Enter:
docker-compose up -d
Edit the config.yml file to set your Plex details and desired variables:
| Setting | Value | Description |
|---|---|---|
LAUNCH_METHOD |
'0', '1', '2', '3' |
0 = Choose at runtime, 1 = Movies only, 2 = TV Shows only, 3 = Both consecutively |
PLEX_URL |
'http://localhost:32400' |
URL of your Plex server (change if needed) |
PLEX_TOKEN |
'YOUR_PLEX_TOKEN' |
Authentication token for Plex API access (How to find your Plex Token) |
USE_LABELS |
true, false |
Whether to use MTDfP labels to track processed items |
| Setting | Value | Description |
|---|---|---|
CHECK_PLEX_PASS_TRAILERS |
true, false |
Check for existing Plex Pass trailers before downloading (default: true) |
DOWNLOAD_TRAILERS |
true, false |
Whether to actually download missing trailers (false will only list them) |
PREFERRED_LANGUAGE |
'original', 'english', 'german', 'french', etc. |
Language preference for trailer downloads (default: 'original'). You can also use multiple terms like 'german deutsch' |
REFRESH_METADATA |
true, false |
Refresh Plex metadata after downloading trailers |
| Setting | Value | Description |
|---|---|---|
SHOW_YT_DLP_PROGRESS |
true, false |
Show detailed yt-dlp download progress (useful for debugging) |
YT_DLP_CUSTOM_OPTIONS |
"your custom command" |
Any custom options/commands you'd like to pass to yt-dlp |
The script supports multiple libraries for both Movies and TV Shows. You can configure multiple libraries with individual genre skip lists.
# TV Libraries Configuration
# Configure multiple TV show libraries with individual genre skip lists
# Each library can have different genres_to_skip settings
TV_LIBRARIES:
- name: 'TV Shows'
genres_to_skip:
- 'Talk Show'
- 'Stand-Up'
- 'News'
- name: 'Anime TV'
genres_to_skip:
- 'Talk Show'
- 'Stand-Up'
- 'News'
- 'Reality'
- name: 'Documentaries'
genres_to_skip:
- 'Talk Show'
- 'Stand-Up'
# Movie Libraries Configuration
# Configure multiple movie libraries with individual genre skip lists
# Each library can have different genres_to_skip settings
MOVIE_LIBRARIES:
- name: 'Movies'
genres_to_skip:
- 'Short'
- 'Stand-Up'
- 'Concert'
- name: 'Anime Movies'
genres_to_skip:
- 'Short'
- 'Stand-Up'
- 'Concert'
- name: 'Documentaries'
genres_to_skip:
- 'Short'
- 'Stand-Up'# TV Libraries Configuration
# Configure multiple TV show libraries
# Each library will process all genres (no filtering)
TV_LIBRARIES:
- name: 'TV Shows'
- name: 'Kids TV Shows'
# Movie Libraries Configuration
# Configure multiple movie libraries
# Each library will process all genres (no filtering)
MOVIE_LIBRARIES:
- name: 'Movies'
- name: 'Kids Movies'In case you need to use your browser's cookies, you can pass them along to yt-dlp.
To extract your cookies in Netscape format, you can use an extension:
Add the path to the folder containing your cookies.txt to your docker-compose.yml under volumes::
- /path/to/cookies:/cookies- Create a
cookiesfolder in the same directory as the MTDP script - Export your browser cookies to
cookies.txtwithin this new subfolder
Open a Terminal in your script directory and launch the script with:
python MTDfP.pyYou’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.
Check out Trailarr if you want to ignore Plex Pass Trailers and want a UI, running in Docker!
| Main Differences: | Trailarr | MTDfP |
|---|---|---|
| GUI | ✅ | ❌ |
| unRAID Template | ✅ | ❌ |
| Requires Radarr and Sonarr | ✅ | ❌ |
| Requires Plex | ❌ | ✅ |
| Automatically refreshes Plex metadata (required for Plex to detect the trailers) | ❌ | ✅ |
| Can skip download if trailer is already available via Plex Pass | ❌ | ✅ |
If you like this project, please ⭐ star the repository and share it with the community!
