mirror of https://github.com/morpheus65535/bazarr
Fixed Greeksubs provider to handle 404 response when searching for subtitles based on imdbId
This commit is contained in:
parent
21a728c13b
commit
c83f47b2d0
|
@ -70,7 +70,14 @@ class GreekSubsProvider(Provider):
|
||||||
search_link = self.server_url + 'en/view/' + imdb_id
|
search_link = self.server_url + 'en/view/' + imdb_id
|
||||||
|
|
||||||
r = self.session.get(search_link, timeout=30)
|
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'])
|
soup_page = ParserBeautifulSoup(r.content.decode('utf-8', 'ignore'), ['html.parser'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue