def __init__(self):
"""
Generate an authorized YouTube API client and S3 client
"""
credentials = oauth2client.client.GoogleCredentials(
settings.YT_ACCESS_TOKEN,
settings.YT_CLIENT_ID,
settings.YT_CLIENT_SECRET,
settings.YT_REFRESH_TOKEN,
None,
'https://accounts.google.com/o/oauth2/token',
None)
authorization = credentials.authorize(httplib2.Http())
credentials.refresh(authorization)
self.client = build('youtube', 'v3', credentials=credentials)
self.s3 = boto3.client('s3')
评论列表
文章目录