我正在尝试使用 python gdata 库获取 YouTube 源。 身份验证功能工作正常,yt_service.ProgrammaticLogin() 工作,生成子身份验证 token 工作等,但是当我尝试获取一些提要(GetMostRecentVideoFeed、GetYouTubeVideoEntry、甚至 GetFeed 和任何其他)时,我得到:
RequestError: {'status': 302, 'body': '<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">\n<TITLE>302 Moved</TITLE></HEAD><BODY>\n<H1>302 Moved</H1>\nThe document has moved\n<A HREF="http://www.google.com">here</A>.\r\n</BODY></HTML>\r\n', 'reason': 'Redirect received, but redirects_remaining <= 0'}
302 到“google.com”???
我什至尝试按照谷歌在线教程做一些事情,但遇到了同样的错误。这是怎么回事?
最佳答案
已解决。
您需要将 ssl=False 添加到 YouTubeService 对象。但在文档中看不到任何相关内容。
yt = gdata.youtube.service.YouTubeService()
yt.ssl = False
关于python - gdata youtube api 302 'The document has moved',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2863785/