Use shell-fm for fun* and profit*

*where fun is great utility
*where profit is a rich storehouse of otherwise unsaveable audio tracks

I was supposed to post this about 8 months ago. Anyway, being that was recently accused of handed over a load of non-anonymized data to the RIAA, I thought it would be fitting to post this info on basically abusing leveraging through a combination of the shell-fm client and a program called tee. This is essentially me linking to someone else's information, but I put it in a few useful contexts. Click through to read the full post.

You should read this if any of the following apply:

  • you appreciate free music, especially via some cool linux hacks
  • you want to passively generate a potentially massive music library in mp3 format
  • to not only listen to, but also simultaneously download great potential mixtape songs that you've never heard before
  • somewhat random, yet full access to the entire secure catalogue of mp3s
  • to become part of a tiny minority of power users leveraging a great service for a novel purpose

Many of us listen to enormous quantities of music these days. Those of us who are smart and cautious tend to back this music up on external hard drives. Sometimes, multiple redundant hard drives. Some of us are smart, but not cautious. We have plenty of music, but it isn't stored with the worst case scenario in mind. My hard drives crashed in September, right after I moved 500 miles away from home, to live in Columbus, Ohio. Shortly thereafter, I found a hack here that allowed me to re-generate my music library using my profile data and the service. No hard work necessary. Listen to music; the collection builds itself.

About a year ago, I wrote about shell-fm, a lightweight Last.FM client for Linux. It's still pretty much the best thing going when it comes to console-based Last.FM clients. Being that it's just a little console app, it's a lot less bloated than the official app. And personally, I think it's better looking.

The command follows. There's a far more sophisticated version of this available at the external link now, that actually tags the file as it downloads. I suggest you go and get that one.
extern = tee "/home/noah/sapphires/%a - %t.mp3" | aoss madplay -Q -
With this, I generated a gigabyte of music over 3 days of casual listening. Over 300 songs, with many of them among my favorite songs. How else would I get this so easily?

Why would you want this?
  • You can regenerate a music library from music you've already scrobbled, but might not have access to.
  • You're like me in that when someone asks you to make them a mixtape, you never know what to put on it because your musical taste is so broad. Your profile is pretty well fleshed out, so just run shell-fm with this script for as long as you want the mixtape to be, on the library station for your username, and then burn the mp3s to disc.
  • See above for more reasons.

Where this doesn't work: with filenames that have special characters. Artists who have filenames like GZA/Genius won't get written to disk because it confuses tee. tee interprets this as a directory instead of a filename because of the slash. Here's an example of a bad songname: Heard Iron Bug, "They're Coming To Town". The quotes in the song name also confuse tee. This may be corrected in the newer version discussed briefly above and linked to throughout this post, but I haven't finished testing it out yet.

Lastly, in light of the user data scare, I feel I should mention, an open alternative to It's in the alpha stage of testing and will even import your user data via this scraping utility.


Unknown said...

My understanding is that handed over data to its parent company upon request, and was only told it was for the RIAA after the information had changed hands.

Anonymous said...

You can import your data from to using a python script they have. Here's the page on their wiki:

Noah said...

Thanks anonymous, updating post.

Anonymous said...

That rumor was a lie. They never handed data over to the RIAA.

Anonymous said...

(I'm a developer at

The data-scare rumour is bollocks. denied it (twice), CBS denied it, even the RIAA denied it. TC based their story on an anonymous source, who since publication has cut all contact and disappeared.

Don't believe everything you read on the internet. I wouldn't say it's a fair reason to "abuse", that said shell-fm is pretty neat.

Noah said...

Yeah, I guess abuse was something of a strong word and not necessarily what I intended. When I found this hack, my intent was to use it to get me out of the fairly common situation I described above, that i found myself in last September.

If you happen to check back, I have a question: how does get these files in the first place? I imagine a significant portion are from licensing agreements. I am aware that it collects meta data about a track but does it ever collect actual tracks from users?

Post a Comment