Skip navigation.

TrueJournals

Life of a programmer

Posts tagged with "blogmusik"

Anything Streamed can be Downloaded...

, , , ...

It's only a matter of how much effort you will have to put in to download the file, not a matter of if it CAN be done. As soon as I saw that blogmusik had opened back up, with the ability to stream music for free, I thought about this. With a little bit of work, you CAN download music from Deezer, however, at the moment, it is quite a bit of work. Perhaps I (or someone else) will work on an easier way to do all of this.

The basis is simple: use a packet sniffer to find the address of one of the files. Done. I found Weird Al's Bohemian Polka at http://proxy-0.blogmusik.net/encapsulation.php?ID=46a4f541-5db0-ff08-c65b-3e74d647b672 However, I was disappointed by the URL a bit. I was hoping that finding the URL, it would turn out to be some standard thing, but instead they use a unique ID for each song. Which only delays progress a little. Next, I wanted to see if I could hijack the "Search" function to find Song IDs. Then I hit a road bump.

The whole website is done in flash, and the search function is done with flash remoting. Unfortunately, Ethereal, the program I was using to packet-sniff, cannot decoding flash remoting communications. So, I had to find what could. I quickly found ServiceCapture, which claims to be "the only tool of its kind to deserialize and display all Flash Remoting or AMF traffic in a simple-to-use interface." I'm staying with service capture for now because there is a 15 day trial, however, this marketing sentence is written in such fuzzy wording that it's hard to tell EXACTLY what they mean. Anyway, I fired up ServiceCapture and was able to capture the Flash Remoting traffic VERY easily.

I found out that it sends a call to www.deezer.com/flashservices/gateway.php to the service rp_search_release2, the method search, with one parameter: the string you are searching for. The response I found contained an array (0 > serverInfo > initialData) with all the songs returned from the search. The ninth element of each item in this array contains the unique song ID. Choose any one you want, and you can easily use the URL http://proxy-0.blogmusik.net/encapsulation.php?ID= with your own ID, and download any song. Just a warning though: the songs are MP3s at 64kbps. This is really more of a proof-of-concept than something you would actually want to do.

Hope you enjoyed this. I shall now try to work on a PHP script to automate this. Wish me luck!

[edit]OK, thanks to the AMFPHP project, I was able to create a PHP script that automates this. Since this project is meerly for educational purposes, and I do not condone the use of this for illegaly downloading music, I'm not putting a link to a usable version on the web, I will only post some download mirrors. The zip file contains everything you need. deezerd.php is the script that actually does all the work, the rest is all AMFPHP stuff. Here are the mirros:
http://rapidshare.com/files/50663739/deezerd.zip
http://filevip.com/pages/download.php?id=8053488139
http://files-upload.com/files/452548/deezerd.zip

If a link goes down, let me know.

Instructions: Search for a song just like you would normally on deezer.com. The results will be shown after a little bit (it takes some time to search). Simply right click on the title of the song you want to download (album - artist are shown below the song, and album art to the left of the song title and ID#), and choose "Save Link As...". In the box that pops up, choose "All Files" for file type, and type in (...).mp3 for the file name (replacing (...) with whatever you want to call the file).

[edit2]I reported, based on a couple songs I tested, that the MP3s are 64kbps. However, I looked more into how deezer works, and know have a different answer for this after finding a song that was 128kbps. Deezer's MP3s are uploaded by users. Whatever bitrate MP3 the user uploads, that is the bitrate you will get. You may or may not get ID3 tags either.
December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31