diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2022-08-03 21:31:46 +0200 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2022-10-31 20:09:04 +0100 |
| commit | 7df0cfcbed6100f16b1ccc2bd93aba42cff2b669 (patch) | |
| tree | 0cf4c92cabca893517fe6fcd59fd8fdff44d32cb /src | |
| parent | 907ddfa06a08ace8e7f6806e4e8567a18903a790 (diff) | |
| download | invidious-7df0cfcbed6100f16b1ccc2bd93aba42cff2b669.tar.gz invidious-7df0cfcbed6100f16b1ccc2bd93aba42cff2b669.tar.bz2 invidious-7df0cfcbed6100f16b1ccc2bd93aba42cff2b669.zip | |
Videos: fix 'views' parsing for livestreams
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/videos.cr | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 6211bcd7..b76da8f9 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -690,7 +690,11 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any # Basic video infos title = video_details["title"]?.try &.as_s - views = video_details["viewCount"]?.try &.as_s.to_i64 + + views = video_primary_renderer + .dig?("viewCount", "videoViewCountRenderer", "viewCount", "runs", 0, "text") + .try &.as_s.to_i64 + views ||= video_details["viewCount"]?.try &.as_s.to_i64 length_txt = (microformat["lengthSeconds"]? || video_details["lengthSeconds"]) .try &.as_s.to_i64 |
