This is yet another Perl program that ended up being simple but still took hours to do because of the piss-poor documentation out there. The goal was to set up a Shoutcast stream that was dead simple. I like the idea of just selecting all your MP3's and playing them randomly. But that makes it a pain in the ass to play single ones when you feel the need. So I figured a Shoutcast stream would do the job. I could switch back to it with one click, it would always be randomized, and it would pick up new songs in the directory (eventually).
So these were the requirements:
None of what I found out there was simple enough (using mySQL was just overkill), so I wrote my own in Perl.
Here's the result: duhcast.pl
This requires a crapload of supporting software, most of which has to be compiled. Viva Linux! Here's what you have to do.
duhcast.pl mp3dir
For the record, here's what threw me off. There are two shoutcast-compatible servers: shoutcast and icecast. The undocumented switch to make libshout work with shoutcast is icy-compat. Figure that one out.