From cdf7296dd41fe6fb46d7abe49c684e03680a278c Mon Sep 17 00:00:00 2001 From: Vitiko Date: Sun, 28 Jan 2024 17:21:48 -0400 Subject: [PATCH] Embedded Subtitles Provider: handle KeyError for cached paths --- libs/subliminal_patch/providers/embeddedsubtitles.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)