summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2022-10-09 21:54:32 -0400
committermorpheus65535 <[email protected]>2022-10-09 21:54:32 -0400
commit8a5e05b86a39b0717f34825571f69fbc0bfedaaf (patch)
treed55e5625d312082fe9eb96d5280b25257c6c5016
parent167cb5dd983025e9935abc00d59d291b8ef571f4 (diff)
parenta82ab6769d9f508151c1cc438a6ab637d65bd7e8 (diff)
downloadbazarr-1.1.2-beta.19.tar.gz
bazarr-1.1.2-beta.19.zip
Merge remote-tracking branch 'origin/development' into developmentv1.1.2-beta.19
-rwxr-xr-xlibs/fese/stream.py2
-rw-r--r--libs/subliminal_patch/providers/titulky.py6
-rw-r--r--tests/subliminal_patch/conftest.py6
3 files changed, 12 insertions, 2 deletions
diff --git a/libs/fese/stream.py b/libs/fese/stream.py
index 3c73b1d3c..1039cdd8b 100755
--- a/libs/fese/stream.py
+++ b/libs/fese/stream.py
@@ -20,7 +20,7 @@ class FFprobeSubtitleStream:
:raises: LanguageNotFound, UnsupportedCodec
"""
self.index = int(stream["index"])
- self.codec_name = stream["codec_name"]
+ self.codec_name = stream.get("codec_name", "Unknown")
try:
self._codec = _codecs[self.codec_name]
diff --git a/libs/subliminal_patch/providers/titulky.py b/libs/subliminal_patch/providers/titulky.py
index aedbe7906..9fdc1661c 100644
--- a/libs/subliminal_patch/providers/titulky.py
+++ b/libs/subliminal_patch/providers/titulky.py
@@ -452,7 +452,11 @@ class TitulkyProvider(Provider, ProviderSubtitleArchiveMixin):
else:
subtitle_content = fix_line_ending(res.content)
- if not subtitle_content:
+ if archive and len(archive.infolist()) > 1 and not subtitle_content:
+ logger.info(f"Titulky.com: Couldn't find a proper subtitle file in the downloaded archive.")
+ elif archive and len(archive.infolist()) == 1 and not subtitle_content:
raise DownloadLimitExceeded("Subtitles download limit has been exceeded")
+ elif not subtitle_content:
+ raise ProviderError("No subtitles provided from titulky")
subtitle.content = subtitle_content
diff --git a/tests/subliminal_patch/conftest.py b/tests/subliminal_patch/conftest.py
index d60a807aa..7f72a4814 100644
--- a/tests/subliminal_patch/conftest.py
+++ b/tests/subliminal_patch/conftest.py
@@ -6,6 +6,7 @@ import os
import pytest
from subliminal_patch.core import Movie, Episode
+from subzero.language import Language
logging.getLogger("vcr").setLevel(logging.WARNING)
@@ -149,5 +150,10 @@ def episodes():
@pytest.fixture
+def languages():
+ return {"en": Language.fromietf("en"), "es-MX": Language("spa", "MX")}
+
+
def data():
return os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")