YT:配额太多的最近通话 - 的Youtube API帮助 [英] yt:quota too many recent calls - Youtube API help

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

问题描述

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

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

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


  

如果您收到配额错误,
  还有你可以采取几个步骤进行:


  
  

      
  • 让您的请求包含您的开发人员密钥和clientID的。 我这样做

  •   
  • 确保您的code被执行的操作是用户启动。 我做的
      这个

  •   
  • 在限制查询参数传递用户的IP地址。 我能
      只有通过代理/服务器的IP
      地址,没有确切的客户端的
      因为谷歌AppEngine上不
      支持
      InetAddress.getLocalHost()。getHostAddress())

  •   
  • 如果您请求验证的饲料,以登录用户,而不是
      整个网站的帐户。 我不使用
      认证

  •   


解决方案

我不得不与YouTube API +应用引擎同样的问题。我经过开发商键作为请求的参数,以及其他建议参数(用户IP,在请求URL开发商键),仍然没有使用App Engine。

那么它似乎是开发商的关键不是通过获得(虽然的X做为Gdata,关键是在POST请求头present)。我发现这个解决方案:

每个YouTubeService实例具有属性 Developer_Key开发的client_id 。设置在创建服务实例时这个属性(而不是在标题或在键设定X-的GData键查询实例的属性),使得在 Developer_Key开发作为应用程序ID:的client_id 以在每个请求成功发送,并接受。

您可以在为Java API YouTubeService的构造。

如果您正在使用的Python API,您可以直接设置参数如下:

 客户端= gdata.youtube.service.YouTubeService()
    client.client_id =<&APPLICATION_ID GT;
    client.developer_key =< D​​eveloper_Key开发>

我注意到Developer_Key开发并没有通过检查的YouTube API仪表盘的统计数据可以通过。

I am using youtube api to get contents from a youtube account (with just user feed...without user authentication) on our website. Since yesterday morning, we keep getting:

<error>
    <domain>yt:quota</domain>
    <code>too_many_recent_calls</code>
</error>

It started off as a random occurrence, but very soon, we get this error 100% of the time. I tried the following quota limits instructions but I still get the error:

If you are receiving quota errors, there are a couple steps you can take:

  • Have your requests include your developer key and clientID. I do this
  • Make sure the actions your code is performing is user-initiated. I do this
  • Pass the user's IP address in the restriction query parameter. I am able to pass only the proxy/server IP address, not the exact client's because Google AppEngine does not support InetAddress.getLocalHost().getHostAddress())
  • If you are requesting authenticated feeds, login as the user rather than a site-wide account. I am not using authentication

解决方案

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帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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