def callback():
code = request.args.get('code', None)
if code is None:
return render_template(
'show_message.html',
message='There was an error while trying to authenticate you.'
'Please, try again.'), 503
flow = client.OAuth2WebServerFlow(
YOUTUBE_CLIENT_ID,
YOUTUBE_CLIENT_SECRET,
scope='https://www.googleapis.com/auth/youtube.readonly',
redirect_uri=YOUTUBE_REDIRECT_URI
)
credentials = flow.step2_exchange(code)
session['credentials'] = credentials.to_json()
influxdb.count('youtube.logins')
return redirect(url_for('youtube.index'))
评论列表
文章目录