This Python script automates the process of downloading, synchronizing, and organizing movie subtitle files. It integrates with external tools to download subtitles, synchronize them with a reference file, and organize them into directories named after the movies.
- Download Subtitles: Uses
isubripto download subtitles from any iTunes movie URL. - Synchronize Subtitles: Utilizes
ffsubsyncto synchronize the downloaded subtitles with a reference.srtfile. - Organize Subtitles: Renames and organizes subtitles into directories based on movie titles and release years, retrieved from The Movie Database (TMDb) API.
- Language Mapping: Automatically maps language codes to descriptive language names using the
pycountrylibrary.
- Windows: This script is Windows only due to some dependencies, however, can be adapted easily if you wish.
- Python 3.x: Ensure you have Python 3 installed.
- TMDb API Key: Sign up for an API key at The Movie Database (TMDb).
- Download the repository as a .zip
- Extract the .zip to a location of your choosing. (A separate sub-directory is highly recommended)
- The script automatically creates a configuration file for
isubripat%USERPROFILE%\.isubrip\config.toml. This file specifies the download folder and other settings. - Make sure to update yout TMDb API key in the script.py file.
- Open a command prompt window within the current directory
- Install requirements
pip install -r requirements.txt - Run script with either provided
Start.batorscript.py - Enter iTunes movie URL when requested (this script does not work with TV shows, as is the same with isubrip)
- Select existing .srt file as extracted from existing movie file or converted using OCR
- Script will quit when complete and files will be found in a directory named "Movie Name (Movie Year)"
- Done
- Python Packages:
requestspycountry
- External Tools:
isubripffsubsync
- System Libraries:
tkinter(usually included with Python)
- Ensure that both
isubripandffsubsyncare installed and accessible from your command line. - The script is designed for Windows systems due to the use of
%USERPROFILE%. For Unix-based systems, modifications may be needed to use$HOMEinstead. - The script uses
tkinterfor the file dialog. Iftkinteris not installed, you may need to install it separately.
- Invalid TMDb API Key: If the script exits with an error about the TMDb API key, ensure you've correctly replaced
'YOUR_TMDB_API_KEY'with your actual API key. - ModuleNotFoundError: If you receive an error about missing modules, ensure all Python dependencies are installed using the
requirements.txtfile. - External Tools Not Found: If the script cannot find
isubriporffsubsync, make sure they are installed and added to your system's PATH.
This project is licensed under the MIT License.
- iSubRip for subtitle downloading capabilities.
- ffsubsync for subtitle synchronization.
- The Movie Database (TMDb) for movie data.
- pycountry for language code mappings.