#!/bin/sh # pretty oneliner to pull url data from a url #perl -MURI -le '$a=URI->new($ARGV[0]); map { eval { print "m$_=\"".($a->$_ || "/")."\"" } } qw(host port path)' $stream` PID=0 while read url; do if [ ! -z "$url" ]; then [ "$PID" -gt 0 ] && kill -TERM $PID && sleep 1 case "$url" in http://*.m3u) stream=`wget -O - -q "$url" | col` ;; http://*.mp3|http://*.ogg) stream="$url" ;; http://*.pls) stream=`wget -O - -q "$url" | col | awk -F= '/^File[0-9]/ { print $2; }'` ;; http://*) stream="$url" ;; d) stream="" ;; esac #echo "mplayer -quiet -cache 48" $stream perl /home/sissel/bin/noisefilter.pl $stream | mpg321 -q - PID=$! fi done # Nasty ;)