Fix get_title and get_provider null safety, add provider edge case tests
This commit is contained in:
@@ -373,9 +373,12 @@ class AniworldLoader(Loader):
|
||||
title_div = soup.find('div', class_='series-title')
|
||||
|
||||
if title_div:
|
||||
title = title_div.find('h1').find('span').text
|
||||
logging.debug(f"Found title: {title}")
|
||||
return title
|
||||
h1_tag = title_div.find('h1')
|
||||
span_tag = h1_tag.find('span') if h1_tag else None
|
||||
if span_tag:
|
||||
title = span_tag.text
|
||||
logging.debug(f"Found title: {title}")
|
||||
return title
|
||||
|
||||
logging.warning(f"No title found for key: {key}")
|
||||
return ""
|
||||
@@ -531,7 +534,7 @@ class AniworldLoader(Loader):
|
||||
|
||||
redirect_link_tag = link.find('a', class_='watchEpisode')
|
||||
redirect_link = (
|
||||
redirect_link_tag['href']
|
||||
redirect_link_tag.get('href')
|
||||
if redirect_link_tag else None
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user