Do live messages have a push notification?

59 views Asked by At

I have a bot for youtube that I turn on when I stream. According to the LiveMessage documentation part of the response is how long to wait before the bot requests the list again.

Usually this value is slightly over 1000. If the bot pings the server for a list of messages once every second and a list call is 5 quota(s) and I stream for an hour and a half, I would use 27000 quota. Over double the limit.

Of course, I might be polling youtube incorrectly. Here is what I am doing.

  1. Send a GET request to https://www.googleapis.com/youtube/v3/liveChat/messages?liveChatId={LiveChatId}&part=id,authordetails,snippet&access_token={MyAccessToken}
  2. Save pollingIntervalMillis, and nextPageToken
  3. Task.Delay(MillisecondsToWait)
  4. Make a GET request to https://www.googleapis.com/youtube/v3/liveChat/messages?liveChatId={LiveChatId}&part=id,authordetails,snippet&access_token={MyAccessToken}&pageToken={nextPageToken}
  5. Repeat steps 2-4 until the response has the attribute offlineAt

Looking at the Java sample this approach is correct. Just, that the Java example uses a youtube object.

How am I supposed to stay under the 10K limit if I use 5 quota points every second?

0

There are 0 answers