Music Scripts

September 11, 2003 | http://meejah.homeip.net/cgi-bin/viewcvs.cgi/projects/cd |

I organise all the music on my machine via some Python scripts, which are getting more and more complex. The gist is that all my music lives in files which look like:

~/sound/artists/artist-name/song-name.ogg

...and there are symbolic links of the form:

~/sound/albums/artist-name--album-name/001

~/sound/albums/artist-name--album-name/002

~/sound/albums/artist-name--album-name/...

~/sound/albums/artist-name--album-name/art.jpeg

I have a script which uses cd paranoia to extract a CD, oggenc to encode and CDDA to read the track/album names and put the resultant files in the correct place. This makes it easy to extract a new album when I get one.

There are also, of course, scripts for playing the music. The best one is albumizer.py, which allows one to queue up albums to be played. When playing, it displays the cover art (if it exists) along with the track, artist and album name on the root window. Nice and handy and unobtrusive.

There is also a crusader-based server to play the music via a Web interface and support scripts to make some of the summary Web pages listing music for streaming, etcetera.

The code is both horribly messy and GPL'd; drop me a line if it's useful for you (who knows; maybe I'll clean it up if so ;). You can download a .tar.gz of the code, or browse it with the URL in the title.