Hallo liebe InternetRadio Liebhaber,
nach langer erfolgloser Suche im Forum habe ich mich einmal hingesetzt und ein Script *zusammengeklöppelt* um automatisch Playlisten für Shoutcaststationen zu erzeugen.
Wie allerdings jeder mit ein wenig Programmiererfahrung sehen kann, ist das wirklich mit dem Holzhammer programmmiert.
Schön wäre es, wenn sich ein *echter* Programmierer mal dessen annehmen kann, um es ein wenig zu "verbessern".
Grundsätzlich tut es zwar das was es soll, aber elegant ist es nicht!!!
Bash
#!/bin/sh
#
# this script will download the top 100 Stations from [URL]www.shoutcast.com[/URL] matching the genre 'Metal'
#
declare -a array1
declare -a array2
lynx -dump 'http://yp.shoutcast.com/?sgenre=metal?numresult=100' | awk '/http.*pls/ {print $2}' > /tmp/pl
lynx -dump 'http://yp.shoutcast.com/index.phtml?startat=25' | awk '/http.*pls/ {print $2}' >> /tmp/pl
lynx -dump 'http://yp.shoutcast.com/index.phtml?startat=50' | awk '/http.*pls/ {print $2}' >> /tmp/pl
lynx -dump 'http://yp.shoutcast.com/index.phtml?startat=75' | awk '/http.*pls/ {print $2}' >> /tmp/pl
wget -q -i /tmp/pl -P /tmp
for i in /tmp/shoutc*
do
cat $i | awk '/Title/ {print $4$5"_"substr($1,10,10)}' > /tmp/Filename
cat $i | awk '/File/ {print substr($1,7,99)}' > /tmp/Inhalt
linecount=$(wc -l < /tmp/Filename)
array1=(`cat /tmp/Filename`)
array2=(`cat /tmp/Inhalt`)
for ((l=0 ; l<linecount ; l++))
do
echo Filename:${array1[$l]}
echo ${array2[$l]} > /etc/vdr/Network-Streams/${array1[$l]}.pls
done
done
rm /tmp/Filename
rm /tmp/Inhalt
rm /tmp/shoutc*
rm /tmp/pl
Alles anzeigen
Ich rufe dieses Script dann bei Bedarf über eine entsprechende commands.conf auf.
Gruß,
Thilo