I'm writing a script that lets you automatically download and save songs locally from your hypem account.
The process thus far has been difficult but I've once again run into a bit of a quagmire.
I found out that hypem assigns an ID and a Key to each song on their database. Each ID is unique to it's Key.
Doing some packet sniffing I found out that there's a page where an array full of these ID's and Key's get populated.
The page will be:
http://hypem.com/[username]?ax=1&ts=[unix-time]
I thought I was done and my script was ready to download the files but I found out that the Key's that it was parsing weren't correct.
After a little investigating it turned out that the page would return the correct song keys only if the request was being made from a web browser. That is, making an HTTP request through my ruby script returned a page with seemingly random keys.
So every time you go to that page in a web browser you'll get the right key for the song. Trying to automate it doesn't work...
My plan at this point was to stop using an HTTP client and send a raw packet over a TCP socket on port 80. So I copied exactly what the firefox request looked like and sent it over the socket....unfortunately the problem persisted.
I can't figure out how their website is distinguishing my script from a firefox client. The packets were identical when I looked at them through wireshark.
At this point I'm open to ideas any of you may have.