source: titan/mediathek/localparser_secret/7tv.sh @ 43636

Last change on this file since 43636 was 43636, checked in by aafsvn, 5 years ago

tithek add 7tv

File size: 17.7 KB
RevLine 
[43636]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
11PAGE=$3
12
13URL=http://www.7tv.de/
14PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
15NAME=7tv
16FILENAME="$PARSER $INPUT $PAGE"
17FILENAME=`echo $FILENAME | tr '&' '.' | tr '/' '.' | tr '?' '.'  | tr '=' '.' | sed 's/ \+/./g' | sed 's/\.\+/./g'`
18
19#rm -rf $TMP > /dev/null 2>&1
20mkdir $TMP > /dev/null 2>&1
21
22if [ `echo $SRC | grep ^"/mnt/parser" | wc -l` -gt 0 ];then
23        TYPE="$SRC - Shell script"
24elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then
25        TYPE="Swap - Shell script"
26elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then
27        TYPE="Mnt - Shell script"
28else
29        TYPE="Flash - Shell script"
30fi
31
32init()
33{
34#       rm -f /mnt/network/cookies > /dev/null 2>&1
35        rm -rf $TMP > /dev/null 2>&1
36        echo "$NAME ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0"
37}
38
39mainmenu()
40{
41#       echo "Tv Shows#$SRC $SRC serien tv/#http://atemio.dyndns.tv/mediathek/menu/tv-shows.jpg#tv-shows.jpg#$NAME#0" > $TMP/$FILENAME.list
42        echo "Search Serien#$SRC $SRC searchtv '7tvsearch/search/query/%search%/type/format/offset/0/limit/5'#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >$TMP/$FILENAME.list
43        echo "Search Clips#$SRC $SRC searchtv '7tvsearch/search/query/%search%/type/clip/offset/0/limit/5'#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >>$TMP/$FILENAME.list
44        echo "Search Ganue Folgen#$SRC $SRC searchtv '7tvsearch/search/query/%search%/type/episode/offset/0/limit/5'#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >>$TMP/$FILENAME.list
45        echo "$TMP/$FILENAME.list"
46}
47
48#13:22:35.345 T:140602909902592   DEBUG: [plugin.video.7tvneu-1.0.1](searchtext) URL-x : https://www.7tv.de/7tvsearch/search/query/big+brother/type/format/offset/0/limit/5
49searchtv()
50{
51rm "$TMP/$FILENAME.list"
52rm $TMP/cache.$FILENAME.*
53        if [ ! -e "$TMP/$FILENAME.list" ]; then
54                piccount=0
55
56                $curlbin $URL/$PAGE$NEXT$PAGE2 -o $TMP/cache.$FILENAME.1
57#               $BIN /tmp/localhoster/cloudflare.py "$URL/$PAGE$NEXT$PAGE2" > $TMP/cache.$FILENAME.1
58
59
60                if [ -z "$NEXT" ];then
61                        NEXT=1
62                fi
63                pages=`cat $TMP/cache.$FILENAME.1 | grep $PAGE | sed "s/$PAGE/\n$PAGE/g" | cut -d ">" -f2 | cut -d "<" -f1 | tail -n1`
64                if [ -z "$pages" ];then
65                        pages=0
66                fi
67                cat $TMP/cache.$FILENAME.1 | tr '\n' ' ' | sed 's!<a href=!\n<a href=!g' | grep ^"<a href=" >$TMP/cache.$FILENAME.2
68
69#echo $TMP/cache.$FILENAME.1
70#exit
71
72                while read -u 3 ROUND; do
73                        ID=`echo $ROUND | cut -d'"' -f1 | tail -n1`
74                        NEWPAGE=`echo $ROUND | sed -nr 's/.*<a href="([^"]+)".*/\1/p'`
75                        TITLE=`echo $NEWPAGE | tr '-' ' ' | sed 's!/!!'`
76       
77#                       if [ ! -z "$NEWPAGE" ]; then
78#                               if [ -z "$TITLE" ];then
79#                                       TITLE=`echo $TMPURL`
80#                               fi
81#                               TMPURL="$URL"/$TMPURL
82#                       fi
83
84                        PIC=`echo $ROUND | sed -nr 's/.*data-src="([^"]+)".*/\1/p'`
85
86#suche big broter
87#
88#serien
89#14:07:13.118 T:139913047566080   DEBUG: 'GET /7tvsearch/search/query/big+brother/type/format/offset/0/limit/5 HTTP/1.1\r\nHost: www.7tv.de\r\nConnection: close\r\nAccept-Encoding: gzip, deflate\r\n\r\n'
90#
91#clips
92#14:08:13.114 T:139913047566080   DEBUG: 'GET /7tvsearch/search/query/big+brother/type/clip/offset/0/limit/5 HTTP/1.1\r\nHost: www.7tv.de\r\nConnection: close\r\nAccept-Encoding: gzip, deflate\r\n\r\n'
93#
94#ganue folgen
95#14:09:21.003 T:139914294122240   DEBUG: 'GET /7tvsearch/search/query/big+brother/type/episode/offset/0/limit/5 HTTP/1.1\r\nHost: www.7tv.de\r\nConnection: close\r\nAccept-Encoding: gzip, deflate\r\n\r\n'
96
97#14:14:26.546 T:139914311513856   DEBUG: [plugin.video.7tvneu-1.0.1](searchtext) URL-x : https://www.7tv.de/7tvsearch/search/query/big+brother/type/episode/offset/7/limit/5
98
99                        if [ `echo $ROUND | grep us_ger_small.png | wc -l` -eq 1 ]; then
100                                LANG=" (de)"
101                        elif [ `echo $ROUND | grep us_flag_small.png | wc -l` -eq 1 ]; then
102                                LANG=" (en)"
103                        else
104                                LANG=" (??)"
105                        fi
106       
107                        if [ -z "$PIC" ]; then
108                                PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
109                        fi
110#echo TITLE $TITLE
111#echo NEWPAGE $NEWPAGE
112#echo PIC $PIC
113#exit
114                        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'`
115       
116                        if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then
117                                if [ ! -e $TMP/$FILENAME.list ];then
118                                        touch $TMP/$FILENAME.list
119                                fi
120                                piccount=`expr $piccount + 1`
121#14:17:18.074 T:139914121307904   DEBUG: 'GET /big-brother/ganze-folgen HTTP/1.1\r\nHost: www.7tv.de\r\nConnection: close\r\nAccept-Encoding: gzip, deflate\r\n\r\n'
122
123                                LINE="$TITLE (ganze-folgen)#$SRC $SRC episodetv $NEWPAGE/ganze-folgen#$PIC#$PARSER.$INPUT.$NEXT.$PAGE2.$FILENAME.$piccount.jpg#$NAME#0"
124                                echo "$LINE" >> $TMP/$FILENAME.list
125
126                                LINE="$TITLE (alle-clips)#$SRC $SRC episodetv $NEWPAGE/alle-clips#$PIC#$PARSER.$INPUT.$NEXT.$PAGE2.$FILENAME.$piccount.jpg#$NAME#0"
127                                echo "$LINE" >> $TMP/$FILENAME.list
128
129#       LINE="Big Brother#episode '/tv/big-brother'#http://atemio.dyndns.tv/mediathek/menu/default.jpg#sixx.serien.tv..41.jpg#Sixx#0"
130
131                        fi
132       
133                done 3<$TMP/cache.$FILENAME.2
134
135                if [ "$NEXT" -lt "$pages" ]; then
136                        NEXTPAGE=`expr $NEXT + 1`
137                        LINE="Page ($NEXTPAGE/$pages)#$SRC $SRC searchtv '$PAGE' $NEXTPAGE '$PAGE2'#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#$NAME#0"
138                        echo "$LINE" >> $TMP/$FILENAME.list
139                fi
140#               rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
141        fi
142        echo "$TMP/$FILENAME.list"
143}
144
145episodetv()
146{
147rm "$TMP/$FILENAME.list"
148rm $TMP/cache.$FILENAME.*
149        if [ ! -e "$TMP/$FILENAME.list" ]; then
150                piccount=0
151
152                $curlbin $URL/$PAGE$NEXT$PAGE2 -o $TMP/cache.$FILENAME.1
153#               $BIN /tmp/localhoster/cloudflare.py "$URL/$PAGE$NEXT$PAGE2" > $TMP/cache.$FILENAME.1
154
155
156                if [ -z "$NEXT" ];then
157                        NEXT=1
158                fi
159                pages=`cat $TMP/cache.$FILENAME.1 | grep $PAGE | sed "s/$PAGE/\n$PAGE/g" | cut -d ">" -f2 | cut -d "<" -f1 | tail -n1`
160                if [ -z "$pages" ];then
161                        pages=0
162                fi
163                cat $TMP/cache.$FILENAME.1 | tr '\n' ' ' | sed 's!<a href=!\n<a href=!g' | grep ^"<a href=" | grep "teaser-img" | grep "data-track" >$TMP/cache.$FILENAME.2
164
165#next
166#<a href="/big-brother/alle-clips" itemprop="url" ><span itemprop="name">Alle Clips</span></a>              </li>             </ul> </nav><!-- / #format_nav-->                     </div>                   <div class="format-sponsor">                             <div class="format-sponsor-brand">                     <a class="brand-logo-sixx" href="https://www.sixx.de" target="_blank" title="sixx"></a>                 </div>                                  </div>     </div>                                                <!--googleoff: index-->  <div class="main-zone">                                                                         <div class="row ">     <div class="row-wrapper " data-track="zone:main,row:N/A,col:N/A,width:3,cont:">                                                         <section class="bentobox-default teaser-row" data-ajax-more="/psdflow/ajaxblock/(block)/1600530d298d8cd1de1e560337538f82/(offset)/24/(limit)/24/(node_id)/117716">                 <article class="teaser teaser_300x160 class-clip" data-track="teasNr:1,BentoBox default,Staffel 1 Episode 92: Big Brother Live - Das Finale - Teil 1 - N/A">                 
167
168#echo $TMP/cache.$FILENAME.1
169#exit
170
171                while read -u 3 ROUND; do
172                        ID=`echo $ROUND | cut -d'"' -f1 | tail -n1`
173                        NEWPAGE=`echo $ROUND | sed -nr 's/.*<a href="([^"]+)".*/\1/p'`
174                        TITLE=`echo $ROUND | sed -nr 's/.*title="([^"]+)".*/\1/p'`
175if [ -z "$TITLE" ]; then
176                        TITLE=`echo $NEWPAGE | tr '-' ' ' | sed 's!/!!'`
177fi
178
179TITLE=`echo $TITLE | tr '-' '\n' | tail -n3 | tr '\n' '-'`
180#TITLE2=`echo $TITLE | tr '-' '\n' | tail -n2`
181
182                        PIC=`echo $ROUND | sed -nr 's/.*data-src="([^"]+)".*/\1/p'`
183       
184                        if [ -z "$PIC" ]; then
185                                PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
186                        fi
187#echo TITLE $TITLE
188#echo NEWPAGE $NEWPAGE
189#echo PIC $PIC
190#exit
191                        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'`
192       
193                        if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then
194                                if [ ! -e $TMP/$FILENAME.list ];then
195                                        touch $TMP/$FILENAME.list
196                                fi
197                                piccount=`expr $piccount + 1`
198
199#                               LINE="$TITLE#$SRC $SRC episodetvlist $NEWPAGE#$PIC#$PARSER.$INPUT.$NEXT.$PAGE2.$FILENAME.$piccount.jpg#$NAME#0"
200                                LINE="$TITLE#$SRC $SRC play '$NEWPAGE'#$PIC#$FILENAME.$piccount.jpg#$NAME#111"
201
202                                echo "$LINE" >> $TMP/$FILENAME.list
203
204                        fi
205       
206                done 3<$TMP/cache.$FILENAME.2
207
208                PAGE=`cat $TMP/cache.$FILENAME.1 | sed -nr 's/.*data-ajax-more="([^"]+)".*/\1/p'`
209
210                if [ ! -z "$PAGE" ];then
211#                       if [ "$NEXT" -lt "$pages" ]; then
212                                NEXTPAGE=`expr $NEXT + 1`
213                                LINE="Page ($NEXTPAGE/$pages)#$SRC $SRC episodetv '$PAGE' $NEXTPAGE '$PAGE2'#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#$NAME#0"
214                                echo "$LINE" >> $TMP/$FILENAME.list
215                        fi
216#               fi
217#               rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
218        fi
219        echo "$TMP/$FILENAME.list"
220}
221
222#[titan] cmd: /mnt/parser/7tv.sh /mnt/parser/7tv.sh searchtv '7tvsearch/search/query/big+brother/type/format/offset/0/limit/5', file=tithek_global.h, func=localparser_search, line=1476
223#[tithek] cmd: /mnt/parser/7tv.sh /mnt/parser/7tv.sh episodetv /big-brother/ganze-folgen
224#[tithek] cmd: /mnt/parser/7tv.sh /mnt/parser/7tv.sh episodetvlist /big-brother/183-staffel-1-episode-83-big-brother-tag-82-teil-2-ganze-folge
225
226episodetvlist()
227{
228rm "$TMP/$FILENAME.list"
229rm $TMP/cache.$FILENAME.*
230
231        if [ ! -e "$TMP/$FILENAME.list" ]; then
232                piccount=0
233
234                SEARCHSTR=$(echo $PAGE | tr '/' '\n' | tail -n1)
235
236                $curlbin $URL/$PAGE -o $TMP/cache.$FILENAME.1
237                cat $TMP/cache.$FILENAME.1 | tr '\n' '\r' |  tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed 's/ \+/ /g' | sed 's!<a href=!\nfound=!g' | grep ^'found=' | grep "title="  | grep "$SEARCHSTR" >$TMP/cache.$FILENAME.2
238
239                while read -u 3 ROUND; do
240
241                        NEWPAGE=`echo $ROUND | cut -d'"' -f2`
242                        TITLE=$(echo $ROUND | sed -nr 's/.*title="([^"]+)".*/\1/p')
243                        PIC=$(echo $ROUND | sed -nr 's/.*data-src="([^"]+)".*/\1/p')
244
245                        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'`
246
247                        if [ ! -z "$TITLE" ] && [ ! -z "$URL" ];then
248                                if [ ! -e $TMP/$FILENAME.list ];then
249                                        touch $TMP/$FILENAME.list
250                                fi
251                                piccount=$[$piccount+1]
252                                LINE="$TITLE#$SRC $SRC play '$NEWPAGE'#$PIC#$FILENAME.$piccount.jpg#$NAME#111"
253                                echo "$LINE" >> $TMP/$FILENAME.list
254                        fi
255
256                done 3<$TMP/cache.$FILENAME.2
257#               rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
258        fi
259        echo "$TMP/$FILENAME.list"
260}
261
262serien()
263{
264        if [ ! -e "$TMP/$FILENAME.list" ]; then
265                piccount=0
266
267                $curlbin $URL/$PAGE -o $TMP/cache.$FILENAME.1
268#               cat $TMP/cache.$FILENAME.1 | tr '\n' '\r' |  tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed 's/ \+/ /g' | sed 's!<a href=!\nfound=!g' | grep ^'found=' | grep "/$PAGE" | grep -v "class=" | grep -v title= | grep '">' >$TMP/cache.$FILENAME.2
269
270                while read -u 3 ROUND; do
271                        NEWPAGE=`echo $ROUND | cut -d'"' -f2`
272
273                        TITLE=$(echo $ROUND | sed -nr 's/.*">([^>]+)<\/a>.*/\1/p')
274                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
275
276                        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'`
277
278                        if [ ! -z "$TITLE" ] && [ ! -z "$URL" ];then
279                                if [ ! -e $TMP/$FILENAME.list ];then
280                                        touch $TMP/$FILENAME.list
281                                fi
282                                piccount=$[$piccount+1]
283                                LINE="$TITLE#$SRC $SRC episode '$NEWPAGE'#$PIC#$FILENAME.$piccount.jpg#$NAME#0"
284                                echo "$LINE" >> $TMP/$FILENAME.list
285                        fi
286
287                done 3<$TMP/cache.$FILENAME.2
288                rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
289        fi
290#work start
291        LINE="Big Brother#/tmp/localparser/sixx.sh /tmp/localparser/sixx.sh episode '/tv/big-brother'#http://atemio.dyndns.tv/mediathek/menu/default.jpg#sixx.serien.tv..41.jpg#Sixx#0"
292        echo "$LINE" > $TMP/$FILENAME.list
293#end
294        echo "$TMP/$FILENAME.list"
295}
296
297episode()
298{
299        if [ ! -e "$TMP/$FILENAME.list" ]; then
300                piccount=0
301
302                $curlbin $URL/$PAGE/alle-tage -o $TMP/cache.$FILENAME.1
303                cat $TMP/cache.$FILENAME.1 | tr '\n' '\r' |  tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed 's/ \+/ /g' | sed 's!<a href=!\nfound=!g' | grep ^'found=' | grep "title=" | grep "$PAGE" >$TMP/cache.$FILENAME.2
304
305                while read -u 3 ROUND; do
306                        NEWPAGE=`echo $ROUND | cut -d'"' -f2`
307                        TITLE=$(echo $ROUND | sed -nr 's/.*title="([^"]+)".*/\1/p')
308                        PIC=$(echo $ROUND | sed -nr 's/.*data-src="([^"]+)".*/\1/p')
309
310                        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'`
311
312                        if [ ! -z "$TITLE" ] && [ ! -z "$URL" ];then
313                                if [ ! -e $TMP/$FILENAME.list ];then
314                                        touch $TMP/$FILENAME.list
315                                fi
316                                piccount=$[$piccount+1]
317                                LINE="$TITLE#$SRC $SRC episodelist '$NEWPAGE'#$PIC#$FILENAME.$piccount.jpg#$NAME#0"
318                                echo "$LINE" >> $TMP/$FILENAME.list
319                        fi
320
321                done 3<$TMP/cache.$FILENAME.2
322                rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
323        fi
324        echo "$TMP/$FILENAME.list"
325}
326
327
328episodelist()
329{
330rm "$TMP/$FILENAME.list"
331rm $TMP/cache.$FILENAME.*
332
333        if [ ! -e "$TMP/$FILENAME.list" ]; then
334                piccount=0
335
336                SEARCHSTR=$(echo $PAGE | tr '/' '\n' | tail -n1)
337
338                $curlbin $URL/$PAGE -o $TMP/cache.$FILENAME.1
339                cat $TMP/cache.$FILENAME.1 | tr '\n' '\r' |  tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed 's/ \+/ /g' | sed 's!<a href=!\nfound=!g' | grep ^'found=' | grep "title="  | grep "$SEARCHSTR" >$TMP/cache.$FILENAME.2
340
341                while read -u 3 ROUND; do
342
343                        NEWPAGE=`echo $ROUND | cut -d'"' -f2`
344                        TITLE=$(echo $ROUND | sed -nr 's/.*title="([^"]+)".*/\1/p')
345                        PIC=$(echo $ROUND | sed -nr 's/.*data-src="([^"]+)".*/\1/p')
346
347                        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'`
348
349                        if [ ! -z "$TITLE" ] && [ ! -z "$URL" ];then
350                                if [ ! -e $TMP/$FILENAME.list ];then
351                                        touch $TMP/$FILENAME.list
352                                fi
353                                piccount=$[$piccount+1]
354                                LINE="$TITLE#$SRC $SRC play '$NEWPAGE'#$PIC#$FILENAME.$piccount.jpg#$NAME#111"
355                                echo "$LINE" >> $TMP/$FILENAME.list
356                        fi
357
358                done 3<$TMP/cache.$FILENAME.2
359#               rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
360        fi
361        echo "$TMP/$FILENAME.list"
362}
363
364play()
365{
366#       /tmp/localhoster/hoster.sh youtube_dl $URL/$PAGE
367        /tmp/localhoster/hoster.sh youtube_dl $PAGE
368}
369
370
371case $INPUT in
372        init) $INPUT;;
373        mainmenu) $INPUT;;
374        play) $INPUT;;
375        search) $INPUT;;
376        serien) $INPUT;;
377        episode) $INPUT;;
378        episodelist) $INPUT;;
379        searchtv) $INPUT;;
380        episodetv) $INPUT;;
381        episodetvlist) $INPUT;;
382esac
Note: See TracBrowser for help on using the repository browser.