Downloading online songs

You know those songs on Raaga, MusicIndiaOnline, etc? The ones you can listen to but can’t download?

Well, you can download them.

It’s always been possible to download these files. After all, that’s how you get to listen to them in the first place. What stopped you is security by obscurity. You didn’t know the location where the song was stored, but if you did, you could download them.

So how do you figure out the URL to download the file from?

Let’s take a look at MusicIndiaOnline first. When you click on a song, it pops up in a new window. You can’t figure out the address of that window because the address bar is hidden, but you can get it by hovering over the link before clicking, or by right-clicking and copying the link location. It’s always something like this:

http://www.musicindiaonline.com/p/x/FAfgqz0HzS.As1NMvHdW/

It always has the same structure: http://www.musicindiaonline.com/p/x/something/. Let’s call that the something the song’s key.

Now, what this page does is play a .SMIL file. An SMIL file is a text file that has a list of songs to play. This file is always stored at

http://www.musicindiaonline.com/g/r/FAfgqz0HzS.As1NMvHdW/play2.smil

(Notice that the key remains the same.) If you type this into your browser, you’ll get a text file that you can open in Notepad. You’ll find that it has a bunch of lines, two of which are interesting. There’s one that reads:

<meta name="base" content="http://205.134.247.2/QdZmq-LL/">

The content="…" part gives you the first part of the song’s address. Then there’s a line that reads:

<audio src="ra/film/…"/>

The src="…" part gives you the rest of the address. Putting the two together, you have the full URL at which to download the song.

Except, they’re a bit smart about it. These songs are meant to be played on RealPlayer, and not downloaded. So if you try to access the page using your browser, you get a 404 Page not found error. But if you typed the same page into RealPlayer, you can hear the song play.

To actually download the song, you need to fool the site into thinking that your browser is RealPlayer. So first, you need to get a good browser like Firefox. Then download the User Agent Switcher add-on. Change your user agent to "RMA/1.0 (compatible; RealMedia)" and try the same song: you should be able to download it.

Let me summarise:

  1. Right-click on the song you want to play, and copy the URL
  2. Extract the key. In the URL http://www.musicindiaonline.com/p/x/FAfgqz0HzS.As1NMvHdW/ the key is FAfgqz0HzS.As1NMvHdW
  3. Open http://www.musicindiaonline.com/g/r/<your_key>/play2.smil in your browser. Open it with Notepad
  4. Switch the user agent on your browser to "RMA/1.0 (compatible; RealMedia)"
  5. Put the content="…" and audio src="…" pieces together to form the URL
  6. Type the URL and save the file

I’ve automated this in my music search engine. So if you go to the Hindi, Tamil or any other online music page and click on the blue ball next to the song, you’ll see a menu with a download option. The download opens a Java program that does these steps for you and saves the song in your PC.

So now, you’re probably thinking:

  1. How did he figure this out?
  2. What about other sites?
  3. How does that Java program work?
  4. How do I listen to these on my iPod?

How did I figure this out?

Fiddler.

I believe a good measure of a tool’s power is it’s ability to be the one-word answer to a relatively broad question. For example, "Where can I find more about something?" "Google it." "How do I improve my pictures?" "Photoshop it".

Fiddler’s like that. "How do I find out what I’m downloading?" "Use Fiddler".

It’s a proxy you can install on your machine. It automatically configures your browsers when you run it. Thereafter, it tells you about all the HTTP requests that are being sent by your machine. So if you patiently walk through the logs, you’ll find all the URLs that MusicIndiaOnline or any other site uses, as well as the other headers (like User-Agent) that are needed to make it work.

What about other sites?

I’ll list a couple here.

Smashits:

  1. Right-click on the song you want to play, and copy the URL
  2. View the source and hunt for the URL fragment "player/ra/ondemand/launch_player.cfm?something".  The key is is something.
  3. Open http://ww.smashits.com/player/ra/ondemand/playlist.asp?6;giftsToIndia1.rm;1,something in your browser, using Notepad
  4. Switch the user agent on your browser to "RMA/1.0 (compatible; RealMedia)"
  5. Type in what’s inside the src="…" in your browser and save the file

Oosai:

  1. Right-click on the song you want to play, and copy the URL
  2. View the source and hunt for the URL fragment onclick="setUsrlist(something)".  The key is is something.
  3. Open http://www.oosai.com/oosai_plyr/playlist.cfm?sng_id=something in your browser, using Notepad
  4. Switch the user agent on your browser to "RMA/1.0 (compatible; RealMedia)"
  5. Type in the URL that you see in Notepad and save the file.

Try figuring out the others yourself.

How does the Java program work?

It does most of these steps automatically. The applet itself is fairly straightforward, and you can view it here. It takes two parameters: db, which indicates the server from which to download (M for MusicIndiaOnline, S for Smashits, etc.) and num, which is the key.

But in order for an applet to be able to download files from any site, and to be able to save this on your PC, it needs to be a signed applet. Since Sun offers a tool to sign JAR files, this wasn’t much of an issue.

There is one pending problem with Windows Vista, however. Signed applets can’t save files anywhere on Vista. They are saved in a special folder. This is being fixed, but until then, if you use Internet Explorer on Vista, you probably will be unable to find your saved files.

How do I listen to these on my iPod?

The saved files are in RealMedia format. Your best bet is to convert them to MP3 files using MediaCoder. Then transfer them using iTunes.

41 thoughts on “Downloading online songs”

  1. I have to admit that, I tried and figured out the URL obfuscation. However the
    user agent add-on switch was the missing bit.

    The quality of these songs are not good enough to download. Anyways, I’m happy someone hacked the fake security built on these sites 🙂

    Did you try it on Raaga and Musicmazza?

  2. @Murali: I’ve tried it on Raaga (it’s a bit subtler to crack, given that it uses cookies), but haven’t visited Musicmazza so far.

  3. Anand, this is a great piece of info for music download enthusiasts. However, i think you should put in a word of not supporting such downloads and this is only provided for the sake of learning technology..and the user would do so at his own risk..

    Your blog is a publicly accessible site and being in UK you may fall under strict purview of anti-piracy rules

  4. @Vaidya: Actually, these songs fall under the purview of the Indian Performing Rights Society (IPRS). You’re right in that I may be liable for contributory infringement, but if so, it would be under the jurisdiction of Indian law, not the UK. And I’m not sure if the laws around contributory infringement is well established in India.

    It’s one of those sad things, Vaidya. Something that’s this easy to do shouldn’t have to be illegal. And yet…

  5. hi anand! been entertaining myself reading through this pot-pourri site of urs amidst surgery & drugs. its fun! esp the calvin series & ur interview series 🙂 cant undertsand most of the tech stuff though, this entry on downloading music included! (i simply go to the other websites with downloadable links :p). hope london’s as fun as ever!

  6. Hey, As you have so much experience with the music sites, can u prepare an auto tagging program which can fill missing tags in the songs, i.e. Music: Composer: Artist: Year etc…

  7. Oh, I want to Pradeep, believe me! I’ve been working on that for a while…
    it might take me a few months to get there, but it’s definitely right on top
    of my priority list.

  8. But I tried in Raga.com. When copying the link location I am getting the link of page itself. Also I am not getting the “.SMIL” link….. pls help

  9. Hi Anand,

    Great work! Hats off to you.
    I have just had a glimpse of ur site. I haven’t explored it. But its awesome.

    Thanks & Regards,
    Vanitha

  10. Amazing and so much to learn from your site. I dont think not so many gentlemen like you share their knowledge like you do.
    Thanks & continue your good work.

  11. Sir,
    Whether it’s possible in raaga.com…….i tried but I cannot follow ur way………..can u plz explain it using raaga.com as an example……plz

  12. Sir,
    u r great and u r right. Its worked out with musiconlineindia.com. Thank u very much. But I got the song in .rm format. Can we convert this to .mp3 ?

  13. Sir,
    Thank u sir, thank u very much……..You have done a great help to me…………I got many songs and I converted it to mp3 with mediacoder……………….It is a great help that u have done to me. I thank u very much.
    Satheesh. S

  14. Can you figure out a way to find the source of songs at tinysong.com?

    Their songs are in real high quality.

  15. Why wouldn’t you just play the song in MIO and use Audacity if you are anyway converting RM to Mp3 using some program?

  16. Great!! It works. I tried it to download kannada songs from Kannadaaudio.com. And the song quality is also great. Thats a great work. Thanks Anand.

    Prathibha

  17. Hi Anand,

    I am a new user to itunes and iPhone.

    How does 1 arrange music?
    I have some mp3 files. Do I copy it all to “audio” and then tag all of it individually?

    Where do I put my podcasts?

    Is there any website which facilitates hindi mp3 with tags filled in without ambiguity and it has its album art?

    I know that itunes might have all of this.
    But who wants to pay 40 bucks for 1 song? 😉

    When you reply to this comment, please email it to me (I read your blog under bloglines).

    Thanks for all your efforts.

  18. say i have a link like this: http://www.angelfire.com/freak3/devin/09_Tha_Mot_Lan_Dau.wma

    i’m not sure what happened, but before, whenever i put in a url like that in my web browser, window would pop up asking me if i wanted to save it or open it. but now it saves the file straight into my temp internet files folder and pops up in windows media player so i dont have the option of downloading the song. how can i download it now?

  19. @Alan: The easiest way may be to mail yourself the links on your Yahoo or
    Gmail account. This will convert the URLs into links. You can right-click on
    the link and select “Save link as” and place it where you wish.

  20. Hi Anand,

    I have downloaded many songs from you blog. Thanks a lot. But I have some songs which I didnot find in the blog and found in Musicindiaonline. I read the article as to how we can download the songs. But I am not able to change the user agent to RMA compatible in mozilla. can you please guide me.

    I would be very happy if you mail me the steps.

    Thanks,

    Rahul

  21. Hi Anand,

    I finally figured out how to change the user agent and downloaded the songs. I am very happy. Thanks for the help.

    Regards,

    Rahul

  22. dear anand sir i requesting

    sir this is ram I have downloaded many songs from you blog. Thanks a lot & hats off to u . But I have some songs which I didnot find in the blog and found in Musicindiaonline. I read the article as to how we can download the songs sir plz help me how i can get my faverates songs from raga.com & Musicindiaonline plz helpme .. guide me

    sir i m waiting for u r reply

  23. Hi Anand
    This is an excellent tip to download from musicindi and thank you very much for sharing with all .I manage to open link into mt notepad ,and understood upto content ,however i am having trouble reg src= , i am not sure exaclty what is src= , to copy ,so can you please help me giving example of a link ,i will be very thankful .Thanks again for your contribution Anand .

    Regards,
    Bharat

  24. Hi Anand Finally i am now able to download without any problem from notepad .Also to share with you , i use firefox add-ons download helper which can download any song you play from smashit.com and save file as .mp3.
    Can you please help me ,how to download from hummaa.com

    Thanks

    Bharat

  25. Good to hear that, Bharat. I’m afraid I know nothing of hummaa.com, though.
    Not sure if I can be of any help.

  26. Hi Anand,

    Thanks for the wonderful post. I was wondering if you know any application which converts mp3 to rm.

    Thanks
    Arti

  27. Hi Anand,

    I am not able download the songs of “Bhoothnath” from your blog. Can you help me?

    Thanks in advance.

  28. I am afraid that this kind of trick may not work when the obscured mp3/video/resource is streamed rather than being sent (or stored) as a file from the server. These days this trend is on high. Store your stuff in databases (rather than in file systems), locate and stream it on demand.

    Vikas

  29. Hi there,

    Simple Alternatives…

    Some time back for english song…I used the wii player skin of Radioblogclub.com online for English Song searching and playing right there no plugin required.

    Also there is a nice search engine for all types of songs bomb-mp3.com with built-in Player support.

    Ensure you have good version updated of Flash 9 or 10 otherwise some songs may be chip-munks.

    For Hindi Songs….I have managed to download all or complete list of songs they have on their site.For More info you can write to me on mysite.

    What if you have all the songs, instead of your choosen songs, just go through complete list and search and play…as your own playlist…links to all mp3 files.

    Simply Simple,
    Kapil [NA Infosy’ite]

  30. Hi Anand,

    I am not able to download old movie songs of any language from your music sites. Please help.

    Rahul

Leave a Comment

Your email address will not be published. Required fields are marked *