From 3f9cec3e79ded15729552c1561c4c95047d21843 Mon Sep 17 00:00:00 2001 From: ducklet Date: Thu, 22 Jul 2021 20:31:30 +0200 Subject: [PATCH] import IMDb vote count from user ratings --- unwind/imdb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unwind/imdb.py b/unwind/imdb.py index a110ece..0da9091 100644 --- a/unwind/imdb.py +++ b/unwind/imdb.py @@ -32,6 +32,7 @@ log = logging.getLogger(__name__) # div.ipl-rating-star.ipl-rating-star--other-user.small # span.ipl-rating-star__rating.text # p.text-muted.text ("Rated on 06 May 2021") +# p.text-muted.text-small span[name=nv] [data-value] async def refresh_user_ratings_from_imdb(stop_on_dupe=True): @@ -126,6 +127,9 @@ def movie_and_rating_from_item(item) -> tuple[Movie, Rating]: if not movie.media_type: movie.media_type = "Movie" + if match := item.find("span", attrs={"name": "nv"}): + movie.imdb_votes = int(match["data-value"]) + rating = Rating() ratings_item = item.find("div", "ipl-rating-widget")