Skip to content

Commit

Permalink
Merge pull request EchterAlsFake#4 from EchterAlsFake/master
Browse files Browse the repository at this point in the history
Fixed an Issue with the views function of the video.
  • Loading branch information
Egsagon committed Jun 19, 2023
2 parents 8a49f3b + f5f156d commit 685df56
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/phub/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,17 +359,17 @@ def like(self) -> Like:

votes = {t.lower(): v for t, v in consts.regexes.video_likes(self.page)}
return Like(votes['up'], votes['down'])

@cached_property
def views(self) -> int:
'''
How many times the video has been watched.
'''

self._lazy()

raw = consts.regexes.video_interactions(self.page)[0]
return int(json.loads(f'[{raw}]')[0]['userInteractionCount'].replace(' ', ''))
return int(json.loads(f'[{raw}]')[0]['userInteractionCount'].replace(' ', '').replace(',', ''))

@cached_property
def hotspots(self) -> list[int]:
Expand Down

0 comments on commit 685df56

Please sign in to comment.