Moin,
wollte hier mal mein kleines Bash-Script teilen, das es auch für Kabelkunden ermöglicht in XBMC und XVDR Kanallogos zu bekommen.
Hatte im Netz gesucht und nichts gefunden ...
Was macht es:
1. Git-Repository von Bitbucket holen
2. eine serviceref.conf mitels dem Tool serviceref vom vdr-plugin-xvdr erstellen
3. umwandeln und speichern der Kanallogos als PNG unter einem Referenz-Namen, welchen XVDR vorraussetzt
Beötigt wird:
1. das Tool serviceref - der Quellcode liegt im Verzeichnis tools im Paket vdr-plugin-xvdr (für Gentoo gibt es hier ein ebuild)
2. das Programm convert von ImageMagick
3. natürlich XBMC und XVDR
Vorgehensweise:
1. Ordner im Home-Verzeichnis erstellen - z.B. mkdir Channellogos
2. speichern des Bash-Scriptes in diesem Ordner, z.B. unter dem Namen get_channellogos.sh
3. das Script ausführbar machen - chmod +x get_channellogos.sh
4. Script ausführen - ./get_channellogs.sh
5. das genutzte Verzeichnis in den Einstellungen im XVDR-Addon in XBMC definieren - zu finden unter dem Reiter Verbindung -> Picons
get_channellogos.sh
#!/bin/sh
XVDR_SERVICEREF=/usr/bin/xvdr-serviceref
CONVERT=/usr/bin/convert
LANGUAGE="deu"
#################################################
SERVICEREF=serviceref.conf
REPOSITORY=https://bitbucket.org/picons/logos.git
LOCALFOLDER=logos
if [ ! -f $XVDR_SERVICEREF ]; then
echo "$XVDR_SERVICEREF not found, please install serviceref from vdr-plugin-xvdr or adjust \$XVDR_SERVICEREF in this script." && exit 1
fi
if [ ! -f $CONVERT ]; then
echo "$CONVERT not found, please install ImageMagick or adjust \$CONVERT in this script." && exit 1
fi
# create serviceref.conf and count lines/channels
$XVDR_SERVICEREF > $SERVICEREF
lines=`wc -l $SERVICEREF | sed -e "s/ .*//"`
IFS=$'\012'
if [ -d $LOCALFOLDER ]; then
echo ">> Updating Logos"
echo ">>> Pulling from $REPOSITORY"
cd "$LOCALFOLDER" && git pull && cd ..
echo ""
else
echo ">> Downloading Logos"
echo ">>> Cloning $REPOSITORY"
git clone "$REPOSITORY" "$LOCALFOLDER"
echo ""
fi
# count line
cline=1
# count founded channels
cchannel=0
for line in `cat $SERVICEREF`; do
line=`echo $line | sed -e "s/ //g"`
channelname=`echo $line | sed -e "s/-\([^-]*\)$//" | sed -e "s/,.*$//" | sed -e "s/;.*//"`
channel=`echo $channelname | sed -e "s/\.//g" | sed -e "s/-//g" | sed -e "s/_//g" | sed -e "s/\*//g" | sed -e "s/\///g" | sed -e "s/\!//g" | sed -e "s/(.*)//g" | sed -e "s/+/plus/" | sed -e "s/II/2/" | sed -e "s/\(.*\)/\L\1/"`
reverence=`echo $line | sed -e "s/^.*-//"`
type=`echo $reverence | awk 'BEGIN { FS="_" } { print $3 }'`
# dirname of channelpicture (tv or radio)
case $type in
2)
chapicdir="radio"
;;
*)
chapicdir="tv"
;;
esac
logo="$LOCALFOLDER/$chapicdir/$channel"
colour="\e[0;32m"
if [ -f $logo.* ] ; then
logo=`ls $logo.*`
convert -background transparent -resize '200' $logo $reverence.png
let cchannel=$cchannel+1
elif [ -f $logo-$LANGUAGE.* ] ; then
logo=`ls $logo-$LANGUAGE.*`
convert -background transparent -resize '200' $logo $reverence.png
let cchannel=$cchannel+1
else
logo=$logo".* does not exist"
colour="\e[0;31m"
fi
printf "$colour %4s / %3s \e[0;37m %35s %-40s %8s\n" $cline $lines $channelname $reverence $logo
let cline=$cline+1
done
echo "Found $cchannel channels of $lines"
Alles anzeigen
sieht dann so aus :
$ ./get_channellogos.sh
>> Updating Logos
>>> Pulling from https://bitbucket.org/picons/logos.git
Already up-to-date.
1 / 374 DasErsteHD 1_0_19_2B5C_41B_1_FFFF0000_0_0_0 logos/tv/daserstehd.png
2 / 374 ZDFHD 1_0_19_2B66_437_1_FFFF0000_0_0_0 logos/tv/zdfhd.svg
3 / 374 arteHD 1_0_19_2B70_271E_F001_FFFF0000_0_0_0 logos/tv/artehd.svg
4 / 374 SkyCinemaHD 1_0_19_83_6_85_FFFF0000_0_0_0 logos/tv/skycinemahd-deu.png
5 / 374 SkyAtlanticHD 1_0_19_6E_D_85_FFFF0000_0_0_0 logos/tv/skyatlantichd-deu.png
6 / 374 SkyXmasHD 1_0_19_6B_C_85_FFFF0000_0_0_0 logos/tv/skyxmashd.* does not exist
7 / 374 SkySportHD1 1_0_19_81_6_85_FFFF0000_0_0_0 logos/tv/skysporthd1.* does not exist
....
360 / 374 Arirang(engl)/Fashion(spa) 1_0_1_C75C_2725_F001_FFFF0000_0_0_0 logos/tv/arirang.* does not exist
361 / 374 INInt./GODTV 1_0_1_C75D_2725_F001_FFFF0000_0_0_0 logos/tv/inintgodtv.* does not exist
362 / 374 Khatereh-TV(far) 1_0_1_C75E_2725_F001_FFFF0000_0_0_0 logos/tv/khaterehtv.* does not exist
363 / 374 MBC1(ara)/ducktv 1_0_1_C760_2725_F001_FFFF0000_0_0_0 logos/tv/mbc1ducktv.* does not exist
364 / 374 France2(frz) 1_0_1_C762_2725_F001_FFFF0000_0_0_0 logos/tv/france2.svg
365 / 374 BodyBal/TVRecord 1_0_1_C763_2725_F001_FFFF0000_0_0_0 logos/tv/bodybaltvrecord.* does not exist
366 / 374 ProTV/TVR(rum) 1_0_1_D03A_2725_F001_FFFF0000_0_0_0 logos/tv/protvtvr.* does not exist
367 / 374 LRTLituanica(lit)/GINXTV(engl) 1_0_1_D03B_2725_F001_FFFF0000_0_0_0 logos/tv/lrtlituanica.* does not exist
368 / 374 BVN(dut) 1_0_1_D046_2725_F001_FFFF0000_0_0_0 logos/tv/bvn.svg
369 / 374 ANN/Tunisie1(ara) 1_0_1_D04A_2725_F001_FFFF0000_0_0_0 logos/tv/anntunisie1.* does not exist
370 / 374 HDTestkanal 1_0_19_C378_2721_F001_FFFF0000_0_0_0 logos/tv/hdtestkanal.* does not exist
371 / 374 RTLLiving 1_0_1_CF0B_2721_F001_FFFF0000_0_0_0 logos/tv/rtlliving.png
372 / 374 Testkanal 1_0_19_CF0D_2721_F001_FFFF0000_0_0_0 logos/tv/testkanal.* does not exist
373 / 374 446-22|45 1_0_1_FE_2_85_FFFF0000_0_0_0 logos/tv/44622|45.* does not exist
374 / 374 426-18|45 1_0_1_105_2_85_FFFF0000_0_0_0 logos/tv/42618|45.* does not exist
Found 230 channels of 374
Alles anzeigen
grüsse
MichaeL