From 408d0cd2534694c2f247df45b8d9eea75051ffac Mon Sep 17 00:00:00 2001 From: josdion Date: Sun, 13 Sep 2020 14:24:49 +0300 Subject: [PATCH] subssabbz, subsunacs - fix inconsistent movie naming --- libs/subliminal_patch/providers/subssabbz.py | 7 ++++++- libs/subliminal_patch/providers/subsunacs.py | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libs/subliminal_patch/providers/subssabbz.py b/libs/subliminal_patch/providers/subssabbz.py index 960d36429..04c720738 100644 --- a/libs/subliminal_patch/providers/subssabbz.py +++ b/libs/subliminal_patch/providers/subssabbz.py @@ -43,6 +43,11 @@ def fix_tv_naming(title): }, True) +def fix_movie_naming(title): + return fix_inconsistent_naming(title, {"Back to the Future Part": "Back to the Future", + }, True) + + class SubsSabBzSubtitle(Subtitle): """SubsSabBz Subtitle.""" provider_name = 'subssabbz' @@ -147,7 +152,7 @@ class SubsSabBzProvider(Provider): params['movie'] = "%s %02d %02d" % (sanitize(fix_tv_naming(video.series), {'\''}), video.season, video.episode) else: params['yr'] = video.year - params['movie'] = sanitize(video.title, {'\''}) + params['movie'] = sanitize(fix_movie_naming(video.title), {'\''}) if language == 'en' or language == 'eng': params['select-language'] = 1 diff --git a/libs/subliminal_patch/providers/subsunacs.py b/libs/subliminal_patch/providers/subsunacs.py index 137d2f7bf..d2afb0528 100644 --- a/libs/subliminal_patch/providers/subsunacs.py +++ b/libs/subliminal_patch/providers/subsunacs.py @@ -43,6 +43,12 @@ def fix_tv_naming(title): }, True) +def fix_movie_naming(title): + return fix_inconsistent_naming(title, {"Back to the Future Part III": "Back to the Future 3", + "Back to the Future Part II": "Back to the Future 2", + }, True) + + class SubsUnacsSubtitle(Subtitle): """SubsUnacs Subtitle.""" provider_name = 'subsunacs' @@ -147,7 +153,7 @@ class SubsUnacsProvider(Provider): params['m'] = "%s %02d %02d" % (sanitize(fix_tv_naming(video.series), {'\''}), video.season, video.episode) else: params['y'] = video.year - params['m'] = sanitize(video.title, {'\''}) + params['m'] = sanitize(fix_movie_naming(video.title), {'\''}) if language == 'en' or language == 'eng': params['l'] = 1