source: titan/mediathek/localparser_secret/streamlive.sh @ 43007

Last change on this file since 43007 was 42594, checked in by obi, 6 years ago

didable remove cooke on tithek start

  • Property svn:executable set to *
File size: 3.8 KB
Line 
1#!/bin/sh
2# first sh box parser for titannit mfg obi
3
4case $2 in
5        init) echo skip load hoster.sh;;
6        *) . /tmp/localhoster/hoster.sh;;
7esac
8
9SRC=$1
10INPUT=$2
11FROM=$3
12PAGE=$4
13
14FILENAME=`echo $PAGE | tr '/' '.'`
15FILENAME=`echo $FILENAME | tr '&' '.'`
16
17if [ -z "$PAGE" ]; then
18        FILENAME=none
19fi
20
21URL=www.streamlive.to
22PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
23NAME=StreamLive
24
25mkdir $TMP > /dev/null 2>&1
26
27if [ `echo $SRC | grep ^"/mnt/parser" | wc -l` -gt 0 ];then
28        TYPE="$SRC - Shell script"
29elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then
30        TYPE="Swap - Shell script"
31elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then
32        TYPE="Mnt - Shell script"
33else
34        TYPE="Flash - Shell script"
35fi
36
37init()
38{
39#       if [ "$ARCH" != "sh4" ] || [ -e /etc/.beta ];then
40#               rm -f /mnt/network/cookies > /dev/null 2>&1
41                rm -rf $TMP > /dev/null 2>&1
42                echo "$NAME ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0"
43#       fi
44}
45
46mainmenu()
47{
48        echo "Category#$SRC $SRC category#http://atemio.dyndns.tv/mediathek/menu/category.jpg#category.jpg#$NAME#0" > $TMP/$PARSER.$INPUT.list
49        echo "$TMP/$PARSER.$INPUT.list"
50}
51
52category()
53{
54        if [ ! -e "/tmp/tithek/$PARSER.$INPUT.list" ]; then
55                tagcount=60
56                i=1
57                until [ "$i" -gt "$tagcount" ]
58                do
59                TITLE="Page $i"
60                echo "$TITLE#$SRC $SRC page category '?p=$i&q=&sort=1'#http://atemio.dyndns.tv/mediathek/menu/page.jpg#page.jpg#$NAME#0" >> /tmp/tithek/$PARSER.$INPUT.list
61                i=`expr $i + 1`
62                done
63        fi
64        echo "/tmp/tithek/$PARSER.$INPUT.list"
65}
66
67page()
68{
69        if [ ! -e "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list" ]; then
70                piccount=0
71
72                $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$FROM.$FILENAME.1
73
74                cat $TMP/cache.$PARSER.$FROM.$FILENAME.1 | tr '\n' '\r' |  tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed 's/ \+/ /g' | sed 's!<a href="http://www.streamlive.to/view/!\nhttp://www.streamlive.to/view/!g' | grep ^"http://www.streamlive.to/view/" | grep -v "<strong>" | grep -v "premium_only" >$TMP/cache.$PARSER.$FROM.$FILENAME.2
75
76                while read -u 3 ROUND; do
77
78                        URL=`echo $ROUND | cut -d'"' -f1`
79                        PIC=`echo $ROUND | sed 's!src="!\npic="!g' | grep ^pic= | cut -d'"' -f2 | tail -n1`
80                        TITLE=`echo $ROUND | sed 's!title="!\ntitle="!g' | grep ^title= | cut -d'"' -f2 | tail -n1`
81                        if [ -z "$TITLE" ];then
82                                TITLE=`echo $ROUND | cut -d"<" -f2 | cut -d">" -f2`
83                        fi
84
85                        if [ -z "$PIC" ] || [ "$PIC" = "http:" ]; then
86                                PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
87                        fi
88
89                        TITLE=`echo $URL | tr '/' '\n' | tail -n1 | sed 's/_/ /g'`
90                        TITLE=`echo $TITLE | sed -e 's/&#038;/&/g' -e 's/&amp;/und/g' -e 's/&quot;/"/g' -e 's/&lt;/\</g' -e 's/&#034;/\"/g' -e 's/&#039;/\"/g' -e 's/#034;/\"/g' -e 's/#039;/\"/g' -e 's/&szlig;/Ãx/g' -e 's/&ndash;/-/g' -e 's/&Auml;/Ã/g' -e 's/&Uuml;/ÃS/g' -e 's/&Ouml;/Ã/g' -e 's/&auml;/ä/g' -e 's/&uuml;/ü/g' -e 's/&ouml;/ö/g' -e 's/&eacute;/é/g' -e 's/&egrave;/è/g' -e 's/%F6/ö/g' -e 's/%FC/ü/g' -e 's/%E4/ä/g' -e 's/%26/&/g' -e 's/%C4/Ã/g' -e 's/%D6/Ã/g' -e 's/%DC/ÃS/g' -e 's/%28/(/g' -e 's/%29/)/g' -e 's/%3A/:/g' -e 's/%40/@/g' -e 's/%2B/&/g' -e 's/%C3/A/g' -e 's/%B1/&/g' -e 's/%5B//g' -e 's/%5D//g' -e 's!%2F!/!g' -e 's/|/ /g' -e 's/(/ /g' -e 's/)/ /g' -e 's/+/ /g' -e 's/\//-/g' -e 's/,/ /g' -e 's/;/ /g' -e 's/:/ /g' -e 's/\.\+/./g'`
91
92                        if [ ! -z "$TITLE" ] && [ ! -z "$URL" ];then
93                                if [ ! -e $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list ];then
94                                        touch $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
95                                fi
96                                piccount=`expr $piccount + 1`
97                                LINE="$TITLE#$URL#$PIC#$PARSER_$piccount.jpg#$NAME#91"
98                                echo "$LINE" >> $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
99                        fi
100
101                done 3<$TMP/cache.$PARSER.$FROM.$FILENAME.2
102                rm $TMP/cache.* > /dev/null 2>&1
103        fi
104        echo "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list"
105}
106
107case $INPUT in
108#       init) $INPUT;;
109        mainmenu) $INPUT;;
110        category) $INPUT;;
111        page) $INPUT;;
112esac
Note: See TracBrowser for help on using the repository browser.