aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvitiko98 <[email protected]>2022-09-27 17:21:13 -0400
committervitiko98 <[email protected]>2022-09-27 17:21:13 -0400
commitc791f39e53b28f6b2e1053098bc39923ae1f7dbf (patch)
tree4cfd37da2e02ed3f16331be94a6685805645a1ee
parente8d3b6f0dd417e504ee80f3729634080f67d8d11 (diff)
downloadbazarr-c791f39e53b28f6b2e1053098bc39923ae1f7dbf.tar.gz
bazarr-c791f39e53b28f6b2e1053098bc39923ae1f7dbf.zip
Subdivx Provider: improve spanish detectionv1.1.2-beta.12
-rw-r--r--libs/subliminal_patch/providers/subdivx.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/subliminal_patch/providers/subdivx.py b/libs/subliminal_patch/providers/subdivx.py
index be72ff052..5be08e45e 100644
--- a/libs/subliminal_patch/providers/subdivx.py
+++ b/libs/subliminal_patch/providers/subdivx.py
@@ -25,6 +25,7 @@ _CLEAN_TITLE_RES = [
(r"´|`", "'"),
(r" {2,}", " "),
]
+_SPANISH_RE = re.compile(r"españa|ib[eé]rico|castellano|gallego|castilla")
_YEAR_RE = re.compile(r"(\(\d{4}\))")
@@ -224,7 +225,10 @@ class SubdivxSubtitlesProvider(Provider):
description = sub_details.replace(",", " ")
# language
- spain = "/pais/7.gif" in datos or "españa" in description.lower()
+ spain = (
+ "/pais/7.gif" in datos
+ or _SPANISH_RE.search(description.lower()) is not None
+ )
language = Language.fromalpha2("es") if spain else Language("spa", "MX")
# uploader