2

我已经使用 Google App Engine 应用程序中的 YouTube 数据 API 5 个月了,但没有收到服务不可用、503 错误响应。但是今天,我得到了这个:

YouTubeError: {
    'status': 503,
    'body': '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n<html>\n<head><meta http-equiv="content-type" content="text/html; charset=utf-8"><title>http://gdata.youtube.com/action/GetUploadToken</title></head>\n<body style="font-family: arial, sans-serif; background-color: #fff; color: #000; padding:20px; font-size:18px;" onload="e=document.getElementById(\'captcha\');if(e){e.focus();}">\n<div style="max-width:400px;">\n <hr noshade size="1" style="color:#ccc; background-color:#ccc;"><br>\n \n \n  <div style="font-size:13px;">\n   Our systems have detected unusual traffic from your computer network.  Please try your request again later.  <a href="#" onclick="document.getElementById(\'infoDiv0\').style.display=\'block\';">Why did this happen?</a><br><br>\n   <div id="infoDiv0" style="display:none; background-color:#eee; padding:10px; margin:0 0 15px 0; line-height:1.4em;">\n    This page appears when Google automatically detects requests coming from your computer network which appear to be in violation of the <a href="http://www.google.com/accounts/TOS">Terms of Service</a>. The block will expire shortly after those requests stop.<br><br>This traffic may have been sent by malicious software, a browser plug-in, or a script that sends automated requests.  If you share your network connection, ask your administrator for help &mdash; a different computer using the same IP address may be responsible.  <a href="http://www.google.com/support/bin/answer.py?answer=86640">Learn more</a><br><br>Sometimes you may see this page if you are using advanced terms that robots are known to use, or sending requests very quickly.\n   </div><br>\n \n IP address: 74.125.19.24<br>Time: 2012-10-09T17:48:20Z<br>URL: http://gdata.youtube.com/action/GetUploadToken<br>\n </div>\n</div>\n</body>\n</html>\n',
    'reason': 'Service Unavailable'
}

我正在使用 YouTube 上传用户的视频,也用于显示现有视频(用户只输入视频 URL)。有人知道它不起作用的可能原因吗?

4

1 回答 1

0

我正在使用 gdata python 库。我在视频模型中定义了 yt_service 属性:

def yt_service(self):
    try:
        return self._yt_service
    except AttributeError:
        yt_service = gdata.youtube.service.YouTubeService()            
        yt_service.developer_key = settings.SYNCR_YT_DEVKEY
        yt_service.email = settings.SYNCR_YT_EMAIL
        yt_service.password = settings.SYNCR_YT_PASS
        yt_service.ProgrammaticLogin()
        self._yt_service = yt_service
        return yt_service

然后在创建上传表单时,查看调用yt_service.GetFormUploadToken以检索上传令牌。在这里失败了。

于 2012-10-12T10:01:05.200 回答