本文介绍了YT:配额太多的最近通话 - 的Youtube API帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用YouTube API从YouTube帐户的内容(与
在我们的网站只是用户饲料...无需用户身份验证)。
从昨天早上开始,我们不断收到:

 <错误>
    &LT结构域GT; YT:配额< /域>
    < code基too_many_recent_calls< / code>
< /错误>

它开始作为一个随机事件,但很快,我们得到这个错误的时间100%。
我尝试以下,但我仍然得到错误:

解决方案

I had the same problem with Youtube API + App-Engine. I was passing the developer-key as parameter of the request, as well as the other suggested parameters (user-ip, developer-key in the request url) and still didn't work with App Engine.

Well it seemed that the developer key wasn't getting through (although X-Gdata-key was present in the POST request headers). I've found this solution:

Every YouTubeService instance has the attributes developer_key and client_id. Setting this attributes when creating the service instance (instead of setting the 'X-GData-Key' in the headers or the key attribute of a query instance) makes the developer_key for the app id: client_id to be sent in every request, and accepted successfully.

You can set these values in the constructor of YouTubeService for the Java API.

If you are using the API for Python, you can set the parameters directly as following:

client = gdata.youtube.service.YouTubeService()
    client.client_id = <application_id>
    client.developer_key = <developer_key>

I noticed that my developer_key wasn't getting through by checking the stats on the YouTube API dashboard.

这篇关于YT:配额太多的最近通话 - 的Youtube API帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 11:35
查看更多