Preserve your favorite fansubs with ease!
MKV Extractor is a powerful tool designed primarily for archiving fansubs. It extracts chapters, subtitles, and fonts from MKV files, preserving the hard work of fansubbers and ensuring that high-quality subtitles and typesetting are not lost to time.
- 📂 Bulk extraction from multiple MKV files
- 📑 Extracts chapters, subtitles, and fonts
- 🎨 Preserves subtitle styles and fonts
- 📊 Real-time progress tracking with rich console interface
- ⚙️ Configurable settings with automatic config file management
- 📝 Detailed logging
- 🖥️ Cross-platform support (Windows, Mac, Linux)
- 🔍 Automatic MKVToolNix detection on Windows
- 🚀 Optional parallel processing for faster extraction
- Ensure you have Python 3.9 or higher installed.
- Clone this repository:
git clone https://github.com/yourusername/mkv-extractor.git cd mkv-extractor
- Install the required Python module:
pip install rich
- Install MKVToolNix:
- Windows: Download and install from here. The script will attempt to find it automatically.
- Mac: Use Homebrew:
brew install mkvtoolnix
- Linux: Use your distribution's package manager, e.g., for Ubuntu:
sudo apt update sudo apt install mkvtoolnix
The script automatically creates and manages a configuration file mkv_extractor_config.ini
in the same directory as the script. Here's a sample configuration:
[Paths]
input_dir = /path/to/your/anime
output_dir = /path/to/your/output
mkvextract_path = /path/to/mkvextract
[Settings]
use_parallel = false
max_workers = 4
max_log_lines = 1000
input_dir
: Directory containing your MKV filesoutput_dir
: Directory where extracted files will be savedmkvextract_path
: Path to the mkvextract executableuse_parallel
: Set totrue
for parallel processing (faster but may use more resources)max_workers
: Maximum number of parallel workers (ifuse_parallel
istrue
)max_log_lines
: Maximum number of log lines to keep in memory
Note: On Windows, the script will attempt to find MKVToolNix automatically and update the config file.
Run the script with:
python mkv_extractor.py
Or specify custom paths:
python mkv_extractor.py --input_dir "/path/to/input" --output_dir "/path/to/output" --mkvextract_path "/path/to/mkvextract"
The script provides real-time progress tracking with a beautiful interface:
output_dir/
├── anime_name/
│ ├── chapters/
│ │ └── episode01_chapters.xml
│ ├── subs/
│ │ └── episode01_track2[English].ass
│ └── fonts/
│ └── custom_font.ttf
└── info.txt
The script preserves the original directory structure and copies any info.txt
files found in the source directories.
This project is licensed under the MIT License - see the LICENSE file for details.
- If you encounter a "command not found" error for mkvextract, ensure it's installed and in your system's PATH.
- On Mac/Linux, you might need to make the script executable:
chmod +x mkv_extractor.py
- If you're having issues with file permissions on Mac/Linux, try running the script with sudo (not recommended for regular use).
- For Windows users, if the script can't find MKVToolNix automatically, you'll be prompted to enter the path manually.