Saving MP3 Streams from Shoutcast and Digitally Imported

My objective with this script is to save Shoutcast (PLS) MP3 streams to load in my MP3 player. This is equivalent to taping the radio and playing the tape later. I'm not really interested in breaking up the stream (though there are tools to do it) into individual MP3 files. I simply want to play the tunes in my car.

The following bash script takes the URL of the PLS file as a parameter, it will attempt each stream listed in the PLS file. It will use the first title as the basis for the output file name. If a stream dies, the next one will be appended to the file. Pretty simple, stupid, and effective. Later changes may include setting a time option (ie.. record 2 hours), or a file size option (record a 64meg file). This would give me a going to work recording and a separate coming home one. I'll probably add an opt to specify the output file name first though.

If anyone has thoughts about how to mod this feel free the leave a message on my BLOG. Also, if anybody has a script to make colorized HTML from a bash script, that would be really cool.

Disclaimer: the legality of this is questionable. Use at your own risk.




Sponsors:

About willCode4Beer