SciLor's Open Source Forums
http://forum.scilor.com/

Grooveshark Token Problems
http://forum.scilor.com/viewtopic.php?f=133&t=43
Page 1 of 2

Author:  super [ Tue Feb 02, 2010 11:59 pm ]
Post subject:  Grooveshark Token Problems

Hey SciLor
If have spot your programm just some weeks ago.
I coded a similiar one, but due to new tokens my programm doesn't work.

How is the token composed now?
I looked into the main.swf and tried several attempts but none of them worked.

Probably you can give me some hints or solutions ;)

I could help you to put the download-routine into a (multi-)thread and include a progressbar for the downloads.


PS: Kannst auch gerne auf deutsch schreiben. Ich dachte mir nur , da hier alles auch englisch ist und so :)

Author:  SciLor [ Wed Feb 03, 2010 12:06 am ]
Post subject:  Re: Grooveshark Token Problems

We stay in English :)

Where you started coding? Got some existing code?!
If you have used Grooveshark Mobile Source or you working with the groovefish dll there is a simple solution:

The token includes a constant string called "theColorIsRed" (I just remembered, so there may a mistake). In the version before it where "theHumansAreDead" you should replace it in your source ;) I presume that the version will be also wrong, but you can also find it under the keyword "clientRevision".

Thank you for your "help", but I want to do it for myself, I just have no time to ^^ I want to reinvent the DLL due to some big bugs in song searching!

(Good Night!)

Author:  cjoudrey [ Wed Mar 17, 2010 9:12 pm ]
Post subject:  Re: Grooveshark Token Problems

Do you know at what frequency they change this constant?

How did you find the new constant?

It appears to have changed again...

I am currently working on reverse engineering their protocol for fun...

communicationToken = 4ba1249e27b86

I sniffed the following packet:

Code:
{
"header":
{
"token":"6b017bf5e8744f719f78c60f97dca10eaa45d742e6d502",
"client":"widget",
"clientRevision":"20100211.2",
"session":"8f019bd4f8b4a99a116fb02a6f921637",
"uuid":"64830F98-293C-97AC-69E4-6D79A5FEF785"
},
"parameters": {"widgetID":20464003},
"method":"getWidgetSongListFromWidgetID"
}


Thus.

method = getWidgetSongListFromWidgetID
token = 6b017bf5e8744f719f78c60f97dca10eaa45d742e6d502
so lastRandomizer = 6b017b
sha1 = f5e8744f719f78c60f97dca10eaa45d742e6d502

Unfortunately, when I compute the SHA1 myself it does not give the same result..

sha1(getWidgetSongListFromWidgetID:4ba1249e27b86:theColorIsRead:6b017b) = 16b41c5653d5dd43a7085789bca02cad2871f0e7

Any ideas?

Author:  SciLor [ Wed Mar 17, 2010 9:15 pm ]
Post subject:  Re: Grooveshark Token Problems

My mistake, theColorIsRead had a typo, it must be "theColorIsRed"

The constant was changed once since the last 4 Month, so nearly never

Author:  cjoudrey [ Wed Mar 17, 2010 9:20 pm ]
Post subject:  Re: Grooveshark Token Problems

Wow !!! Quick reply ! :O

Weird...

sha1(getWidgetSongListFromWidgetID:4ba1249e27b86:theColorIsRed:6b017b) = 640f18001684848deb61ffda3e34e19c9d468eaa

When it should be:

sha1 = f5e8744f719f78c60f97dca10eaa45d742e6d502

Author:  cjoudrey [ Wed Mar 17, 2010 9:21 pm ]
Post subject:  Re: Grooveshark Token Problems

Maybe it is because I am sniffing the Widget application and it might have a different constant?

Author:  SciLor [ Wed Mar 17, 2010 9:29 pm ]
Post subject:  Re: Grooveshark Token Problems

I create the sha in that way in c#
Code:
        public static string GetSHA1Hash(string str)
        {
            SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider();
            byte[] strBytes = Encoding.ASCII.GetBytes(str);
            byte[] sha1Bytes = sha1.ComputeHash(strBytes);

            StringBuilder hashStr = new StringBuilder();
            foreach (byte b in sha1Bytes)
                hashStr.Append(b.ToString("x2"));

            return hashStr.ToString();
        }

Just the normal creating.

The token I create that way:
Code:
        internal string GetRequestToken(string method)
        {
            string randomHex = GetRandomHexStr();
            string hashStr = method + ":" + this.communicationToken + ":theColorIsRed:" + randomHex;

            string sha1 = HashHelper.GetSHA1Hash(hashStr);
            return randomHex + sha1;
        }


As you the the random string is in front of the sha1 hash
And yours seems to be different :D

Author:  cjoudrey [ Wed Mar 17, 2010 9:42 pm ]
Post subject:  Re: Grooveshark Token Problems

So strange...

method = userGetPlaylists
randomHexStr = cf2120
communicationToken = 4ba12d2944e1c

sha1(userGetPlaylists:4ba12d2944e1c:theColorIsRed:cf2120) = 74047cab9aef19a7410b08f172baab4af6783912
token = cf212074047cab9aef19a7410b08f172baab4af6783912

The token sent by GrooveShark Flash: cf21200614a2d6513ec83aebf353d9fb6c02c398feb4a1

Maybe it's my SHA1 that is not computing properly?

What do you get when you input those values in your GetRequestToken?

Author:  SciLor [ Wed Mar 17, 2010 9:59 pm ]
Post subject:  Re: Grooveshark Token Problems

Here is what I did:

"getSearchResults:4ba134189baf0:theColorIsRed:a4b0e2" will be sha1 to "4d2c109390a5c133faf1df7aad47b6cdd2668a14" and afterwards with the randomHex "a4b0e24d2c109390a5c133faf1df7aad47b6cdd2668a14"

Author:  cjoudrey [ Wed Mar 17, 2010 10:03 pm ]
Post subject:  Re: Grooveshark Token Problems

Wow.. I get the same SHA1... this is so strange...

Ok well I will keep trying :)

Thanks a lot for your help !

Page 1 of 2 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/