I’m trying to get some data of certain games but to do that I need a code from oauth2/authorize. Unless there is a way i can bypass this or there is something else that I haven’t seen yet, I’m quiet lost as the redirect_uri doesn’t work.
# main.py
# Get Code from oauth2/authorize
def get_code():
url = 'https://id.twitch.tv/oauth2/authorize'
params = {
'client_id': CLIENT_ID,
'redirect_uri': 'http://localhost:5000',
'response_type': 'code',
'scope': 'analytics:read:games'
}
response = requests.get(url, params=params)
# webserver.py
class MainHandler(tornado.web.RequestHandler):
async def get(self):
# print stuff
async def post(self):
# print stuff
if __name__ == "__main__":
app = tornado.web.Application([
('', MainHandler),
])
app.listen(5000)
tornado.ioloop.IOLoop.instance().start()