Extract mp3 from imeem (or similar site)

Posted on August 18, 2008. Filed under: Uncategorized |

When I listen to Michael Jackson’s Billie Jean in Imeem, I want to download it, of course they won’t let me download it so easily, but I know that I must have the cache computer for song, here’s a way to extract it:

  • Use you *Firefox* to open this URL, if you have flash player, it plays right away
  • Entry about:cache in the address bar
  • Under Memory cache device, click into List Cache Entries
  • In the list of of cache entries, you will see one very long item and the data size is going up, that’s the cache for the mp3
  • Wait for a while for the cache to be fully downloaded, then click into Key, you will see this page
  • So now you have the content of the song in hex dump, you will need to extract it, go to File and Save Page As to save it to a file “billie_jean.dump”, use Text files as Save as type.
  • Use your favorite text editor to open billie_jean.dump, you will see something like this:

    Remove all the lines up to “00000000:” and save it.
  • Finally you need to run a small C++ problem to help you convert the hex dump to a binary file
    #include 
    #include 
    
    using namespace std;
    
    int hex2int(int v){
      if(v >= 'a' && v <= 'z' )
        return v - 'a' + 10;
      if(v >= 'A' && v <= 'Z' )
        return v - 'A' + 10;
      else return v - '0';
    }
    
    int hex2int(int a,int b){
      return hex2int(a) << 4 | hex2int(b);
    }
    
    int main(){
      string line;
      while(getline(cin,line)){
        istringstream iss(line);
        string token;
        iss >> token;
        for(int i=0;i<16;++i){
          iss >> token;
          putchar(hex2int(token[0],token[1]));
        }
      }
    }
    

    Save it to hex2bin.cc and compile it with your favorite compiler, in my case gcc, so I just do "make hex2bin" to build the program.

  • Run the program and use billie_jean.dump as input (Note the song is in flv format)
    ./hex2bin < billie_jean.dump > billie_jean.flv
  • Now you have the song in flv format, to convert it to mp3, I use ffmpeg:
    ffmpeg -i billie_jean.flv -acodec copy billie_jean.mp3
    and you have billie_jean.mp3 ! Nice song MJ!
Advertisements

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: