source: titan/mediathek/localparser_secret/bs.sh @ 39982

Last change on this file since 39982 was 39886, checked in by tt4sk, 7 years ago

[TiThek] fixed: bs.to website changed

  • Property svn:executable set to *
File size: 8.8 KB
Line 
1#!/bin/bash
2# titannit box parser for burning series
3
4. /tmp/localhoster/hoster.sh
5
6SRC=$1
7INPUT=$2
8PARAM=$3
9PARAM2=$4
10URL="https://bs.to/"
11PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
12NAME="burningseries"
13
14#rm -rf $TMP > /dev/null 2>&1
15mkdir $TMP > /dev/null 2>&1
16
17if [ `echo $SRC | grep ^"/mnt/parser" |wc -l` -gt 0 ];then
18        TYPE="$SRC - Shell script"
19elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then
20        TYPE="Swap - Shell script"
21elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then
22        TYPE="Mnt - Shell script"
23else
24        TYPE="Flash - Shell script"
25fi
26
27init()
28{
29        echo "Burning Series ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0"
30}
31
32mainmenu()
33{
34        echo "Genres#$SRC $SRC genres#http://atemio.dyndns.tv/mediathek/menu/serien.genre.jpg#serien.genre.jpg#$NAME#0" >/tmp/tithek/$PARSER.mainmenu.list
35        echo "All Series#$SRC $SRC allseries#http://atemio.dyndns.tv/mediathek/menu/serien.jpg#serien.jpg#$NAME#0" >>/tmp/tithek/$PARSER.mainmenu.list
36        echo "Search#$SRC $SRC search#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#0" >>/tmp/tithek/$PARSER.mainmenu.list
37        echo "/tmp/tithek/$PARSER.mainmenu.list"
38}
39
40genres()
41{
42        $curlbin -o - $URL"serie-genre" | awk -v SRC=$SRC -v NAME=$NAME '
43BEGIN { in_genres = 0
44      }
45
46/<div class="genre">/ { in_genres = 1
47                        next
48                      }
49
50/<span><strong>/ { i = index($0, "<span><strong>") + 14
51                   j = index($0, "</strong></span>") - i
52                   title = substr($0, i, j)
53                   pic = tolower(title)
54                   print title "#" SRC " " SRC " series " title "#http://atemio.dyndns.tv/mediathek/menu/" pic ".jpg#" pic ".jpg#" NAME "#0"
55                   next
56                 }
57
58' >/tmp/tithek/$PARSER.genres.list
59        echo "/tmp/tithek/$PARSER.genres.list"
60}
61
62series()
63{
64        $curlbin -o - $URL"serie-genre" | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME '
65/<span><strong>/ { i = index($0, "<span><strong>") + 14
66                   j = index($0, "</strong></span>") - i
67                   genre = substr($0, i, j)
68                 }
69
70/<li><a href=\"/ { if (genre == PARAM) {
71                      i = index($0, "<li><a href=\"") + 13
72                      j = index(substr($0, i), "\"") - 1
73                      url = substr($0, i, j)
74                      j = index(substr($0, i), "\">") - 1
75                      k = i + j + 2
76                      l = index(substr($0, k), "</a></li>") - 1
77                      title = substr($0, k, l)
78                      print title "#" SRC " " SRC " staffel " url "#http://atemio.dyndns.tv/mediathek/menu/default.jpg#default.jpg#" NAME "#0"
79                   }
80                   next
81                 }
82' >/tmp/tithek/$PARSER.series.list
83        echo "/tmp/tithek/$PARSER.series.list"
84}
85
86allseries()
87{
88        $curlbin -o - $URL"serie-alphabet" | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME '
89/<span><strong>/ { i = index($0, "<span><strong>") + 14
90                   j = index($0, "</strong></span>") - i
91                   genre = substr($0, i, j)
92                 }
93
94/<li><a href=\"/ { if (genre == PARAM) {
95                      i = index($0, "<li><a href=\"") + 13
96                      j = index(substr($0, i), "\">") - 1
97                      url = substr($0, i, j)
98                      k = i + j + 2
99                      l = index(substr($0, k), "</a></li>") - 1
100                      title = substr($0, k, l)
101                      print title "#" SRC " " SRC " staffel " url "#http://atemio.dyndns.tv/mediathek/menu/default.jpg#default.jpg#" NAME "#0"
102                   }
103                   next
104                 }
105' >/tmp/tithek/$PARSER.allseries.list
106        echo "/tmp/tithek/$PARSER.allseries.list"
107}
108
109staffel()
110{
111        $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME '
112BEGIN { in_class_clearfix = 0
113      }
114
115/<ul class=\"clearfix\">/ { in_class_clearfix = 1
116                          }
117
118/<li><a href=\"/ { if (in_class_clearfix == 1) {
119                      i = index($0, "<li><a href=\"") + 13
120                      j = index(substr($0, i), "\">") - 1
121                      url = substr($0, i, j)
122                      k = i + j + 2
123                      l = index(substr($0, k), "</a></li>") - 1
124                      staffel = substr($0, k, l)
125                      print "Staffel " staffel "#" SRC " " SRC " episode " url " " staffel "#http://atemio.dyndns.tv/mediathek/menu/s" staffel ".jpg#s" staffel ".jpg#" NAME "#0"
126                   }
127                 }
128
129/<\/ul>/ { in_class_clearfix = 0
130         }
131' >/tmp/tithek/$PARSER.staffel.list
132        echo "/tmp/tithek/$PARSER.staffel.list"
133}
134
135episode()
136{
137        $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME '
138BEGIN { in_table_row = 0
139      }
140
141/<tr>/ { in_table_row = 1
142         next
143       }
144
145/<td><a href=\"/ { if (in_table_row == 1) {
146                      i = index($0, "<td><a href=\"") + 13
147                      j = index(substr($0, i), "\"") - 1
148                      url = substr($0, i, j)
149                      i = index($0, "title=\"") + 7
150                      j = index(substr($0, i), "\"") - 1
151                      title = substr($0, i, j)
152                      k = i + j + 2
153                      l = index(substr($0, k), "</a></td>") - 1
154                      episode = substr($0, k, l)
155                      print title "#" SRC " " SRC " hosterlist " url "#http://atemio.dyndns.tv/mediathek/menu/s" PARAM2 "e" episode ".jpg#s" PARAM2 "e" episode ".jpg#" NAME "#0"
156                   }
157                   next
158                 }
159
160/<\/tr>/ { in_table_row = 0
161           next
162         }
163' >/tmp/tithek/$PARSER.episode.list
164        echo "/tmp/tithek/$PARSER.episode.list"
165}
166
167hosterlist()
168{
169        $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME '
170BEGIN { in_hosterlist = 0
171      }
172
173/<ul class=\"hoster-tabs top\">/ { in_hosterlist = 1
174                                   next
175                                 }
176
177/href=\"/ { if (in_hosterlist == 1) {
178               i = index($0, "href=\"") + 6
179               j = index(substr($0, i), "\">") - 1
180               url = substr($0, i, j)
181            }
182            next
183          }
184
185/<\/span>&nbsp;/ { if (in_hosterlist == 1) {
186                 i = index($0, "</span>&nbsp;") + 13
187                 title = substr($0, i)
188                 pic = tolower(title)
189                 print title "#" SRC " " SRC " hoster " url "#http://atemio.dyndns.tv/mediathek/menu/" pic ".jpg#" pic ".jpg#" NAME "#111"
190              }
191              next
192            }
193
194/<\/ul>/ { in_hosterlist = 0
195          next
196        }
197
198' >/tmp/tithek/$PARSER.hosterlist.list
199        echo "/tmp/tithek/$PARSER.hosterlist.list"
200}
201
202
203###################
204# in_hoster
205###################
206#<div id="video_actions">
207#                <div>
208#            <a href="http://vivo.sx/dcd747a9af" target="_blank"><span class="icon link_go"></span> Link zum Originalvideo</a>
209#                    </div>
210#            </div>
211#    <br style="clear:both;"/>
212
213###################
214# in_hoster_iframe
215###################
216#<iframe scrolling='no' frameborder='no' width='630' height='390' allowfullscreen='ture' webkitallowfullscreen='true' mozallowfullscreen='true' src='https://openload.co/embed/r3Qxa6zWdwM/Die.Simpsons.S01E01.Es.weihnachtet.schwer.German.DVDRiP.XviD.iNTERNAL-UTOPiA.mkv'></iframe>
217#        <div id="video_actions">
218#                <div>
219#            <a href="javascript:alert(&#039;Nicht möglich&#039;);" target="_blank"><span class="icon link_go"></span> Link zum Originalvideo</a>
220#                    </div>
221#            </div>
222#    <br style="clear:both;"/>
223
224
225#function followlocation()
226#{
227#       system("curlbin -s -D - $1 | grep Location: | tail -n1")
228#}
229
230hoster()
231{
232        STREAM=`$curlbin -o - $URL$PARAM | awk '
233/class=\"hoster-player\"/ { i = index($0, "<a href=\"") + 9
234                            j = index(substr($0, i), "\"") - 1
235                            url = substr($0, i, j)
236                            print url
237                            next
238                          }
239'`
240        $curlbin -o - $STREAM >/tmp/tithek/$PARSER.hoster.1
241        cat /tmp/tithek/$PARSER.hoster.1 | $curlbin -o - $STREAM | awk '
242/\"og:url\" content=/ { i = index($0, "\"og:url\" content=") + 18
243                        j = index(substr($0, i), "\"") - 1
244                        url = substr($0, i, j)
245                        print url
246                        next
247                      }
248/name=\"id\" value=\"/ { i = index($0, "value=\"") + 7
249                         j = index(substr($0, i), "\"") - 1
250                         url = "http://vidto.me/" substr($0, i, j) ".html"
251                         print url
252                         next
253                       }
254' >/tmp/tithek/$PARSER.hoster.list
255        cat /tmp/tithek/$PARSER.hoster.list
256}
257
258case $INPUT in
259        init) $INPUT;;
260        mainmenu) $INPUT;;
261        genres) $INPUT;;
262        series) $INPUT;;
263        allseries) $INPUT;;
264        staffel) $INPUT;;
265        episode) $INPUT;;
266        hosterlist) $INPUT;;
267        hoster) $INPUT;;
268esac
269
Note: See TracBrowser for help on using the repository browser.