mirror of
https://github.com/krateng/maloja.git
synced 2025-06-05 18:03:14 +03:00
Fixed audioscrobbler APIs
This commit is contained in:
parent
2720dc1be5
commit
781ed66357
@ -55,7 +55,8 @@ class Audioscrobbler(APIHandler):
|
|||||||
raise InvalidAuthException()
|
raise InvalidAuthException()
|
||||||
# or username and token (deprecated by lastfm)
|
# or username and token (deprecated by lastfm)
|
||||||
elif user is not None and token is not None:
|
elif user is not None and token is not None:
|
||||||
for client,key in apikeystore:
|
for client in apikeystore:
|
||||||
|
key = apikeystore[client]
|
||||||
if md5(user + md5(key)) == token:
|
if md5(user + md5(key)) == token:
|
||||||
sessionkey = self.generate_key(client)
|
sessionkey = self.generate_key(client)
|
||||||
return 200,{"session":{"key":sessionkey}}
|
return 200,{"session":{"key":sessionkey}}
|
||||||
|
@ -42,10 +42,9 @@ class AudioscrobblerLegacy(APIHandler):
|
|||||||
protocol = 'http' if (keys.get("u") == 'nossl') else request.urlparts.scheme
|
protocol = 'http' if (keys.get("u") == 'nossl') else request.urlparts.scheme
|
||||||
|
|
||||||
if auth is not None:
|
if auth is not None:
|
||||||
for identifier in apikeystore:
|
for client in apikeystore:
|
||||||
key = apikeystore[identifier]
|
key = apikeystore[client]
|
||||||
client = self.check_token(auth,key,timestamp)
|
if self.check_token(auth,key,timestamp):
|
||||||
if client:
|
|
||||||
sessionkey = self.generate_key(client)
|
sessionkey = self.generate_key(client)
|
||||||
return 200, (
|
return 200, (
|
||||||
"OK\n"
|
"OK\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user