以最小的负载达到YouTube API的投放限制 [英] Hitting YouTube API serving limit with the slightest load

查看:94
本文介绍了以最小的负载达到YouTube API的投放限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在parse.com上有一个脚本,该脚本使用YouTube v3 API从大约10个频道中导入了有关最新视频的最新信息.它在一段时间内运作良好,但是大约一个月前,它开始每天失败一次或两次,并出现错误:

I have a script at parse.com which imports a fresh information about recent videos from ~10 channels with YouTube v3 API. It worked well for some time, but about a month ago it started to fail once or twice per day with an error:

错误:无法获取 https://www.googleapis.com/youtube/v3/ ...错误":{错误":[{域":"usageLimits",原因":"servingLimitExceeded",消息":超出服务限制"}],代码":403 ,消息":超出了投放限制"}

Error: can't fetch https://www.googleapis.com/youtube/v3/... "error": { "errors": [ { "domain": "usageLimits", "reason": "servingLimitExceeded", "message": "Serving Limit Exceeded" } ], "code": 403, "message": "Serving Limit Exceeded" }

从下面的屏幕截图中可以看到,我每天最多使用3万个50000k单位.我估计一次脚本运行最多需要2k个单元.为了确保绝对不会达到每秒3k单位/秒/用户的限制,我在每次调用YouTube API之前添加了1秒的延迟,但是偶尔还是会看到这些错误.

As you can see from the following screenshot I use maximum 37k of 50000k units available per day. I estimate one script run could take maximum 2k units. To make absolutely sure I'm not hitting 3k units/second/user limit I've added 1 second delay before every call to YouTube API, but I still see those errors occasionally.

这是怎么回事? YouTube v3 API是否有其他限制,例如每个IP的单位? (Parse的一个IP可以托管数千个安装)

What's going on? Does YouTube v3 API have some other limits, for example units per IP? (one IP at Parse could host thousands of installations)

推荐答案

我认为这是YouTube的问题,似乎与实际使用的配额无关.

I think this is a issue on YouTube's end and doesn't seem related to the actual quota used.

在过去的几周中,我偶尔会收到这些错误,而且似乎是无缘无故-参见

I have been getting quite a few of these errors sporadically, and seemingly for no reason, over the last few weeks - see YouTube Data API - "Serving Limit Exceeded"

这篇关于以最小的负载达到YouTube API的投放限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆