def index(self):
sd = json.dumps({
"alexa:all": {
"productID": config['alexa']['Device_Type_ID'],
"productInstanceAttributes": {
"deviceSerialNumber": hashlib.sha256(str(uuid.getnode()).encode()).hexdigest()
}
}
})
url = "https://www.amazon.com/ap/oa"
callback = cherrypy.url() + "code"
payload = {
"client_id": config['alexa']['Client_ID'],
"scope": "alexa:all",
"scope_data": sd,
"response_type": "code",
"redirect_uri": callback
}
req = requests.Request('GET', url, params=payload)
prepared_req = req.prepare()
raise cherrypy.HTTPRedirect(prepared_req.url)
评论列表
文章目录