How-to: Record SiriusXM online radio
A lot of people have been wondering whether it is possible to record the music they play from SiriusXM. Well with a little determination and patience it's possible. If you follow the instructions you should be able to do it too.
I should probably point out that recording online radio is no big accomplishment. There are a number of programs that will let you record an audio stream to a file. There's no trick to it. What 'is' a trick is having the stream broken up into individual songs, properly named with the artist name and track name in both the filename and ID3 tags. That's what I'm going to try to explain here.
Why would you want to? I can tell you why I would want to. I like to be able to listen to this music offline. I also like to be able to skip songs I don't like. I particularly enjoy the Coffe House channel, but I hate some songs that sound like someone is dying. I also don't like the station promos they play, I don't like to have to be forced to listen to freaking Jhon Mayer ad nauseum. Some program director at SXM is seriously into freaking Jhon Mayer. I know, it's the hair.
I should first say that it feels marginally 'iffy' to be doing that. The truth is that you are entitled to record anything if you are legally allowed to listen to it in the first place. That is part of the 'Fair Use' doctrine of the US Copyright act, as specified in the Audio Home Recording Act. See section 5 of this page.
Still, just because it's legal doesn't mean SXM will make it easy for you - in fact they will do everything possible to make it very difficult.
I should also say that this works as of the time of this writing, but if you are reading this a month later, things may have changed a bit. Yesterday I heard SiriusXM was loosing money, and there is no guarantee they will stick around forever. It costs a lot to operate a satellite network and pay Howard Stern, and smartphone-based options are giving SXM some real competition.
Now to specifics.
You are going to need some tools. Some are free some are not.
- Google Chrome. You probably already have this, but that's not good enough, for reasons that I will describe later. As of today Chrome is on major version 15. What you will need is version 8 or 9 or 10 because it works differently. You can get it from OldApps.com - I'm using version 8.0.552.237. I have tested it with version 9 and 10 and they work too. And yes, you will have to un-install your current version of Chrome first - them's the breaks.
- Windows Macro Recorder. It's a free utility program, works well, and there's a nice short video on the site telling you exactly how to use it. Believe me it's well worth the minute of your time to watch the video.
- Total Recorder from High Criteria. It's not free, but you can get an evaluation edition so you can make sure your setup works before buying a license. It's well worth the money spent. I use Professional version 8.3
The basic idea is this. We will use Total Recorder to record the music. We will configure it to split the stream into individual files, name and tag them, based on the song information from SXM. To do that we will need to get the song information from the SXM website, then put it into a place where Total Recorder can pick it up - and that place is the Google Chrome browser.
As a sidebar, SXM really doesn't want you to be getting the information from there... Instead of embedding the information directly in the HTML of the page, they make the page load and then have Javascript send an AJAX request to the server to populate the song info... This way you can't just use a program to get the HTML from their server and then parse out the song info. But anything that can be read by a human can also be read by a program - just takes a little more doing, that's all. Even if the song info was displayed as an image, nothing prevents me from having a program do a capture of a screen area then have a Perl script feed it to an OCR library... but I digress.
1. Download and install Total Recorder. You will then need to configure it as follows. Firstly, we need to add a few lines to its players.txt configuration file. It goes in the Program Files directory - in my example under XP it's in "C:\Program Files\HighCriteria\TotalRecorder\players.txt"; it's something similar on newer OSes. Add the following lines to the bottom of the file:
; XM in Google Chrome
;
[XM in Google Chrome]
CLASSNAME="Chrome_WindowImpl_0"
FORMAT="about:blank - <artist> - <title>"
This will tell Total Recorder to look for the Google Chrome application, find what's written in its title bar, and extract the Artist and Title information out of it.
You will probably need to reboot after installing Total Recorder.
Further configuration:
Select Options -> Settings and click on "Split" on the left side of the window.
Make sure the first checkbox is checked and the dropdown reads 'Rules using file tag'.
Also check the second checkbox 'Split mode...'.
Click on the 'Conditions' button. Here is where the magic happens. This is how the program knows when to cut your audio stream, write out the audio file, name it and tag it.
Check the 'when the clip info in external player is changed', but uncheck 'Split at the point with the lowest level' check box.
Also check 'use info from external player...' check box, and in the dropdown select the bottom-most setting - 'XM in Google Chrome'. This is why we added the configuration above to the players.txt file.
You will also need to check 'duplicate last X seconds of previous file and next file'. Set it to 30 seconds each. I know, it's not ideal, but this has to be done this way, because the song information does not change at the exact same time the next song starts. We will address what to do with this later.
Optionally save this configuration using 'Save as...' button, give it some meaningful name like XM Chrome Split.
Now we'll go through and tell Total Recorder what to record, what format to use, where to save it, etc.
Slect Tools-> Recording Wizard.
1. Accept default first checkbox (sound produced by sound player), click Next
Feel free to perform a test recording at this point. Start the browser-based player. If you see green bar in the Total Recorder window, showing recording level, you are probably okay.
2. Select MP3 format. Do not use Ogg Vorbis. This is because tools are readily available for trimming MP3s, not so for Ogg. Also, MP3s can be trimmed to the milliseconds instead of blocks the way Ogg is. More on that later. Next.
3. I suggest Near High Quality. It's music afterall, not talk radio. Next.
4. Accept default. Next.
5. No to 'Pause reduction feature'. Again, not talk radio. Next.
6. Leave 'Yes' to automatic file creatin. Next.
7. Leave next setting in place (we set it earlier). Next.
8. Leave this in place also. Next.
Wizard Finish Screen - say 'yes'
So now we have configured the software to record your audio stream, and to split it automatically based on the track information in the title bar of your Google Chrome browser. But how do you get that track information in there? That's the next step.
Open another browser. I recommend Firefox. You can't just do it using a different tab in Chrome, or a different window either. Has to be another browser. Chrome sets its title bar to be the title of whatever page it is currently displaying. We need it to be displaying the song information so we can't be using it for browsing.
So, now that you have another browser (Firefox) opened, navigate to the web page of the channel you would like to record. SXM has individual web pages for its channels. For example, channel #35 Lithium has a web page at http://www.siriusxm.com/lithium. When you load the page, it will display the song information for whatever it is currently playing. This is where we will be getting the song information.
As a sidebar, SXM really doesn't want you to be getting the information from there... Instead of embedding the information directly in the HTML of the page, they make the page load and then have Javascript send an AJAX request to the server to populate the song info... This way you can't just use a program to get the HTML from their server and then parse out the song info. But anything that can be read by a human can also be read by a program - just takes a little more doing, that's all. Even if the song info was displayed as an image, nothing prevents me from having a program do a capture of a screen area then have a Perl script feed it to an OCR library... but I digress.
Now do this: Highlight the song information in the Firefox browser window, copy it (Ctrl-C) to the clipboard, alt-tab to your Chrome window with a blank tab open, and type this in the URL bar:
about:blank <space> to paste song info>
Using the screen grab from above, I get this in the URL bar.
about:blank Beastie Boys - Intergalactic
Now position your cursor over your Start bar over the Chrome program icon. You will see a tooltip that shows something along the lines of
about:blank Beastie Boys - Intergalactic - Google Chrome
Bingo! this is the information that Total Recorder will now pick up, parse out the artist and title, and split your track.
Of course the song information changes as the music changes, and the last thing you want to do is sit in front of the computer copy-pasting all day. This is where the macro recorder /player comes in. The steps you just performed - load the SXM page in the Firefox browser, select song info, copy and paste into Chrome - you will perform again, but this time you will record it using the macro recorder, then simply tell the recorder to replay.
IMPORTANT: before you start running this macro, or any macro, know how to stop it. Otherwise you are stuck in your own private Voodoo dick joke. In this case, Ctrl-Escape does it.
OK, so now we're ready. Here's what you do:
1. Start the browser based player and get it to play your station in tab 1 in Firefox. Do not have Firefox or Chrome maximized; this will let you switch easily between programs by clicking their title bar.
3. In a second tab in Firefox, load page for your station.
2. Start Macro Recorder.
4. Press Record on Total Recorder.
5. Press Record on Macro Recorder.
6. Switch to Firefox by clicking on its title bar. Twice with 1-2 second interval (don't want your clicks to read as a double-click, which would maximize your window - not what you want). Two clicks are necessary here - has to do with the way macros run... I'll tell you later why if you're interested.
7. Click on tab 2 to open it (even if already open). Press F5 to reload page.
Switch to Tab 1 where your player is. Select some text in the page, doesn't matter what. This is to tell the player "I'm still listening, don't time out".
Switch back to Tab 2. After artist and track info appears, wait another few seconds (they might not appear as quickly fifteen minutes from now and you don't want to trip up your macro).
7. Select artist and track info in Firefox and Ctrl-C to copy it to clipboard. While selecting, pretend the song title and artist name are really long - select a wide area of the screen. The song that's currently playing might nave a short name, but some subsequent song might have a really long name.
8. Switch to Chrome by clicking on its start bar icon
9. Type into the URL bar 'about:blank - ' (that's a space dash space in the end there) then Ctrl-V to paste artist and track info.
10. Click the Stop button on the Macro recorder to stop recording. (Do not ctrl-escape to stop recording). Right-click and select Save to save your macro, give it a filename. Exit and re-open macro recorder, then load your recorded macro.
10.5. Macro recorder was placed in the same spot on the screen where it was when you last closed it. Which means when you run your macro, it will recreate every one of your keystrokes and mouse moves - that includes the clicked you used to stop recording the macro. When you run your macro in the repeat mode, you don't want the macro itself to stop running of the macro. For that reason, you need to move your Macro recorder to a different spot on the screen. Also, when you run the macro in repeat mode and the macro executes a click in the space where the Stop button used to be, there is now only the windows desktop. The click registers as an interaction with the desktop. This is why we were clicking on the Firefox window title bar twice earlier.
11. Click on Repeat button in Macro recorder and press Play.
12. Sit back and watch as the macro recorder gets the info from the station's web page into Chrome, then Total Recorder cuts the song and creates a new file whenever song info changes.
Adjust your macro as necessary. It will probably take you a few tries.
For extra credit, interject an intermediate step in your macro which uses a simple graphics program like FastStone Image Viewer to capture a rectangular area on your player where album art is displayed, and save it as a separate JPG file named with artist and track info.
You will need the Regex tool at this address http://www.regular-expressions.info/javascriptexample.html and this as the regex string: [\\]+|[*]|\/|:|\?|>|<\|
in order to sanitize file names. Don't worry about it if you don't care about having images available.
7 Comments:
It would appear that Sirius XM no longer lists the current song playing on the stations web page such as http://www.siriusxm.com/classicvinyl - there's no text after "Now Playing - "
It's definitely still there. Maybe wasn't at the very moment you were looking at it - or maybe there was something wrong with your Javascript (not enabled?) or maybe the particular song didn't have a title. I just checked - it's still there.
Hi! I am extremely interested in your idea. So far, I have tried it and am hitting several brick walls. After fiddling with the recorder for awhile, I learned that you need to capitalize "Artist" and "Title" for the program to recognize it. Also, your link for Sound Recorder is just a link to the macro program (no biggie). I tried Chrome 8.0, but the new XM internet radio needs Flash 11.0. I tried to install this, but Chrome (in newer versions) automatically updates, with no specific working update for 8.0. I will be trying 10.0 now. Please respond; I am very intrigued by your method.
So far, I ditched your entire idea of using chrome to tell the recorder when to split files. Instead, one can simply put the data in a blank text files name using my format below:
; Text Editor
;
[Text Editor]
CLASSNAME="Notepad"
In addition, I've looked for a more up to date "now playing" list and have found that this site has the info down to about 2 second accuracy:
http://www.dogstarradio.com/now_playing.php
The only problem that I am encountering is the complexity of making this process 100% fool-proof. For example, once in awhile I might get a weird character that will not be saved by notepad, requiring the text to be "cleaned" on a different level. In addition, there are some smaller things that will interrupt the cycle. The biggest problem I've encountered is the way the title and artist are displayed on dogstarradio. The text might change the size of the box, causing the copy-paste process to fail. I will try to contact the creator of that site to see if he can help me.
Sorry - didn't see your question there. For some reason I didn't get notified of the comment - just happen to be looking at the post now.
Anyway - here's what I think:
1 - if the Notepad method works for you, then by all means stick with it. If you get weird characters in the song name like quotes, which happens - that's not a legal character for a filename, so you need to 'clean' it like you said. You can do that with a Regular Expression (regex) program,as I mentioned at the bottom of the post - http://www.regular-expressions.info/javascriptexample.html
Chrome 8 should work and not auto-update. It doesn't need Flash 11 because, remember, you are not actually running the player in Chrome, you are running it on Firefox. You are only using Chrome to display the song info in the title bar.
Will this all work with scheduled recordings. I would like to record (using Total Recorder) a program that comes on at night when I am asleep?
Sure it will work.
You just need to start the stream using the web client and use the macro recorder to click on the window every now and again to keep it alive. Then set up a schedule in the Total Recorder.
Post a Comment
Subscribe to Post Comments [Atom]
<< Home