reddittube-add.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:reddittube 作者: armandg 项目源码 文件源码
def get_authenticated_service():
    '''Authorize the request and store authorization credentials to YouTube'''
    flow = flow_from_clientsecrets(CLIENT_SECRETS_FILE,
                                   scope=YOUTUBE_READ_WRITE_SSL_SCOPE,
                                   message=MISSING_CLIENT_SECRETS_MESSAGE)

    storage = Storage("%s-oauth2.json" % sys.argv[0])
    credentials = storage.get()

    if credentials is None or credentials.invalid:
        credentials = run_flow(flow, storage)

    # Trusted testers can download this discovery document from the
    # developers page and it should be in the same directory with the code.
    return build(API_SERVICE_NAME, API_VERSION,
                 http=credentials.authorize(httplib2.Http()))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号