我们的应用程序每天使用YouTube API上传数百个视频,但现在超出配额错误
我的应用程序允许用户将其YouTube帐户链接"到我们的系统,然后我们允许他们在某些情况下自动将视频上传到其频道,并允许他们将视频上传到自己的频道.我们有数百个视频正在上传,因为我们有成千上万的用户在使用我们的系统.
My application allows users to "link" their YouTube accounts to our system and then we allow them to upload videos to their channels both automatically in some cases, and on an "upload" action on their part. We have hundreds of videos being uploaded because we have thousands of users that use our system.
今天,当我们运行批处理自动上传作业时,我的应用程序中出现了数百个错误.错误原因是:
Today I saw hundreds of errors in my application when our batch automatic upload job was running. The errors were for:
quotaExceed,已达到视频上传限制.
quotaExceeded, video upload limit reached.
我的API配额非常高(每天50,000,000,每用户100秒3,000,000,每位用户每100秒300,000),因此,如果视频为1600点,我每天就可以上传30,000+,每100部视频1,800秒,每位用户每100秒180 +.
My API quotas are very high (50,000,000 per day, 3,000,000 per 100 seconds, 300,000 per 100 seconds per user), so if a video is 1600 points, I have enough limit to upload 30,000+ per day, 1,800 videos per 100 seconds, and 180+ per 100 seconds per user.
我还看到其他问题,暗示Google实施了一些新的限制,即仅限制50个视频,然后每15分钟限制1个视频?对于我的应用程序(配额如此大),这是一个非常低的限制!需要明确的是,我最多只能看到我的应用程序一天就能处理1000个视频(在我的5000万总配额中,有1,600,000点).
I have seen other questions out there hinting at some newly enforced limit by Google to just 50 videos and then 1 video every 15 minutes? This is a very low limit for my application which has such a large quota! To be clear, at most I have seen my application handle 1,000 videos in a single day (1,600,000 points of my total 50,000,000 quota).
有什么办法可以使我限制为50个视频,然后每15分钟删除1个视频吗?对于一个非常流行的Web应用程序,这是我用户功能的主要障碍.我可以理解每个用户是否有50个视频,然后每15分钟1个,但是我非常怀疑我今天早上的错误是否出自一位用户尝试一次上传300多个视频的错误.我的系统每天仅上传其最新"视频,大多数人最多只能上传1-10个视频.数以百计的情况将是非常罕见的.
Is there any way I can get this artificial limit of 50 videos and then 1 per 15 minutes removed? This is a major block to my users' functionality for a very popular web app. I could understand if it were 50 videos per user and then 1 every 15 minutes, but I highly doubt my errors this morning were from one user trying to upload 300+ videos at a time. My system only uploads their "newest" videos each day, which most people only have 1-10 videos at max. Hundreds would be a very rare edge case.
您实际上可以在开发人员控制台中进行确认您的应用程序的可用配额.默认情况下,配额使用情况.如果您发现您的用量已达到配额限制,则可以请求在配额" 标签上.
You can actually confirm in your Developers Console the available quota for your application. By default, YouTube API have a quota allocation of 1 million units per day as mentioned in Quota usage. If you see that your usage reached your quota limit, you can request additional quota on the Quotas tab.
还要注意,所有API请求(包括无效请求)的配额成本至少为1分.您可以使用配额计算器来估算API查询的配额成本
Note also that, all API requests, including invalid requests, incur a quota cost of at least one point. You may use the Quota Calculator to get an estimate of the quota cost for an API query.
另一方面,为了有效地使用配额,如果您还没有这样做,我建议您在遇到高错误率时实施指数补偿.请参阅此示例代码,该示例代码显示了恢复失败的指数退避策略.上载.另外,如果适用的话,订阅推送通知比轮询更有效基础的解决方案.
On the other hand, to work efficiently with your quota and if you haven't done so, I suggest that you implement exponential backoff if you're encountering high error ratio. See this sample code which shows an exponential backoff strategy to resume a failed upload. Also, if applicable, subscribe to Push Notifications which is much more efficient than polling-based solutions.
查看文档,以获取有关PubSubHubbub回调服务器如何接收Atom的更多信息.某个频道进行以下任何活动时,都会提供通知:
Check the documentation for more information on how PubSubHubbub callback server receives Atom feed notifications when a channel does any of the following activities:
- 上传视频
- 更新视频的标题
- 更新视频的说明
希望有帮助!