Determining whether a stream is live #727
planetarian
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
One problem I had today was that I needed to be able to distinguish between finished/live/upcoming streams within a channel playlist, to determine whether a channel's streaming "status" has changed so I can then decide whether to pull further information about the videos in question using the official API. Finished streams/videos was simple because they just have a duration that isn't 00:00:00. Live/upcoming streams were impossible to distinguish from each other, though, because they both had the same zeroed duration and no other distinguishing features.
I found a solution for this, which is to check
_content->badges->metadataBadgeRenderer[0]->style
for the valueBADGE_STYLE_TYPE_LIVE_NOW
. I don't know whether it's up to the project's code standards, but I implemented it in my own fork of and it's been working reliably so far.Since this project is in maintenance mode and not accepting new issues/PRs, I'm just posting it here. The commit with the relevant changes is here:
planetarian@9b6ad2f
Beta Was this translation helpful? Give feedback.
All reactions