#!/bin/bash
# titannit box parser for burning series
. /tmp/localhoster/hoster.sh
SRC=$1
INPUT=$2
PARAM=$3
PARAM2=$4
URL="https://bs.to/"
PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
NAME="burningseries"
#rm -rf $TMP > /dev/null 2>&1
mkdir $TMP > /dev/null 2>&1
if [ `echo $SRC | grep ^"/mnt/parser" |wc -l` -gt 0 ];then
TYPE="$SRC - Shell script"
elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then
TYPE="Swap - Shell script"
elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then
TYPE="Mnt - Shell script"
else
TYPE="Flash - Shell script"
fi
init()
{
echo "Burning Series ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0"
}
mainmenu()
{
echo "Genres#$SRC $SRC genres#http://atemio.dyndns.tv/mediathek/menu/serien.genre.jpg#serien.genre.jpg#$NAME#0" >/tmp/tithek/$PARSER.mainmenu.list
echo "All Series#$SRC $SRC allseries#http://atemio.dyndns.tv/mediathek/menu/serien.jpg#serien.jpg#$NAME#0" >>/tmp/tithek/$PARSER.mainmenu.list
echo "Search#$SRC $SRC search#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#0" >>/tmp/tithek/$PARSER.mainmenu.list
echo "/tmp/tithek/$PARSER.mainmenu.list"
}
genres()
{
$curlbin -o - $URL"serie-genre" | awk -v SRC=$SRC -v NAME=$NAME '
BEGIN { in_genres = 0
}
/
/ { in_genres = 1
next
}
/
/ { i = index($0, "") + 14
j = index($0, "") - i
title = substr($0, i, j)
pic = tolower(title)
print title "#" SRC " " SRC " series " title "#http://atemio.dyndns.tv/mediathek/menu/" pic ".jpg#" pic ".jpg#" NAME "#0"
next
}
' >/tmp/tithek/$PARSER.genres.list
echo "/tmp/tithek/$PARSER.genres.list"
}
series()
{
$curlbin -o - $URL"serie-genre" | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME '
// { i = index($0, "") + 14
j = index($0, "") - i
genre = substr($0, i, j)
}
/") - 1
k = i + j + 2
l = index(substr($0, k), "") - 1
title = substr($0, k, l)
print title "#" SRC " " SRC " staffel " url "#http://atemio.dyndns.tv/mediathek/menu/default.jpg#default.jpg#" NAME "#0"
}
next
}
' >/tmp/tithek/$PARSER.series.list
echo "/tmp/tithek/$PARSER.series.list"
}
allseries()
{
$curlbin -o - $URL"serie-alphabet" | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME '
// { i = index($0, "") + 14
j = index($0, "") - i
genre = substr($0, i, j)
}
/") - 1
url = substr($0, i, j)
k = i + j + 2
l = index(substr($0, k), "") - 1
title = substr($0, k, l)
print title "#" SRC " " SRC " staffel " url "#http://atemio.dyndns.tv/mediathek/menu/default.jpg#default.jpg#" NAME "#0"
}
next
}
' >/tmp/tithek/$PARSER.allseries.list
echo "/tmp/tithek/$PARSER.allseries.list"
}
staffel()
{
$curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME '
BEGIN { in_class_clearfix = 0
}
// { in_class_clearfix = 1
}
/- ") - 1
url = substr($0, i, j)
k = i + j + 2
l = index(substr($0, k), "
") - 1
staffel = substr($0, k, l)
print "Staffel " staffel "#" SRC " " SRC " episode " url " " staffel "#http://atemio.dyndns.tv/mediathek/menu/s" staffel ".jpg#s" staffel ".jpg#" NAME "#0"
}
}
/<\/ul>/ { in_class_clearfix = 0
}
' >/tmp/tithek/$PARSER.staffel.list
echo "/tmp/tithek/$PARSER.staffel.list"
}
episode()
{
$curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME '
BEGIN { in_table_row = 0
}
// { in_table_row = 1
next
}
/ | ") - 1
episode = substr($0, k, l)
print title "#" SRC " " SRC " hosterlist " url "#http://atemio.dyndns.tv/mediathek/menu/s" PARAM2 "e" episode ".jpg#s" PARAM2 "e" episode ".jpg#" NAME "#0"
}
next
}
/<\/tr>/ { in_table_row = 0
next
}
' >/tmp/tithek/$PARSER.episode.list
echo "/tmp/tithek/$PARSER.episode.list"
}
hosterlist()
{
$curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME '
BEGIN { in_hosterlist = 0
}
// { in_hosterlist = 1
next
}
/href=\"/ { if (in_hosterlist == 1) {
i = index($0, "href=\"") + 6
j = index(substr($0, i), "\">") - 1
url = substr($0, i, j)
}
next
}
/<\/span> / { if (in_hosterlist == 1) {
i = index($0, " ") + 13
title = substr($0, i)
pic = tolower(title)
print title "#" SRC " " SRC " hoster " url "#http://atemio.dyndns.tv/mediathek/menu/" pic ".jpg#" pic ".jpg#" NAME "#111"
}
next
}
/<\/ul>/ { in_hosterlist = 0
next
}
' >/tmp/tithek/$PARSER.hosterlist.list
echo "/tmp/tithek/$PARSER.hosterlist.list"
}
###################
# in_hoster
###################
#
#
###################
# in_hoster_iframe
###################
#
#
#
#function followlocation()
#{
# system("curlbin -s -D - $1 | grep Location: | tail -n1")
#}
hoster()
{
STREAM=`$curlbin -o - $URL$PARAM | awk '
/class=\"hoster-player\"/ { i = index($0, "/tmp/tithek/$PARSER.hoster.1
cat /tmp/tithek/$PARSER.hoster.1 | $curlbin -o - $STREAM | awk '
/\"og:url\" content=/ { i = index($0, "\"og:url\" content=") + 18
j = index(substr($0, i), "\"") - 1
url = substr($0, i, j)
print url
next
}
/name=\"id\" value=\"/ { i = index($0, "value=\"") + 7
j = index(substr($0, i), "\"") - 1
url = "http://vidto.me/" substr($0, i, j) ".html"
print url
next
}
' >/tmp/tithek/$PARSER.hoster.list
cat /tmp/tithek/$PARSER.hoster.list
}
case $INPUT in
init) $INPUT;;
mainmenu) $INPUT;;
genres) $INPUT;;
series) $INPUT;;
allseries) $INPUT;;
staffel) $INPUT;;
episode) $INPUT;;
hosterlist) $INPUT;;
hoster) $INPUT;;
esac