def __authorize(self):
headers = ["Authorization: Basic " + self.user_info_base64]
post_field = urlencode(self.parameter)
buf = BytesIO()
client = pycurl.Curl()
client.setopt(client.URL, self.spotify_authorize_url)
client.setopt(client.HTTPHEADER, headers)
client.setopt(client.POSTFIELDS, post_field)
client.setopt(client.WRITEFUNCTION, buf.write)
client.setopt(pycurl.SSL_VERIFYPEER, 0)
client.perform()
client.close()
self.response = json.loads(buf.getvalue().decode())
buf.close()
self.access_token = self.response.get("access_token")
评论列表
文章目录