Skip to content

Commit

Permalink
Subdivx Provider: improve spanish detection
Browse files Browse the repository at this point in the history
  • Loading branch information
vitiko98 committed Sep 27, 2022
1 parent e8d3b6f commit c791f39
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/subliminal_patch/providers/subdivx.py
Expand Up @@ -25,6 +25,7 @@
(r"´|`", "'"),
(r" {2,}", " "),
]
_SPANISH_RE = re.compile(r"españa|ib[eé]rico|castellano|gallego|castilla")

_YEAR_RE = re.compile(r"(\(\d{4}\))")

Expand Down Expand Up @@ -224,7 +225,10 @@ def _parse_subtitles_page(self, video, response):
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
Expand Down

0 comments on commit c791f39

Please sign in to comment.