diff --git a/CHANGELOG.md b/CHANGELOG.md index 5441c23..d8a2987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +* [v3.18.2](https://github.com/newt-sc/a4kSubtitles/releases/tag/service.subtitles.a4ksubtitles%2Fservice.subtitles.a4ksubtitles-3.18.2): + * SubSource: Fix foreign languages + * [v3.18.1](https://github.com/newt-sc/a4kSubtitles/releases/tag/service.subtitles.a4ksubtitles%2Fservice.subtitles.a4ksubtitles-3.18.1): * Fix IMDB ID not found diff --git a/a4kSubtitles/services/subsource.py b/a4kSubtitles/services/subsource.py index f089668..9158d0e 100644 --- a/a4kSubtitles/services/subsource.py +++ b/a4kSubtitles/services/subsource.py @@ -7,6 +7,20 @@ __search = __api + "searchMovie" __download = __api + "downloadSub/" +ss_to_code = { + "Big 5 code": "zh", + "Brazilian Portuguese": "pt-BR", + "Bulgarian": "bg", + "Chinese BG code": "zh", + "Farsi/Persian": "fa", + "Chinese(Simplified)": "zh-Hans", + "Chinese(Traditional)": "zh-Hant", + "French(France)": "fr-FR", + "Icelandic": "is", + "Spanish(Latin America)": "es-419", + "Spanish(Spain)": "es-ES" +} + def build_search_requests(core, service_name, meta): def get_movie(response): results = response.json() @@ -58,6 +72,9 @@ def map_result(result): name = result.get("releaseName", "") lang = result.get("lang") + if lang in ss_to_code: + lang = core.kodi.xbmc.convertLanguage(ss_to_code[lang], core.kodi.xbmc.ENGLISH_NAME) + if lang not in meta.languages: return None diff --git a/addon.xml b/addon.xml index 29fa736..5683344 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ @@ -27,6 +27,9 @@ Supports: OpenSubtitles, BSPlayer, Podnadpisi.NET, SubDL, Addic7ed screenshot-03.png +[v3.18.2]: + * SubSource: Fix foreign languages + [v3.18.1]: * Fix IMDB ID not found diff --git a/packages/addons.xml b/packages/addons.xml index a61ed10..bd68aae 100644 --- a/packages/addons.xml +++ b/packages/addons.xml @@ -4,7 +4,7 @@ @@ -30,6 +30,9 @@ Supports: OpenSubtitles, BSPlayer, Podnadpisi.NET, SubDL, Addic7ed screenshot-03.png +[v3.18.2]: + * SubSource: Fix foreign languages + [v3.18.1]: * Fix IMDB ID not found diff --git a/packages/addons.xml.crc b/packages/addons.xml.crc index d870568..f85c33f 100644 --- a/packages/addons.xml.crc +++ b/packages/addons.xml.crc @@ -1 +1 @@ -f25ab410db7f2fa919a10fba60723f58f8742576 \ No newline at end of file +e03a251d45a110a157656eb8241273cee119ff32 \ No newline at end of file