diff options
author | siankatabg <[email protected]> | 2021-07-17 14:52:37 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-17 09:52:37 -0400 |
commit | 31dcd37d52dfb52d091c1131754bba7f1bd94609 (patch) | |
tree | 6bad8157b1b5b1503aeb9e6414075a1cf2ae6d0b | |
parent | 8cdd362caab710923f6d6247d8e24c5cfc8ac72c (diff) | |
download | bazarr-31dcd37d52dfb52d091c1131754bba7f1bd94609.tar.gz bazarr-31dcd37d52dfb52d091c1131754bba7f1bd94609.zip |
Added fix for inconsistent movie/tv naming to yavkanet providerv0.9.6-beta.43v0.9.6
-rw-r--r-- | libs/subliminal_patch/providers/yavkanet.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/libs/subliminal_patch/providers/yavkanet.py b/libs/subliminal_patch/providers/yavkanet.py index 83c77d93a..9be512491 100644 --- a/libs/subliminal_patch/providers/yavkanet.py +++ b/libs/subliminal_patch/providers/yavkanet.py @@ -15,7 +15,7 @@ from guessit import guessit from dogpile.cache.api import NO_VALUE from subliminal_patch.providers import Provider from subliminal_patch.subtitle import Subtitle, guess_matches -from subliminal_patch.utils import sanitize +from subliminal_patch.utils import sanitize, fix_inconsistent_naming from subliminal.video import Episode, Movie from subliminal.subtitle import fix_line_ending from subliminal.cache import region @@ -25,6 +25,22 @@ from .utils import FIRST_THOUSAND_OR_SO_USER_AGENTS as AGENT_LIST logger = logging.getLogger(__name__) +def fix_tv_naming(title): + """Fix TV show titles with inconsistent naming using dictionary, but do not sanitize them. + :param str title: original title. + :return: new title. + :rtype: str + """ + return fix_inconsistent_naming(title, {"Superman & Lois": "Superman and Lois", + }, True) + + +def fix_movie_naming(title): + return fix_inconsistent_naming(title, { + }, True) + + + class YavkaNetSubtitle(Subtitle): """YavkaNet Subtitle.""" provider_name = 'yavkanet' @@ -112,10 +128,10 @@ class YavkaNetProvider(Provider): } if isEpisode: - params['s'] = "%s s%02de%02d" % (sanitize(video.series, {'\''}), video.season, video.episode) + params['s'] = "%s s%02de%02d" % (sanitize(fix_tv_naming(video.series), {'\''}), video.season, video.episode) else: params['y'] = video.year - params['s'] = sanitize(video.title, {'\''}) + params['s'] = sanitize(fix_movie_naming(video.title), {'\''}) if language == 'en' or language == 'eng': params['l'] = 'EN' |