mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-23 16:23:41 +00:00
Fixed addic7ed provider that wasn't able to find all shows. #1619
This commit is contained in:
parent
c60c7513a5
commit
4b8f0dbe81
1 changed files with 12 additions and 15 deletions
|
@ -285,24 +285,21 @@ class Addic7edProvider(_Addic7edProvider):
|
||||||
logger.info('Getting show ids')
|
logger.info('Getting show ids')
|
||||||
region.set(self.last_show_ids_fetch_key, datetime.datetime.now())
|
region.set(self.last_show_ids_fetch_key, datetime.datetime.now())
|
||||||
|
|
||||||
r = self.session.get(self.server_url, timeout=60)
|
r = self.session.get(self.server_url + 'shows.php', timeout=60)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
|
||||||
soup = ParserBeautifulSoup(r.content.decode('utf-8', 'ignore'), ['lxml', 'html.parser'])
|
soup = ParserBeautifulSoup(r.content.decode('utf-8', 'ignore'), ['lxml', 'html.parser'])
|
||||||
|
|
||||||
# populate the show ids
|
# populate the show ids
|
||||||
show_ids = {}
|
show_ids = {}
|
||||||
shows = soup.find(id='qsShow')
|
shows = soup.select('td > h3 > a[href^="/show/"]')
|
||||||
for show in shows:
|
for show in shows:
|
||||||
if hasattr(show, 'attrs'):
|
show_clean = sanitize(show.text, default_characters=self.sanitize_characters)
|
||||||
try:
|
try:
|
||||||
show_id = int(show.attrs['value'])
|
show_id = int(show['href'][6:])
|
||||||
except ValueError:
|
except ValueError:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if show_id != 0:
|
|
||||||
show_clean = sanitize(show.text, default_characters=self.sanitize_characters)
|
|
||||||
|
|
||||||
show_ids[show_clean] = show_id
|
show_ids[show_clean] = show_id
|
||||||
match = series_year_re.match(show_clean)
|
match = series_year_re.match(show_clean)
|
||||||
if match and match.group(2) and match.group(1) not in show_ids:
|
if match and match.group(2) and match.group(1) not in show_ids:
|
||||||
|
|
Loading…
Reference in a new issue