You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 value BADGE_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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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