Duhcast

The dumbest Shoutcast stream-maker ever

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.

  1. Install Nullsoft's linux Shoutcast server (I used 1.8.3).
  2. Set a password in the sc_serv.conf file.
  3. Start up the Shoutcast server (./sc_serv).
  4. Make sure you have MP3::Info, available at your nearest CPAN.
  5. Compile and install libshout-1.0.8.tar.gz.
  6. Compile and install perl module Shout-1.0.tar.gz.
  7. Download that duhcast.pl script
  8. Edit it to change the password, and the other fields if you want.
  9. Start the duhcast.pl script: duhcast.pl mp3dir
  10. Point your web browser to your server, port 8000.
  11. Dance!

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.


 

home