Fixed opensubtitlescom provider to remove filename from query because it was too specific and reduced number of subtitles returned for no good reason.

pull/1744/head
morpheus65535 3 years ago
parent c2f74465e9
commit bd5aae7f77

@ -30,7 +30,7 @@ logger = logging.getLogger(__name__)
SHOW_EXPIRATION_TIME = datetime.timedelta(weeks=1).total_seconds() SHOW_EXPIRATION_TIME = datetime.timedelta(weeks=1).total_seconds()
TOKEN_EXPIRATION_TIME = datetime.timedelta(hours=12).total_seconds() TOKEN_EXPIRATION_TIME = datetime.timedelta(hours=12).total_seconds()
retry_amount=5 retry_amount = 5
def fix_tv_naming(title): def fix_tv_naming(title):
@ -293,7 +293,6 @@ class OpenSubtitlesComProvider(ProviderRetryMixin, Provider):
('languages', langs.lower()), ('languages', langs.lower()),
('moviehash', file_hash), ('moviehash', file_hash),
('parent_feature_id', title_id if title_id else None), ('parent_feature_id', title_id if title_id else None),
('query', os.path.basename(self.video.name).lower()),
('season_number', self.video.season)), ('season_number', self.video.season)),
timeout=30), timeout=30),
validate_json=True, validate_json=True,
@ -309,8 +308,7 @@ class OpenSubtitlesComProvider(ProviderRetryMixin, Provider):
('id', title_id if title_id else None), ('id', title_id if title_id else None),
('imdb_id', imdb_id if not title_id else None), ('imdb_id', imdb_id if not title_id else None),
('languages', langs.lower()), ('languages', langs.lower()),
('moviehash', file_hash), ('moviehash', file_hash)),
('query', os.path.basename(self.video.name).lower())),
timeout=30), timeout=30),
validate_json=True, validate_json=True,
json_key_name='data' json_key_name='data'

Loading…
Cancel
Save