mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-15 11:17:49 +08:00
Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
commit
8a5e05b86a
3 changed files with 12 additions and 2 deletions
|
@ -20,7 +20,7 @@ class FFprobeSubtitleStream:
|
||||||
:raises: LanguageNotFound, UnsupportedCodec
|
:raises: LanguageNotFound, UnsupportedCodec
|
||||||
"""
|
"""
|
||||||
self.index = int(stream["index"])
|
self.index = int(stream["index"])
|
||||||
self.codec_name = stream["codec_name"]
|
self.codec_name = stream.get("codec_name", "Unknown")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._codec = _codecs[self.codec_name]
|
self._codec = _codecs[self.codec_name]
|
||||||
|
|
|
@ -452,7 +452,11 @@ class TitulkyProvider(Provider, ProviderSubtitleArchiveMixin):
|
||||||
else:
|
else:
|
||||||
subtitle_content = fix_line_ending(res.content)
|
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")
|
raise DownloadLimitExceeded("Subtitles download limit has been exceeded")
|
||||||
|
elif not subtitle_content:
|
||||||
|
raise ProviderError("No subtitles provided from titulky")
|
||||||
|
|
||||||
subtitle.content = subtitle_content
|
subtitle.content = subtitle_content
|
||||||
|
|
|
@ -6,6 +6,7 @@ import os
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from subliminal_patch.core import Movie, Episode
|
from subliminal_patch.core import Movie, Episode
|
||||||
|
from subzero.language import Language
|
||||||
|
|
||||||
|
|
||||||
logging.getLogger("vcr").setLevel(logging.WARNING)
|
logging.getLogger("vcr").setLevel(logging.WARNING)
|
||||||
|
@ -148,6 +149,11 @@ def episodes():
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def languages():
|
||||||
|
return {"en": Language.fromietf("en"), "es-MX": Language("spa", "MX")}
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def data():
|
def data():
|
||||||
return os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
|
return os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
|
||||||
|
|
Loading…
Reference in a new issue