hab mir ein kleines Script geschrieben, um mein Digitally Imported Abo als Webradio auf der Mutant einzurichten.
Das Script laeuft sowohl auf der mutant als auch auf einem linux pc. Ihr braucht dazu ein Abo und von dort natürlich den Key, welchen Ihr in das Script am Anfang eintragen müsst.
Code: Alles auswählen
#/bin/sh
KEYONLINE="<enteryourcodehere>"
dir=$1
diurl=http://prem2.di.fm:80
di=http://listen.di.fm/public3
clurl=http://prem2.classicalradio.com:80
cl=http://listen.classicalradio.com/public3
rturl=http://prem2.radiotunes.com:80
rt=http://listen.radiotunes.com/public3
rrurl=http://prem2.rockradio.com:80
rr=http://listen.rockradio.com/public3
jzurl=http://prem2.jazzradio.com:80
jz=http://listen.jazzradio.com/public3
prefix=$3
if [ "$dir" == "" ]; then
echo "Usage: di.sh PLAYLIST_DIR "
echo
echo "EXAMPLE"
echo "di.sh /var/lib/mpd/playlists"
exit
fi
url=$di
file="$dir/di.xml"
echo "<?xml version=\"1.0\"?>">$file
echo "<webradios name=\"[Digitally Imported]\">">>$file
IFS=$'\n';for keyname in `wget -nv -O - $url | grep -o '"key":"[^"]*","name":"[^"]*"'` ; do
key="`echo $keyname | grep -o '"key":"[^"]*"' | sed 's/"key":"\([^"]*\)"/\1/g'`"_hi
name="`echo $keyname | grep -o '"name":"[^"]*"' | sed 's/"name":"\([^"]*\)"/\1/g'`"
echo " <webradio genre=\"DI.FM\" title=\"$name\" url=\"$diurl/$key?$KEYONLINE\" />">>$file
done
url=$rt
IFS=$'\n';for keyname in `wget -nv -O - $url | grep -o '"key":"[^"]*","name":"[^"]*"'` ; do
key="`echo $keyname | grep -o '"key":"[^"]*"' | sed 's/"key":"\([^"]*\)"/\1/g'`"_hi
name="`echo $keyname | grep -o '"name":"[^"]*"' | sed 's/"name":"\([^"]*\)"/\1/g'`"
echo " <webradio genre=\"RadioTunes\" title=\"$name\" url=\"$rturl/$key?$KEYONLINE\" />">>$file
done
url=$jz
IFS=$'\n';for keyname in `wget -nv -O - $url | grep -o '"key":"[^"]*","name":"[^"]*"'` ; do
key="`echo $keyname | grep -o '"key":"[^"]*"' | sed 's/"key":"\([^"]*\)"/\1/g'`"
name="`echo $keyname | grep -o '"name":"[^"]*"' | sed 's/"name":"\([^"]*\)"/\1/g'`"
echo " <webradio genre=\"JazzRadio\" title=\"$name\" url=\"$jzurl/$key?$KEYONLINE\" />">>$file
done
url=$rr
IFS=$'\n';for keyname in `wget -nv -O - $url | grep -o '"key":"[^"]*","name":"[^"]*"'` ; do
key="`echo $keyname | grep -o '"key":"[^"]*"' | sed 's/"key":"\([^"]*\)"/\1/g'`"
name="`echo $keyname | grep -o '"name":"[^"]*"' | sed 's/"name":"\([^"]*\)"/\1/g'`"
echo " <webradio genre=\"RockRadio\" title=\"$name\" url=\"$rrurl/$key?$KEYONLINE\" />">>$file
done
url=$cl
IFS=$'\n';for keyname in `wget -nv -O - $url | grep -o '"key":"[^"]*","name":"[^"]*"'` ; do
key="`echo $keyname | grep -o '"key":"[^"]*"' | sed 's/"key":"\([^"]*\)"/\1/g'`"
name="`echo $keyname | grep -o '"name":"[^"]*"' | sed 's/"name":"\([^"]*\)"/\1/g'`"
echo " <webradio genre=\"ClassicalRadio\" title=\"$name\" url=\"$clurl/$key?$KEYONLINE\" />">>$file
done
echo "</webradios>">>$file
greetz ...