All apps Β· 0 apps
mtdp
Docker app from MrCorehh's Repository
Overview
Readme
View on GitHubMissing Trailer Downloader for Plex (MTDP)
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.
Main 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..
- 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)
- Real-time New Item Detection (optional): Watches your Plex server and checks newly added movies and shows the moment they appear.
- webUI: Change settings, keep track and trigger manual downloads
π₯οΈ Web UI
MTDP is designed to run headless on schedule so it keeps your library updated with trailers.
However you can also access the webUI on http://localhost:2121/
On the Dashboard you'll find general statistics, an overview of the latest downloaded trailers, and a yt-dlp updater.
You can edit your config in the Settings page and check the Log.
The Movies and TV Shows pages allow you to apply filters for missing trailers. Local trailers can be filtered by resolution.
Open a detail page to see the current available trailer or trigger a manual search.
π Installation via Docker
Step 1: Install Docker
- 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
Step 2: Create Docker Compose File
- 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)
# - CRON=0 2 * * * # Optional: cron schedule (overrides SCHEDULE_HOURS)
ports:
- "2121:2121" # Web UI
volumes:
- ./config:/config # Mount your config directory
- ./logs:/app/Logs # Optional: persist logs
- ./cookies:/cookies # Optional: location of your cookie file
- /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)
- Optional: Use a CRON schedule instead of
SCHEDULE_HOURSfor more precise timing. Uncomment theCRONline and set a cron expression (e.g.,0 2 * * *for daily at 2am). WhenCRONis set, it overridesSCHEDULE_HOURS. Uses standard 5-field cron syntax:minute hour day month weekday.
Step 3: Update Media Paths
- 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:\moviesthen remove the colon and use forward slash.
example:- P:\Movies:/P/Movies
Step 4: Create your config
- Create a
configdirectory - Download
config.example.yml, rename it toconfig.ymland save it in your config folder - Configure your settings. See βοΈ Configuration
Step 5: Pull the image
- Open a terminal/command prompt in your MTDP folder
- Type this command and press Enter:
docker-compose pull
Step 6: Run MTDP
- Type this command and press Enter:
docker-compose up -d
UNRAID
Missing Trailer Downloader for Plex is available on the Unraid Community Apps store as MTDP.
Click install and apply the default template.
βοΈ Configuration
Edit the config.yml file to set your Plex details and desired variables:
π General Settings
| 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) |
PLEX_TIMEOUT |
e.g. 120 |
Read timeout (seconds) for Plex API requests (default: 120). Increase if full-library queries time out on large libraries |
USE_LABELS |
true, false |
Whether to use MTDfP labels to track processed items |
π¬ Trailer Settings
| 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 |
π§ Advanced Settings
| 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 |
TRAILER_FILE_FORMAT |
mkv, mp4 |
File format you want your trailers to use |
TRAILER_RESOLUTION_MAX |
360, 480, 720, 1080, 1440, 2160 |
Highest resolution to attempt downloading |
TRAILER_RESOLUTION_MIN |
360, 480, 720, 1080, 1440, 2160 |
Lowest acceptable resolution β won't download below this |
UPGRADE_TRAILERS |
'off', 'local', 'local_plexpass' |
Re-download trailers that already exist but fall below TRAILER_RESOLUTION_MIN (default: 'off'). 'local' upgrades only locally stored trailers; 'local_plexpass' also upgrades Plex Pass trailers. See notes below. |
β¬οΈ Upgrading low-resolution trailers
By default (UPGRADE_TRAILERS: 'off') an item that already has a trailer is left untouched. When enabled, MTDP also re-checks existing trailers and, if one is below TRAILER_RESOLUTION_MIN, attempts to downloads a higher-resolution replacement.
Notes:
'local_plexpass'requiresCHECK_PLEX_PASS_TRAILERS: true, since Plex Pass trailers are only visible through Plex's extras.- Plex Pass trailers are sourced from Internet Video Archive and generally top out at ~1080p. If you set
TRAILER_RESOLUTION_MINhigher than what's available, MTDP makes a single download attempt per item and then records it so it won't retry every run. RaisingTRAILER_RESOLUTION_MINlater re-arms the attempt. - The resolution shown under each poster (and on the detail page) reflects the maximum available resolution for Plex Pass trailers.
- If you use labels (
USE_LABELS: true) and changeUPGRADE_TRAILERSorTRAILER_RESOLUTION_MINby editingconfig.ymldirectly (not via the Web UI), click "Remove all MTDfP labels" once so previously-processed items get re-evaluated. Saving these settings through the Web UI does this automatically.
π Library Configuration
The script supports multiple libraries for both Movies and TV Shows. You can configure multiple libraries with individual genre skip lists.
Multiple Libraries with Genre Filtering
# 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'
Multiple Libraries without Genre Filtering
# 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'
π New Item Detection (real-time)
By default MTDP only checks for missing trailers on its schedule. With New Item Detection enabled, MTDP also listens to your Plex server in real time and runs a trailer check for just that item the moment something new is added β so a freshly added movie gets its trailer within a minute or two instead of waiting for the next scheduled scan.
| Setting | Value | Description |
|---|---|---|
NEW_ITEM_DETECTION |
true, false |
Enable real-time detection of newly added items (default: false) |
NEW_ITEM_DELAY |
seconds (e.g. 60) |
How long to wait after an item appears before checking it, so Plex can finish matching metadata/extras (default: 60) |
[!TIP] If you'd rather rely entirely on real-time detection, set Schedule Type to Disabled in Settings. MTDP will then never run a full scan on its own (no startup run, no timed runs) β it only checks items as they're added, plus whatever you trigger with Run Now. The two features are independent, so any mix works: a schedule with detection off, detection with the schedule disabled, or both together.
πͺ Using browser cookies for yt-dlp
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:
For Docker Users:
Add the path to the folder containing your cookies.txt to your docker-compose.yml under volumes::
- /path/to/cookies:/cookies
For Local Installation
- Create a
cookiesfolder in the same directory as the MTDP script - Export your browser cookies to
cookies.txtwithin this new subfolder
π 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 editorFor example:
"C:\Users\User1\AppData\Local\Programs\Python\Python311\python.exe" "P:\Scripts\Missing Trailer Downloader for Plex\MTDfP.py" -r pauseSave 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.
π€ 
| Main Differences: | Trailarr | MTDP |
|---|---|---|
| Requires Radarr and Sonarr | β | β |
| Emby/Jellyfin support | β | β |
| Plex Support | β | β |
| Automatically refreshes Plex metadata (required for Plex to detect the trailers) | β | β |
| Can skip download if trailer is already available via Plex Pass | β | β |
β€οΈ Support the Project
If you like this project, please β star the repository and share it with the community!
Install Mtdp on Unraid in a few clicks.
Find Mtdp in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.
Categories
Download Statistics
Related apps
Explore more like this
Explore allDetails
netplexflix/mtdp:latestRuntime arguments
- Web UI
http://[IP]:[PORT:2121]- Network
bridge- Shell
sh- Privileged
- false
Template configuration
- Target
- /config
- Default
- /mnt/user/appdata/mtdp/config
- Value
- /mnt/user/appdata/mtdp/config
- Target
- /app/Logs
- Default
- /mnt/user/appdata/mtdp/logs
- Value
- /mnt/user/appdata/mtdp/logs
- Target
- /cookies
- Default
- /mnt/user/appdata/mtdp/cookies
- Value
- /mnt/user/appdata/mtdp/cookies
Mount your media directory (same as Plex sees it) Eg /mnt/user/data/media/
- Target
- /data/media
- Target
- 2121
- Default
- 2121
- Value
- 2121
Match your location (e.g.: America/New_York, Europe/London, Asia/Tokyo)
Run every X hours (default: 24) - CRON=0 2 * * * # Optional: cron schedule (overrides SCHEDULE_HOURS - Configure cron via webUI)
- Default
- 24
- Value
- 24
- Default
- 99
- Value
- 99
- Default
- 100
- Value
- 100