mirror of
https://github.com/iv-org/invidious.git
synced 2025-04-20 23:46:26 -04:00
parser: live_now: Add fallback based on viewCount and isLive.
This commit is contained in:
parent
70acf7c8a3
commit
b2f7d07641
@ -249,6 +249,10 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any
|
||||
|
||||
live_now = microformat.dig?("liveBroadcastDetails", "isLiveNow")
|
||||
.try &.as_bool
|
||||
if live_now.nil?
|
||||
live_now = video_primary_renderer
|
||||
.try &.dig?("viewCount", "videoViewCountRenderer", "isLive").try &.as_bool
|
||||
end
|
||||
live_now ||= video_details.dig?("isLive").try &.as_bool || false
|
||||
|
||||
post_live_dvr = video_details.dig?("isPostLiveDvr")
|
||||
|
Loading…
x
Reference in New Issue
Block a user