source: titan/mediathek/localparser_secret/thesolarmovie.sh @ 38252

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

[tithek] tithek update localparser thesolar

  • Property svn:executable set to *
File size: 6.2 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
8FROM=$3
9PAGE=$4
10NEXT=$5
11
12FILENAME=`echo $PAGE | tr '/' '.'`
13FILENAME=`echo $FILENAME | tr '&' '.'`
14
15if [ -z "$PAGE" ]; then
16        FILENAME=none
17fi
18
19URL=http://www.thesolarmovie.me
20PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
21NAME=TheSolarMovie
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 "Category#$SRC $SRC category#http://atemio.dyndns.tv/mediathek/menu/category.jpg#category.jpg#$NAME#0" > $TMP/$PARSER.$INPUT.list
44        echo "$TMP/$PARSER.$INPUT.list"
45}
46
47category()
48{
49        echo "Movies (Year)#$SRC $SRC movieyear#http://atemio.dyndns.tv/mediathek/menu/movie.year.jpg#movie.year.jpg#$NAME#0" > $TMP/$PARSER.$INPUT.list
50        echo "Movies (Genre)#$SRC $SRC moviegenre#http://atemio.dyndns.tv/mediathek/menu/movie.genre.jpg#movie.genre.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
51        echo "Series#$SRC $SRC page category 'free/tv-series/page/' 1#http://atemio.dyndns.tv/mediathek/menu/series.jpg#series.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
52        echo "$TMP/$PARSER.$INPUT.list"
53}
54
55movieyear()
56{
57        rm $TMP/$PARSER.$INPUT.list > /dev/null 2>&1
58
59        WATCHLIST="tag/movies"
60
61        if [ ! -e "/tmp/tithek/$PARSER.$INPUT.list" ]; then
62                for ROUND0 in $WATCHLIST; do
63                        tags=""
64                        tagcount=`date +"%Y"`
65                        i=1950
66                        until [ "$i" -gt "$tagcount" ]
67                        do
68                        echo "$i#$SRC $SRC page category '$ROUND0-$i/page/' 1#http://atemio.dyndns.tv/mediathek/menu/$i.jpg#$i.jpg#$NAME#0" | sort -r >> $TMP/$PARSER.$INPUT.list
69                        i=`expr $i + 1`
70                        done
71                done
72        fi
73
74        echo "$TMP/$PARSER.$INPUT.list"
75}
76
77moviegenre()
78{
79        watchlist="
80                free/action
81                free/adventure
82                free/animation
83                free/biography
84                free/comedy
85                free/crime
86                free/documentary
87                free/drama
88                free/family
89                free/history
90                free/horror
91                free/music
92                free/mystery
93                free/romance
94                free/sci-fi
95                free/sport
96                free/thriller
97                free/war
98                free/western
99                "
100        rm $TMP/$PARSER.$INPUT.list > /dev/null 2>&1
101
102        for ROUND0 in $watchlist; do
103                TITLE=`echo $ROUND0 | tr '/' '-' | sed 's/free-//g'`
104                filename=`echo $TITLE` 
105                echo "$TITLE#$SRC $SRC page category '$ROUND0/page/' 1#http://atemio.dyndns.tv/mediathek/menu/$filename.jpg#$filename.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
106        done
107        echo "$TMP/$PARSER.$INPUT.list"
108}
109
110page()
111{
112        if [ ! -e "$TMP/$PARSER.$INPUT.$FROM.$NEXT.$FILENAME.list" ]; then
113                piccount=0
114                $curlbin $URL/$PAGE/$NEXT -o $TMP/cache.$PARSER.$FROM.$NEXT.$FILENAME.1
115                cat $TMP/cache.$PARSER.$FROM.$NEXT.$FILENAME.1 | tr '\n' '\r' |  tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed 's/ \+/ /g' | sed 's/<a class="coverImage"/\nfound=/g' | grep ^found=  | sed 's/data-original/\r\n/g' | tr ' ' '~' >$TMP/cache.$PARSER.$FROM.$NEXT.$FILENAME.2
116
117                pages=`cat $TMP/cache.$PARSER.$FROM.$NEXT.$FILENAME.1 | grep "<span class='pages'>" | sed 's! of !\npage<!' | grep ^"page<" | cut -d'<' -f2`
118                while read -u 3 ROUND; do
119                        TITLE=`echo $ROUND | cut -d '"' -f2 | tr '~' ' ' | sed 's/#/%/'`
120                        if [ `echo $TITLE | grep ^"//" | wc -l` -eq 0 ];then
121                                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/|/ /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'`
122                                NEWPAGE=`echo $ROUND | sed s'!href=!\nhref=!' | grep ^"href=" | cut -d '"' -f2 | tr '~' ' '`
123                                PIC=http:`echo $ROUND | sed s'!src=!\nsrc=!' | grep ^"src=" | cut -d '"' -f2 | tr '~' ' '`
124                       
125                                if [ -z "$PIC" ] || [ "$PIC" = "http:" ]; then 
126                                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
127                                fi
128                       
129                                if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then
130                                        if [ ! -e $TMP/$PARSER.$INPUT.$FROM.$NEXT.$FILENAME.list ];then
131                                                touch $TMP/$PARSER.$INPUT.$FROM.$NEXT.$FILENAME.list
132                                        fi
133                                        piccount=`expr $piccount + 1`
134                                        LINE="$TITLE#$SRC $SRC hosterlist page $NEWPAGE#$PIC#$PARSER.$FILENAME.$NEXT.$piccount.jpg#$NAME#0"
135
136                                        echo "$LINE" >> $TMP/$PARSER.$INPUT.$FROM.$NEXT.$FILENAME.list
137                                fi
138                        fi
139                done 3<$TMP/cache.$PARSER.$FROM.$NEXT.$FILENAME.2
140
141                if [ "$NEXT" -lt "$pages" ]; then
142                        NEXTPAGE=`expr $NEXT + 1`
143                        LINE="Page ($NEXTPAGE/$pages)#$SRC $SRC page category '$PAGE' $NEXTPAGE#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#$NAME#0"
144                        echo "$LINE" >> $TMP/$PARSER.$INPUT.$FROM.$NEXT.$FILENAME.list
145                fi
146                rm $TMP/cache.* > /dev/null 2>&1
147        fi
148        echo "$TMP/$PARSER.$INPUT.$FROM.$NEXT.$FILENAME.list"
149}
150
151hosterlist()
152{
153        piccount=0
154        $curlbin $PAGE -o $TMP/cache.$PARSER.$FROM.$NEXT.$FILENAME.1
155        cat $TMP/cache.$PARSER.$FROM.$NEXT.$FILENAME.1 | tr '\n' '\r' |  tr '\r' ' ' | tr '\n' ' ' | sed 's/<tr id="link_/\nfound=/g' | sed 's!</tbody>!\n!g' | grep ^found= >$TMP/cache.$PARSER.$FROM.$NEXT.$FILENAME.2
156
157        while read -u 3 ROUND; do
158                NEWPAGE=`echo $ROUND | sed s'!go.php?url=!\nurl="!' | grep ^'url="' | cut -d '"' -f2`
159                TITLE=`echo $ROUND | sed s'!target="_blank">!\nurl=<!' | grep ^'url=<' | cut -d '<' -f2`
160                if [ ! -z "$TITLE" ] && [ "$TITLE" != " " ] && [ ! -z "$NEWPAGE" ];then
161                        PIC=`echo $TITLE | tr [A-Z] [a-z]`
162                        LINE="$TITLE#$SRC $SRC hoster page $NEWPAGE $NEWPAGE#http://atemio.dyndns.tv/mediathek/menu/$PIC#$PIC.jpg#$NAME#111"
163                        echo "$LINE" >> $TMP/$PARSER.$INPUT.$FROM.$NEXT.$FILENAME.list
164                fi
165        done 3<$TMP/cache.$PARSER.$FROM.$NEXT.$FILENAME.2
166        rm $TMP/cache.* > /dev/null 2>&1
167        echo "$TMP/$PARSER.$INPUT.$FROM.$NEXT.$FILENAME.list"
168}
169
170hoster()
171{
172        echo $PAGE
173}
174
175case $INPUT in
176        init) $INPUT;;
177        mainmenu) $INPUT;;
178        category) $INPUT;;
179        moviegenre) $INPUT;;
180        movieyear) $INPUT;;
181        page) $INPUT;;
182        hosterlist) $INPUT;;
183        hoster) $INPUT;;
184esac
Note: See TracBrowser for help on using the repository browser.