diff --git a/unwind/imdb.py b/unwind/imdb.py index 5159fa9..e541277 100644 --- a/unwind/imdb.py +++ b/unwind/imdb.py @@ -99,9 +99,10 @@ find_movie_id = re.compile(r"/title/(?Ptt\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