import flask import gzip def generateResponse(token, data = None): """ Return a flask response with required headers for osu! client, token and gzip compressed data token -- user token data -- plain response body return -- flask response """ resp = flask.Response(gzip.compress(data, 6)) resp.headers['cho-token'] = token resp.headers['cho-protocol'] = '19' resp.headers['Keep-Alive'] = 'timeout=5, max=100' resp.headers['Connection'] = 'keep-alive' resp.headers['Content-Type'] = 'text/html; charset=UTF-8' resp.headers['Vary'] = 'Accept-Encoding' resp.headers['Content-Encoding'] = 'gzip' return resp def HTMLResponse(): """Return HTML bancho meme response""" html = "MA MAURO ESISTE?
"
	html += "           _                 __
" html += " (_) / /
" html += " ______ __ ____ ____ / /____
" html += " / ___/ / _ \\/ _ \\/ / _ \\
" html += " / / / / /_) / /_) / / ____/
" html += "/__/ /__/ .___/ .___/__/ \\_____/
" html += " / / / /
" html += " /__/ /__/
" html += "PYTHON > ALL VERSION

" html += "
" html += " .. o .
" html += " o.o o . o
" html += " oo...
" html += " __[]__
" html += " phwr--> _\\:D/_/o_o_o_|__ u wot m8
" html += " \\\"\"\"\"\"\"\"\"\"\"\"\"\"\"/
" html += " \\ . .. .. . /
" html += "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
" html += "

reverse engineering a protocol impossible to reverse engineer since always
we are actually reverse engineering bancho successfully. for the third time.
" return html