import IMDb vote count from user ratings

This commit is contained in:
ducklet 2021-07-22 20:31:30 +02:00
parent 159ffce4b4
commit 3f9cec3e79

View file

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