SciLor's Open Source Forums

Also visit my Website!
It is currently Mon Dec 10, 2018 8:09 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: CommunicationToken
PostPosted: Wed Jul 21, 2010 11:07 pm 
Hello,

i want built a own downloader to learn and get better in codeing ;)
My Problem is to get the CommunicationToken.

This is my code:

Code:
  private string _sessionId;
        private string _md5sessionId;
        private string _randomHex;
        private string _userId;
        private string _keyword;
        private string _revision;
        private string _client;
        private string _communikationtoken;

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            GetSessionId();
            GetMd5SessionId();
            GetRandomHex();
            GetUserId();
            this._keyword = ":quitStealinMahShit:";
            this._revision = "20100412.45";
            this._client = "gslite";

            GetCommuncationToken();
        }

        public void GetSessionId()
        {
            CookieCollection Cookies = new CookieCollection();
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://listen.grooveshark.com/");
            request.CookieContainer = new CookieContainer();
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Cookies = response.Cookies;
            this._sessionId = Cookies[0].Value.ToString();
        }

        public void GetMd5SessionId()
        {
            this._md5sessionId = Helper.ConvertMD5Hash(this._sessionId);
        }

        public void GetRandomHex()
        {
            this._randomHex = Helper.GetRandomHex();
        }

        public void GetUserId()
        {
            this._userId = Guid.NewGuid().ToString("D").ToUpper();
        }

        private void GetCommuncationToken()
        {
            //?????
        }


I know i must build a Json Object and send it with a Webrequest. In the Response is the Token.
I know too, that i can use the Newtonsoft.Json lib to build this object. But i dont know how!

Can someone help me a bit with the CommunicationToken?
Thanks! ;)


Top
  
 
 
Online
The Adswinger

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


 Post subject: Re: CommunicationToken
PostPosted: Thu Jul 22, 2010 1:45 am 
Offline
The Developer

Joined: Wed Jan 13, 2010 11:56 pm
Posts: 1467
Donated: free software
Iam am creating the Json query with:
Code:
            Dim jss As New JsonSerializer()
            Dim serialisedRequestContentBuilder As New StringBuilder()
            Using serializerRequestWriter As New StringWriter(serialisedRequestContentBuilder)
                jss.Serialize(serializerRequestWriter, SendObject)
            End Using
            Dim serializedRequestContent As String = serialisedRequestContentBuilder.ToString()




You must request the communication token from the server, just sniff some data with tamper data in firefox. The Secret key is the md5 hash of the SessionId.

If you want to write your own downloader/player, feel free to use my dll. But beware you are not allowed to republish your software including my dll. You will have to point to my website to download that

_________________
My Windows Mobile and Windows Open Source Website:
www.scilor.com

Like my work? Donate!
Donation Website

My Programs:
grooveshark™.com Downloader, GrooveMobile, Fuel Blaster, Chameleon TicTacToe, QuickTap, WiMoBlue, Driving Licence Trainer, CodeSnippetViewer, Gesture Launcher, Fahrplanauskunft, GSensor Control


Top
 Profile  
 
 Post subject: Re: CommunicationToken
PostPosted: Thu Jul 22, 2010 10:57 am 
okay thanks!

i create this Json Obj:

Code:
"{"header":{"client":"gslite","uuid":"AC76E39B-0E20-4477-AA20-F885A847F57E","clientRevision":"20100412.45","session":"956d8e45e89c74484319a1de681d0dd8"},"method":"getCommunicationToken","parameters":{"secretKey":"f683ab080fe774b9f93fe47190bf3cb2"}}"


looks this right?

I a send this to "https://cowbell.grooveshark.com/service.php", but how can i get the token out of the response? :)


Top
  
 
 Post subject: Re: CommunicationToken
PostPosted: Thu Jul 22, 2010 12:46 pm 
Offline
The Developer

Joined: Wed Jan 13, 2010 11:56 pm
Posts: 1467
Donated: free software
Its a json object again, just read it from the stream and read it onto a custom class with the same structure as the json object.

TO check if it is right just compare it to the "real" data send by grooveshark.com

_________________
My Windows Mobile and Windows Open Source Website:
www.scilor.com

Like my work? Donate!
Donation Website

My Programs:
grooveshark™.com Downloader, GrooveMobile, Fuel Blaster, Chameleon TicTacToe, QuickTap, WiMoBlue, Driving Licence Trainer, CodeSnippetViewer, Gesture Launcher, Fahrplanauskunft, GSensor Control


Top
 Profile  
 
 Post subject: Re: CommunicationToken
PostPosted: Thu Jul 22, 2010 1:18 pm 
But how can create a class for the parameters in the response? Because i dont know what paramters are in the response...


Top
  
 
 Post subject: Re: CommunicationToken
PostPosted: Thu Jul 22, 2010 1:29 pm 
Offline
The Developer

Joined: Wed Jan 13, 2010 11:56 pm
Posts: 1467
Donated: free software
Just download the data and print it out into your console or a messagebox :)

_________________
My Windows Mobile and Windows Open Source Website:
www.scilor.com

Like my work? Donate!
Donation Website

My Programs:
grooveshark™.com Downloader, GrooveMobile, Fuel Blaster, Chameleon TicTacToe, QuickTap, WiMoBlue, Driving Licence Trainer, CodeSnippetViewer, Gesture Launcher, Fahrplanauskunft, GSensor Control


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 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