I have been polling some information from the API for awhile, I have noticed that the _id on streams change fairly regularly. When I say fairly regularly, I mean every 30 minutes or so.
Does the _id only change when the streamer goes offline and comes back online or does the _id just change randomly? Also is there any way to poll a stream _id later to get the time that the stream ended? or do you have to continually poll it until the stream _id is no longer visible and then assume that it ended?
I would ideally like to know when a stream began and ended as a single stream, and I figured that the stream _id was the right way to determine this.
The stream _id changes every stream, so if the broadcaster goes offline then online, it’ll change.
As for polling for the stream _id after the stream has ended and API has updated, I don’t believe there is a way as the API returns null at that point.
For my stuff, I just poll to see if the stream token contains anything (_ID, game, etc) - if it contains something, then the stream is live but if it returns null then the stream is offline. If the stream was online but I poll and it shows offline, I consider it a soft-end, and I rely on a second poll few minutes later to ensure it wasn’t an API burp and that stream has actually ended.
And not just the API caching data, the fact that when you poll you might get server a, then on the next poll get server b, and server b is still feeding you the previous stream data as it’s not updated yet.
So yes in the event that a stream bounce occurs you will get this weirdness