#!/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"
curlbin="curl -k -s"
#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"andere-serien" | 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"andere-serien" | 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 '
// { sub(//, "", $0)
}
/") - 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"
}
' >/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
episode = ""
url = ""
title = ""
}
// { in_table_row = 1
next
}
/") - 1
url = substr($0, i, j)
}
next
}
/ | / { if (in_table_row == 1) {
i = index($0, " | ") + 4
j = index(substr($0, i), " | ") - 1
episode = substr($0, i, j)
}
next
}
// { if (in_table_row == 1) {
i = index($0, "") + 8
j = index(substr($0, i), "") - 1
title = substr($0, i, j)
do {
i = match(title, /[0-2][0-9][0-9];/)
if (i != 0) {
j = substr(title, i + 2, 3) * 1
title = substr(title, 1, i - 1) sprintf("%c", j) substr(title, i + 6)
}
} while(i != 0)
}
next
}
/<\/tr>/ { if (in_table_row == 1) {
if (episode != "") {
print title "#" SRC " " SRC " hosterlist " url "#http://atemio.dyndns.tv/mediathek/menu/s" PARAM2 "e" episode ".jpg#s" PARAM2 "e" episode ".jpg#" NAME "#0"
title = ""
url = ""
episode = ""
}
in_table_row = 0
}
next
}
// { sub(//, "", $0)
}
' >/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
url = ""
title = ""
}
/Hoster dieser Episode<\/h3>/ { 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, " ") + 8
j = index(substr($0, i), "") - 1
title = substr($0, i, j)
i = index($0, " ") + 8
j = index(substr($0, i), " -") - 1
pic = substr($0, i, j)
pic = tolower(pic)
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()
{
$curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME '
BEGIN { in_hosterlist = 0
url = ""
title = ""
}
/