Friday, April 17

So I was sitting around last night with Vince & Freeman, drinking a little red wine. Or maybe more than a little red wine. The Alice White in the big bottle is like $9, and I can't honestly tell you I know any better.

Anyway, it occurred to me to find some music, and pretty soon I found myself thinking that there's no good reason Rhythmbox shouldn't let me select, for example, the contents of a playlist and send the corresponding files to some arbitrary location.

Well, I sez to myself, I sez, this is not iTunes. This is not how we roll. I will bet there is a solution to this problem. So I have a look around ~brennen, and what do I find but ~/.gnome2/rhythmbox/playlists.xml.

So here's playlist.pl. The original was about 12 unnecessarily verbose lines, but I hear you're not supposed to process HTML with cheesy regexen. This one uses XML::Simple just for kicks.

brennen@eris 18:05:41 ~ $ ./playlist.pl --list dr.*
drinking
driving

brennen@eris 18:01:57 ~ $ ./playlist.pl drinking
/home/brennen/music/Violent Femmes/Add It Up (1981-1993)/07 Country Death Song.m4a
/home/brennen/music/m4a/Modest Mouse/The Lonesome Crowded West/10 Long Distance Drunk.m4a
/home/brennen/music/mp3/h/Hem - When I Was Drinking.mp3
/home/brennen/music/mp3/l/leadbelly - Ain't Goin' Drink No More.mp3
/home/brennen/music/mp3/t/treepeople - smokin and drinkin.mp3
/home/brennen/music/random songs from the internet/06 Daddy Needs A Drink.mp3

For good measure, I guess it should escape spaces and read those INI-file style playlists that Rhythmbox also generates.