MKV Episode Matcher
Automatically match and rename your MKV TV episodes using The Movie Database (TMDb).
Features
- ๐ฏ Automatic Episode Matching: Uses TMDb and OpenSubtitles to accurately identify episodes
- ๐ Speech Recognition: Uses OpenAI Whisper for accurate episode identification
- โฌ๏ธ Subtitle Downloads: Integration with OpenSubtitles
- โจ Bulk Processing: Handle entire seasons at once
- ๐งช Dry Run Mode: Test changes before applying
Prerequisites
- Python 3.9-3.12
- FFmpeg installed and available in system PATH
- TMDb API key (optional, for subtitle downloads)
- OpenSubtitles account (optional, for subtitle downloads)
Quick Start
- Install the package:
- Run onboarding to set up your configuration (first-time users or to update credentials):
- You will be prompted for:
- TMDb API key (for episode matching)
- OpenSubtitles API key, Consumer Name, Username, and Password (for subtitle downloads)
- Show Directory (main directory of your show)
-
If a config value already exists, you can accept the default or enter a new value.
-
a. If you setup the TMDb and Opensubtitles credentials above, automatically fetch subtitles with the
--get-subs
flag. b. Alternatively, manually download .srt subtitles files to ~/.mkv-episode-matcher/cache/data/Show Name/ -
Run on your show directory:
Onboarding & Configuration
The onboarding process will prompt you for all required configuration values if you run with --onboard
or if no config file exists. You can re-run onboarding at any time to update your credentials or show directory.
Required information: - TMDb API key (for episode matching) - OpenSubtitles API key (for subtitle downloads) - OpenSubtitles Consumer Name (for subtitle downloads) - OpenSubtitles Username (for subtitle downloads) - OpenSubtitles Password (for subtitle downloads) - Show Directory (main directory of your show)
If a value already exists, it will be shown as the default and you can accept it or enter a new value.
Directory Structure
MKV Episode Matcher expects your TV shows to be organized as follows:
Show Name/
โโโ Season 1/
โ โโโ episode1.mkv
โ โโโ episode2.mkv
โโโ Season 2/
โ โโโ episode1.mkv
โ โโโ episode2.mkv
Reference Subtitle File Structure
Subtitle files that are not automatically downloaded using the --get-subs
flag should be named as follows:
~/.mkv-episode-matcher/cache/data/Show Name/
โโโ Show Name - S01E01.srt
โโโ Show Name - S01E02.srt
โโโ ...
On Windows, the cache directory is located at C:\Users\{username}\.mkv-episode-matcher\cache\data\
Reference subtitle files should follow this naming pattern:
{show_name} - S{season:02d}E{episode:02d}.srt
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Acknowledgments
- TMDb for their excellent API
- OpenSubtitles for subtitle integration
- All contributors who have helped improve this project
Documentation
Full documentation is available at https://jsakkos.github.io/mkv-episode-matcher/
Changelog
See CHANGELOG.md for a detailed list of changes.