mkv-episode-matcher 0.4.5__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mkv-episode-matcher might be problematic. Click here for more details.
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/.coverage +0 -0
- mkv_episode_matcher-0.6.0/CHANGELOG.md +35 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/PKG-INFO +7 -13
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/README.md +6 -3
- mkv_episode_matcher-0.6.0/docs/changelog.md +36 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/docs/cli.md +7 -8
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/docs/configuration.md +1 -16
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/docs/installation.md +2 -8
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/docs/tips.md +14 -3
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher/__init__.py +2 -2
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher/__main__.py +14 -29
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher/config.py +0 -3
- mkv_episode_matcher-0.6.0/mkv_episode_matcher/episode_identification.py +368 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher/episode_matcher.py +19 -42
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher/subtitle_utils.py +26 -25
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher/utils.py +61 -54
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher.egg-info/PKG-INFO +7 -13
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher.egg-info/SOURCES.txt +2 -12
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher.egg-info/requires.txt +0 -11
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/pyproject.toml +0 -45
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/setup.cfg +1 -1
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/tests/test_main.py +19 -29
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/uv.lock +238 -539
- mkv_episode_matcher-0.4.5/mkv_episode_matcher/episode_identification.py +0 -282
- mkv_episode_matcher-0.4.5/mkv_episode_matcher/libraries/pgs2srt/.gitignore +0 -2
- mkv_episode_matcher-0.4.5/mkv_episode_matcher/libraries/pgs2srt/Libraries/SubZero/SubZero.py +0 -321
- mkv_episode_matcher-0.4.5/mkv_episode_matcher/libraries/pgs2srt/Libraries/SubZero/dictionaries/data.py +0 -16700
- mkv_episode_matcher-0.4.5/mkv_episode_matcher/libraries/pgs2srt/Libraries/SubZero/post_processing.py +0 -260
- mkv_episode_matcher-0.4.5/mkv_episode_matcher/libraries/pgs2srt/README.md +0 -26
- mkv_episode_matcher-0.4.5/mkv_episode_matcher/libraries/pgs2srt/imagemaker.py +0 -89
- mkv_episode_matcher-0.4.5/mkv_episode_matcher/libraries/pgs2srt/pgs2srt.py +0 -150
- mkv_episode_matcher-0.4.5/mkv_episode_matcher/libraries/pgs2srt/pgsreader.py +0 -225
- mkv_episode_matcher-0.4.5/mkv_episode_matcher/libraries/pgs2srt/requirements.txt +0 -4
- mkv_episode_matcher-0.4.5/mkv_episode_matcher/mkv_to_srt.py +0 -302
- mkv_episode_matcher-0.4.5/mkv_episode_matcher/speech_to_text.py +0 -96
- mkv_episode_matcher-0.4.5/tests/__init__.py +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/.gitattributes +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/.github/funding.yml +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/.github/workflows/documentation.yml +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/.github/workflows/python-publish.yml +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/.github/workflows/tests.yml +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/.gitignore +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/.gitmodules +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/.python-version +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/.vscode/settings.json +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/docs/api/index.md +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/docs/quickstart.md +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkdocs.yml +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher/.gitattributes +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher/tmdb_client.py +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher.egg-info/dependency_links.txt +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher.egg-info/entry_points.txt +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/mkv_episode_matcher.egg-info/top_level.txt +0 -0
- {mkv_episode_matcher-0.4.5 → mkv_episode_matcher-0.6.0}/setup.py +0 -0
- {mkv_episode_matcher-0.4.5/mkv_episode_matcher/libraries/pgs2srt → mkv_episode_matcher-0.6.0/tests}/__init__.py +0 -0
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.6.0] - 2025-02-24
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Comprehensive documentation including installation, configuration, and CLI guides
|
|
12
|
+
- Quick start guide with common usage examples
|
|
13
|
+
- Tips and tricks documentation with best practices
|
|
14
|
+
- Detailed changelog structure
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Improved project metadata and description
|
|
18
|
+
- Updated version number in setup.cfg
|
|
19
|
+
|
|
20
|
+
### Removed
|
|
21
|
+
- Removed OCR support and Tesseract dependency
|
|
22
|
+
- Removed unused code
|
|
23
|
+
|
|
24
|
+
## [0.5.0] - 2025-02-23
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
- Try to use tiny version of OpenAI Whisper for initial matching
|
|
28
|
+
- Fall back to base model if tiny model fails
|
|
29
|
+
- Progressive matching in 30s intervals (was 300s)
|
|
30
|
+
|
|
31
|
+
### Removed
|
|
32
|
+
- Removed unused code
|
|
33
|
+
|
|
34
|
+
[0.6.0]: https://github.com/Jsakkos/mkv-episode-matcher/releases/tag/v0.6.0
|
|
35
|
+
[0.5.0]: https://github.com/Jsakkos/mkv-episode-matcher/releases/tag/v0.5.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: mkv-episode-matcher
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: The MKV Episode Matcher is a tool for identifying TV series episodes from MKV files and renaming the files accordingly.
|
|
5
5
|
Home-page: https://github.com/Jsakkos/mkv-episode-matcher
|
|
6
6
|
Author: Jonathan Sakkos
|
|
@@ -21,7 +21,6 @@ Requires-Dist: ffmpeg>=1.4
|
|
|
21
21
|
Requires-Dist: loguru>=0.7.2
|
|
22
22
|
Requires-Dist: openai-whisper>=20240930
|
|
23
23
|
Requires-Dist: opensubtitlescom>=0.1.5
|
|
24
|
-
Requires-Dist: pytesseract>=0.3.13
|
|
25
24
|
Requires-Dist: rapidfuzz>=3.10.1
|
|
26
25
|
Requires-Dist: requests>=2.32.3
|
|
27
26
|
Requires-Dist: tmdb-client>=0.0.1
|
|
@@ -29,14 +28,6 @@ Requires-Dist: torch>=2.5.1
|
|
|
29
28
|
Requires-Dist: torchaudio>=2.5.1
|
|
30
29
|
Requires-Dist: torchvision>=0.20.1
|
|
31
30
|
Requires-Dist: wave>=0.0.2
|
|
32
|
-
Provides-Extra: cpu
|
|
33
|
-
Requires-Dist: torch>=2.5.1; extra == "cpu"
|
|
34
|
-
Requires-Dist: torchvision>=0.20.1; extra == "cpu"
|
|
35
|
-
Requires-Dist: torchaudio>=2.5.1; extra == "cpu"
|
|
36
|
-
Provides-Extra: cu124
|
|
37
|
-
Requires-Dist: torch>=2.5.1; extra == "cu124"
|
|
38
|
-
Requires-Dist: torchvision>=0.20.1; extra == "cu124"
|
|
39
|
-
Requires-Dist: torchaudio>=2.5.1; extra == "cu124"
|
|
40
31
|
|
|
41
32
|
# MKV Episode Matcher
|
|
42
33
|
|
|
@@ -48,7 +39,7 @@ Requires-Dist: torchaudio>=2.5.1; extra == "cu124"
|
|
|
48
39
|
[](https://github.com/Jsakkos/mkv-episode-matcher/commits/main)
|
|
49
40
|
[](https://github.com/Jsakkos/mkv-episode-matcher/issues)
|
|
50
41
|
[](https://github.com/Jsakkos/mkv-episode-matcher/actions/workflows/tests.yml)
|
|
51
|
-
[](https://codecov.io/gh/Jsakkos/mkv-episode-matcher)
|
|
42
|
+
[](https://codecov.io/gh/Jsakkos/mkv-episode-matcher/)
|
|
52
43
|
|
|
53
44
|
Automatically match and rename your MKV TV episodes using The Movie Database (TMDb).
|
|
54
45
|
|
|
@@ -56,7 +47,7 @@ Automatically match and rename your MKV TV episodes using The Movie Database (TM
|
|
|
56
47
|
|
|
57
48
|
- 🎯 **Automatic Episode Matching**: Uses TMDb to accurately identify episodes
|
|
58
49
|
- 📝 **Subtitle Extraction**: Extracts subtitles from MKV files
|
|
59
|
-
-
|
|
50
|
+
- 🔊 **Speech Recognition**: Uses Whisper for accurate episode identification
|
|
60
51
|
- 🚀 **Multi-threaded**: Fast processing of multiple files
|
|
61
52
|
- ⬇️ **Subtitle Downloads**: Integration with OpenSubtitles
|
|
62
53
|
- ✨ **Bulk Processing**: Handle entire seasons at once
|
|
@@ -66,7 +57,6 @@ Automatically match and rename your MKV TV episodes using The Movie Database (TM
|
|
|
66
57
|
|
|
67
58
|
- Python 3.9 or higher
|
|
68
59
|
- [FFmpeg](https://ffmpeg.org/download.html) installed and available in system PATH
|
|
69
|
-
- [Tesseract OCR](https://github.com/UB-Mannheim/tesseract/wiki) installed (required for image-based subtitle processing)
|
|
70
60
|
- TMDb API key (optional, for subtitle downloads)
|
|
71
61
|
- OpenSubtitles account (optional, for subtitle downloads)
|
|
72
62
|
|
|
@@ -135,3 +125,7 @@ Distributed under the MIT License. See `LICENSE` for more information.
|
|
|
135
125
|
## Documentation
|
|
136
126
|
|
|
137
127
|
Full documentation is available at [https://jsakkos.github.io/mkv-episode-matcher/](https://jsakkos.github.io/mkv-episode-matcher/)
|
|
128
|
+
|
|
129
|
+
## Changelog
|
|
130
|
+
|
|
131
|
+
See [CHANGELOG.md](CHANGELOG.md) for a detailed list of changes.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
[](https://github.com/Jsakkos/mkv-episode-matcher/commits/main)
|
|
9
9
|
[](https://github.com/Jsakkos/mkv-episode-matcher/issues)
|
|
10
10
|
[](https://github.com/Jsakkos/mkv-episode-matcher/actions/workflows/tests.yml)
|
|
11
|
-
[](https://codecov.io/gh/Jsakkos/mkv-episode-matcher)
|
|
11
|
+
[](https://codecov.io/gh/Jsakkos/mkv-episode-matcher/)
|
|
12
12
|
|
|
13
13
|
Automatically match and rename your MKV TV episodes using The Movie Database (TMDb).
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ Automatically match and rename your MKV TV episodes using The Movie Database (TM
|
|
|
16
16
|
|
|
17
17
|
- 🎯 **Automatic Episode Matching**: Uses TMDb to accurately identify episodes
|
|
18
18
|
- 📝 **Subtitle Extraction**: Extracts subtitles from MKV files
|
|
19
|
-
-
|
|
19
|
+
- 🔊 **Speech Recognition**: Uses Whisper for accurate episode identification
|
|
20
20
|
- 🚀 **Multi-threaded**: Fast processing of multiple files
|
|
21
21
|
- ⬇️ **Subtitle Downloads**: Integration with OpenSubtitles
|
|
22
22
|
- ✨ **Bulk Processing**: Handle entire seasons at once
|
|
@@ -26,7 +26,6 @@ Automatically match and rename your MKV TV episodes using The Movie Database (TM
|
|
|
26
26
|
|
|
27
27
|
- Python 3.9 or higher
|
|
28
28
|
- [FFmpeg](https://ffmpeg.org/download.html) installed and available in system PATH
|
|
29
|
-
- [Tesseract OCR](https://github.com/UB-Mannheim/tesseract/wiki) installed (required for image-based subtitle processing)
|
|
30
29
|
- TMDb API key (optional, for subtitle downloads)
|
|
31
30
|
- OpenSubtitles account (optional, for subtitle downloads)
|
|
32
31
|
|
|
@@ -95,3 +94,7 @@ Distributed under the MIT License. See `LICENSE` for more information.
|
|
|
95
94
|
## Documentation
|
|
96
95
|
|
|
97
96
|
Full documentation is available at [https://jsakkos.github.io/mkv-episode-matcher/](https://jsakkos.github.io/mkv-episode-matcher/)
|
|
97
|
+
|
|
98
|
+
## Changelog
|
|
99
|
+
|
|
100
|
+
See [CHANGELOG.md](CHANGELOG.md) for a detailed list of changes.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
For a complete list of changes, see [CHANGELOG.md](../CHANGELOG.md) in the repository root.
|
|
4
|
+
|
|
5
|
+
## Latest Changes
|
|
6
|
+
|
|
7
|
+
## [0.6.0] - 2025-02-24
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Comprehensive documentation including installation, configuration, and CLI guides
|
|
11
|
+
- Quick start guide with common usage examples
|
|
12
|
+
- Tips and tricks documentation with best practices
|
|
13
|
+
- Detailed changelog structure
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Improved project metadata and description
|
|
17
|
+
- Updated version number in setup.cfg
|
|
18
|
+
|
|
19
|
+
### Removed
|
|
20
|
+
- Removed OCR support and Tesseract dependency
|
|
21
|
+
- Removed unused code
|
|
22
|
+
|
|
23
|
+
## [0.5.0] - 2025-02-23
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Try to use tiny version of OpenAI Whisper for initial matching
|
|
27
|
+
- Fall back to base model if tiny model fails
|
|
28
|
+
- Progressive matching in 30s intervals (was 300s)
|
|
29
|
+
|
|
30
|
+
### Removed
|
|
31
|
+
- Removed unused code
|
|
32
|
+
|
|
33
|
+
[0.6.0]: https://github.com/Jsakkos/mkv-episode-matcher/releases/tag/v0.6.0
|
|
34
|
+
[0.5.0]: https://github.com/Jsakkos/mkv-episode-matcher/releases/tag/v0.5.0
|
|
35
|
+
|
|
36
|
+
For older versions and complete changelog history, please visit our [GitHub releases page](https://github.com/Jsakkos/mkv-episode-matcher/releases).
|
|
@@ -16,14 +16,13 @@ mkv-match --show-dir "/path/to/show" --season 1
|
|
|
16
16
|
|
|
17
17
|
## Command Options
|
|
18
18
|
|
|
19
|
-
| Option
|
|
20
|
-
|
|
|
21
|
-
| `--show-dir`
|
|
22
|
-
| `--season`
|
|
23
|
-
| `--dry-run`
|
|
24
|
-
| `--get-subs`
|
|
25
|
-
| `--tmdb-api-key`
|
|
26
|
-
| `--tesseract-path` | Path to Tesseract | None |
|
|
19
|
+
| Option | Description | Default |
|
|
20
|
+
| ---------------- | --------------------------- | ---------- |
|
|
21
|
+
| `--show-dir` | Show directory path | None |
|
|
22
|
+
| `--season` | Season number to process | None (all) |
|
|
23
|
+
| `--dry-run` | Test without making changes | False |
|
|
24
|
+
| `--get-subs` | Download subtitles | False |
|
|
25
|
+
| `--tmdb-api-key` | TMDb API key | None |
|
|
27
26
|
|
|
28
27
|
## Examples
|
|
29
28
|
|
|
@@ -21,7 +21,6 @@ open_subtitles_api_key = your_opensubs_key
|
|
|
21
21
|
open_subtitles_user_agent = your_user_agent
|
|
22
22
|
open_subtitles_username = your_username
|
|
23
23
|
open_subtitles_password = your_password
|
|
24
|
-
tesseract_path = /path/to/tesseract
|
|
25
24
|
```
|
|
26
25
|
|
|
27
26
|
## Command Line Configuration
|
|
@@ -34,8 +33,7 @@ mkv-match \
|
|
|
34
33
|
--show-dir "/path/to/shows" \
|
|
35
34
|
--season 1 \
|
|
36
35
|
--dry-run true \
|
|
37
|
-
--get-subs true
|
|
38
|
-
--tesseract-path "/path/to/tesseract"
|
|
36
|
+
--get-subs true
|
|
39
37
|
```
|
|
40
38
|
|
|
41
39
|
## Environment Variables
|
|
@@ -94,16 +92,3 @@ Adjust based on your system's capabilities:
|
|
|
94
92
|
- Default: 4 threads
|
|
95
93
|
- Minimum: 1 thread
|
|
96
94
|
- Maximum: Number of CPU cores
|
|
97
|
-
|
|
98
|
-
### OCR Configuration
|
|
99
|
-
|
|
100
|
-
```ini
|
|
101
|
-
[Config]
|
|
102
|
-
tesseract_path = /path/to/tesseract
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Required for processing image-based subtitles. Common paths:
|
|
106
|
-
- Windows: `C:\Program Files\Tesseract-OCR\tesseract.exe`
|
|
107
|
-
- Linux/macOS: `/usr/bin/tesseract`
|
|
108
|
-
|
|
109
|
-
Make sure Tesseract OCR is properly installed before using this feature.
|
|
@@ -10,13 +10,7 @@
|
|
|
10
10
|
- macOS: `brew install ffmpeg`
|
|
11
11
|
- Verify installation: `ffmpeg -version`
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
- Windows: Install from [UB-Mannheim](https://github.com/UB-Mannheim/tesseract/wiki)
|
|
15
|
-
- Linux: `sudo apt install tesseract-ocr` or equivalent
|
|
16
|
-
- macOS: `brew install tesseract`
|
|
17
|
-
- Verify installation: `tesseract --version`
|
|
18
|
-
|
|
19
|
-
Make sure both FFmpeg and Tesseract are added to your system PATH.
|
|
13
|
+
Make sure FFmpeg is added to your system PATH.
|
|
20
14
|
|
|
21
15
|
## Basic Installation
|
|
22
16
|
|
|
@@ -43,7 +37,6 @@ pip install -U torch torchvision torchaudio --index-url https://download.pytorch
|
|
|
43
37
|
mkv-match --check-gpu true
|
|
44
38
|
```
|
|
45
39
|
|
|
46
|
-
|
|
47
40
|
### Development Installation
|
|
48
41
|
|
|
49
42
|
For contributing or development:
|
|
@@ -80,6 +73,7 @@ uv sync --dev
|
|
|
80
73
|
|
|
81
74
|
### For CPU-Only
|
|
82
75
|
- No special requirements beyond Python 3.9+
|
|
76
|
+
- Note: Speech recognition will be slower on CPU
|
|
83
77
|
|
|
84
78
|
## Verification
|
|
85
79
|
|
|
@@ -21,7 +21,7 @@ TV Shows/
|
|
|
21
21
|
1. **Thread Configuration**
|
|
22
22
|
```ini
|
|
23
23
|
[Config]
|
|
24
|
-
max_threads = 4 # Adjust based on CPU
|
|
24
|
+
max_threads = 4 # Adjust based on CPU/GPU capability
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
2. **Batch Processing**
|
|
@@ -32,6 +32,12 @@ TV Shows/
|
|
|
32
32
|
done
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
3. **Speech Recognition**
|
|
36
|
+
- Uses OpenAI Whisper for audio analysis
|
|
37
|
+
- Tiny model is tried first for speed
|
|
38
|
+
- Falls back to base model if needed
|
|
39
|
+
- Works with both DVD and Blu-ray sources
|
|
40
|
+
|
|
35
41
|
### Error Handling
|
|
36
42
|
|
|
37
43
|
1. Always use dry-run first:
|
|
@@ -87,6 +93,11 @@ process_show(
|
|
|
87
93
|
- Use rate limiting in configuration
|
|
88
94
|
- Implement exponential backoff
|
|
89
95
|
|
|
96
|
+
3. **Speech Recognition**
|
|
97
|
+
- GPU recommended for faster processing
|
|
98
|
+
- Processing happens in 30s intervals
|
|
99
|
+
- More accurate than OCR-based methods
|
|
100
|
+
|
|
90
101
|
3. **Memory Usage**
|
|
91
102
|
- Reduce max_threads
|
|
92
103
|
- Process seasons separately
|
|
@@ -97,8 +108,8 @@ process_show(
|
|
|
97
108
|
|
|
98
109
|
1. Remove temporary files:
|
|
99
110
|
```python
|
|
100
|
-
from mkv_episode_matcher.utils import
|
|
101
|
-
|
|
111
|
+
from mkv_episode_matcher.utils import cleanup_temp_files
|
|
112
|
+
cleanup_temp_files(show_dir)
|
|
102
113
|
```
|
|
103
114
|
|
|
104
115
|
2. Clear cache:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""MKV Episode Matcher package."""
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
3
4
|
|
|
4
5
|
try:
|
|
5
6
|
__version__ = version("mkv-episode-matcher")
|
|
6
7
|
except PackageNotFoundError:
|
|
7
8
|
# package is not installed
|
|
8
9
|
__version__ = "unknown"
|
|
9
|
-
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# __main__.py
|
|
2
2
|
import argparse
|
|
3
3
|
import os
|
|
4
|
-
import sys
|
|
5
4
|
|
|
6
5
|
from loguru import logger
|
|
6
|
+
|
|
7
7
|
from mkv_episode_matcher import __version__
|
|
8
8
|
from mkv_episode_matcher.config import get_config, set_config
|
|
9
9
|
|
|
@@ -34,7 +34,7 @@ if not os.path.exists(log_dir):
|
|
|
34
34
|
logger.add(
|
|
35
35
|
os.path.join(log_dir, "stdout.log"),
|
|
36
36
|
format="{time} {level} {message}",
|
|
37
|
-
level="
|
|
37
|
+
level="INFO",
|
|
38
38
|
rotation="10 MB",
|
|
39
39
|
)
|
|
40
40
|
|
|
@@ -56,7 +56,6 @@ def main():
|
|
|
56
56
|
--season: The season number to be processed. If not provided, all seasons will be processed.
|
|
57
57
|
--dry-run: A boolean flag indicating whether to perform a dry run (i.e., not rename any files). If not provided, the function will rename files.
|
|
58
58
|
--get-subs: A boolean flag indicating whether to download subtitles for the show. If not provided, the function will not download subtitles.
|
|
59
|
-
--tesseract-path: The path to the tesseract executable. If not provided, the function will try to get it from the cache or prompt the user to input it.
|
|
60
59
|
|
|
61
60
|
The function logs its progress to two separate log files: one for standard output and one for errors.
|
|
62
61
|
"""
|
|
@@ -67,7 +66,7 @@ def main():
|
|
|
67
66
|
"--version",
|
|
68
67
|
action="version",
|
|
69
68
|
version=f"%(prog)s {__version__}",
|
|
70
|
-
help="Show the version number and exit"
|
|
69
|
+
help="Show the version number and exit",
|
|
71
70
|
)
|
|
72
71
|
parser.add_argument("--tmdb-api-key", help="TMDb API key")
|
|
73
72
|
parser.add_argument("--show-dir", help="Main directory of the show")
|
|
@@ -92,13 +91,6 @@ def main():
|
|
|
92
91
|
nargs="?",
|
|
93
92
|
help="Download subtitles for the show (default: None)",
|
|
94
93
|
)
|
|
95
|
-
parser.add_argument(
|
|
96
|
-
"--tesseract-path",
|
|
97
|
-
type=str,
|
|
98
|
-
default=None,
|
|
99
|
-
nargs="?",
|
|
100
|
-
help="Path to the tesseract executable (default: None)",
|
|
101
|
-
)
|
|
102
94
|
parser.add_argument(
|
|
103
95
|
"--check-gpu",
|
|
104
96
|
type=bool,
|
|
@@ -108,7 +100,8 @@ def main():
|
|
|
108
100
|
)
|
|
109
101
|
args = parser.parse_args()
|
|
110
102
|
if args.check_gpu:
|
|
111
|
-
from mkv_episode_matcher.
|
|
103
|
+
from mkv_episode_matcher.utils import check_gpu_support
|
|
104
|
+
|
|
112
105
|
check_gpu_support()
|
|
113
106
|
return
|
|
114
107
|
logger.debug(f"Command-line arguments: {args}")
|
|
@@ -118,17 +111,17 @@ def main():
|
|
|
118
111
|
|
|
119
112
|
# Get TMDb API key
|
|
120
113
|
tmdb_api_key = args.tmdb_api_key or config.get("tmdb_api_key")
|
|
121
|
-
|
|
122
|
-
tmdb_api_key = input("Enter your TMDb API key: ")
|
|
123
|
-
logger.debug(f"TMDb API Key: {tmdb_api_key}")
|
|
124
|
-
|
|
114
|
+
|
|
125
115
|
logger.debug("Getting OpenSubtitles API key")
|
|
126
116
|
open_subtitles_api_key = config.get("open_subtitles_api_key")
|
|
127
117
|
open_subtitles_user_agent = config.get("open_subtitles_user_agent")
|
|
128
118
|
open_subtitles_username = config.get("open_subtitles_username")
|
|
129
119
|
open_subtitles_password = config.get("open_subtitles_password")
|
|
130
|
-
|
|
120
|
+
|
|
131
121
|
if args.get_subs:
|
|
122
|
+
if not tmdb_api_key:
|
|
123
|
+
tmdb_api_key = input("Enter your TMDb API key: ")
|
|
124
|
+
logger.debug(f"TMDb API Key: {tmdb_api_key}")
|
|
132
125
|
if not open_subtitles_api_key:
|
|
133
126
|
open_subtitles_api_key = input("Enter your OpenSubtitles API key: ")
|
|
134
127
|
if not open_subtitles_user_agent:
|
|
@@ -137,24 +130,17 @@ def main():
|
|
|
137
130
|
open_subtitles_username = input("Enter your OpenSubtitles Username: ")
|
|
138
131
|
if not open_subtitles_password:
|
|
139
132
|
open_subtitles_password = input("Enter your OpenSubtitles Password: ")
|
|
140
|
-
|
|
141
|
-
# Use config for show directory
|
|
133
|
+
|
|
134
|
+
# Use config for show directory
|
|
142
135
|
show_dir = args.show_dir or config.get("show_dir")
|
|
143
136
|
if not show_dir:
|
|
144
137
|
show_dir = input("Enter the main directory of the show:")
|
|
145
138
|
logger.info(f"Show Directory: {show_dir}")
|
|
146
139
|
if not show_dir:
|
|
147
140
|
show_dir = os.getcwd()
|
|
148
|
-
|
|
149
|
-
if not args.tesseract_path:
|
|
150
|
-
tesseract_path = config.get("tesseract_path")
|
|
151
|
-
if not tesseract_path:
|
|
152
|
-
tesseract_path = input(r"Enter the path to the tesseract executable: ['C:\Program Files\Tesseract-OCR\tesseract.exe']")
|
|
153
|
-
else:
|
|
154
|
-
tesseract_path = args.tesseract_path
|
|
155
|
-
logger.debug(f"Teesseract Path: {tesseract_path}")
|
|
141
|
+
|
|
156
142
|
logger.debug(f"Show Directory: {show_dir}")
|
|
157
|
-
|
|
143
|
+
|
|
158
144
|
# Set the configuration
|
|
159
145
|
set_config(
|
|
160
146
|
tmdb_api_key,
|
|
@@ -164,7 +150,6 @@ def main():
|
|
|
164
150
|
open_subtitles_password,
|
|
165
151
|
show_dir,
|
|
166
152
|
CONFIG_FILE,
|
|
167
|
-
tesseract_path=tesseract_path,
|
|
168
153
|
)
|
|
169
154
|
logger.info("Configuration set")
|
|
170
155
|
|
|
@@ -27,7 +27,6 @@ def set_config(
|
|
|
27
27
|
open_subtitles_password,
|
|
28
28
|
show_dir,
|
|
29
29
|
file,
|
|
30
|
-
tesseract_path=None,
|
|
31
30
|
):
|
|
32
31
|
"""
|
|
33
32
|
Sets the configuration values and writes them to a file.
|
|
@@ -40,7 +39,6 @@ def set_config(
|
|
|
40
39
|
open_subtitles_password (str): The password for OpenSubtitles.
|
|
41
40
|
show_dir (str): The directory where the TV show episodes are located.
|
|
42
41
|
file (str): The path to the configuration file.
|
|
43
|
-
tesseract_path (str, optional): The path to the Tesseract OCR executable.
|
|
44
42
|
|
|
45
43
|
Returns:
|
|
46
44
|
None
|
|
@@ -54,7 +52,6 @@ def set_config(
|
|
|
54
52
|
"open_subtitles_user_agent": str(open_subtitles_user_agent),
|
|
55
53
|
"open_subtitles_username": str(open_subtitles_username),
|
|
56
54
|
"open_subtitles_password": str(open_subtitles_password),
|
|
57
|
-
"tesseract_path": str(tesseract_path),
|
|
58
55
|
}
|
|
59
56
|
logger.info(
|
|
60
57
|
f"Setting config with API:{tmdb_api_key}, show_dir: {show_dir}, and max_threads: {MAX_THREADS}"
|