netradio-list

This utility helps keeping track of your favourite Internet radio stations. Its goal is to reduce the hassle of lost and outdated streams. The program produces output compatible to the m3u format and can be used directly as input for several audio players, such as the music player daemon.

Unfortunately, Internet radio stations have to change their stream addresses from time to time. Whenever this happens the streams stored inside your player configuration become invalid. The hassle and search for the proper stream address starts again.

This program will calculate a new playlist in the m3u format upon every execution. It works on the assumption that the address of the pls and m3u playlist file for a particular Internet radio station expire less frequently.

Input is read from a simple configuration file in which all favourite radio stations are configured. The output will be written to standard out and can thus be redirected by the shell or post-processed by the calling program. As a bonus the name and website (if provided) for a given Internet radio station will be written into the output as a comment.

Synopsis

  netradio-list [--config|-c conffile] [--agent|--useragent|-ua agentstring]

The default location for the config file is ~/etc/netradio.conf. This is changed with the --config parameter. The program sends the UserAgent string configured in the LWP library if not specified otherwise with the --useragent parameter.

Configuration file

The configuration file uses a very simple format. Only the name of the station (given in square brackets) and the address of the playlist file is required. The url is given only for later reference in case the playlist file is hosted on a different server and became invalid.

One station entry looks like:

   [Frequence 3]
   url = http://www.frequence3.net/
   stream = http://streams.frequence3.net/mp3-192.m3u

Several of these are allowed. The order in which stations are listed are honoured by the program and thus the resulting playlist file. You may list more than one playlist stream addresses by duplicating the stream line.

Program Code

The program is written in Perl using only Getopt::Long and LWP::UserAgent. It should run without problems on any GNU/Linux, BSD and Unix systems.

CVS.

Download.