spotify.py 文件源码

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

项目:xmusic-crawler 作者: rockers7414 项目源码 文件源码
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")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号