diff options
author | Michiel van Baak Jansen <[email protected]> | 2021-03-27 13:14:29 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-27 08:14:29 -0400 |
commit | c83f47b2d02470da70ad42797a0f4aa1085ee20a (patch) | |
tree | 0b10a9f138bef3a727f3580c769ee28565b70656 | |
parent | 21a728c13bf98ef14ec531738965fbc4675c4429 (diff) | |
download | bazarr-c83f47b2d02470da70ad42797a0f4aa1085ee20a.tar.gz bazarr-c83f47b2d02470da70ad42797a0f4aa1085ee20a.zip |
Fixed Greeksubs provider to handle 404 response when searching for subtitles based on imdbId
-rw-r--r-- | libs/subliminal_patch/providers/greeksubs.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/subliminal_patch/providers/greeksubs.py b/libs/subliminal_patch/providers/greeksubs.py index a5944f8a6..d138fcd49 100644 --- a/libs/subliminal_patch/providers/greeksubs.py +++ b/libs/subliminal_patch/providers/greeksubs.py @@ -70,7 +70,14 @@ class GreekSubsProvider(Provider): search_link = self.server_url + 'en/view/' + imdb_id r = self.session.get(search_link, timeout=30) - r.raise_for_status() + + # 404 is returned if the imdb_id was not found + if r.status_code != 404: + r.raise_for_status() + + if r.status_code != 200: + logger.debug('No subtitles found') + return subtitles soup_page = ParserBeautifulSoup(r.content.decode('utf-8', 'ignore'), ['html.parser']) |