mirror of
https://github.com/iv-org/invidious.git
synced 2025-05-31 14:11:54 +05:30
Videos: fix 'views' parsing for livestreams
This commit is contained in:
@@ -690,7 +690,11 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any
|
|||||||
# Basic video infos
|
# Basic video infos
|
||||||
|
|
||||||
title = video_details["title"]?.try &.as_s
|
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"])
|
length_txt = (microformat["lengthSeconds"]? || video_details["lengthSeconds"])
|
||||||
.try &.as_s.to_i64
|
.try &.as_s.to_i64
|
||||||
|
Reference in New Issue
Block a user