source: titan/mediathek/localparser_secret/movie4k.sh @ 40917

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

fix

  • Property svn:executable set to *
File size: 11.2 KB
Line 
1#!/bin/sh
2# first sh box parser for titannit mfg obi
3
4. /tmp/localhoster/hoster.sh
5
6#SRC=$1
7#INPUT=$2
8#PAGE=$3
9#NEXT=$4
10#
11#FILENAME=`echo $PAGE | tr '/' '.'`
12#FILENAME=`echo $FILENAME | tr '&' '.'`
13#
14#if [ -z "$PAGE" ]; then
15#       FILENAME=none
16#fi
17
18SRC=$1
19INPUT=$2
20PAGE=$3
21NEXT=$4
22PAGE2=$5
23PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
24
25FILENAME="$PARSER $INPUT $PAGE $NEXT $PAGE2"
26FILENAME=`echo $FILENAME | tr '&' '.' | tr '/' '.' | tr '?' '.'  | tr '=' '.' | sed 's/ \+/./g' | sed 's/\.\+/./g'`
27
28if [ -z "$FILENAME" ]; then
29        FILENAME=none
30fi
31
32URL=http://movie4k.to
33PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
34NAME=Movie4k
35
36mkdir $TMP > /dev/null 2>&1
37
38if [ `echo $SRC | grep ^"/mnt/parser" | wc -l` -gt 0 ];then
39        TYPE="$SRC - Shell script"
40elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then
41        TYPE="Swap - Shell script"
42elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then
43        TYPE="Mnt - Shell script"
44else
45        TYPE="Flash - Shell script"
46fi
47
48init()
49{
50        rm -rf $TMP > /dev/null 2>&1
51        echo "$NAME ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0"
52}
53
54mainmenu()
55{
56        echo "Kino#$SRC $SRC kino 'index.php?lang=de'#http://atemio.dyndns.tv/mediathek/menu/kino.jpg#kino.jpg#$NAME#0" >$TMP/$FILENAME.list
57        echo "Movies (A-Z)#$SRC $SRC sorted#http://atemio.dyndns.tv/mediathek/menu/Movies.jpg#Movies.jpg#$NAME#0" >>$TMP/$FILENAME.list
58        echo "Movies (Genre)#$SRC $SRC genre#http://atemio.dyndns.tv/mediathek/menu/Movies.genre.jpg#Movies.genre.jpg#$NAME#0" >>$TMP/$FILENAME.list
59        echo "Search#$SRC $SRC search 'movies.php?list=search&search=%search%'#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >>$TMP/$FILENAME.list
60        echo "$TMP/$FILENAME.list"
61}
62
63genre()
64{
65        watchlist="
66                movies-genre-1-Action.html
67                movies-genre-58-Adult.html
68                movies-genre-4-Adventure.html
69                movies-genre-5-Animation.html
70                movies-genre-6-Biography.html
71                movies-genre-27-Bollywood.html
72                movies-genre-3-Comedy.html
73                movies-genre-7-Crime.html
74                movies-genre-8-Documentary.html
75                movies-genre-2-Drama.html
76                movies-genre-9-Family.html
77                movies-genre-10-Fantasy.html
78                movies-genre-13-History.html
79                movies-genre-14-Horror.html
80                movies-genre-15-Music.html
81                movies-genre-56-Musical.html
82                movies-genre-17-Mystery.html
83                movies-genre-26-Other.html
84                movies-genre-59-Reality-TV.html
85                movies-genre-20-Romance.html
86                movies-genre-21-Sci-Fi.html
87                movies-genre-55-Short.html
88                movies-genre-22-Sport.html
89                movies-genre-23-Thriller.html
90                movies-genre-24-War.html
91                movies-genre-25-Western.html
92                "
93        rm $TMP/$FILENAME.list > /dev/null 2>&1
94
95        for ROUND0 in $watchlist; do
96                TITLE=`echo $ROUND0 | cut -d"-" -f4 | sed 's/.html//'`
97                NUMMER=`echo $ROUND0 | cut -d"-" -f3`
98
99                filename=`echo $TITLE | tr [A-Z] [a-z]`
100                echo "$TITLE#$SRC $SRC search 'movies-genre-$NUMMER-' 1 '.html'#http://atemio.dyndns.tv/mediathek/menu/$filename.jpg#$filename.jpg#$NAME#0" >> $TMP/$FILENAME.list
101        done
102        echo "$TMP/$FILENAME.list"
103}
104
105sorted()
106{
107        watchlist="0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
108
109        rm $TMP/$FILENAME.list > /dev/null 2>&1
110
111        for ROUND0 in $watchlist; do
112                TITLE=`echo $ROUND0`
113                filename=`echo $TITLE | tr [A-Z] [a-z]`
114                echo "$TITLE#$SRC $SRC search 'movies-all-$ROUND0-' 1 '.html'#http://atemio.dyndns.tv/mediathek/menu/$filename.jpg#$filename.jpg#$NAME#0" >> $TMP/$FILENAME.list
115        done
116        echo "$TMP/$FILENAME.list"
117}
118
119search()
120{
121        if [ ! -e "$TMP/$FILENAME.list" ]; then
122                piccount=0
123
124                $curlbin $URL/$PAGE$NEXT$PAGE2 -o $TMP/cache.$FILENAME.1
125
126                pages=`cat $TMP/cache.$FILENAME.1 | grep $PAGE | sed "s/$PAGE/\n$PAGE/g" | cut -d ">" -f2 | cut -d "<" -f1 | tail -n1`
127                cat $TMP/cache.$FILENAME.1 | tr '\n' ' ' | sed 's!tablemoviesindex!\ntablemoviesindex!g' | grep ^"tablemoviesindex" | sed 's!coverPreview!\ncoverPreview!g' | grep ^"coverPreview" | grep 'id="tdmovies"' >$TMP/cache.$FILENAME.2
128
129                while read -u 3 ROUND; do
130                        ID=`echo $ROUND | cut -d'"' -f1 | tail -n1`
131#                       PIC=`echo $ROUND | sed 's!"url": !\nurl=!g' | grep ^url= | cut -d'"' -f2 | tail -n1`
132                        TITLE=`echo $ROUND | sed 's!<a href=!\nfound=>!g' | grep ^found= | cut -d">" -f3 | cut -d"<" -f1`
133                        NEWPAGE=`echo $ROUND | sed 's!<a href=!\nfound=!g' | grep ^found= | cut -d'"' -f2 | tail -n1`
134       
135                        if [ ! -z "$NEWPAGE" ]; then
136                                if [ -z "$TITLE" ];then
137                                        TITLE=`echo $TMPURL`
138                                fi
139                                TMPURL="$URL"/$TMPURL
140                        fi
141#echo 3333333   bremst
142#                       PIC=`cat $TMP/cache.$PARSER.$INPUT.$NEXT.$FILENAME.1 | tr '\n' '\r' |  tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed 's/ \+/ /g' | sed "s/$ID/\n$ID/g" | grep ^"$ID"'").hover' | sed "s#img src=#\nfound=#g" | grep ^"found=" | cut -d"'" -f2 | head -n1`
143                        PIC=`cat $TMP/cache.$FILENAME.1 | tr '\n' ' ' | sed "s/$ID/\n$ID/g" | grep ^"$ID"'").hover' | sed "s#img src=#\nfound=#g" | grep ^"found=" | cut -d"'" -f2 | head -n1`
144
145                        if [ `echo $ROUND | grep us_ger_small.png | wc -l` -eq 1 ]; then
146                                LANG=" (de)"
147                        elif [ `echo $ROUND | grep us_flag_small.png | wc -l` -eq 1 ]; then
148                                LANG=" (en)"
149                        else
150                                LANG=" (??)"
151                        fi
152       
153#                       if [ `echo $TMPURL | grep "online-serie-" | wc -l` -eq 1 ]; then
154#                               STREAMTYPE="40"
155#                       else
156#                               STREAMTYPE="34"
157#                       fi
158       
159                        if [ -z "$PIC" ]; then
160                                PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
161                        fi
162       
163                        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;/\C3x/g' -e 's/&ndash;/-/g' -e 's/&Auml;/\C3/g' -e 's/&Uuml;/\C3S/g' -e 's/&Ouml;/\C3/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/\C3/g' -e 's/%D6/\C3/g' -e 's/%DC/\C3S/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'`
164       
165                        if [ ! -z "$TITLE" ] && [ ! -z "$TMPURL" ];then
166                                if [ ! -e $TMP/$FILENAME.list ];then
167                                        touch $TMP/$FILENAME.list
168                                fi
169                                piccount=`expr $piccount + 1`
170#                               LINE="$TITLE#$SRC $SRC list '$TMPURL'#$PIC#$PARSER_$piccount.jpg#$NAME#0"
171#                               LINE="$TITLE $LANG#$TMPURL#$PIC#$PARSER_$piccount.jpg#$NAME#14"
172#                               LINE="$TITLE $LANG#$TMPURL#$PIC#$PARSER_$piccount.jpg#$NAME#$STREAMTYPE"
173#                               LINE="$TITLE $LANG#$TMPURL#$PIC#$PARSER_$piccount.jpg#$NAME#34"
174                                LINE="$TITLE $LANG#$SRC $SRC hosterlist $NEWPAGE#$PIC#$PARSER.$INPUT.$NEXT.$PAGE2.$FILENAME.$piccount.jpg#$NAME#0"
175       
176                                echo "$LINE" >> $TMP/$FILENAME.list
177                        fi
178       
179                done 3<$TMP/cache.$FILENAME.2
180                rm $TMP/cache.* > /dev/null 2>&1
181                if [ "$NEXT" -lt "$pages" ]; then
182                        NEXTPAGE=`expr $NEXT + 1`
183                        LINE="Page ($NEXTPAGE/$pages)#$SRC $SRC search '$PAGE' $NEXTPAGE '$PAGE2'#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#$NAME#0"
184                        echo "$LINE" >> $TMP/$FILENAME.list
185                fi
186                rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
187        fi
188        echo "$TMP/$FILENAME.list"
189}
190
191
192kino()
193{
194        if [ -e "$TMP/$FILENAME.list" ] ; then
195                rm $TMP/$FILENAME.list
196        fi
197
198        piccount=0
199#       /tmp/localhoster/hoster.sh get $URL/$PAGE > $TMP/cache.$PARSER.$INPUT.1
200        $curlbin "$URL/$PAGE" -o "$TMP/cache.$FILENAME.1"
201        cat $TMP/cache.$FILENAME.1 | grep ^"<a href=" | grep "<img src=" >$TMP/cache.$FILENAME.2
202
203        while read -u 3 ROUND; do
204                ID=`echo $ROUND | cut -d'"' -f1 | tail -n1`
205                PIC=`echo $ROUND | sed 's!<img src=!\nurl=!g' | grep ^url= | cut -d'"' -f2 | tail -n1`
206                TITLE=`echo $ROUND | sed 's!title=!\nfound=>!g' | grep ^found= | cut -d'"' -f2 | tail -n1 | sed 's/ kostenlos//'`
207                NEWPAGE=`echo $ROUND | sed 's!<a href=!\nfound=!g' | grep ^found= | cut -d'"' -f2 | tail -n1`
208
209#echo ID $ID
210#echo PIC $PIC
211#echo TITLE $TITLE
212#echo NEWPAGE $NEWPAGE
213
214                if [ -z "$PIC" ]; then
215                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
216                fi
217
218                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;/\C3x/g' -e 's/&ndash;/-/g' -e 's/&Auml;/\C3/g' -e 's/&Uuml;/\C3S/g' -e 's/&Ouml;/\C3/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/\C3/g' -e 's/%D6/\C3/g' -e 's/%DC/\C3S/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'`
219
220                if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then
221                        if [ ! -e $TMP/$FILENAME.list ];then
222                                touch $TMP/$FILENAME.list
223                        fi
224                        piccount=`expr $piccount + 1`
225                        LINE="$TITLE#$SRC $SRC hosterlist $NEWPAGE#$PIC#$PARSER.$INPUT.$NEXT.$PAGE2.$FILENAME.$piccount.jpg#$NAME#0"
226
227                        echo "$LINE" >> $TMP/$FILENAME.list
228                fi
229
230        done 3<$TMP/cache.$FILENAME.2
231        rm $TMP/cache.* > /dev/null 2>&1
232
233        echo "$TMP/$FILENAME.list"
234}
235
236hosterlist()
237{
238        if [ -e "$TMP/$FILENAME.list" ] ; then
239                rm $TMP/$FILENAME.list
240        fi
241#       $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$INPUT.1 -A 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.7.3000 Chrome/30.0.1599.101 Safari/537.36'
242        /tmp/localhoster/hoster.sh get $URL/$PAGE > $TMP/cache.$FILENAME.1
243
244        cat $TMP/cache.$FILENAME.1 | grep ^"links\[" >$TMP/cache.$FILENAME.2
245
246        while read -u 3 ROUND; do
247                NEWPAGE="`echo $ROUND | cut -d '"' -f9 | sed 's/;/%3B/g'`"
248                TITLE=`echo $ROUND | sed 's!&nbsp;!\nfound=<!g' | grep ^"found=<" | cut -d"<" -f2`             
249       
250                if [ ! -z "$TITLE" ] && [ "$TITLE" != " " ] && [ ! -z "$NEWPAGE" ];then
251                        PIC=`echo $TITLE | tr [A-Z] [a-z] | cut -d"." -f1 | sed 's/streamclou/streamcloud/'`
252#                       LINE="$TITLE#$SRC $SRC hoster $NEWPAGE '--referer $URL/$PAGE'#http://atemio.dyndns.tv/mediathek/menu/$PIC.jpg#$PIC.jpg#$NAME#111"
253                        LINE="$TITLE#$SRC $SRC hoster $NEWPAGE#http://atemio.dyndns.tv/mediathek/menu/$PIC.jpg#$PIC.jpg#$NAME#111"
254
255#                       LINE="$TITLE#$URL/$NEWPAGE#http://atemio.dyndns.tv/mediathek/menu/$PIC.jpg#$PIC.jpg#$NAME#41"
256
257                        echo "$LINE" >> $TMP/$FILENAME.list
258                fi
259        done 3<$TMP/cache.$FILENAME.2
260#       rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
261        echo "$TMP/$FILENAME.list"
262}
263
264hoster()
265{
266        rm $TMP/$TMP/cache.$FILENAME.* > /dev/null 2>&1
267#       $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$INPUT.1 -A 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.7.3000 Chrome/30.0.1599.101 Safari/537.36'
268        /tmp/localhoster/hoster.sh get $URL/$PAGE > $TMP/cache.$FILENAME.1
269
270        STREAMURL=`cat $TMP/cache.$FILENAME.1 | sed 's!<a target="_blank" href="!\nstreamurl="!' | grep ^streamurl= | cut -d'"' -f2`
271
272        if [ `echo $STREAMURL | grep ^http | wc -l` -eq 0 ]; then
273#               <iframe src="//www.rapidvideo.com/e/FIW59O2DED" width="730" height="460" frameborder="0" scrolling="no"></iframe><BR> <div id="underplayer">
274                STREAMURL=`cat $TMP/cache.$FILENAME.1 | sed 's!<iframe src="!\nstreamurl="!' | grep ^streamurl= | cut -d'"' -f2 | tr ' ' '\n' | head -n1`
275        fi
276
277#       STREAMURL=`cat $TMP/cache.$PARSER.$INPUT.1 | sed 's!<a target="_blank" href="!\nstreamurl="!' | grep ^streamurl= | cut -d'"' -f2`
278#       rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
279        echo $STREAMURL
280}
281
282
283case $INPUT in
284        init) $INPUT;;
285        mainmenu) $INPUT;;
286        hosterlist) $INPUT;;
287        hoster) $INPUT;;
288        search) $INPUT;;
289        kino) $INPUT;;
290        sorted) $INPUT;;
291        genre) $INPUT;;
292esac
Note: See TracBrowser for help on using the repository browser.