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

Last change on this file since 42276 was 41998, checked in by phillipsd2, 6 years ago

quick 'n' dirty fix not showing all series

  • Property svn:executable set to *
File size: 9.5 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        cat /tmp/tithek/$PARSER.series.list | sed -e "s!&#039;!'!g" > /tmp/tithek/$PARSER.series.list.1
84        echo "/tmp/tithek/$PARSER.series.list.1"
85}
86
87allseries()
88{
89        $curlbin -o - $URL"serie-alphabet" | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME '
90/<span><strong>/ { i = index($0, "<span><strong>") + 14
91                   j = index($0, "</strong></span>") - i
92                   genre = substr($0, i, j)
93                 }
94
95/<li><a href=\"/ { if (genre == PARAM) {
96                      i = index($0, "<li><a href=\"") + 13
97                      j = index(substr($0, i), "\">") - 1
98                      url = substr($0, i, j)
99                      k = i + j + 2
100                      l = index(substr($0, k), "</a></li>") - 1
101                      title = substr($0, k, l)
102                      print title "#" SRC " " SRC " staffel " url "#http://atemio.dyndns.tv/mediathek/menu/default.jpg#default.jpg#" NAME "#0"
103                   }
104                   next
105                 }
106' >/tmp/tithek/$PARSER.allseries.list
107        echo "/tmp/tithek/$PARSER.allseries.list"
108}
109
110staffel()
111{
112        $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME '
113BEGIN { in_class_clearfix = 0
114      }
115
116/<ul class=\"clearfix\">/ { in_class_clearfix = 1
117                          }
118
119/<li><a href=\"/ { if (in_class_clearfix == 1) {
120                      i = index($0, "<li><a href=\"") + 13
121                      j = index(substr($0, i), "\">") - 1
122                      url = substr($0, i, j)
123                      k = i + j + 2
124                      l = index(substr($0, k), "</a></li>") - 1
125                      staffel = substr($0, k, l)
126                      print "Staffel " staffel "#" SRC " " SRC " episode " url " " staffel "#http://atemio.dyndns.tv/mediathek/menu/s" staffel ".jpg#s" staffel ".jpg#" NAME "#0"
127                   }
128                 }
129
130/<\/ul>/ { in_class_clearfix = 0
131         }
132' >/tmp/tithek/$PARSER.staffel.list
133        echo "/tmp/tithek/$PARSER.staffel.list"
134}
135
136episode()
137{
138        $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME '
139BEGIN { in_table_row = 0
140      }
141
142/<tr>/ { in_table_row = 1
143         next
144       }
145
146/<td><a href=\"/ { if (in_table_row == 1) {
147                      i = index($0, "<td><a href=\"") + 13
148                      j = index(substr($0, i), "\"") - 1
149                      url = substr($0, i, j)
150                      i = index($0, "title=\"") + 7
151                      j = index(substr($0, i), "\"") - 1
152                      title = substr($0, i, j)
153                      k = i + j + 2
154                      l = index(substr($0, k), "</a></td>") - 1
155                      episode = substr($0, k, l)
156                      print title "#" SRC " " SRC " hosterlist " url "#http://atemio.dyndns.tv/mediathek/menu/s" PARAM2 "e" episode ".jpg#s" PARAM2 "e" episode ".jpg#" NAME "#0"
157                   }
158                   next
159                 }
160
161/<\/tr>/ { in_table_row = 0
162           next
163         }
164' >/tmp/tithek/$PARSER.episode.list
165        echo "/tmp/tithek/$PARSER.episode.list"
166}
167
168hosterlist()
169{
170        $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME '
171BEGIN { in_hosterlist = 0
172      }
173
174/<ul class=\"hoster-tabs top\">/ { in_hosterlist = 1
175                                   next
176                                 }
177
178/href=\"/ { if (in_hosterlist == 1) {
179               i = index($0, "href=\"") + 6
180               j = index(substr($0, i), "\">") - 1
181               url = substr($0, i, j)
182            }
183            next
184          }
185
186/<\/span>&nbsp;/ { if (in_hosterlist == 1) {
187                 i = index($0, "</span>&nbsp;") + 13
188                 title = substr($0, i)
189                 pic = tolower(title)
190                 print title "#" SRC " " SRC " hoster " url "#http://atemio.dyndns.tv/mediathek/menu/" pic ".jpg#" pic ".jpg#" NAME "#111"
191              }
192              next
193            }
194
195/<\/ul>/ { in_hosterlist = 0
196          next
197        }
198
199' >/tmp/tithek/$PARSER.hosterlist.list
200        echo "/tmp/tithek/$PARSER.hosterlist.list"
201}
202
203
204###################
205# in_hoster
206###################
207#<div id="video_actions">
208#                <div>
209#            <a href="http://vivo.sx/dcd747a9af" target="_blank"><span class="icon link_go"></span> Link zum Originalvideo</a>
210#                    </div>
211#            </div>
212#    <br style="clear:both;"/>
213
214###################
215# in_hoster_iframe
216###################
217#<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>
218#        <div id="video_actions">
219#                <div>
220#            <a href="javascript:alert(&#039;Nicht möglich&#039;);" target="_blank"><span class="icon link_go"></span> Link zum Originalvideo</a>
221#                    </div>
222#            </div>
223#    <br style="clear:both;"/>
224
225
226#function followlocation()
227#{
228#       system("curlbin -s -D - $1 | grep Location: | tail -n1")
229#}
230
231hoster()
232{
233        STREAM=`$curlbin -o - $URL$PARAM | awk '
234/class=\"hoster-player\"/ { i = index($0, "<a href=\"") + 9
235                            j = index(substr($0, i), "\"") - 1
236                            url = substr($0, i, j)
237                            print url
238                            next
239                          }
240'`
241
242        STREAM=`echo $STREAM | sed 's!https://bs.to/out/!watch/!'`
243        HEADER=`$BIN /tmp/localhoster/bs.py $STREAM`
244
245        $curlbin -H "$HEADER" -o - $URL/api/$STREAM >/tmp/tithek/$PARSER.hoster.1
246        cat /tmp/tithek/$PARSER.hoster.1 | grep fullurl | sed 's!fullurl!\nfullurl!' | grep ^fullurl | cut -d'"' -f3 | tr -d '\\'
247}
248
249hosterold()
250{
251        STREAM=`$curlbin -o - $URL$PARAM | awk '
252/class=\"hoster-player\"/ { i = index($0, "<a href=\"") + 9
253                            j = index(substr($0, i), "\"") - 1
254                            url = substr($0, i, j)
255                            print url
256                            next
257                          }
258'`
259        $curlbin -o - $STREAM >/tmp/tithek/$PARSER.hoster.1
260        cat /tmp/tithek/$PARSER.hoster.1 | $curlbin -o - $STREAM | awk '
261/\"og:url\" content=/ { i = index($0, "\"og:url\" content=") + 18
262                        j = index(substr($0, i), "\"") - 1
263                        url = substr($0, i, j)
264                        print url
265                        next
266                      }
267/name=\"id\" value=\"/ { i = index($0, "value=\"") + 7
268                         j = index(substr($0, i), "\"") - 1
269                         url = "http://vidto.me/" substr($0, i, j) ".html"
270                         print url
271                         next
272                       }
273' >/tmp/tithek/$PARSER.hoster.list
274        cat /tmp/tithek/$PARSER.hoster.list
275}
276
277case $INPUT in
278        init) $INPUT;;
279        mainmenu) $INPUT;;
280        genres) $INPUT;;
281        series) $INPUT;;
282        allseries) $INPUT;;
283        staffel) $INPUT;;
284        episode) $INPUT;;
285        hosterlist) $INPUT;;
286        hoster) $INPUT;;
287esac
288
Note: See TracBrowser for help on using the repository browser.