A collection of advanced userscripts for themoviedb.org.
Tired of going through hundreds of posters, backdrops, logos, or profile images to find duplicates? This tool makes it easy.
find-duplicate-images.mp4
Download and install Python 3.11.9 from python.org (later versions above this may not work properly).
- Click here to download
- Extract the ZIP file.
- Copy the
tmdb.cmdfile to anywhere you like — this will be your launcher. - Copy the entire
tmdb-advanced-userscriptsfolder toC:\(so scripts folder is available inC:\tmdb-advanced-userscripts\scripts).
Open a terminal in the C:\tmdb-advanced-userscripts folder and run:
For NVIDIA GPU users:
Make sure your GPU driver is version 520.61 or newer (for CUDA 11.8). Install PyTorch with:
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118💡 Not sure what CUDA your GPU supports? Check this list or ask ChatGPT.
Check if PyTorch installed with CUDA correctly, by running:
python -c "import torch; print(torch.cuda.is_available())"It should output True, if its False try installing a different version of CUDA or you can just install CPU-only version 👇 (slower computation).
For non-NVIDIA or Mac users (CPU-only):
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpupip install -r requirements.txt💡 For Mac Users: The above process is similar, but note that the Windows path and tmdb.cmd won't work for you. Instead, navigate to tmdb-advanced-userscripts/scripts and run python server.py.
Click and install the following userscripts (you’ll need a userscript manager like Tampermonkey):
-
Double-click
tmdb.cmdto start the server. -
Go to any image page on TMDb (posters, backdrops, etc.).
-
Click the Find Duplicates button that appears.
-
Use the slider to adjust the Similarity Threshold:
- Default value is set for each image type, which already works best
- 100 = exact matches only
- 75–95 = recommended for best balance
- Lower than 75 values may detect more but less accurate (not recommended)
💡Tip: Setting threshold to 75 to 80 in poster page will detect official posters as duplicates thus remaining posters are mostly fan-art, which can be removed.
This project uses a client-server architecture to detect duplicate images on a webpage.
The client-side script mainly handles the UI and communication:
- Collects all image URLs on the current page.
- Sorts image cards in the UI.
- Shows toast notifications in the browser.
- Sends image URLs to the server via WebSocket when the "Find Duplicates" button is clicked.
Userscripts running in a browser can't access local files or use hardware-accelerated AI models, so the heavy lifting is done by the server.
The server performs the core image analysis:
- Downloads and caches the images.
- Uses a Convolutional Neural Network (CNN) provided by imagededup to detect visually similar images (posters, backdrops, profile images).
- Uses Perceptual Hashing (PHash) for logos which require precise duplicate detection.
- Compares images based on a similarity threshold — higher thresholds mean stricter matching.
- Sends back the results in a format the client can easily understand.
client.user.js: Handles WebSocket communication and integrates everything on the page.findDuplicateImages.user.js: Handles logic specific to sorting and highlighting duplicate images.toast.user.js: Displays toast messages. This script is modular and can be reused independently, even without the server or other scripts.
- Click here to download the latest source code and extract it.
- Replace your
C:\tmdb-advanced-userscriptswith the new one.
Click on the respective userscripts you have installed, then click 'Update/Reinstall' button:
💡 If you get any error after the update, do Step 5: Install Dependencies.
Need help or found a bug?