gpt4 book ai didi

Do live messages have a push notification?(实时消息有推送通知吗?)

转载 作者:bug小助手 更新时间:2023-10-25 17:44:21 26 4
gpt4 key购买 nike



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.

我有一个YouTube机器人,当我流媒体时,它就会打开。根据LiveMessage文档,响应的一部分是机器人再次请求列表之前等待多长时间。


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.

通常,该值略高于1000。如果机器人每秒向服务器ping一次消息列表,列表调用是5个配额(S),而我流了一个半小时,我将使用27000个配额。超过了限额的两倍。


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

当然,我可能对YouTube进行了错误的投票。这就是我正在做的事情。



  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.

从Java示例来看,这种方法是正确的。Java示例使用了一个youtube对象。


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

如果我每秒使用5个配额分,我怎么能保持在10K的限制之下?


更多回答

Honestly there are three solutions: 1. request more quota 2. webscrap the live chat (I don't remember if my webscraping endpoint still works) 3. use the no-key endpoint I propose on yt.lemnoslife.com

老实说,有三种解决方案:1.请求更多配额2.取消网络实时聊天(我不记得我的网络抓取端点是否还能工作)3.使用我在yt.lemnolife.com上建议的无密钥端点

Interesting. I thought requesting a higher quota was for super-professional bots, or companies. I'll take a look at all three of your suggestions. Thanks.

有意思的。我以为要求更高的配额是针对超级专业机器人或公司的。我会把你的三条建议都看一看。谢谢。

I opened this issue to investigate my webscraping endpoint.

我打开这个问题是为了调查我的网络抓取终结点。

To anyone looking at this and the only solution is to ping youtube. As long as your stream isn't getting too many messages, to reduce the amount of API calls multiply milliseconds to wait by 6. That comes out to roughly 4500 points per hour and a half.

对于任何看到这一点的人来说,唯一的解决方案是ping YouTube。只要您的流没有收到太多消息,就可以将API调用量减少6毫秒,这大约是每小时4500个点。

优秀答案推荐
更多回答

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com