def _refresh_access_token(self):
"""
Request new access token to send with requests to Brightcove. Access Token expires every 5 minutes.
"""
url = "https://oauth.brightcove.com/v3/access_token"
params = {"grant_type": "client_credentials"}
auth_string = base64.encodestring(
'{}:{}'.format(self.api_key, self.api_secret)
).replace('\n', '')
headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Basic " + auth_string
}
resp = requests.post(url, headers=headers, data=params)
if resp.status_code == httplib.OK:
result = resp.json()
return result['access_token']
评论列表
文章目录