SciLor's Open Source Forums

Also visit my Website!
It is currently Mon Jun 18, 2018 9:28 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jun 14, 2012 10:32 pm 
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:
Code:
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("grooveshark.com")
    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:
Code:
{'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 grooveshark.com/more.php?getCommunicationToken with the header that can be seen as variable "header"

Why won't grooveshark return anything here?


Top
  
 
 
Online
The Adswinger

Joined: Wed Jan 13, 2010 11:56 pm
Posts: Too many!
Donated: Ad Posts


PostPosted: Tue Jun 19, 2012 2:13 pm 
it's a problem with openssl 0.9.8: http://bugs.python.org/issue15082


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
template->_php_include(): File ./counter/foruminclude.php does not exist or is empty Powered by phpBB® Forum Software © phpBB Group