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:
@@ -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",
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user