parser: live_now: Add fallback based on viewCount and isLive.

This commit is contained in:
mk-pmb feat. Emilien Devos 2025-04-11 15:26:00 +02:00
parent 70acf7c8a3
commit b2f7d07641

View File

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