Is there a way to know if a stream segment is currently live?
I only found the channel “online” event to get notified when a channel is currently live, but it does not contain any info about what “video/segment” is live.
My goal would be to share on my platform that a twitch channel is currently with a video (title, description, etc.)
Is there a way to do this? I couldn’t find it in the API docs.
YouTube is “create a stream on day x with title y and category y” which generates basically a completely different channel (well URL for the live stream).
Title/category changes when the streamer/user changes it.
It’s not connected to the live event.
Yesterday, for example, the main streamer I work for, did three streams.
For stream 2 they did not file a title/category update.
Twitch has titles/categories persist after a stream ends. So you’ll find that some streamers, who go on vacation, will update the title to say “away till x” (which’ll trigger a channel.update)
The problem with
is that there is a slim chance you get the wrong title/category, as the streamer goes live, then goes “dammit forgot to update the title/category” so they’ll change the title and streams might return cached information.
So if you intent is to
You need the real time updates that EventSub gives you. Just in case
Thanks @BarryCarlyon, things are now more clear to me. The thing with the title is indeed an issue or could be.
Here is a more detailed view of what I want to achieve:
I have a platform https://larastreamers.com/ where I show upcoming streams from streamers. This currently only works for YouTube streams, but I want to support twitch too.
The way it currently works is
streamer submits the URL of an already schedule YT stream
I regularly check if this stream is live, if it is, I set it to “live”, later than to “finished”
The question for me is, since Twitch works quite differently, if I can integrate Twitch here too, so I can list upcoming Twitch “streams”, and also mark them as “live” when they are live.
When it comes to streams
YouTube is strict and formal.
Twitch is not.
You can’t easily pair a Twitch stream schedule item to a Stream as quite often streamers start late or early. And there just isn’t a correlation to a stream schedule item an a stream on Twitch.
On Twitch a channel being live is a property of a channel.
II’s not a property of a scheduled event.
You should be saying here
Channel of ID xxxx has gone live
Channel of ID xxxx is live
Not
Calendar Item of ID yyy on the schedule of Channel of ID xxx has gone live
if you are trying to tie a stream on a channel to a schedule item of a channel, the only way to do that is to compare start times.
But you can’t as a streamer could go live an hour early for a totallty different reason. Or plays a different game to what is on the calendar.
Twitch streamers are not “formal and strucuted” like this.
So your best bet here is to not mark a calendar item as live, just mark the channel as live.
There is no correlation betwen the stream schedule and VODs.
So you’d have to assume the most recent vod is for the stream that just ended. (And compare start times, and lengths)
Alterantively, if you are trying to show past broadcasts, just show everything from Get Videos - Reference | Twitch Developers using a type param of archive to filter the results.
And this only works if the target channel has Vod Retention enabled