Open bofinbabu opened 8 years ago
If you make a call to /streams/:channel/, stream
will either be an object (if LIVE) or null
(if OFFLINE).
Yes it's working. But it's taking about 20 seconds recognize the change (took 20 sec for that api call to return a null, instead of the object, after I stopped broadcasting) Is it normal?
That is normal.
On Tue, May 10, 2016 at 10:11 AM Bofin Babu notifications@github.com wrote:
Yes it's working. But it's taking about 20 seconds recognize the change (took 20 sec for that api call to return a null, instead of the object, after I stopped broadcasting) Is it normal?
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/justintv/Twitch-API/issues/548#issuecomment-218169243
@bashtech @Decicus It's not just 20 seconds. It's about 1 minute 45 seconds to detect that the stream has started. And it's about 3 mins to detect that the broadcasting stopped.
Is there any way to reduce these delays?
The time will vary, the endpoints are cached to improve performance, this is expected behavior.
bumping this.. is there anyway to speed this up?
@TournyMasterBotCurse how long is the cache?
Long is length, we use words,, C
-----Original Message----- From: "Ari Evans" notifications@github.com Sent: 09/06/2016 02:49 To: "justintv/Twitch-API" Twitch-API@noreply.github.com Subject: Re: [justintv/Twitch-API] Check if a user is LIVE or OFFLINE (#548)
@TournyMasterBotCurse how long is the cache? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
No, it can take anywhere up to 3 minutes for streams to change state due to various layers of caching. There is no way for you to speed this up.
@Fugiman what about using event listeners to catch when a channel goes online/offline?
@Argus9 @Fugiman here is a link if you are wondering what the event listeners are using the embeded video player https://github.com/justintv/Twitch-API/blob/master/embed-video.md#events
Or you could just use the (now documented) PubSub system.
Listen for video-playback.some_channel
and look for stream-up
/stream-down
. Documentation for the video-playback
topic is available in this PR.
I'm entirely new to twitch API. From what I've read from the documentation so far, I'm unclear how I'm going to make this simple API call which will tell if a user is streaming live or not? Note: In my particular case, the user is myself.