summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2023-05-17 06:42:27 -0400
committermorpheus65535 <[email protected]>2023-05-17 06:42:27 -0400
commitbdf4ee85af7bd9f194da82420f66649e964650a1 (patch)
tree04455e9ceb1cf5cd7e9be66be2974b6438c28402
parent015beaf769f7d10077ad590a6ed0363c4407f129 (diff)
downloadbazarr-1.2.2-beta.5.tar.gz
bazarr-1.2.2-beta.5.zip
Fixed AI and machine translated subtitles being incorrectly returned by Opensubtitles.comv1.2.2-beta.5
-rw-r--r--libs/subliminal_patch/providers/opensubtitlescom.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/subliminal_patch/providers/opensubtitlescom.py b/libs/subliminal_patch/providers/opensubtitlescom.py
index a2b66fbcc..97c4f4ffe 100644
--- a/libs/subliminal_patch/providers/opensubtitlescom.py
+++ b/libs/subliminal_patch/providers/opensubtitlescom.py
@@ -56,6 +56,7 @@ class OpenSubtitlesComSubtitle(Subtitle):
def __init__(self, language, forced, hearing_impaired, page_link, file_id, releases, uploader, title, year,
hash_matched, file_hash=None, season=None, episode=None, imdb_match=False):
+ super().__init__(language, hearing_impaired, page_link)
language = Language.rebuild(language, hi=hearing_impaired, forced=forced)
self.title = title
@@ -334,6 +335,16 @@ class OpenSubtitlesComProvider(ProviderRetryMixin, Provider):
if len(result['data']):
for item in result['data']:
+ # ignore AI translated subtitles
+ if 'ai_translated' in item['attributes'] and item['attributes']['ai_translated']:
+ logging.debug("Skipping AI translated subtitles")
+ continue
+
+ # ignore machine translated subtitles
+ if 'machine_translated' in item['attributes'] and item['attributes']['machine_translated']:
+ logging.debug("Skipping machine translated subtitles")
+ continue
+
if 'season_number' in item['attributes']['feature_details']:
season_number = item['attributes']['feature_details']['season_number']
else: