1 | #!/bin/sh |
---|
2 | # first sh box parser for titannit mfg obi |
---|
3 | |
---|
4 | case $2 in |
---|
5 | init) echo skip load hoster.sh;; |
---|
6 | *) . /tmp/localhoster/hoster.sh;; |
---|
7 | esac |
---|
8 | |
---|
9 | #SRC=$1 |
---|
10 | #INPUT=$2 |
---|
11 | #PAGE=$3 |
---|
12 | #NEXT=$4 |
---|
13 | # |
---|
14 | #FILENAME=`echo $PAGE | tr '/' '.'` |
---|
15 | #FILENAME=`echo $FILENAME | tr '&' '.'` |
---|
16 | # |
---|
17 | #if [ -z "$PAGE" ]; then |
---|
18 | # FILENAME=none |
---|
19 | #fi |
---|
20 | |
---|
21 | SRC=$1 |
---|
22 | INPUT=$2 |
---|
23 | PAGE=$3 |
---|
24 | NEXT=$4 |
---|
25 | PAGE2=$5 |
---|
26 | PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'` |
---|
27 | |
---|
28 | FILENAME="$PARSER $INPUT $PAGE $NEXT $PAGE2" |
---|
29 | FILENAME=`echo $FILENAME | tr '&' '.' | tr '/' '.' | tr '?' '.' | tr '=' '.' | sed 's/ \+/./g' | sed 's/\.\+/./g'` |
---|
30 | |
---|
31 | if [ -z "$FILENAME" ]; then |
---|
32 | FILENAME=none |
---|
33 | fi |
---|
34 | |
---|
35 | URL=`cat /mnt/config/titan.cfg | grep tithek_kinox_url | grep -v "#" | cut -d "=" -f2` |
---|
36 | if [ -z "$URL" ];then |
---|
37 | URL=https://kinoxto.stream |
---|
38 | fi |
---|
39 | PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'` |
---|
40 | NAME=KinoX |
---|
41 | |
---|
42 | if [ `cat /mnt/config/titan.cfg | grep tithek_kinox_localhoster=1 | wc -l` -eq 1 ];then |
---|
43 | ACTIVEBIN="$curlbin" |
---|
44 | elif [ `cat /mnt/config/titan.cfg | grep tithek_kinox_localhoster=2 | wc -l` -eq 1 ];then |
---|
45 | ACTIVEBIN="$BIN /tmp/localhoster/cloudflare.py" |
---|
46 | else |
---|
47 | ACTIVEBIN="$curlbin" |
---|
48 | URL=`echo $URL | sed 's/https:/http:/'` |
---|
49 | fi |
---|
50 | |
---|
51 | mkdir $TMP > /dev/null 2>&1 |
---|
52 | |
---|
53 | if [ `echo $SRC | grep ^"/mnt/parser" | wc -l` -gt 0 ];then |
---|
54 | TYPE="$SRC - Shell script" |
---|
55 | elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then |
---|
56 | TYPE="Swap - Shell script" |
---|
57 | elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then |
---|
58 | TYPE="Mnt - Shell script" |
---|
59 | else |
---|
60 | TYPE="Flash - Shell script" |
---|
61 | fi |
---|
62 | |
---|
63 | init() |
---|
64 | { |
---|
65 | rm -rf $TMP > /dev/null 2>&1 |
---|
66 | echo "$NAME ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0" |
---|
67 | } |
---|
68 | |
---|
69 | mainmenu() |
---|
70 | { |
---|
71 | echo "Kino#$SRC $SRC kino 'Kino-filme.html'#http://atemio.dyndns.tv/mediathek/menu/Cine-Films.jpg#Cine-Films.jpg#$NAME#0" >$TMP/$FILENAME.list |
---|
72 | echo "Movie (A-Z)#$SRC $SRC sorted movie#http://atemio.dyndns.tv/mediathek/menu/a-z.jpg#a-z.jpg#$NAME#0" >>$TMP/$FILENAME.list |
---|
73 | echo "Tv (A-Z)#$SRC $SRC sorted series#http://atemio.dyndns.tv/mediathek/menu/a-z.jpg#a-z.jpg#$NAME#0" >>$TMP/$FILENAME.list |
---|
74 | echo "Doku (A-Z)#$SRC $SRC sorted documentation#http://atemio.dyndns.tv/mediathek/menu/a-z.jpg#a-z.jpg#$NAME#0" >>$TMP/$FILENAME.list |
---|
75 | echo "Actor (A-Z)#$SRC $SRC sorted actor#http://atemio.dyndns.tv/mediathek/menu/a-z.jpg#a-z.jpg#$NAME#0" >>$TMP/$FILENAME.list |
---|
76 | echo "Director (A-Z)#$SRC $SRC sorted director#http://atemio.dyndns.tv/mediathek/menu/a-z.jpg#a-z.jpg#$NAME#0" >>$TMP/$FILENAME.list |
---|
77 | echo "Search#http://atemio.dyndns.tv/mediathek/youtube/streams/kinox.all-sorted.list#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#KinoX#21" >>$TMP/$FILENAME.list |
---|
78 | echo "Search Cast#http://atemio.dyndns.tv/mediathek/youtube/streams/kinox.all-sorted.list#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search10.jpg#KinoX#31" >>$TMP/$FILENAME.list |
---|
79 | echo "$TMP/$FILENAME.list" |
---|
80 | } |
---|
81 | |
---|
82 | |
---|
83 | #https://www.kinos.to/aGET/List/?sEcho=2&iColumns=7&sColumns=&iDisplayStart=@NEXT@&iDisplayLength=25&iSortingCols=1&iSortCol_0=2&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fType%22%3A%22movie%22%2C%22Length%22%3A60%2C%22fLetter%22%3A1%7D |
---|
84 | additional=%7B%22fType%22%3A%22$@PAGE2@%22%2C%22fLetter%22%3A%22$@PAGE@%22%7D |
---|
85 | |
---|
86 | #https://www.kinos.to/aGET/Actor/?sEcho=1&iColumns=2&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=1&sSortDir_0=asc&bSortable_0=true&bSortable_1=false&additional=%7B%22fLetter%22%3A%22B%22%2C%22fSex%22%3A%22%22%7D |
---|
87 | #https://www.kinos.to/aGET/Actor/?sEcho=1&iColumns=2&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=1&sSortDir_0=asc&bSortable_0=true&bSortable_1=false&additional=%7B%22fLetter%22%3A%22A%22%2C%22fSex%22%3A%22%22%7D |
---|
88 | #https://www.kinos.to/aGET/Director/?sEcho=1&iColumns=2&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=1&sSortDir_0=asc&bSortable_0=true&bSortable_1=false&additional=%7B%22fLetter%22%3A%22A%22%2C%22fSex%22%3A%22%22%7D |
---|
89 | #https://www.kinos.to/aGET/List/?sEcho=2&iColumns=7&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=2&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22Length%22%3A60%2C%22fLetter%22%3A1%2C%22fGenre%22%3A%226%22%7D |
---|
90 | #https://www.kinos.to/aGET/List/?sEcho=2&iColumns=7&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=2&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fType%22%3A%22movie%22%2C%22Length%22%3A60%2C%22fLetter%22%3A1%7D |
---|
91 | #https://www.kinos.to/aGET/List/?sEcho=2&iColumns=7&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=2&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fType%22%3A%22documentation%22%2C%22Length%22%3A60%2C%22fLetter%22%3A1%7D |
---|
92 | #https://www.kinos.to/aGET/List/?sEcho=2&iColumns=7&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=2&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fType%22%3A%22series%22%2C%22Length%22%3A60%2C%22fLetter%22%3A1%7D |
---|
93 | #https://www.kinos.to/aGET/List/?sEcho=3&iColumns=7&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=2&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fType%22%3A%22series%22%2C%22Length%22%3A60%2C%22fLetter%22%3A%22B%22%7D |
---|
94 | |
---|
95 | sorted() |
---|
96 | { |
---|
97 | |
---|
98 | if [ ! -e "$TMP/$FILENAME.list" ]; then |
---|
99 | watchlist="1 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" |
---|
100 | |
---|
101 | rm $TMP/$FILENAME.list > /dev/null 2>&1 |
---|
102 | |
---|
103 | for ROUND0 in $watchlist; do |
---|
104 | TITLE=`echo $ROUND0` |
---|
105 | if [ "$ROUND0" == "1" ];then |
---|
106 | TITLE="0-9" |
---|
107 | fi |
---|
108 | |
---|
109 | filename=`echo $TITLE | tr [A-Z] [a-z]` |
---|
110 | # echo "$TITLE#$SRC $SRC search '$ROUND0' 1 $PAGE#http://atemio.dyndns.tv/mediathek/menu/$filename.jpg#$filename.jpg#$NAME#0" >> $TMP/$FILENAME.list |
---|
111 | echo "$TITLE#$SRC $SRC search '$PAGE' 1 '$ROUND0'#http://atemio.dyndns.tv/mediathek/menu/$filename.jpg#$filename.jpg#$NAME#0" >> $TMP/$FILENAME.list |
---|
112 | |
---|
113 | done |
---|
114 | fi |
---|
115 | echo "$TMP/$FILENAME.list" |
---|
116 | } |
---|
117 | |
---|
118 | search() |
---|
119 | { |
---|
120 | #rm $TMP/cache.$FILENAME.* > /dev/null 2>&1 |
---|
121 | #rm $TMP/$FILENAME.list |
---|
122 | if [ ! -e "$TMP/$FILENAME.list" ]; then |
---|
123 | piccount=0 |
---|
124 | # $ACTIVEBIN "$URL/aGET/List/?sEcho=1&iColumns=10&sColumns=&iDisplayStart=$NEXT&iDisplayLength=50&iSortingCols=1&iSortCol_0=5&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fType%22%3A%22$PAGE2%22%2C%22fLetter%22%3A%22$PAGE%22%7D" > $TMP/cache.$FILENAME.1 |
---|
125 | if [ "$PAGE" == "movie" ] || [ "$PAGE" == "series" ] || [ "$PAGE" == "documentation" ];then |
---|
126 | # $ACTIVEBIN "$URL/aGET/List/?sEcho=1&iColumns=10&sColumns=&iDisplayStart=$NEXT&iDisplayLength=50&iSortingCols=1&iSortCol_0=5&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fType%22%3A%22$PAGE%22%2C%22fLetter%22%3A%22$PAGE2%22%7D" > $TMP/cache.$FILENAME.1 |
---|
127 | TMPPFAD=List |
---|
128 | FTYPE="%22fType%22%3A%22$PAGE%22" |
---|
129 | FLETTER="%22fLetter%22%3A%22$PAGE2%22" |
---|
130 | additional="%7B$FTYPE%2C$FLETTER%7D" |
---|
131 | elif [ "$PAGE" == "actor" ];then |
---|
132 | # $ACTIVEBIN "$URL/aGET/Actor/?sEcho=1&iColumns=10&sColumns=&iDisplayStart=$NEXT&iDisplayLength=50&iSortingCols=1&iSortCol_0=5&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fLetter%22%3A%22$PAGE2%22%2C%22fSex%22%3A%22%22%7D" > $TMP/cache.$FILENAME.1 |
---|
133 | TMPPFAD=Actor |
---|
134 | FLETTER="%22fLetter%22%3A%22$PAGE2%22" |
---|
135 | FSEX="%22fSex%22%3A%22%22" |
---|
136 | additional="%7B$FLETTER%2C$FSEX%7D" |
---|
137 | elif [ "$PAGE" == "director" ];then |
---|
138 | # $ACTIVEBIN "$URL/aGET/Director/?sEcho=1&iColumns=10&sColumns=&iDisplayStart=$NEXT&iDisplayLength=50&iSortingCols=1&iSortCol_0=5&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fLetter%22%3A%22$PAGE2%22%2C%22fSex%22%3A%22%22%7D" > $TMP/cache.$FILENAME.1 |
---|
139 | TMPPFAD=Director |
---|
140 | FLETTER="%22fLetter%22%3A%22$PAGE2%22" |
---|
141 | FSEX="%22fSex%22%3A%22%22" |
---|
142 | additional="%7B$FLETTER%2C$FSEX%7D" |
---|
143 | fi |
---|
144 | |
---|
145 | $ACTIVEBIN "$URL/aGET/$TMPPFAD/?sEcho=1&iColumns=10&sColumns=&iDisplayStart=$NEXT&iDisplayLength=50&iSortingCols=1&iSortCol_0=5&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=$additional" > $TMP/cache.$FILENAME.1 |
---|
146 | |
---|
147 | #https://www.kinos.to/aGET/Actor/?sEcho=1&iColumns=2&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=1&sSortDir_0=asc&bSortable_0=true&bSortable_1=false&additional=%7B%22fLetter%22%3A%22B%22%2C%22fSex%22%3A%22%22%7D |
---|
148 | #https://www.kinos.to/aGET/Actor/?sEcho=1&iColumns=2&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=1&sSortDir_0=asc&bSortable_0=true&bSortable_1=false&additional=%7B%22fLetter%22%3A%22A%22%2C%22fSex%22%3A%22%22%7D |
---|
149 | #https://www.kinos.to/aGET/Director/?sEcho=1&iColumns=2&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=1&sSortDir_0=asc&bSortable_0=true&bSortable_1=false&additional=%7B%22fLetter%22%3A%22A%22%2C%22fSex%22%3A%22%22%7D |
---|
150 | #https://www.kinos.to/aGET/List/?sEcho=2&iColumns=7&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=2&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22Length%22%3A60%2C%22fLetter%22%3A1%2C%22fGenre%22%3A%226%22%7D |
---|
151 | #https://www.kinos.to/aGET/List/?sEcho=2&iColumns=7&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=2&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fType%22%3A%22movie%22%2C%22Length%22%3A60%2C%22fLetter%22%3A1%7D |
---|
152 | #https://www.kinos.to/aGET/List/?sEcho=2&iColumns=7&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=2&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fType%22%3A%22documentation%22%2C%22Length%22%3A60%2C%22fLetter%22%3A1%7D |
---|
153 | #https://www.kinos.to/aGET/List/?sEcho=2&iColumns=7&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=2&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fType%22%3A%22series%22%2C%22Length%22%3A60%2C%22fLetter%22%3A1%7D |
---|
154 | #https://www.kinos.to/aGET/List/?sEcho=3&iColumns=7&sColumns=&iDisplayStart=0&iDisplayLength=25&iSortingCols=1&iSortCol_0=2&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=true&additional=%7B%22fType%22%3A%22series%22%2C%22Length%22%3A60%2C%22fLetter%22%3A%22B%22%7D |
---|
155 | |
---|
156 | if [ `cat $TMP/cache.$FILENAME.1 | grep "KinoX 404 Not Found" | wc -l` -eq 1 ];then |
---|
157 | ERRORMSG="KinoX 404 Not Found" |
---|
158 | # echo "errormsg=$ERRORMSG" |
---|
159 | LINE="$ERRORMSG#$NEWPAGE#$PIC#kinox_$piccount.jpg#KinoX#22" |
---|
160 | echo "$LINE" > $TMP/$FILENAME.list |
---|
161 | exit |
---|
162 | fi |
---|
163 | |
---|
164 | if [ `cat $TMP/cache.$FILENAME.1 | grep "KinoX 503 Service Temporarily Unavailable" | wc -l` -eq 1 ];then |
---|
165 | ERRORMSG="KinoX 503 Service Temporarily Unavailable" |
---|
166 | # echo "errormsg=$ERRORMSG" |
---|
167 | LINE="$ERRORMSG#$NEWPAGE#$PIC#kinox_$piccount.jpg#KinoX#22" |
---|
168 | echo "$LINE" > $TMP/$FILENAME.list |
---|
169 | exit |
---|
170 | fi |
---|
171 | |
---|
172 | pages=`cat $TMP/cache.$FILENAME.1 | tr ',' '\n' | grep iTotalDisplayRecords | cut -d '"' -f4` |
---|
173 | if [ -z "$pages" ];then |
---|
174 | pages=0 |
---|
175 | fi |
---|
176 | cat $TMP/cache.$FILENAME.1 | tr '\n' ' ' | sed 's!<TR>!\nfound=!g'| grep ^"found=" >$TMP/cache.$FILENAME.2 |
---|
177 | |
---|
178 | if [ "$pages" == " " ] || [ -z "$pages" ] || [ "$pages" == 0 ]; then |
---|
179 | rm $TMP/cache.$FILENAME.1 |
---|
180 | break |
---|
181 | ls $TMP/cache.$FILENAME.1 |
---|
182 | exit |
---|
183 | fi |
---|
184 | |
---|
185 | # if [ $pages -gt 1000 ]; then |
---|
186 | # pages=1000 |
---|
187 | # fi |
---|
188 | |
---|
189 | max=`expr $pages - 4` |
---|
190 | # echo max $max |
---|
191 | |
---|
192 | cat $TMP/cache.$FILENAME.1 | tr '],[' '\n' | grep 'Stream' | cut -d '/' -f3 | cut -d"\\" -f1 > $TMP/cache.$FILENAME.3 |
---|
193 | |
---|
194 | if [ "$PAGE" == "actor" ] || [ "$PAGE" == "director" ];then |
---|
195 | cat $TMP/cache.$FILENAME.1 | sed "s!\[!\n\[!g" | grep '"nm' > $TMP/cache.$FILENAME.3 |
---|
196 | fi |
---|
197 | |
---|
198 | count=0 |
---|
199 | |
---|
200 | while read -u 3 ROUND; do |
---|
201 | piccount=`expr $piccount + 1` |
---|
202 | filename=`echo $ROUND | sed 's!/Stream/!!'` |
---|
203 | picname=`echo $filename | sed 's!.html!.jpg!'` |
---|
204 | searchname=`echo $filename | sed 's!.html!!'` |
---|
205 | |
---|
206 | TITLE=`echo $picname | sed 's!.jpg!!' | tr "_" " " | cut -d'"' -f2` |
---|
207 | |
---|
208 | if [ `cat /mnt/config/titan.cfg | grep tithek_kinox_pic=1 | wc -l` -eq 1 ];then |
---|
209 | # $wgetbin --no-check-certificate "$MAINURL/$ROUND1" -O cache."$filename".list |
---|
210 | # echo $BIN /tmp/localhoster/cloudflare.py "$URL/Stream/$ROUND" |
---|
211 | $ACTIVEBIN "$URL/Stream/$ROUND" > $TMP/cache."$filename".list |
---|
212 | if [ $(cat $TMP/cache."$filename".list | wc -l) -eq 0 ];then |
---|
213 | # echo $BIN2 /tmp/localhoster/cloudflare.py "$URL/Stream/$ROUND" |
---|
214 | $ACTIVEBIN "$URL/Stream/$ROUND" > $TMP/cache."$filename".list |
---|
215 | fi |
---|
216 | if [ $(cat $TMP/cache."$filename".list | wc -l) -eq 0 ];then |
---|
217 | # echo $BIN3 /tmp/localhoster/cloudflare.py "$URL/Stream/$ROUND" |
---|
218 | $ACTIVEBIN "$URL/Stream/$ROUND" > $TMP/cache."$filename".list |
---|
219 | fi |
---|
220 | if [ $(cat $TMP/cache."$filename".list | wc -l) -eq 0 ];then |
---|
221 | # echo $BIN4 /tmp/localhoster/cloudflare.py "$URL/Stream/$ROUND" |
---|
222 | $ACTIVEBIN "$URL/Stream/$ROUND" > $TMP/cache."$filename".list |
---|
223 | fi |
---|
224 | if [ $(cat $TMP/cache."$filename".list | wc -l) -eq 0 ];then |
---|
225 | # echo $BIN5 /tmp/localhoster/cloudflare.py "$URL/Stream/$ROUND" |
---|
226 | $ACTIVEBIN "$URL/Stream/$ROUND" > $TMP/cache."$filename".list |
---|
227 | fi |
---|
228 | if [ $(cat $TMP/cache."$filename".list | wc -l) -eq 0 ];then |
---|
229 | # echo $BIN6 /tmp/localhoster/cloudflare.py "$URL/Stream/$ROUND" |
---|
230 | $ACTIVEBIN "$URL/Stream/$ROUND" > $TMP/cache."$filename".list |
---|
231 | fi |
---|
232 | PIC=$URL/`cat $TMP/cache."$filename".list | tr '><' '>\n<' | grep $picname | cut -d '"' -f2 | sort -um` |
---|
233 | LANG=`cat $TMP/cache."$filename".list | grep 'alt="language" src="/gr/sys/lng' | sed 's!alt="language" src="/gr/sys/lng/!\n!' | tail -n1 |cut -d"." -f1` |
---|
234 | else |
---|
235 | PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg" |
---|
236 | LANG=1 |
---|
237 | fi |
---|
238 | |
---|
239 | LANGTXT=" (de)" |
---|
240 | |
---|
241 | if [ ! -z $LANG ];then |
---|
242 | if [ $LANG = 1 ];then |
---|
243 | LANGTXT=" (de)" |
---|
244 | elif [ $LANG = 2 ];then |
---|
245 | LANGTXT=" (en)" |
---|
246 | else |
---|
247 | LANGTXT=" (??)" |
---|
248 | fi |
---|
249 | fi |
---|
250 | |
---|
251 | NEWPAGE="$URL/Stream/$ROUND" |
---|
252 | if [ "$PAGE" == "actor" ] || [ "$PAGE" == "director" ];then |
---|
253 | TMPPFAD=`echo $ROUND | sed -nr 's/.*","([^"]+)".*/\1/p'` |
---|
254 | NEWPAGE="/People/$TMPPFAD" |
---|
255 | fi |
---|
256 | if [ -z "$PIC" ]; then |
---|
257 | PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg" |
---|
258 | fi |
---|
259 | |
---|
260 | TITLE=`echo $TITLE | sed -e 's/&/&/g' -e 's/&/und/g' -e 's/"/"/g' -e 's/</\</g' -e 's/"/\"/g' -e 's/'/\"/g' -e 's/#034;/\"/g' -e 's/#039;/\"/g' -e 's/ß/\C3x/g' -e 's/–/-/g' -e 's/Ä/\C3/g' -e 's/Ü/\C3S/g' -e 's/Ö/\C3/g' -e 's/ä/\E4/g' -e 's/ü/\FC/g' -e 's/ö/\F6/g' -e 's/é/\E9/g' -e 's/è/\E8/g' -e 's/%F6/\F6/g' -e 's/%FC/\FC/g' -e 's/%E4/\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'` |
---|
261 | |
---|
262 | if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then |
---|
263 | if [ ! -e $TMP/$FILENAME.list ];then |
---|
264 | touch $TMP/$FILENAME.list |
---|
265 | fi |
---|
266 | piccount=`expr $piccount + 1` |
---|
267 | LINE="$TITLE$LANGTXT#$NEWPAGE#$PIC#kinox_$piccount.jpg#KinoX#22" |
---|
268 | if [ "$PAGE" == "actor" ] || [ "$PAGE" == "director" ];then |
---|
269 | # LINE="$TITLE#$SRC $SRC search 'movie' 1 '$NEWPAGE'#$PIC#kinox_$piccount.jpg#KinoX#0" |
---|
270 | LINE="$TITLE#$NEWPAGE#$PIC#kinox_$piccount.jpg#KinoX#32" |
---|
271 | |
---|
272 | fi |
---|
273 | echo "$LINE" >> $TMP/$FILENAME.list |
---|
274 | fi |
---|
275 | |
---|
276 | done 3<$TMP/cache.$FILENAME.3 |
---|
277 | |
---|
278 | if [ "$NEXT" -lt "$pages" ]; then |
---|
279 | NEXTPAGE=`expr $NEXT + 30` |
---|
280 | LINE="Page ($NEXTPAGE/$pages)#$SRC $SRC search '$PAGE' $NEXTPAGE $PAGE2#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#$NAME#0" |
---|
281 | echo "$LINE" >> $TMP/$FILENAME.list |
---|
282 | fi |
---|
283 | |
---|
284 | # rm $TMP/cache.$FILENAME.* > /dev/null 2>&1 |
---|
285 | fi |
---|
286 | echo "$TMP/$FILENAME.list" |
---|
287 | } |
---|
288 | |
---|
289 | kino() |
---|
290 | { |
---|
291 | # rm $TMP/cache.$FILENAME.* > /dev/null 2>&1 |
---|
292 | # rm $TMP/$FILENAME.list |
---|
293 | if [ ! -e "$TMP/$FILENAME.list" ]; then |
---|
294 | piccount=0 |
---|
295 | # $curlbin "$URL/$PAGE" -o "$TMP/cache.$FILENAME.1" |
---|
296 | $ACTIVEBIN "$URL/$PAGE" > $TMP/cache.$FILENAME.1 |
---|
297 | |
---|
298 | if [ `cat $TMP/cache.$FILENAME.1 | grep "KinoX 404 Not Found" | wc -l` -eq 1 ];then |
---|
299 | ERRORMSG="KinoX 404 Not Found" |
---|
300 | # echo "errormsg=$ERRORMSG" |
---|
301 | LINE="$ERRORMSG#$NEWPAGE#$PIC#kinox_$piccount.jpg#KinoX#22" |
---|
302 | echo "$LINE" > $TMP/$FILENAME.list |
---|
303 | exit |
---|
304 | fi |
---|
305 | if [ `cat $TMP/cache.$FILENAME.1 | grep "KinoX 503 Service Temporarily Unavailable" | wc -l` -eq 1 ];then |
---|
306 | ERRORMSG="KinoX 503 Service Temporarily Unavailable" |
---|
307 | # echo "errormsg=$ERRORMSG" |
---|
308 | LINE="$ERRORMSG#$NEWPAGE#$PIC#kinox_$piccount.jpg#KinoX#22" |
---|
309 | echo "$LINE" > $TMP/$FILENAME.list |
---|
310 | exit |
---|
311 | fi |
---|
312 | |
---|
313 | # cat $TMP/cache.$FILENAME.1 | grep /Stream/ | sed 's!/Stream/!\n/Stream/!' | grep ^/Stream/ | cut -d '"' -f1 | cut -d "'" -f1 | sort -um >$TMP/cache.$FILENAME.2 |
---|
314 | cat $TMP/cache.$FILENAME.1 | grep /Stream/ | sed 's!/Stream/!\n/Stream/!' | grep ^/Stream/ | cut -d '"' -f1 | cut -d "'" -f1 >$TMP/cache.$FILENAME.2 |
---|
315 | |
---|
316 | while read -u 3 ROUND; do |
---|
317 | piccount=`expr $piccount + 1` |
---|
318 | filename=`echo $ROUND | sed 's!/Stream/!!'` |
---|
319 | picname=`echo $filename | sed 's!.html!.jpg!'` |
---|
320 | searchname=`echo $filename | sed 's!.html!!'` |
---|
321 | |
---|
322 | TITLE=`echo $picname | sed 's!.jpg!!' | tr "_" " "` |
---|
323 | |
---|
324 | if [ `cat /mnt/config/titan.cfg | grep tithek_kinox_pic=1 | wc -l` -eq 1 ];then |
---|
325 | # $wgetbin --no-check-certificate "$MAINURL/$ROUND1" -O cache."$filename".list |
---|
326 | # echo $BIN /tmp/localhoster/cloudflare.py "$URL/$ROUND" |
---|
327 | $ACTIVEBIN "$URL/$ROUND" > $TMP/cache."$filename".list |
---|
328 | if [ $(cat $TMP/cache."$filename".list | wc -l) -eq 0 ];then |
---|
329 | # echo $BIN2 /tmp/localhoster/cloudflare.py "$URL/$ROUND" |
---|
330 | $ACTIVEBIN "$URL/$ROUND" > $TMP/cache."$filename".list |
---|
331 | fi |
---|
332 | if [ $(cat $TMP/cache."$filename".list | wc -l) -eq 0 ];then |
---|
333 | # echo $BIN3 /tmp/localhoster/cloudflare.py "$URL/$ROUND" |
---|
334 | $ACTIVEBIN "$URL/$ROUND" > $TMP/cache."$filename".list |
---|
335 | fi |
---|
336 | if [ $(cat $TMP/cache."$filename".list | wc -l) -eq 0 ];then |
---|
337 | # echo $BIN4 /tmp/localhoster/cloudflare.py "$URL/$ROUND" |
---|
338 | $ACTIVEBIN "$URL/$ROUND" > $TMP/cache."$filename".list |
---|
339 | fi |
---|
340 | if [ $(cat $TMP/cache."$filename".list | wc -l) -eq 0 ];then |
---|
341 | # echo $BIN5 /tmp/localhoster/cloudflare.py "$URL/$ROUND" |
---|
342 | $ACTIVEBIN "$URL/$ROUND" > $TMP/cache."$filename".list |
---|
343 | fi |
---|
344 | if [ $(cat $TMP/cache."$filename".list | wc -l) -eq 0 ];then |
---|
345 | # echo $BIN6 /tmp/localhoster/cloudflare.py "$URL/$ROUND" |
---|
346 | $ACTIVEBIN "$URL/$ROUND" > $TMP/cache."$filename".list |
---|
347 | fi |
---|
348 | PIC=$URL/`cat $TMP/cache."$filename".list | tr '><' '>\n<' | grep $picname | cut -d '"' -f2 | sort -um` |
---|
349 | LANG=`cat $TMP/cache."$filename".list | grep 'alt="language" src="/gr/sys/lng' | sed 's!alt="language" src="/gr/sys/lng/!\n!' | tail -n1 |cut -d"." -f1` |
---|
350 | else |
---|
351 | PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg" |
---|
352 | LANG=1 |
---|
353 | fi |
---|
354 | |
---|
355 | LANGTXT=" (de)" |
---|
356 | |
---|
357 | if [ ! -z $LANG ];then |
---|
358 | if [ $LANG = 1 ];then |
---|
359 | LANGTXT=" (de)" |
---|
360 | elif [ $LANG = 2 ];then |
---|
361 | LANGTXT=" (en)" |
---|
362 | else |
---|
363 | LANGTXT=" (??)" |
---|
364 | fi |
---|
365 | fi |
---|
366 | |
---|
367 | NEWPAGE="$URL/$ROUND" |
---|
368 | |
---|
369 | if [ -z "$PIC" ]; then |
---|
370 | PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg" |
---|
371 | fi |
---|
372 | |
---|
373 | TITLE=`echo $TITLE | sed -e 's/&/&/g' -e 's/&/und/g' -e 's/"/"/g' -e 's/</\</g' -e 's/"/\"/g' -e 's/'/\"/g' -e 's/#034;/\"/g' -e 's/#039;/\"/g' -e 's/ß/\C3x/g' -e 's/–/-/g' -e 's/Ä/\C3/g' -e 's/Ü/\C3S/g' -e 's/Ö/\C3/g' -e 's/ä/\E4/g' -e 's/ü/\FC/g' -e 's/ö/\F6/g' -e 's/é/\E9/g' -e 's/è/\E8/g' -e 's/%F6/\F6/g' -e 's/%FC/\FC/g' -e 's/%E4/\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'` |
---|
374 | |
---|
375 | if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then |
---|
376 | if [ ! -e $TMP/$FILENAME.list ];then |
---|
377 | touch $TMP/$FILENAME.list |
---|
378 | fi |
---|
379 | piccount=`expr $piccount + 1` |
---|
380 | LINE="$TITLE$LANGTXT#$NEWPAGE#$PIC#kinox_$piccount.jpg#KinoX#22" |
---|
381 | |
---|
382 | if [ `cat $TMP/$FILENAME.list | grep "$TITLE" | wc -l` -eq 0 ];then |
---|
383 | echo "$LINE" >> $TMP/$FILENAME.list |
---|
384 | fi |
---|
385 | fi |
---|
386 | |
---|
387 | done 3<$TMP/cache.$FILENAME.2 |
---|
388 | rm $TMP/cache.$FILENAME.* > /dev/null 2>&1 |
---|
389 | |
---|
390 | fi |
---|
391 | echo "$TMP/$FILENAME.list" |
---|
392 | } |
---|
393 | |
---|
394 | case $INPUT in |
---|
395 | init) $INPUT;; |
---|
396 | mainmenu) $INPUT;; |
---|
397 | search) $INPUT;; |
---|
398 | kino) $INPUT;; |
---|
399 | sorted) $INPUT;; |
---|
400 | esac |
---|