From 803dfe351201ae602d9f3e96cfb01d79604296fc Mon Sep 17 00:00:00 2001 From: vitiko98 Date: Tue, 20 Sep 2022 17:18:24 -0400 Subject: [PATCH] Embedded Subtitles provider: add support for alpha2 tags Done by updating the fese library --- libs/fese/__init__.py | 2 +- libs/fese/tags.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/fese/__init__.py b/libs/fese/__init__.py index fa9d7a754..ae8c75c38 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.2" +__version__ = "0.2.3" diff --git a/libs/fese/tags.py b/libs/fese/tags.py index cdd932761..eee5c336e 100644 --- a/libs/fese/tags.py +++ b/libs/fese/tags.py @@ -128,7 +128,11 @@ def _get_language(tags) -> Language: return Language(*extra["language_args"]) try: - lang = Language.fromalpha3b(og_lang) + if len(og_lang) == 3: + lang = Language.fromalpha3b(og_lang) + else: + lang = Language.fromalpha2(og_lang[:2]) + # Test for suffix assert lang.alpha2