Thursday Night

Paul Betts’s personal website / blog / what-have-you

My foray into Amarok scripts: Autotorrent

Recently, I’ve been listening to Internet radio a lot, it’s the first internet radio that I’ve found that both doesn’t sound like crap, and actually plays songs I like (actually, the coolest feature is “Neighbor radio”, which uses the songs I listen to on my computer to figure out what songs I’d like, and it does a pretty good job!). I wanted a way to download all the songs I liked automatically. First, I tried to rig Amarok to download the songs for me, but responded to that by halting the current song, then playing the song from Snakes on a Plane. Touché, Touché.

After suffering through Cobra Starship’s massive crapfest, I decided to go an alternate route, and thus was born Autotorrent. Basically, it adds a new menu item on the right-click menu called “Download this album”. Autotorrent goes out to, tracks down the album, tries to make sure it has the right track, then sends the Magnet URI to Azureus, which downloads the album.

This program may be slightly immoral, but I’m not too worried about it; the fact is, it’s not doing anything a regular person wouldn’t do anyways, it just automates it a bit. It also allows me to continue my part in the “Annoy big media companies” campaign. Boo hoo, now the music execs will only be able to afford 6 new Porsches this year after screwing real musicians out of every dime they deserve. Seriously, if you like a band, go to their show and buy stuff because that’s the only way that your money goes to where it belongs.

Of course, the script is in Ruby, what other language would make downloading webpages and searching through the text so easy? Well ok, Perl would, but I wanted something I could read in a week. Amarok scripts are really easy to write, if you have a cool idea that involves Amarok you should try to write it up because it’s not that hard to do. A handy tip is that if you’re looking for which functions you can call, if you run DCOP with parameters missing (ie dcop amarok), you’ll get a list of things you can use for the next parameter; in this case, it’d be ‘player’, ‘playlist’, etc…

Really, I wanted to write this program because I find that now that most of my friends are far away, I don’t really listen to new music anymore. I always wondered how people my parents’ age got stuck in a certain era of music; now I know. Luckily, the Internet will come to my rescue and help me out by discovering cool new music for me (to an extent, anyways). I also need to start playing guitar again, I haven’t played guitar regularly for almost a year now and that’s really lame, as well starting to record again and playing my banjo.

Update: Added screenshot to show the geezers that I’m not lightweight

Update 2: Evidently this never actually got posted, it got marked as private? Well now it’s here, tada!

Written by Paul Betts

February 19th, 2007 at 10:37 am

Posted in Linux,Ruby