A tool to merge subtitles from multiple languages, with enhanced automatic detection for various filename patterns.
- Merge subtitles from two different languages into a single file
- Support for both manual filename pattern specification and automatic detection
- Toggle between pattern modes with a convenient UI button
- Automatic detection of episode numbers from filenames
- Support for various subtitle formats
- Batch processing of entire directories
- Python 3.6 or higher
- PyQt6 (for the GUI)
- Clone this repository
- Run the provided script:
./run_subtool.sh
This script will:
- Create a virtual environment if needed
- Install all required dependencies
- Configure the Qt environment
- Launch the application
- Select the "Directory" tab
- Choose whether to use automatic detection or manual patterns with the toggle button
- If using manual patterns:
- Set subtitle filename patterns for both languages
- Set the episode number pattern
- Select the input directory containing subtitle files
- Select the output directory for merged files
- Click "Merge All Files" to process
- Select the "Single Files" tab
- Choose the first subtitle file
- Choose the second subtitle file
- Select an output file
- Click "Merge Files" to process
When automatic detection is enabled, the tool will:
- Scan the directory for subtitle files
- Identify patterns in filenames
- Group subtitles by episode
- Detect the subtitle language
Supported episode number formats include:
S01E02
format01x02
format- Simple numeric formats (e.g.,
Episode 5
or just5
)
If you encounter issues with Qt plugins, try setting the correct Qt plugin path:
export QT_PLUGIN_PATH=/path/to/qt/plugins
export QT_QPA_PLATFORM=xcb # For X11 systems
Or simply use the provided run_subtool.sh
script which handles this automatically.