Codice: Seleziona tutto
#!/bin/bash
while [ "$c" == "" ]; do
clear
echo ""
echo " LISTA CANALI"
echo " ==================================="
echo " 1 --RAI 1 10 --FOCUS"
echo " 2 --RAI 2 11 --D-MAX"
echo " 3 --RAI 3 12 --REAL TIME"
echo " 4 --RETE 4 13 --GIALLO"
echo " 5 --CANALE 5 14 --TOP CRIME"
echo " 6 --ITALIA 1 15 --7 GOLD"
echo " 7 --LA 7 16 --CARTOONROCKS"
echo " 8 --ITALIA 2 17 --RAI NEWS 24"
echo " 9 --LA 5 18 --RAI 4"
echo " ==================================="
echo ""
echo " 0 --USCITA"
echo ""
echo ""
read OPT
case $OPT in
0)
clear
exit 0
;;
1)
CH="rai-1"
;;
2)
CH="rai-2"
;;
3)
CH="rai-3"
;;
4)
CH="rete-4"
;;
5)
CH="canale-5"
;;
6)
CH="italia-1"
;;
7)
CH="la-7"
;;
8)
CH="italia-2"
;;
9)
CH="la-5"
;;
10)
CH="focus"
;;
11)
CH="d-max"
;;
12)
CH="real-time"
;;
13)
CH="giallo"
;;
14)
CH="top-crime"
;;
15)
CH="7-gold"
;;
16)
CH="cartoonrocks"
;;
17)
CH="rai-news-24"
;;
18)
CH="rai-4"
;;
*)
echo ""
echo "Scelta non valida"
echo ""
sleep 3
clear
exit 1
;;
esac
clear
data=`wget -q "http://www.gallinaccia.com/2013/05/$CH.html" -O-`
dati=`echo "$data" | sed -n '/inizo/,/script/p'`
if [ -z "$dati" ]; then
dati=`echo "$data" | grep '<iframe '`
fi
host=`echo "$dati" | grep -o 'src="[^"]*' | cut -d'"' -f2 | cut -d'/' -f3`
if [ -z "$host" ]; then
host=`echo "$dati" | grep -o "src='[^']*" | cut -d"'" -f2 | cut -d'/' -f3`
fi
hosts[0]="live-onweb"
hosts[1]="liveflash"
hosts[2]="yycast"
hosts[3]="ucaster"
hosts[4]="livestream"
hosts[5]="mips"
hosts[6]="micast"
hosts[7]="flashcast"
hosts[8]="ustream"
hosts[9]="battlecam"
hosts[10]="streamago"
hosts[11]="stream4u"
for ((i=0; i<=11; i++)); do
check=`echo "$host" | grep "${hosts[i]}"`
if [ -n "$check" ]; then
host="${hosts[i]}"
fi
done
echo "L'host che correntemente ospita questo canale e': $host"
case $host in
live-onweb)
echo ""
echo "Streaming in corso..."
id=`echo "$dati" | grep -o 'src="[^"]*' | cut -d'"' -f2`
if [ -z "$id" ]; then
id=`echo "$dati" | grep -o "src='[^']*" | cut -d"'" -f2`
fi
bash api.sh "$id" >/dev/null
;;
liveflash)
echo ""
echo "Streaming in corso..."
id=`echo "$dati" | grep -o "channel='[^']*" | cut -d"'" -f2`
bash api.sh "http://www.liveflash.tv/$id" >/dev/null
;;
yycast)
#echo ""
#echo "Streaming in corso..."
#id=`echo "$dati" | grep -o "fid='[^']*" | cut -d"'" -f2`
#bash api.sh "http://flashcast.tv/watch.php?live=$id" >/dev/null
;;
ucaster)
echo ""
echo "Streaming in corso..."
id=`echo "$dati" | grep -o "channel='[^']*" | cut -d"'" -f2`
bash api.sh "http://www.ucaster.eu/$id" >/dev/null
;;
livestream)
echo ""
echo "Streaming in corso..."
id=`echo "$dati" | grep -o 'src="[^"]*' | cut -d'"' -f2 | cut -d'?' -f1 | cut -d'/' -f5`
if [ -z "$id" ]; then
id=`echo "$dati" | grep -o "src='[^']*" | cut -d"'" -f2 | cut -d'?' -f1 | cut -d'/' -f5`
fi
bash api.sh "http://www.livestream.com/$id" >/dev/null
;;
mips)
#echo ""
#echo "Streaming in corso..."
#id=`echo "$dati" | grep -o "fid='[^']*" | cut -d"'" -f2`
#bash api.sh "http://flashcast.tv/watch.php?live=$id" >/dev/null
;;
micast)
echo ""
echo "Streaming in corso..."
id=`echo "$dati" | grep -o 'ca="[^"]*' | cut -d'"' -f2`
bash api.sh "http://micast.tv/ch.php?ch=$id" >/dev/null
;;
flashcast)
echo ""
echo "Streaming in corso..."
id=`echo "$dati" | grep -o "fid='[^']*" | cut -d"'" -f2`
bash api.sh "http://flashcast.tv/watch.php?live=$id" >/dev/null
;;
ustream)
echo ""
echo "Streaming in corso..."
id=`echo "$dati" | grep -o 'src="[^"]*' | cut -d'"' -f2`
if [ -z "$id" ]; then
id=`echo "$dati" | grep -o "src='[^']*" | cut -d"'" -f2`
fi
bash api.sh "$id" >/dev/null
;;
battlecam)
echo ""
echo "Streaming in corso..."
p=`echo "$dati" | grep -o 'src="[^"]*' | cut -d'"' -f2`
if [ -z "$p" ]; then
p=`echo "$dati" | grep -o "src='[^']*" | cut -d"'" -f2`
fi
info=`wget "$p" -q -O-`
r=`echo "$info" | grep -o 'flashvars.playServerUrl = "[^"]*' | cut -d'"' -f2`
y=`echo "$info" | grep -o 'lastStream = "[^"]*' | cut -d'"' -f2`
r="$r$y"
rtmpdump -q -v -r "$r" -p "$p" -W "http://www.battlecam.com/application/themes/base/flash/broadcast/VideoChatECCDN_debug.swf?version=23" | vlc --quiet --meta-title="Powered-by-Darby_Crash" - 2>/dev/null
;;
streamago)
echo ""
echo "Streaming in corso..."
id=`echo "$dati" | grep -o 'src="[^"]*' | cut -d'"' -f2`
if [ -z "$id" ]; then
id=`echo "$dati" | grep -o "src='[^']*" | cut -d"'" -f2`
fi
bash api.sh "$id" >/dev/null
;;
stream4u)
echo ""
echo "Streaming in corso..."
id=`echo "$dati" | grep -o "fid='[^']*" | cut -d"'" -f2`
if [ -z "$id" ]; then
id=`echo "$dati" | grep -o 'fid="[^"]*' | cut -d'"' -f2`
fi
bash api.sh "http://stream4u.eu/?p=channeldetails&id=$id" >/dev/null
;;
esac
done
