SciLor's Open Source Forums

Grooveshark getCommunicationToken no status
Page 1 of 1

Author:  delusionallogic [ Thu Jun 14, 2012 10:32 pm ]
Post subject:  Grooveshark getCommunicationToken no status

I'm using a library written by JackTheRipper51 to interact with grooveshark in python.

When i hit this function grooveshark doesn't return a status and the library screws up:
def getToken():
    global staticHeader, _token
    post = {}
    post["parameters"] = {}
    post["parameters"]["secretKey"] = hashlib.md5(staticHeader["session"]).hexdigest()
    post["method"] = "getCommunicationToken"
    post["header"] = staticHeader
    post["header"]["client"] = "htmlshark"
    post["header"]["clientRevision"] = "20120312"
    header = {"User-Agent": _useragent, "Referer": _referer, "Content-Type":"application/json", "Accept-Encoding":"gzip", "Cookie":"PHPSESSID=" + staticHeader["session"]}
    conn = httplib.HTTPSConnection("")
    conn.request("POST", "/more.php?getCommunicationToken", json.JSONEncoder().encode(post), header)
    print gzip.GzipFile(fileobj=(StringIO.StringIO(conn.getresponse().read()))).read()
    _token = json.JSONDecoder().decode(gzip.GzipFile(fileobj=(StringIO.StringIO(conn.getresponse().read()))).read())["result"]
    print _token

the post variable (or list if you will) is the json that is sent to grooveshark as payload, static header is just the static stuff, like UUID, countrycode, privacy: 0, and token (which is what i am getting, it is therefore null)

The json that is sent to grooveshark is:
{'header': {'session': 'a8d62a8e1b7c163de864075b26e1faac', 'clientRevision': '20120312', 'uuid': '0C304B27-66BF-4102-AF87-A77F5E7A108C', 'privacy': 0, 'country': {'CC4': '0', 'CC1': '72057594037927940', 'ID': '57', 'CC3': '0', 'CC2': '0'}, 'client': 'htmlshark'}, 'method': 'getCommunicationToken', 'parameters': {'secretKey': 'c6196acdf4e60a31c7104770a456bdbd'}}

as you can see this is sent to with the header that can be seen as variable "header"

Why won't grooveshark return anything here?

Author:  nawuko [ Tue Jun 19, 2012 2:13 pm ]
Post subject:  Re: Grooveshark getCommunicationToken no status

it's a problem with openssl 0.9.8:

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group