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

Last change on this file since 39006 was 39006, checked in by Stephan, 8 years ago

[tithek] fix bs all series

  • Property svn:executable set to *
File size: 9.6 KB
RevLine 
[36952]1#!/bin/bash
2# titannit box parser for burning series
3
[37156]4. /tmp/localhoster/hoster.sh
5
[36952]6SRC=$1
7INPUT=$2
8PARAM=$3
9PARAM2=$4
[37466]10URL="https://bs.to/"
[36952]11PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
[36960]12NAME="burningseries"
[37466]13curlbin="curl -k -s"
[37152]14
[38932]15#rm -rf $TMP > /dev/null 2>&1
[36952]16mkdir $TMP > /dev/null 2>&1
17
18if [ `echo $SRC | grep ^"/mnt/parser" |wc -l` -gt 0 ];then
19        TYPE="$SRC - Shell script"
20elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then
21        TYPE="Swap - Shell script"
22elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then
23        TYPE="Mnt - Shell script"
24else
25        TYPE="Flash - Shell script"
26fi
27
28init()
29{
[36980]30        echo "Burning Series ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0"
[36952]31}
32
33mainmenu()
34{
35        echo "Genres#$SRC $SRC genres#http://atemio.dyndns.tv/mediathek/menu/serien.genre.jpg#serien.genre.jpg#$NAME#0" >/tmp/tithek/$PARSER.mainmenu.list
[39006]36        echo "All Series#$SRC $SRC series#http://atemio.dyndns.tv/mediathek/menu/serien.jpg#serien.jpg#$NAME#0" >>/tmp/tithek/$PARSER.mainmenu.list
[36952]37        echo "Search#$SRC $SRC search#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#0" >>/tmp/tithek/$PARSER.mainmenu.list
38        echo "/tmp/tithek/$PARSER.mainmenu.list"
39}
40
41genres()
42{
[37466]43        $curlbin -o - $URL"andere-serien" | awk -v SRC=$SRC -v NAME=$NAME '
[36952]44BEGIN { in_genres = 0
45      }
46
47/<div class="genre">/ { in_genres = 1
48                        next
49                      }
50
51/<span><strong>/ { i = index($0, "<span><strong>") + 14
52                   j = index($0, "</strong></span>") - i
[39006]53                   title = substr($0, i, j)
54                   pic = tolower(title)
[36952]55                   print title "#" SRC " " SRC " series " title "#http://atemio.dyndns.tv/mediathek/menu/" pic ".jpg#" pic ".jpg#" NAME "#0"
56                   next
57                 }
[39006]58
[36952]59' >/tmp/tithek/$PARSER.genres.list
60        echo "/tmp/tithek/$PARSER.genres.list"
61}
62
63series()
64{
[37466]65        $curlbin -o - $URL"andere-serien" | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME '
[36952]66/<span><strong>/ { i = index($0, "<span><strong>") + 14
67                   j = index($0, "</strong></span>") - i
68                   genre = substr($0, i, j)
69                 }
70
71/<li><a href=\"/ { if (genre == PARAM) {
72                      i = index($0, "<li><a href=\"") + 13
73                      j = index(substr($0, i), "\">") - 1
74                      url = substr($0, i, j)
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
86staffel()
87{
[37466]88        $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME '
[36952]89/<li class=\" current\">/ { sub(/<li class=\" current\">/, "<li class=\" \">", $0)
90                          }
91
92/<li class=\" \"><a href="/ { i = index($0, "<li class=\" \"><a href=\"") + 23
93                              j = index(substr($0, i), "\">") - 1
94                              url = substr($0, i, j)
95                              k = i + j + 2
96                              l = index(substr($0, k), "</a></li>") - 1
97                              staffel = substr($0, k, l)
98                              print "Staffel " staffel "#" SRC " " SRC " episode " url " " staffel "#http://atemio.dyndns.tv/mediathek/menu/s" staffel ".jpg#s" staffel ".jpg#" NAME "#0"
99                            }
100' >/tmp/tithek/$PARSER.staffel.list
101        echo "/tmp/tithek/$PARSER.staffel.list"
102}
103
104episode()
105{
[37466]106        $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME '
[36952]107BEGIN { in_table_row = 0
108        episode = ""
109        url = ""
110        title = ""
111      }
112/<tr>/ { in_table_row = 1
113         next
114       }
115/<td><a href=\"/ { if (in_table_row == 1) {
116                      i = index($0, "<td><a href=\"") + 13
117                      j = index(substr($0, i), "\">") - 1
118                      url = substr($0, i, j)
119                   }
120                   next
121                 }
122
123/<td>/ { if (in_table_row == 1) {
124            i = index($0, "<td>") + 4
125            j = index(substr($0, i), "</td>") - 1
126            episode = substr($0, i, j)
127         }
128         next
129       }
130
131/<strong>/ { if (in_table_row == 1) {
132                i = index($0, "<strong>") + 8
133                j = index(substr($0, i), "</strong>") - 1
134                title = substr($0, i, j)
135                do {
136                   i = match(title, /&#[0-2][0-9][0-9];/)
137                   if (i != 0) {
138                      j = substr(title, i + 2, 3) * 1
139                      title = substr(title, 1, i - 1) sprintf("%c", j) substr(title, i + 6)
140                   }
141                } while(i != 0)
142             }
143             next
144           }
145
146/<\/tr>/ { if (in_table_row == 1) {
147             if (episode != "") {
[36972]148                print title "#" SRC " " SRC " hosterlist " url "#http://atemio.dyndns.tv/mediathek/menu/s" PARAM2 "e" episode ".jpg#s" PARAM2 "e" episode ".jpg#" NAME "#0"
[36952]149                title = ""
150                url = ""
151                episode = ""
152             }
153             in_table_row = 0
154          }
155          next
156        }
157
158/<li class=\" current\">/ { sub(/<li class=\" current\">/, "<li class=\" \">", $0)
159                          }
160' >/tmp/tithek/$PARSER.episode.list
161        echo "/tmp/tithek/$PARSER.episode.list"
162}
163
[36972]164hosterlist()
[36952]165{
[37466]166        $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME '
[36972]167BEGIN { in_hosterlist = 0
[36952]168        url = ""
169        title = ""
170      }
171
[36972]172/<h3>Hoster dieser Episode<\/h3>/ { in_hosterlist = 1
[36952]173                                    next
174                                  }
175
[36972]176/href=\"/ { if (in_hosterlist == 1) {
[36952]177               i = index($0, "href=\"") + 6
178               j = index(substr($0, i), "\">") - 1
179               url = substr($0, i, j)
180            }
181            next
182          }
183
[36972]184/<\/span> / { if (in_hosterlist == 1) {
[36952]185                 i = index($0, "</span> ") + 8
186                 j = index(substr($0, i), "</a>") - 1
187                 title = substr($0, i, j)
[36972]188                 i = index($0, "</span> ") + 8
189                 j = index(substr($0, i), " -") - 1
190                 pic = substr($0, i, j)
191                 pic = tolower(pic)
192                 print title "#" SRC " " SRC " hoster " url "#http://atemio.dyndns.tv/mediathek/menu/" pic ".jpg#" pic ".jpg#" NAME "#111"
[36952]193              }
194              next
195            }
196
[36972]197/<\/ul>/ { in_hosterlist = 0
[36952]198          next
199        }
200
[36972]201' >/tmp/tithek/$PARSER.hosterlist.list
202        echo "/tmp/tithek/$PARSER.hosterlist.list"
[36952]203}
204
[38932]205
206###################
207# in_hoster
208###################
209#<div id="video_actions">
210#                <div>
211#            <a href="http://vivo.sx/dcd747a9af" target="_blank"><span class="icon link_go"></span> Link zum Originalvideo</a>
212#                    </div>
213#            </div>
214#    <br style="clear:both;"/>
215
216###################
217# in_hoster_iframe
218###################
219#<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>
220#        <div id="video_actions">
221#                <div>
222#            <a href="javascript:alert(&#039;Nicht möglich&#039;);" target="_blank"><span class="icon link_go"></span> Link zum Originalvideo</a>
223#                    </div>
224#            </div>
225#    <br style="clear:both;"/>
[39006]226
[36972]227hoster()
[36952]228{
[37466]229        $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME '
[36972]230BEGIN { in_hosterlist = 0
[36952]231        url = ""
232        title = ""
233      }
234
[38932]235/<iframe scrolling=/ { in_hoster_iframe = 1
236                               prew
237                             }
238
239/src=/ { if (in_hoster_iframe == 1) {
240                  i = index($0, "src=") + 5
241                  j = index(substr($0, i), ">") - 2
242                  url = substr($0, i, j)
243                  i = index($0, "<a href=\"") + 16
244                  j = index(substr($0, i), "/") - 1
245                  title = substr($0, i, j)
[39006]246
[38932]247#                  print "Originalvideo#" url "#http://atemio.dyndns.tv/mediathek/menu/default.jpg#default.jpg#" NAME "#140"
248#                  print title "#" url "#http://atemio.dyndns.tv/mediathek/menu/" title ".jpg#" title ".jpg#" NAME "#14"
249                  print url
250               }
251               next
252             }
253
[36972]254/<div id=\"video_actions\">/ { in_hoster = 1
[36952]255                               next
256                             }
257
[38932]258/<a href=\"/ { if (in_hoster == 1 && in_hoster_iframe == 0) {
[36952]259                  i = index($0, "<a href=\"") + 9
260                  j = index(substr($0, i), "\"") - 1
261                  url = substr($0, i, j)
[36961]262
263                  i = index($0, "<a href=\"") + 16
264                  j = index(substr($0, i), "/") - 1
265                  title = substr($0, i, j)
[39006]266
[36966]267#                  print "Originalvideo#" url "#http://atemio.dyndns.tv/mediathek/menu/default.jpg#default.jpg#" NAME "#140"
268#                  print title "#" url "#http://atemio.dyndns.tv/mediathek/menu/" title ".jpg#" title ".jpg#" NAME "#14"
269                  print url
[36952]270               }
271               next
272             }
273
[36972]274/<\/div>/ { in_hoster = 0
[38932]275                        in_hoster_iframe = 0
[36952]276            next
277          }
278
[36972]279' >/tmp/tithek/$PARSER.hoster.list
280#       echo "/tmp/tithek/$PARSER.hoster.list"
281        cat     "/tmp/tithek/$PARSER.hoster.list"
[36952]282}
283
284case $INPUT in
285        init) $INPUT;;
286        mainmenu) $INPUT;;
287        genres) $INPUT;;
288        series) $INPUT;;
289        staffel) $INPUT;;
290        episode) $INPUT;;
[36972]291        hosterlist) $INPUT;;
[36952]292        hoster) $INPUT;;
293esac
294
Note: See TracBrowser for help on using the repository browser.