From 369b2c73439d15c5e9c43526b239e36329c82329 Mon Sep 17 00:00:00 2001 From: Vitiko Date: Tue, 23 Apr 2024 17:20:36 -0400 Subject: [PATCH] Embedded Subtitles provider: handle FileNotFoundError --- .../subliminal_patch/providers/embeddedsubtitles.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/custom_libs/subliminal_patch/providers/embeddedsubtitles.py b/custom_libs/subliminal_patch/providers/embeddedsubtitles.py index 7fbf1bef8..1c1a99f7d 100644 --- a/custom_libs/subliminal_patch/providers/embeddedsubtitles.py +++ b/custom_libs/subliminal_patch/providers/embeddedsubtitles.py @@ -208,8 +208,11 @@ class EmbeddedSubtitlesProvider(Provider): except Exception as error: logger.debug("'%s' raised running modifier", error) - with open(path, "rb") as sub: - subtitle.content = sub.read() + if os.path.exists(path): + with open(path, "rb") as sub: + subtitle.content = sub.read() + else: + logger.error("%s not found in filesystem", path) def _get_subtitle_path(self, subtitle: EmbeddedSubtitle): container = subtitle.container