#!/bin/bash
#######################################################################################
#######################################################################################
###
Laberthread - Autoscript Vavoo auf e2 oder TvHeadend
### On an idea of Clever999 modified by Demosat 09.02.2023
#######################################################################################
#######################################################################################
echo -e "\033[32m###Vavoo-Script on an idea of Clever999 modified by Demosat\033[0m"
sleep 2
echo -e "\033[32m###### thx to MasterX, giniman and Oyster for the authkey\033[0m"
sleep 2
echo -e "\033[32m###more info
https://www.digital-eliteboard.com/threads/autoscript-vavoo-auf-e2.513335/\033[0m"
sleep 2
########################################################################################
########################################################################################
########################################################################################
echo "start install..."
###Paketprüfung
echo pruefe curl
PAKET=curl
if [[ -f $(which $PAKET 2>/dev/null) ]]
then
echo -e "\033[32m$PAKET ist bereits installiert...\033[0m"
else
echo -e "\033[33m$PAKET wird installiert...\033[0m"
opkg update && opkg install $PAKET
fi
sleep 1
vec=$(shuf -n 1 /home/vavookeys)
authkey="$(curl -k --location --request POST '
Sie müssen registriert sein, um Links zu sehen.
' --header 'Content-Type: application/json' --data "{\"vec\": \"$vec\"}" | sed 's#^.
"signed":"##' | sed "s#\"}}##g" | sed 's/".//')"
curl -k "
Sie müssen registriert sein, um Links zu sehen.
" > vavoo
echo "#EXTM3U" > index
cat vavoo | sed 's/\(}\),/\1}\n,/g' | sed 's/"url":"/"url":\n/g' | sed 's#,{\"group\":#\#EXTINF:-1 group-title=#g' | sed 's#,\"logo\":\"\",\"name\":#,#g' | sed 's/\"}.
//' | sed 's/\",\"tvg.//' | sed 's#\",\"#\",#g' >> index
mv index index.m3u
for country in Germany Spain Germany.tv; do
cat index.m3u | grep -E -A1 =\"$country > $country.m3u
# file m3u for vlc
echo erstelle $country.m3u...
echo "#EXTM3U" > vavoo-$country.m3u
cat $country.m3u | sed "s#.ts#.ts?n=1\&b=5\&vavoo_auth="$authkey"#g" | sed '/^#EXTINF/a#EXTVLCOPT:http-user-agent=VAVOO/2.6' >> vavoo-$country.m3u
# file for enigma2
echo erstelle vavoo-$country bouquets...
echo "#NAME Vavoo-"$country > /etc/enigma2/userbouquet.vavoo-$country.tv
cat $country.m3u | sed "s#.ts#.ts?n=1\&b=5\&vavoo_auth="$authkey"\#User-Agent=VAVOO/2.6#g" | sed '/^#EXTINF/{h;d}; /^http/G' | sed 's#,#,\#DESCRIPTION #g' | sed 's#^.*,##' | sed 's#:#%3a#g' | sed 's#http#\#SERVICE 4097:0:0:0:0:0:0:0:0:0:http#g' | sed '/--/d; s/#DESCRIPTION/@#DESCRIPTION/g' | sed '$!N;s/\n/ /' | sort -k 4 | sed 's/@/\n/g; s/@//g' >> /etc/enigma2/userbouquet.vavoo-$country.tv
if cat /etc/enigma2/vavoo-Germany/bouquets.tv | grep vavoo-$country > /dev/null 2>&1
then
echo -e Entry bouquets.tv $country available > /dev/null 2>&1
else
echo -e Entry bouquets.tv $country is missing > /dev/null 2>&1
echo "#SERVICE 1:7:1:0:0:0:0:0:0:0:FROM BOUQUET \"userbouquet.vavoo-$country.tv\" ORDER BY bouquet" >> /etc/enigma2/vavoo-Germany/bouquets.tv
fi
rm -rf $country.m3u
done
rm index*
rm userbouquet.vavoo-Germany.tv
rm vavoo-Germany.m3u
####bouquets.tv SID pruefen###
if
cat /etc/enigma2/bouquets.tv | grep vavoosid > /dev/null 2>&1
then
echo -e Eintrag bouquets.tv vorhanden > /dev/null 2>&1
else
echo -e Eintrag bouquets.tv fehlt > /dev/null 2>&1
echo "#SERVICE 1:7:1:0:0:0:0:0:0:0:FROM BOUQUET \"userbouquet.vavoosid.tv\" ORDER BY bouquet" >> /etc/enigma2/bouquets.tv
fi
####pfad zur userbouquet sid###
echo erstelle SID Germany
pfad=/etc/enigma2/userbouquet.vavoo-Germany.tv
###sids bearbeiten####
echo "#NAME vavooSID" > e3
echo "#SERVICE 1:64:1:2:0:0SID:0:0:0:0:http%3a//egal.de:##### FTA #####" >> e3