diff options
author | morpheus65535 <[email protected]> | 2023-08-12 09:57:48 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2023-08-12 09:57:48 -0400 |
commit | cce1be4d0e020ae6eb46bf3802bccaf457e093e7 (patch) | |
tree | 7640d80e9ec827d3370225db49d0bc80ff76fb22 | |
parent | 403386c7d8d41cb509a4c1e856b100fb40fb4057 (diff) | |
download | bazarr-cce1be4d0e020ae6eb46bf3802bccaf457e093e7.tar.gz bazarr-cce1be4d0e020ae6eb46bf3802bccaf457e093e7.zip |
Fixed yavka.net subtitles search since they've modified the website. #2225v1.2.5-beta.12
-rw-r--r-- | libs/subliminal_patch/providers/yavkanet.py | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/libs/subliminal_patch/providers/yavkanet.py b/libs/subliminal_patch/providers/yavkanet.py index e72d00696..3741ea405 100644 --- a/libs/subliminal_patch/providers/yavkanet.py +++ b/libs/subliminal_patch/providers/yavkanet.py @@ -122,32 +122,15 @@ class YavkaNetProvider(Provider): def query(self, language, video): subtitles = [] isEpisode = isinstance(video, Episode) - params = { - 's': '', - 'y': '', - 'u': '', - 'l': 'BG', - 'i': '' - } if isEpisode: - params['s'] = "%s s%02de%02d" % (sanitize(fix_tv_naming(video.series), {'\''}), video.season, video.episode) + imdb_id = video.series_imdb_id else: - params['y'] = video.year - params['s'] = sanitize(fix_movie_naming(video.title), {'\''}) - - if language == 'en' or language == 'eng': - params['l'] = 'EN' - elif language == 'ru' or language == 'rus': - params['l'] = 'RU' - elif language == 'es' or language == 'spa': - params['l'] = 'ES' - elif language == 'it' or language == 'ita': - params['l'] = 'IT' - - logger.info('Searching subtitle %r', params) - response = self.retry(self.session.get('https://yavka.net/subtitles.php', params=params, allow_redirects=False, - timeout=10, headers={'Referer': 'https://yavka.net/'})) + imdb_id = video.imdb_id + + logger.info(f'Searching subtitle for {imdb_id}') + response = self.retry(self.session.get(f'https://yavka.net/imdb/{imdb_id}', timeout=10, + headers={'Referer': 'https://yavka.net/'})) if not response: return subtitles response.raise_for_status() |