Youtube Python API:登录状态
我正在使用示例代码登录youtube:Youtube Python API:登录状态,python,youtube-api,Python,Youtube Api,我正在使用示例代码登录youtube: def auth(email, password): # Setup service. yt_service = gdata.youtube.service.YouTubeService() yt_service.email = email yt_service.password = password yt_service.source = 'youtube_interface' yt_service.develop
def auth(email, password):
# Setup service.
yt_service = gdata.youtube.service.YouTubeService()
yt_service.email = email
yt_service.password = password
yt_service.source = 'youtube_interface'
yt_service.developer_key = DEVELOPER_KEY
# Login.
yt_service.ProgrammaticLogin()
return yt_service
请告诉我,我如何知道登录是否成功?如何注销 如果您正在用Python进行新的开发,我建议您改用API的v3。您正在使用的旧式Python客户机库已经有一段时间没有更新了,并且仍然与API的v1版本相冲突。下面是一些在v3中使用Python的代码示例
也就是说,为了回答您的问题,如果ClientLogin尝试失败,客户端库将引发一个错误。我不知道有什么方法可以通过编程使ClientLogin令牌“注销”无效。令牌将在几个小时后过期。谢谢,我会试试看。我没有使用API的V3,因为标签“实验性”让我觉得有点不舒服。