summaryrefslogtreecommitdiffhomepage
path: root/libs/subliminal_patch/providers/embeddedsubtitles.py
diff options
context:
space:
mode:
authorVitiko <[email protected]>2024-01-28 17:21:48 -0400
committerVitiko <[email protected]>2024-01-28 17:21:48 -0400
commitcdf7296dd41fe6fb46d7abe49c684e03680a278c (patch)
tree9f19e3809cc8ea8e17d96d84bb4fd9d59f6e0e55 /libs/subliminal_patch/providers/embeddedsubtitles.py
parentdeef13d11b9310384d71cb0a4af230a524541359 (diff)
downloadbazarr-cdf7296dd41fe6fb46d7abe49c684e03680a278c.tar.gz
bazarr-cdf7296dd41fe6fb46d7abe49c684e03680a278c.zip
Embedded Subtitles Provider: handle KeyError for cached paths
Diffstat (limited to 'libs/subliminal_patch/providers/embeddedsubtitles.py')
-rw-r--r--libs/subliminal_patch/providers/embeddedsubtitles.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/subliminal_patch/providers/embeddedsubtitles.py b/libs/subliminal_patch/providers/embeddedsubtitles.py
index 2a690331f..045347563 100644
--- a/libs/subliminal_patch/providers/embeddedsubtitles.py
+++ b/libs/subliminal_patch/providers/embeddedsubtitles.py
@@ -190,7 +190,11 @@ class EmbeddedSubtitlesProvider(Provider):
@blacklist_on(ExtractionError)
def download_subtitle(self, subtitle: EmbeddedSubtitle):
- path = self._get_subtitle_path(subtitle)
+ try:
+ path = self._get_subtitle_path(subtitle)
+ except KeyError: # TODO: add MustGetBlacklisted support
+ logger.error("Couldn't get subtitle path")
+ return None
modifiers = _type_modifiers.get(subtitle.stream.codec_name) or set()
logger.debug("Found modifiers for %s type: %s", subtitle.stream, modifiers)