1 | #!/bin/bash |
---|
2 | # titannit box parser for burning series |
---|
3 | |
---|
4 | . /tmp/localhoster/hoster.sh |
---|
5 | |
---|
6 | SRC=$1 |
---|
7 | INPUT=$2 |
---|
8 | PARAM=$3 |
---|
9 | PARAM2=$4 |
---|
10 | URL="https://bs.to/" |
---|
11 | PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'` |
---|
12 | NAME="burningseries" |
---|
13 | curlbin="curl -k -s" |
---|
14 | |
---|
15 | #rm -rf $TMP > /dev/null 2>&1 |
---|
16 | mkdir $TMP > /dev/null 2>&1 |
---|
17 | |
---|
18 | if [ `echo $SRC | grep ^"/mnt/parser" |wc -l` -gt 0 ];then |
---|
19 | TYPE="$SRC - Shell script" |
---|
20 | elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then |
---|
21 | TYPE="Swap - Shell script" |
---|
22 | elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then |
---|
23 | TYPE="Mnt - Shell script" |
---|
24 | else |
---|
25 | TYPE="Flash - Shell script" |
---|
26 | fi |
---|
27 | |
---|
28 | init() |
---|
29 | { |
---|
30 | echo "Burning Series ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0" |
---|
31 | } |
---|
32 | |
---|
33 | mainmenu() |
---|
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 |
---|
36 | echo "All Series#$SRC $SRC allseries#http://atemio.dyndns.tv/mediathek/menu/serien.jpg#serien.jpg#$NAME#0" >>/tmp/tithek/$PARSER.mainmenu.list |
---|
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 | |
---|
41 | genres() |
---|
42 | { |
---|
43 | $curlbin -o - $URL"andere-serien" | awk -v SRC=$SRC -v NAME=$NAME ' |
---|
44 | BEGIN { 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 |
---|
53 | title = substr($0, i, j) |
---|
54 | pic = tolower(title) |
---|
55 | print title "#" SRC " " SRC " series " title "#http://atemio.dyndns.tv/mediathek/menu/" pic ".jpg#" pic ".jpg#" NAME "#0" |
---|
56 | next |
---|
57 | } |
---|
58 | |
---|
59 | ' >/tmp/tithek/$PARSER.genres.list |
---|
60 | echo "/tmp/tithek/$PARSER.genres.list" |
---|
61 | } |
---|
62 | |
---|
63 | series() |
---|
64 | { |
---|
65 | $curlbin -o - $URL"andere-serien" | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME ' |
---|
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 | |
---|
86 | staffel() |
---|
87 | { |
---|
88 | $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME ' |
---|
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 | |
---|
104 | episode() |
---|
105 | { |
---|
106 | $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME ' |
---|
107 | BEGIN { 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 != "") { |
---|
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" |
---|
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 | |
---|
164 | hosterlist() |
---|
165 | { |
---|
166 | $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME ' |
---|
167 | BEGIN { in_hosterlist = 0 |
---|
168 | url = "" |
---|
169 | title = "" |
---|
170 | } |
---|
171 | |
---|
172 | /<h3>Hoster dieser Episode<\/h3>/ { in_hosterlist = 1 |
---|
173 | next |
---|
174 | } |
---|
175 | |
---|
176 | /href=\"/ { if (in_hosterlist == 1) { |
---|
177 | i = index($0, "href=\"") + 6 |
---|
178 | j = index(substr($0, i), "\">") - 1 |
---|
179 | url = substr($0, i, j) |
---|
180 | } |
---|
181 | next |
---|
182 | } |
---|
183 | |
---|
184 | /<\/span> / { if (in_hosterlist == 1) { |
---|
185 | i = index($0, "</span> ") + 8 |
---|
186 | j = index(substr($0, i), "</a>") - 1 |
---|
187 | title = substr($0, i, j) |
---|
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" |
---|
193 | } |
---|
194 | next |
---|
195 | } |
---|
196 | |
---|
197 | /<\/ul>/ { in_hosterlist = 0 |
---|
198 | next |
---|
199 | } |
---|
200 | |
---|
201 | ' >/tmp/tithek/$PARSER.hosterlist.list |
---|
202 | echo "/tmp/tithek/$PARSER.hosterlist.list" |
---|
203 | } |
---|
204 | |
---|
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('Nicht möglich');" target="_blank"><span class="icon link_go"></span> Link zum Originalvideo</a> |
---|
223 | # </div> |
---|
224 | # </div> |
---|
225 | # <br style="clear:both;"/> |
---|
226 | |
---|
227 | hoster() |
---|
228 | { |
---|
229 | $curlbin -o - $URL$PARAM | awk -v PARAM=$PARAM -v PARAM2=$PARAM2 -v SRC=$SRC -v NAME=$NAME ' |
---|
230 | BEGIN { in_hosterlist = 0 |
---|
231 | url = "" |
---|
232 | title = "" |
---|
233 | } |
---|
234 | |
---|
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) |
---|
246 | |
---|
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 | |
---|
254 | /<div id=\"video_actions\">/ { in_hoster = 1 |
---|
255 | next |
---|
256 | } |
---|
257 | |
---|
258 | /<a href=\"/ { if (in_hoster == 1 && in_hoster_iframe == 0) { |
---|
259 | i = index($0, "<a href=\"") + 9 |
---|
260 | j = index(substr($0, i), "\"") - 1 |
---|
261 | url = substr($0, i, j) |
---|
262 | |
---|
263 | i = index($0, "<a href=\"") + 16 |
---|
264 | j = index(substr($0, i), "/") - 1 |
---|
265 | title = substr($0, i, j) |
---|
266 | |
---|
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 |
---|
270 | } |
---|
271 | next |
---|
272 | } |
---|
273 | |
---|
274 | /<\/div>/ { in_hoster = 0 |
---|
275 | in_hoster_iframe = 0 |
---|
276 | next |
---|
277 | } |
---|
278 | |
---|
279 | ' >/tmp/tithek/$PARSER.hoster.list |
---|
280 | # echo "/tmp/tithek/$PARSER.hoster.list" |
---|
281 | cat "/tmp/tithek/$PARSER.hoster.list" |
---|
282 | } |
---|
283 | |
---|
284 | case $INPUT in |
---|
285 | init) $INPUT;; |
---|
286 | mainmenu) $INPUT;; |
---|
287 | genres) $INPUT;; |
---|
288 | series) $INPUT;; |
---|
289 | staffel) $INPUT;; |
---|
290 | episode) $INPUT;; |
---|
291 | hosterlist) $INPUT;; |
---|
292 | hoster) $INPUT;; |
---|
293 | esac |
---|
294 | |
---|