This script uses the Playwright automation framework and only supports Chrome/Chromium browsers. Playwright automatically downloads and manages browsers, eliminating the need for manual driver installation.
pip install playwright
pip install python-dateutil
pip install Pillow
pip install bordercrop
Install Playwright browser:
playwright install chromium
-h, --help: Show help information-V, --version: Show version information-d, --debug: Enable debug logging (default is INFO level)--headless: Run browser in headless mode (default is GUI mode)
python -m tmdb-import [options] "URL"
- GUI Mode (default): Browser window is visible, suitable for debugging and scenarios requiring manual interaction
- Headless Mode (--headless): Browser runs in the background without displaying a window, suitable for automation scripts and server environments
- Headless mode can improve performance and reduce resource usage, especially suitable for batch processing tasks
python -m tmdb-import "http://www.***.com/video.html"
python -m tmdb-import -d "http://www.***.com/video.html" # Enable debug logging
python -m tmdb-import --headless "http://www.***.com/video.html" # Run in headless mode
python -m tmdb-import -d --headless "http://www.***.com/video.html" # Debug + headless mode
- Extract episode data through web links, including title, plot description, duration, release time (mostly current platform time), and background image links, and generate import.csv file for subsequent import.
python -m tmdb-import "https://www.themoviedb.org/tv/{tv_id}/season/{season_number}?language={language}"
# Example: python -m tmdb-import "https://www.themoviedb.org/tv/203646/season/1?language=zh-CN"
# Enable debug: python -m tmdb-import -d "https://www.themoviedb.org/tv/203646/season/1?language=zh-CN"
# Headless mode: python -m tmdb-import --headless "https://www.themoviedb.org/tv/203646/season/1?language=zh-CN"
# Combined options: python -m tmdb-import -d --headless "https://www.themoviedb.org/tv/203646/season/1?language=zh-CN"
- Import data from import.csv in the directory to TMDB. When uploading background images, automatically crop black borders and adapt to the 1.78 ratio required by TMDB. First run requires manual login at the login interface (or fill in code to implement automatic login), forced_upload (when set to True, allows continued upload when TMDB already has background images)
python -m tmdb-import backdrop "https://www.***.com/image.jpg"
python -m tmdb-import --headless backdrop "https://www.***.com/image.jpg" # Process backdrop in headless mode
- Crop backdrop images to fit TMDB requirements
python -m tmdb-import poster "https://www.***.com/image.jpg"
python -m tmdb-import --headless poster "https://www.***.com/image.jpg" # Process poster in headless mode
- Crop poster images to fit TMDB requirements
python -m tmdb-import fitsize width*height "https://www.***.com/image.jpg"
python -m tmdb-import --headless fitsize 1920*1080 "https://www.***.com/image.jpg" # Crop in headless mode
- Crop images according to specified width and height
Windows 11, Chrome/Chromium, Python 3, and Visual Studio Code.
| Website | Title | Plot | Duration | Release Date | Backdrop | Default Language |
|---|---|---|---|---|---|---|
| anidb | ✔ | x | ✔ | ✔ | x | Follow site |
| apple | ✔ | ✔ | ✔ | ✔ | ✔ | zh-CN |
| asahi | ✔ | ✔ | ✔ | ✔ | ✔ | ja-JP |
| bilibili | ✔ | x | ✔ | ✔ | ✔ | zh-CN |
| cctv | ✔ | ✔ | ✔ | x | ✔ | zh-CN |
| disney+ | ✔ | ✔ | ✔ | ✔ | ✔ | zh-CN |
| fod | ✔ | ✔ | x | ✔ | ✔ | ja-JP |
| iqiyi | ✔ | x | x | x | ✔ | zh-CN |
| ixigua | ✔ | ✔ | ✔ | ✔ | ✔ | zh-CN |
| kktv | ✔ | x | ✔ | ✔ | ✔ | zh-TW |
| mgtv | ✔ | x | ✔ | ✔ | x | zh-CN |
| mgtv | ✔ | x | x | x | x | zh-TW |
| mytvsuper | ✔ | ✔ | ✔ | ✔ | ✔ | zh-TW |
| myvideo | ✔ | ✔ | x | x | ✔ | zh-TW |
| netflix | ✔ | ✔ | x | ✔ | x | Follow site |
| nhk | ✔ | ✔ | ✔ | x | ✔ | ja-JP |
| paravi | ✔ | ✔ | x | ✔ | ✔ | ja-JP |
| primevideo | ✔ | ✔ | ✔ | ✔ | ✔ | Follow site |
| ✔ | x | ✔ | ✔ | x | zh-CN | |
| sohu | ✔ | ✔ | ✔ | ✔ | ✔ | zh-CN |
| tvdb | ✔ | x | ✔ | ✔ | x | Follow site |
| viki | x | ✔ | ✔ | x | ✔ | en-US |
| viu | ✔ | ✔ | ✔ | ✔ | ✔ | zh-CN |
| yahoo | ✔ | ✔ | ✔ | x | x | Follow site |
| wavve | ✔ | ✔ | ✔ | ✔ | ✔ | ko-KR |
| youku | x | ✔ | ✔ | ✔ | ✔ | zh-CN |