diff --git a/libs/subliminal_patch/providers/subdivx.py b/libs/subliminal_patch/providers/subdivx.py index 68b4a33dc..bc902363e 100644 --- a/libs/subliminal_patch/providers/subdivx.py +++ b/libs/subliminal_patch/providers/subdivx.py @@ -216,13 +216,14 @@ class SubdivxSubtitlesProvider(Provider): if not any(item in datos for item in ("Cds: 1", "SubRip")): continue - spain = "/pais/7.gif" in datos - language = Language.fromalpha2("es") if spain else Language("spa", "MX") - # description sub_details = body_soup.find("div", {"id": "buscador_detalle_sub"}).text description = sub_details.replace(",", " ") + # language + spain = "/pais/7.gif" in datos or "espaƱa" in description.lower() + language = Language.fromalpha2("es") if spain else Language("spa", "MX") + # uploader uploader = body_soup.find("a", {"class": "link1"}).text download_url = _get_download_url(body_soup) diff --git a/tests/subliminal_patch/conftest.py b/tests/subliminal_patch/conftest.py index afd2cc913..d60a807aa 100644 --- a/tests/subliminal_patch/conftest.py +++ b/tests/subliminal_patch/conftest.py @@ -126,6 +126,15 @@ def episodes(): resolution="720p", video_codec="H.264", ), + "better_call_saul_s06e04": Episode( + "Better.Call.Saul.S06E04.720p.WEBRIP.X264.mkv", + "Better Call Saul", + 6, + 4, + source="Web", + resolution="720p", + video_codec="H.264", + ), "inexistent": Episode( "Inexistent.TVShow.S01E01.720p.BluRay.X264-REWARD.mkv", "121361asdfgh", diff --git a/tests/subliminal_patch/test_subdivx.py b/tests/subliminal_patch/test_subdivx.py index 2b0a6c11f..7ce4980ce 100644 --- a/tests/subliminal_patch/test_subdivx.py +++ b/tests/subliminal_patch/test_subdivx.py @@ -27,6 +27,12 @@ def test_list_subtitles_episode(episodes, episode_key, expected): assert len(subtitles) >= expected +def test_list_subtitles_castillian_spanish(episodes): + item = episodes["better_call_saul_s06e04"] + with SubdivxSubtitlesProvider() as provider: + assert provider.list_subtitles(item, {Language.fromietf("es")}) + + def test_download_subtitle(movies): subtitle = SubdivxSubtitle( Language("spa", "MX"),