Thursday, June 26, 2008

How to download musics from MySpace using Safari and "wget" (on Mac OS X)

DISCLAIMER: even though the instructions provided in this post may be (mis)used to download copyrighted material, this blog or its author do not support any piracy activities and cannot be held responsible for what others do with the knowledge acquired here. The author disseminates this knowledge with the sole purpose of allowing users to backup musics that MySpace's publishing artists already allow users to download, which is the case in the given example.

MySpace is a great social website that has specialized in providing access to a lot of musical material from musicians around the world. Some of those musicians publish their musics in their profile and even allow downloading them (as you can see in the figure below that shows the music box for Ani DiFranco), but for doing that you have to be logged in to your MySpace account.

But what if you don't have (or don't want to create) a MySpace account? Well, that's what I'm going to show you:

  1. First of all, let me remind you that this can only be done using version 3 of the Safari web browser and a small Unix utility called wget. To install wget in Mac OS X, check here (I tried using Firefox 3 but the Page Info's Media tab (Tools -> Page Info) does not show the necessary files)
  2. So, let's start. On the music box on the musician's profile (in this example, I'll be using Ani DiFranco's profile) click on the music you want to download and let it load entirely (you'll see it loading if the blue thin line is growing in the progress bar of the music player)
  3. Open the Activity window in Safari (Go to Window->Activity)

  4. Search for the file (or files, in case you've already load several songs) with a larger size (around 3 MB - may vary depending on the duration of the song) or you can search for the file with the address having some sort of combination of the words "cache" and "music". Then, double-click it.

  5. Safari will open a new window and will start playing the music that you just selected. If you take a look at the address bar, you'll notice that the URL points out to a complex address of an MP3 file. This is MySpace's cache file for the song you selected and can be downloaded directly.

  6. However, this cannot be done in Safari. If you try using the File->Save Page as... option, you'll notice that it's not enabled. That's where "wget" gets into play.
  7. After installing "wget", the command with the same name will be available on Terminal's prompt. Just copy the URL (until the "mp3" part, as shown in the figure above) and paste it after the command at the Terminal, as you see in the following figure:

  8. This will download the file and will place it in the current directory (In the figure, you can see that I did this in ~/Desktop)
  9. Then, just use the MP3 player of your choice and enjoy! :-)
Final remarks: the cached MP3 file is often of lower quality, so don't expect perfect CD quality whilst listening. Also, the downloaded MP3 file comes with no tagging information, so you'll have to fill in everything on the MP3 management application that you choose. I didn't try this in Windows so I don't know if it's possible. If you test it in Windows, let me know the result in the comments.

Source: The Mac Newbie

No comments: