summaryrefslogtreecommitdiffhomepage
path: root/libs/fese
diff options
context:
space:
mode:
authorvitiko98 <[email protected]>2022-07-20 02:51:30 -0400
committervitiko98 <[email protected]>2022-07-20 02:51:30 -0400
commit5624ae431ea6e1d29a0c9fd909949e1021dc1226 (patch)
tree4b6cf26abdf1a088fb4fc6f58cf1cc4738d64627 /libs/fese
parent27d792041c6deda7d31913fda189aea2725029d7 (diff)
downloadbazarr-5624ae431ea6e1d29a0c9fd909949e1021dc1226.tar.gz
bazarr-5624ae431ea6e1d29a0c9fd909949e1021dc1226.zip
Embedded Subtitles provider: add support for unknown language tagsv1.1.1-beta.6
Diffstat (limited to 'libs/fese')
-rwxr-xr-xlibs/fese/__init__.py2
-rw-r--r--libs/fese/tags.py11
2 files changed, 11 insertions, 2 deletions
diff --git a/libs/fese/__init__.py b/libs/fese/__init__.py
index 1ce31e010..fa9d7a754 100755
--- a/libs/fese/__init__.py
+++ b/libs/fese/__init__.py
@@ -4,4 +4,4 @@
from .container import FFprobeVideoContainer
from .stream import FFprobeSubtitleStream
-__version__ = "0.2"
+__version__ = "0.2.2"
diff --git a/libs/fese/tags.py b/libs/fese/tags.py
index f31217ace..cdd932761 100644
--- a/libs/fese/tags.py
+++ b/libs/fese/tags.py
@@ -8,12 +8,21 @@ from .exceptions import LanguageNotFound
logger = logging.getLogger(__name__)
+LANGUAGE_FALLBACK = None
+
class FFprobeGenericSubtitleTags:
_DETECTABLE_TAGS = None
def __init__(self, data: dict):
- self.language = _get_language(data)
+ try:
+ self.language = _get_language(data)
+ except LanguageNotFound:
+ if LANGUAGE_FALLBACK is not None:
+ self.language = Language.fromietf(LANGUAGE_FALLBACK)
+ else:
+ raise
+
self._data = data
@classmethod