summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2022-02-03 09:37:53 -0500
committermorpheus65535 <[email protected]>2022-02-03 09:37:53 -0500
commit2a8dd4a89c1b56cb864ddf1150c1e665c52f0f38 (patch)
treead070f542c27d79c25a326b0a8ebcf972147b4f3 /libs
parentb766b0324efe0d28d4486cc470a329bcb365a056 (diff)
downloadbazarr-2a8dd4a89c1b56cb864ddf1150c1e665c52f0f38.tar.gz
bazarr-2a8dd4a89c1b56cb864ddf1150c1e665c52f0f38.zip
no log: opensubtitles.com - fixed query arguments ordering to prevent redirection and additional request to provider.
Diffstat (limited to 'libs')
-rw-r--r--libs/subliminal_patch/providers/opensubtitlescom.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/libs/subliminal_patch/providers/opensubtitlescom.py b/libs/subliminal_patch/providers/opensubtitlescom.py
index 58ef14300..d3392eb52 100644
--- a/libs/subliminal_patch/providers/opensubtitlescom.py
+++ b/libs/subliminal_patch/providers/opensubtitlescom.py
@@ -289,11 +289,12 @@ class OpenSubtitlesComProvider(ProviderRetryMixin, Provider):
lambda: self.session.get(self.server_url + 'subtitles',
params=(('episode_number', self.video.episode),
('foreign_parts_only', forced),
+ ('imdb_id', imdb_id if not title_id else None),
('languages', langs.lower()),
('moviehash', file_hash),
- ('parent_feature_id', title_id) if title_id else ('imdb_id', imdb_id),
- ('season_number', self.video.season),
- ('query', os.path.basename(self.video.name))),
+ ('parent_feature_id', title_id if title_id else None),
+ ('query', os.path.basename(self.video.name).lower()),
+ ('season_number', self.video.season)),
timeout=30),
validate_json=True,
json_key_name='data'
@@ -305,10 +306,11 @@ class OpenSubtitlesComProvider(ProviderRetryMixin, Provider):
lambda: checked(
lambda: self.session.get(self.server_url + 'subtitles',
params=(('foreign_parts_only', forced),
- ('id', title_id) if title_id else ('imdb_id', imdb_id),
+ ('id', title_id if title_id else None),
+ ('imdb_id', imdb_id if not title_id else None),
('languages', langs.lower()),
('moviehash', file_hash),
- ('query', os.path.basename(self.video.name))),
+ ('query', os.path.basename(self.video.name).lower())),
timeout=30),
validate_json=True,
json_key_name='data'