Skip to main content

The MKV Episode Matcher is a tool for identifying TV series episodes from MKV files and renaming the files accordingly.

Project description

MKV Episode Matcher

Development Status PyPI version License: MIT Documentation Status Downloads GitHub last commit GitHub issues Tests codecov

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

  1. Install the package:
pip install -U mkv-episode-matcher
  1. Run onboarding to set up your configuration (first-time users or to update credentials):
mkv-match --onboard
  • 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.
  1. 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/

  2. Run on your show directory:

mkv-match --show-dir "path/to/your/show"

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

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkv_episode_matcher-0.9.9.tar.gz (195.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkv_episode_matcher-0.9.9-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file mkv_episode_matcher-0.9.9.tar.gz.

File metadata

  • Download URL: mkv_episode_matcher-0.9.9.tar.gz
  • Upload date:
  • Size: 195.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mkv_episode_matcher-0.9.9.tar.gz
Algorithm Hash digest
SHA256 7454056d7239069cc0d87c6d8a21b3a2181515e8ff5b595d549db3e3d8e1d2ab
MD5 9ed30a66fa19e082ca946e5a15a4a000
BLAKE2b-256 b190674d8b508040ff0e4f29579a98d434e7ce2f19f281073aa9b92d1329d9de

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkv_episode_matcher-0.9.9.tar.gz:

Publisher: python-publish.yml on Jsakkos/mkv-episode-matcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mkv_episode_matcher-0.9.9-py3-none-any.whl.

File metadata

File hashes

Hashes for mkv_episode_matcher-0.9.9-py3-none-any.whl
Algorithm Hash digest
SHA256 b9ce7924a00429d7863c0df1b5135ca4f0dad4dcb1d24030180d96d8becd534a
MD5 d19b9d371f262fe1a7e41582bd0b9f61
BLAKE2b-256 324b5b490aac8ecd84b9119dd2c6cf8e9506d62c9e1d556565abe2c7840df470

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkv_episode_matcher-0.9.9-py3-none-any.whl:

Publisher: python-publish.yml on Jsakkos/mkv-episode-matcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page