How to record from Grooveshark

I definitely prefer Grooveshark to Last FM as it seems to have far more music and does not seem to have some of the annoying “features” of Last FM like the fact that a lot of tracks are truncated to 30 seconds in Last FM.    Also Last FM has a lot of “dead” tracks which will not play at all, even for 30 seconds.

Grooveshark is mainly aimed at online usage and you listen to the tracks “live” over the net, which is fine and good, but not so good if you loose your internet connection, say on a 3G signal and you go out of range as the tracks will simply not play any more.

The answer here seems to be to capture the mp3 stream, as it normally gets deleted after each playing.

There seems to be a lot of software that will do this for you, but I don’t really want to have to install special software when there are tools already available which will do the same task.

Another thing to be very cautious about is that some of these tools are “closed source” so by installing them you could be putting your computer at risk if the software has hidden “features” which do extra things you might not want or even be aware of.

Wireshark is a well respected open source network tool so there is no risk in using it.

One of my favorite tools is Wireshark as this will capture just about anything and everything which makes it pretty cool ;-)

What I do is set wireshark to capture and then “play” the track in Grooveshark.    The beauty of grooveshark is that you do not have to wait for the song to finish playing as if you have a fast connection the mp3 stream will be written to the cache in only a few seconds, and there is a nice little progress bar in grooveshark to let you know when this is done.

Once this is done it is time to “save” the live capture as an mp3 file.

To do this you select one of the packets and “follow tcp stream” like this:

You might notice that I have added an extra column of “size” to the capture windows as the packets containing the audio stream generally seem to be 1514 bytes in length.

You then “save” the stream like this:

and save (using the “save as” button) it as a file ending in “.mp3”. You can then play the file without needing a “live” internet connection.

One thing that is not clear is if it is against the terms of service to save a stream. I have read through the lengthy legal document on their website and I could not see any wording that banned the saving of a stream. Most of the restrictions seemed to be aimed at UPLOADING music rather than downloading.

16 thoughts on “How to record from Grooveshark”

  1. Using IE you can also just listen the mp3 from your temporary internet files\Content.IE5\(some folder with wierd name)\listen[1].mp3 (believe its a path like that)

  2. The temp folder trick only works if the “nocache,nocopy’ field is absent. They seem to randomly assign this option afaik.

  3. This has worked for me in the past (granted it wasn’t the same exact sequence of steps), but now when I go to my cached files they show up as flash objects rather than audio files.

    Even worse, the flash files don’t even contain sounds, but rather sprites – so standard swf to mp3 conversion utilities aren’t effective.

    Any ideas?

  4. @ #3 BC

    Sounds like you followed the TCP stream of the SWF song queue that grooveshark uses. Follow a different TCP stream until you find the right one.

  5. Or you could simply use Audacity to record using your computer’s audio out.

  6. Download Audacity for free (google it) then plug a wire from out to in in your sound card, start audacity recording, play the song, when finished stop recording and go file > export and save it

  7. This works, but the files are always broken for me. I believe packets are dropped/retransmitted or something. The application reading the stream gets the correct data, but wireshark doesn’t. Grooveshark mp3:s are always randomly a few 100k too short, compared to the Content-length header, and contain skips.

    Is there any similar way to catch a TCP stream, which actually captures what ends up in the application?

  8. Hi there, im a complete n00b to linux in any form – im using ubuntu natty and i cant get the program to find any interfaces on which to capture.. i know this is some issue with not having some privilidges set up somewhere but i need a step by step guide as to how to aloow those priviliges. if i run wireshark as sudo it gives an error message and crashes…

    anyone wanna help a noob out? :) really want to capture from grooveshark!

    ps also have outrec and audacity but cant get either of those to rec either – just silence.

  9. WOW !

    I had already used wireshark before (i used it when it had other name :)) but this was just very very intelligent!

    Congrats, excellent post! So simple and very enlightening :)
    Good tcp and streams knowledge too.
    Of course not everyone can do this…

  10. I have to edit the file with a text editor that can handle large binary files like Notepad++ and delete the HTTP headers before it will play in my music player Gom.

    I’ve tried Proxomitron to remove the Pragma: No-cache, Cache-control, and Expires headers, but that still didn’t work and I could not find the music in the cache directory. Not with Chrome and not with Opera. However, the log window in Proxomitron showed that it was working and other cache files appeared.

  11. FYI:

    The terms may not have addressed this when you wrote this blog, but this is clearly against Grooveshark’s terms as of today.

    “Any musical work made available via the Service is intended for Streaming only. Streaming meaning the transmission of an audiovisual work via the Internet from the Service to a user’s device in such a manner that the data is intended for real-time listening and not intended to be copied, stored, permanently downloaded, or redistributed by the user. Accessing any musical work for any purpose or in any manner other than Streaming is expressly prohibited.”

    See http://www.grooveshark.com/terms.

  12. Wonderful man! I think I will try to make a little c#.NET program to capture all my playlists! Thanks buddy!

Leave a comment