Fix get_title and get_provider null safety, add provider edge case tests

This commit is contained in:
2026-02-07 19:13:40 +01:00
parent 88f3219126
commit 60e5b5ccda
2 changed files with 273 additions and 4 deletions

View File

@@ -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
)