1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Added ability to use legacy audioscrobbler without SSL

This commit is contained in:
Krateng
2020-11-01 18:05:11 +01:00
parent 9a6617b4b1
commit 5b7d1fd8e9
4 changed files with 54 additions and 31 deletions

View File

@@ -5,7 +5,7 @@ author = {
"email":"maloja@krateng.dev",
"github": "krateng"
}
version = 2,10,2
version = 2,10,3
versionstr = ".".join(str(n) for n in version)
links = {
"pypi":"malojaserver",

View File

@@ -32,13 +32,13 @@ class AudioscrobblerLegacy(APIHandler):
else: return pathnodes[0]
def handshake(self,pathnodes,keys):
user = keys.get("u")
auth = keys.get("a")
timestamp = keys.get("t")
apikey = keys.get("api_key")
host = keys.get("Host")
protocol = 'https'
# expect username and password
protocol = 'http' if (keys.get("u") == 'nossl') else 'https'
# we utilize the useless username field for the protocol
if auth is not None:
for key in database.allAPIkeys():
if check_token(auth, key, timestamp):