fix parsing of ratings listing with missing genres
This commit is contained in:
parent
3c357584a2
commit
62afac7060
1 changed files with 2 additions and 1 deletions
|
|
@ -99,9 +99,10 @@ find_movie_id = re.compile(r"/title/(?P<id>tt\d+)/").search
|
|||
|
||||
def movie_and_rating_from_item(item) -> tuple[Movie, Rating]:
|
||||
|
||||
genres = (genre := item.find("span", "genre")) and genre.string or ""
|
||||
movie = Movie(
|
||||
title=item.h3.a.string.strip(),
|
||||
genres=set(s.strip() for s in item.find("span", "genre").string.split(",")),
|
||||
genres=set(s.strip() for s in genres.split(",")),
|
||||
)
|
||||
|
||||
episode_br = item.h3.br
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue