I recently had a request from Phil to rip a particular track to MP3 from a band’s MySpace page. While most music on MySpace is shoddily encoded at 96Kbps, sometimes it’s the only place available online to listen to a particular song. To save yourself from the agony of calling up a Web browser, going to the domain, and having ads foisted upon yourself, some technical work will get you set to have a fully unrestricted MP3 copy of the music.
Other solutions exist for this process, including connecting a 3.5mm cable from your sound card line out to sound card line in, and then recording the result, but this introduces even more quality loss to the process.
There are some technical restrictions on this process, and I advise anyone coming here to ask about them to seriously consider their questions before commenting. With a post title involving music and MySpace, I don’t expect the cream of the crop to start posting their wireless packet sniffing instructions or automated Flash extractor Linux tools (although that would be a pleasant change.)
You need a wired connection to the Internet to perform the packet capture. Most wireless card drivers don’t have the ability to capture packets, or they don’t work in this configuration.
- Download and install Wireshark, which is the newest version of the classic Ethereal network utility. The Windows installer also comes with a driver, WinPCap, that allows the packet capture to take place. Follow all default instructions in the installer.
- Close any programs that use your Internet or network connection. This includes other Web browsers, instant messaging programs, file sharing utilities and feed readers. While you don’t have to close everything, it’ll help make sure that there’s enough memory to load the MySpace page and capture the MP3 at the same time.
- Open Wireshark, then resize it to a standard window.
- Start a new Web browser window, resize it to a standard window, and click the Stop button to cancel the page load. You should have Wireshark and your web browser running side by side:
- Enter the address of the MySpace page in the web browser address bar, but don’t press Enter or Go yet.
- Switch to Wireshark, and click the Interfaces button – it’s the first one on the left:
- In the Interfaces window, look for the active wired Ethernet controller in your computer. The numbers for the controller should be slowly increasing:
- Click the Start button to the right of the controller. Immediately, switch back to your browser and let the MySpace page load. If the song isn’t the one you want, switch to it as quickly as possible. If you resize the Wireshark window, you’ll see packets scrolling past:
- Wait until the song is done or is almost done playing. (You really only need to wait until the song data is downloaded, though.) Once finished, click the Stop Capture button in Wireshark:
- Resize the Wireshark window. Copy and paste the following text into the Filter box, then click the Apply button.
http.content_type == "audio/mpeg"
- When you click the Apply button, you should only see one entry in the packet list. You may also see two dialog box with progress bars – one filters the captured packets, and the other decodes the MP3 file sequence.
- Resize the Wireshark window so that you can see the packet overview, as in the dialog below. Click on the Media Type header and cancel the progress windows.
- Right-click on the Media Type header and click Export Selected Packet Bytes. Enter a filename for the data, ending with the extension .mp3.
- Open the MP3 or import it into your library. You’ll likely have to provide artist and title information for the track, since it’s not included with the packet stream.
As a special bonus, I’ve also recorded a Wink tutorial on the process. The video takes the shortcut of applying the
audio/mpeg filter before stopping the packet capture, so that you can save your song file immediately after it’s downloaded from MySpace.
Other possibilities to reduce processing time would be to set a filter, only capturing HTTP packets on port 80 following the audio/mpeg chain, and changing various configuration settings in Wireshark.
The band that I demoed the capture from is Stalling Dawn, who also have much higher quality tracks available to download directly from their PodShow page if you create an account. Unfortunately they don’t seem to have an official album released yet, but I’d definitely buy it if one ever comes out.