source: titan/mediathek/localparser_secret/meinkino.sh @ 40059

Last change on this file since 40059 was 40059, checked in by obi, 7 years ago

optimite meinkin

  • Property svn:executable set to *
File size: 7.5 KB
Line 
1#!/bin/sh
2# first sh box parser for titannit mfg obi
3
4. /tmp/localhoster/hoster.sh
5
6SRC=$1
7INPUT=$2
8PAGE=$3
9NEXT=$4
10PAGE2=$5
11PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
12
13FILENAME="$PARSER $INPUT $PAGE $NEXT $PAGE2"
14FILENAME=`echo $FILENAME | tr '&' '.' | tr '/' '.' | tr '?' '.'  | tr '=' '.' | sed 's/ \+/./g' | sed 's/\.\+/./g'`
15
16if [ -z "$PAGE" ]; then
17        FILENAME=none
18fi
19
20URL=http://meinkino.to
21NAME=MeinKino
22
23mkdir $TMP > /dev/null 2>&1
24
25if [ `echo $SRC | grep ^"/mnt/parser" | wc -l` -gt 0 ];then
26        TYPE="$SRC - Shell script"
27elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then
28        TYPE="Swap - Shell script"
29elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then
30        TYPE="Mnt - Shell script"
31else
32        TYPE="Flash - Shell script"
33fi
34
35init()
36{
37        rm -rf $TMP > /dev/null 2>&1
38        echo "$NAME ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0"
39}
40
41mainmenu()
42{
43        echo "Kino#$SRC $SRC search 'filme/' 1 '/?order=veroeffentlichung'#http://atemio.dyndns.tv/mediathek/menu/kino.ger.jpg#kino.ger.jpg#$NAME#0" >$TMP/$FILENAME.list
44        echo "Letze Uploads#$SRC $SRC search 'filme/' 1 '/?order=neu'#http://atemio.dyndns.tv/mediathek/menu/last.updates.ger.jpg#last.updates.ger.jpg#$NAME#0" >>$TMP/$FILENAME.list
45        echo "Alle Filme#$SRC $SRC search 'filme/' 1 '/'#http://atemio.dyndns.tv/mediathek/menu/Movies.jpg#Movies.jpg#$NAME#0" >>$TMP/$FILENAME.list
46        echo "Alle Serien#$SRC $SRC search 'tv/' 1 '/'#http://atemio.dyndns.tv/mediathek/menu/Movies.jpg#Movies.jpg#$NAME#0" >>$TMP/$FILENAME.list
47        echo "Genre#$SRC $SRC genre#http://atemio.dyndns.tv/mediathek/menu/genre.jpg#genre.jpg#$NAME#0" >>$TMP/$FILENAME.list
48#       echo "A-Z#$SRC $SRC sorted#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#0" >>$TMP/$FILENAME.list
49        echo "Suchen#$SRC $SRC search 'alle/' 1 '/?suche=%search%'#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >>$TMP/$FILENAME.list
50        echo "$TMP/$FILENAME.list"
51}
52
53genre()
54{
55        watchlist="
56                abenteuer-filme
57                action-filme
58                animation-filme
59                dokumentarfilm-filme
60                drama-filme
61                familie-filme
62                fantasy-filme
63                foreign-filme
64                historie-filme
65                horror-filme
66                komoedie-filme
67                kriegsfilm-filme
68                krimi-filme
69                lovestory-filme
70                musik-filme
71                mystery-filme
72                science-fiction-filme
73                tv-film-filme
74                thriller-filme
75                western-filme
76                "
77        rm $TMP/$FILENAME.list > /dev/null 2>&1
78
79        for ROUND0 in $watchlist; do
80                TITLE=`echo $ROUND0 | tr '/' '-' | sed 's/-filme//g'`
81                filename=`echo $TITLE` 
82                echo "$TITLE#$SRC $SRC search 'genre/$ROUND0/' 1#http://atemio.dyndns.tv/mediathek/menu/$filename.jpg#$filename.jpg#$NAME#0" >> $TMP/$FILENAME.list
83        done
84        echo "$TMP/$FILENAME.list"
85}
86
87search()
88{
89        if [ -z "$NEXT" ]; then NEXT="search"; fi
90
91#       if [ -e "$TMP/$FILENAME.list" ] ; then
92#               rm $TMP/$FILENAME.list
93#       fi
94
95        if [ ! -e "$TMP/$FILENAME.list" ]; then
96                piccount=0
97
98                $curlbin $URL/$PAGESTART/$PAGE$NEXT$PAGE2 -o $TMP/cache.1
99                cat $TMP/cache.1 | tr '\n' ' ' | sed 's/<div class="ml-description-top">/\nfound=/g' | grep ^found= >$TMP/cache.2
100       
101#               <li class="active">1</li><li><a href="http://meinkino.to/filme/2?order=veroeffentlichung&type=filme" data-ci-pagination-page="2">2</a></li><li><a href="http://meinkino.to/filme/3?order=veroeffentlichung&type=filme" data-ci-pagination-page="3">3</a></li><li><a href="http://meinkino.to/filme/2?order=veroeffentlichung&type=filme" data-ci-pagination-page="2" rel="next">&gt;</a></li><li><a href="http://meinkino.to/filme/87?order=veroeffentlichung&type=filme" data-ci-pagination-page="87">Letzte &rsaquo;</a></li> </ul>
102                pages=`cat $TMP/cache.1 | grep data-ci-pagination-page | sed 's/data-ci-pagination-page=/\nfound=/g' |grep ^found= | cut -d'"' -f2 | tail -n1`
103       
104                while read -u 3 ROUND; do
105                        PIC=`echo $ROUND | sed 's!<img src=!\nurl=!g' | grep ^url= | cut -d'"' -f2 | tail -n1`
106                        TITLE=`echo $ROUND | sed 's!class="ml-name">!\ntitle=<!g' | grep ^title= | sed 's/<span class="mark-wc">//g' | sed 's!</span>!!g' | cut -d'<' -f2`
107                        NEWPAGE=`echo $ROUND | sed 's!<a href=!\nnewpage=!g' | grep ^newpage= | cut -d'"' -f2 | head -n1 | sed "s#$URL##"`
108       
109                        if [ -z "$PIC" ]; then
110                                PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
111                        fi
112       
113                        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'`
114       
115                        if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then
116                                if [ ! -e $TMP/$FILENAME.list ];then
117                                        touch $TMP/$FILENAME.list
118                                fi
119                                piccount=`expr $piccount + 1`
120                                LINE="$TITLE#$SRC $SRC hosterlist $NEWPAGE#$PIC#$FILENAME.$FILENAME.$NEXT.$piccount.jpg#$NAME#0"
121       
122                                echo "$LINE" >> $TMP/$FILENAME.list
123                        fi
124       
125                done 3<$TMP/cache.2
126       
127                if [ "$NEXT" -lt "$pages" ]; then
128                        NEXTPAGE=`expr $NEXT + 1`
129                        LINE="Page ($NEXTPAGE/$pages)#$SRC $SRC search '$PAGE' $NEXTPAGE '$PAGE2'#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#$NAME#0"
130                        echo "$LINE" >> $TMP/$FILENAME.list
131                fi
132       
133#               rm $TMP/cache.* > /dev/null 2>&1
134        fi
135        echo "$TMP/$FILENAME.list"
136}
137
138hosterlist()
139{
140        if [ -e "$TMP/$FILENAME.list" ] ; then
141                rm $TMP/$FILENAME.list
142        fi
143        $curlbin $URL/$PAGE -o $TMP/cache.$FILENAME.1
144        TMPURL=`cat $TMP/cache.$FILENAME.1 | sed 's/data-url-id=/\nfound=/g' | grep ^found= | cut -d'"' -f2`
145
146        TRAILER=`cat $TMP/cache.$FILENAME.1 | grep youtube | cut -d'"' -f2`
147
148#       $curlbin2 -H "X-Requested-With: XMLHttpRequest" -X POST  --referer http://meinkino.to/film/the-zero-theorem-stream-id8795 http://meinkino.to/geturl/8795
149        $curlbin2 -H "X-Requested-With: XMLHttpRequest" -X POST  --referer $URL/$PAGE $TMPURL -o $TMP/cache.$FILENAME.2
150
151        cat $TMP/cache.$FILENAME.2 | sed 's/link_/\nlink_/g' | grep ^link_ | sed 's/"alternative":{"/\nlink_/g' >$TMP/cache.$FILENAME.3
152
153        if [ ! -z "$TRAILER" ];then
154                ID=`echo $TRAILER | tr '=' '\n' | tail -n1`
155                TRAILERURL="https://www.youtube.com/get_video_info?el=leanback&cplayer=UNIPLAYER&cos=Windows&height=1080&cbr=Chrome&hl=en_US&cver=4&ps=leanback&c=TVHTML5&video_id=$ID&cbrver=40.0.2214.115&width=1920&cosver=6.1&ssl_stream=1"
156
157                LINE="Youtube TRAILER#$SRC $SRC play '$TRAILERURL'#http://atemio.dyndns.tv/mediathek/menu/youtube.jpg#$youtube.jpg#$NAME#111"
158                echo "$LINE" >> $TMP/$FILENAME.list
159        fi
160
161        while read -u 3 ROUND; do
162                NEWPAGE=`echo $ROUND | cut -d'"' -f3`
163                TITLE=`echo $ROUND | cut -d'"' -f1`             
164                EXTRA=`echo $ROUND | sed 's/"quality"/\nextra=/g' | grep ^extra= | cut -d'"' -f2`               
165                #"quality":"480"
166                if [ ! -z "$EXTRA" ];then
167                        TITLE="$TITLE ($EXTRA)"
168                fi
169
170                if [ ! -z "$TITLE" ] && [ "$TITLE" != " " ] && [ ! -z "$NEWPAGE" ];then
171                        PIC=`echo $TITLE | tr [A-Z] [a-z] | cut -d "_" -f2 | cut -d" " -f1`
172                        LINE="$TITLE#$SRC $SRC play '$NEWPAGE'#http://atemio.dyndns.tv/mediathek/menu/$PIC.jpg#$PIC.jpg#$NAME#111"
173                        echo "$LINE" >> $TMP/$FILENAME.list
174                fi
175        done 3<$TMP/cache.$FILENAME.3
176#       rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
177        echo "$TMP/$FILENAME.list"
178}
179
180play()
181{
182        URL="gethoster2 $PAGE"
183        echo "$URL"
184}
185
186case $INPUT in
187        init) $INPUT;;
188        mainmenu) $INPUT;;
189        hosterlist) $INPUT;;
190        play) $INPUT;;
191        search) $INPUT;;
192        genre) $INPUT;;
193esac
Note: See TracBrowser for help on using the repository browser.