1 | #!/bin/sh |
---|
2 | # first sh box parser for titannit mfg obi |
---|
3 | |
---|
4 | case $2 in |
---|
5 | init) echo skip load hoster.sh;; |
---|
6 | *) . /tmp/localhoster/hoster.sh;; |
---|
7 | esac |
---|
8 | |
---|
9 | SRC=$1 |
---|
10 | INPUT=$2 |
---|
11 | PAGE=$3 |
---|
12 | NEXT=$4 |
---|
13 | PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'` |
---|
14 | |
---|
15 | FILENAME="`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'` $INPUT $PAGE $NEXT" |
---|
16 | FILENAME="`echo $FILENAME | sed -e 's/\&\+/./g' -e 's#\/\+#.#g' -e 's/\?\+/./g' -e 's/;\+/./g' -e 's/=\+/./g' -e 's/ \+/./g' -e 's/\.\+/./g'`" |
---|
17 | PICNAME=`echo $FILENAME` |
---|
18 | |
---|
19 | if [ -z "$FILENAME" ]; then |
---|
20 | FILENAME=none |
---|
21 | fi |
---|
22 | |
---|
23 | #URL=http://www.myspass.de |
---|
24 | URL=http://m.myspass.de |
---|
25 | NAME="MySpass" |
---|
26 | |
---|
27 | mkdir $TMP > /dev/null 2>&1 |
---|
28 | |
---|
29 | if [ `echo $SRC | grep ^"/mnt/parser" | wc -l` -gt 0 ];then |
---|
30 | TYPE="$SRC - Shell script" |
---|
31 | elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then |
---|
32 | TYPE="Swap - Shell script" |
---|
33 | elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then |
---|
34 | TYPE="Mnt - Shell script" |
---|
35 | else |
---|
36 | TYPE="Flash - Shell script" |
---|
37 | fi |
---|
38 | |
---|
39 | init() |
---|
40 | { |
---|
41 | rm -rf $TMP > /dev/null 2>&1 |
---|
42 | echo "$NAME ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0" |
---|
43 | } |
---|
44 | |
---|
45 | mainmenu() |
---|
46 | { |
---|
47 | echo "Ganze Folgen#$SRC $SRC season 'api/index.php?command=formats' 1#http://atemio.dyndns.tv/mediathek/menu/shows.jpg#shows.jpg#$NAME#0" >$TMP/$FILENAME.list |
---|
48 | echo "Suchen#$SRC $SRC search 'frontend/json/search-videos.php?QUERY_STRING=%search%' 1#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >>$TMP/$FILENAME.list |
---|
49 | echo "$TMP/$FILENAME.list" |
---|
50 | } |
---|
51 | |
---|
52 | season() |
---|
53 | { |
---|
54 | rm "$TMP/$FILENAME.list" |
---|
55 | |
---|
56 | if [ ! -e "$TMP/$FILENAME.list" ]; then |
---|
57 | $curlbin -o - $URL/$PAGE | sed 's/{"format_id":/\n{"format_id":/g' | awk -v SRC=$SRC -v NAME=$NAME -v PICNAME=$PICNAME -v INPUT=$INPUT -v PAGE=$PAGE -v NEXT=$NEXT \ |
---|
58 | ' |
---|
59 | # BEGIN variable setzen |
---|
60 | BEGIN \ |
---|
61 | { |
---|
62 | # setzt suchvariable auf 0 vor dem start |
---|
63 | piccount = 0 |
---|
64 | pages = "1" |
---|
65 | } |
---|
66 | /"format_id"/ \ |
---|
67 | { |
---|
68 | i = index($0, "\"format_id\":\"") + 13 |
---|
69 | j = index(substr($0, i), "\",\"") - 1 |
---|
70 | id = substr($0, i, j) |
---|
71 | |
---|
72 | i = index($0, "\"format\":\"") + 10 |
---|
73 | j = index(substr($0, i), "\",\"") - 1 |
---|
74 | title = substr($0, i, j) |
---|
75 | |
---|
76 | i = index($0, "\"number_of_seasons\":\"") + 21 |
---|
77 | j = index(substr($0, i), "\",\"") - 1 |
---|
78 | extra = substr($0, i, j) |
---|
79 | |
---|
80 | i = index($0, "\"node_id\":\"") + 11 |
---|
81 | j = index(substr($0, i), "\"") - 1 |
---|
82 | newpage = substr($0, i, j) |
---|
83 | gsub(/\\/, "", newpage) |
---|
84 | |
---|
85 | i = index($0, "\"original_image\":\"") + 18 |
---|
86 | j = index(substr($0, i), "\"") - 1 |
---|
87 | pic = substr($0, i, j) |
---|
88 | gsub(/\\/, "", pic) |
---|
89 | |
---|
90 | piccount += 1 |
---|
91 | if ( pic == "" ) |
---|
92 | { |
---|
93 | pic = "http://atemio.dyndns.tv/mediathek/menu/default.jpg" |
---|
94 | } |
---|
95 | else |
---|
96 | pic = "http:" pic |
---|
97 | |
---|
98 | print title " (" extra " Staffeln)#" SRC " " SRC " year \x27api/index.php?command=seasonslist&id=" id "\x27#" pic "#" PICNAME "." piccount ".jpg#" NAME "#0" |
---|
99 | |
---|
100 | next |
---|
101 | } |
---|
102 | # END |
---|
103 | # { |
---|
104 | # if (curpage != pages) |
---|
105 | # print "Page (" NEXT + 1 "/" pages ")#" SRC " " SRC " " INPUT " \x27" PAGE "\x27 " NEXT + 1 "#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#" NAME "#0" |
---|
106 | # } |
---|
107 | # schreibe alles in die list datei |
---|
108 | ' >$TMP/$FILENAME.list |
---|
109 | fi |
---|
110 | # gebe titan den list namen mit pfad zurueck |
---|
111 | echo "$TMP/$FILENAME.list" |
---|
112 | } |
---|
113 | |
---|
114 | year() |
---|
115 | { |
---|
116 | if [ ! -e "$TMP/$FILENAME.list" ]; then |
---|
117 | $curlbin -o - $URL/$PAGE | sed 's/{"season_id":/\n{"season_id":/g' | awk -v SRC=$SRC -v NAME=$NAME -v PICNAME=$PICNAME -v INPUT=$INPUT -v PAGE=$PAGE -v NEXT=$NEXT \ |
---|
118 | ' |
---|
119 | # BEGIN variable setzen |
---|
120 | BEGIN \ |
---|
121 | { |
---|
122 | # setzt suchvariable auf 0 vor dem start |
---|
123 | piccount = 0 |
---|
124 | pages = "1" |
---|
125 | } |
---|
126 | /"season_id"/ \ |
---|
127 | { |
---|
128 | i = index($0, "\"season_id\":\"") + 13 |
---|
129 | j = index(substr($0, i), "\",\"") - 1 |
---|
130 | id = substr($0, i, j) |
---|
131 | |
---|
132 | i = index($0, "\"season_number\":\"") + 17 |
---|
133 | j = index(substr($0, i), "\",\"") - 1 |
---|
134 | title = substr($0, i, j) |
---|
135 | |
---|
136 | i = index($0, "\"season_name\":\"") + 15 |
---|
137 | j = index(substr($0, i), "\",\"") - 1 |
---|
138 | extra = substr($0, i, j) |
---|
139 | |
---|
140 | i = index($0, "\"node_id\":\"") + 11 |
---|
141 | j = index(substr($0, i), "\"") - 1 |
---|
142 | newpage = substr($0, i, j) |
---|
143 | gsub(/\\/, "", newpage) |
---|
144 | |
---|
145 | i = index($0, "\"original_image\":\"") + 18 |
---|
146 | j = index(substr($0, i), "\"") - 1 |
---|
147 | pic = substr($0, i, j) |
---|
148 | gsub(/\\/, "", pic) |
---|
149 | |
---|
150 | piccount += 1 |
---|
151 | if ( pic == "" ) |
---|
152 | { |
---|
153 | pic = "http://atemio.dyndns.tv/mediathek/menu/default.jpg" |
---|
154 | } |
---|
155 | else |
---|
156 | pic = "http:" pic |
---|
157 | |
---|
158 | print "Staffel " title " (" extra ")#" SRC " " SRC " episodes \x27api/index.php?command=seasonepisodes&id=" id "\x27#" pic "#" PICNAME "." piccount ".jpg#" NAME "#0" |
---|
159 | |
---|
160 | next |
---|
161 | } |
---|
162 | # END |
---|
163 | # { |
---|
164 | # if (curpage != pages) |
---|
165 | # print "Page (" NEXT + 1 "/" pages ")#" SRC " " SRC " " INPUT " \x27" PAGE "\x27 " NEXT + 1 "#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#" NAME "#0" |
---|
166 | # } |
---|
167 | # schreibe alles in die list datei |
---|
168 | ' >$TMP/$FILENAME.list |
---|
169 | fi |
---|
170 | # gebe titan den list namen mit pfad zurueck |
---|
171 | echo "$TMP/$FILENAME.list" |
---|
172 | } |
---|
173 | |
---|
174 | episodes() |
---|
175 | { |
---|
176 | if [ ! -e "$TMP/$FILENAME.list" ]; then |
---|
177 | $curlbin -o - $URL/$PAGE | sed 's/{"format":/\n{"format":/g' | awk -v SRC=$SRC -v NAME=$NAME -v PICNAME=$PICNAME -v INPUT=$INPUT -v PAGE=$PAGE -v NEXT=$NEXT \ |
---|
178 | ' |
---|
179 | # BEGIN variable setzen |
---|
180 | BEGIN \ |
---|
181 | { |
---|
182 | # setzt suchvariable auf 0 vor dem start |
---|
183 | piccount = 0 |
---|
184 | pages = "1" |
---|
185 | } |
---|
186 | /"format"/ \ |
---|
187 | { |
---|
188 | i = index($0, "\"episode_id\":\"") + 14 |
---|
189 | j = index(substr($0, i), "\",\"") - 1 |
---|
190 | id = substr($0, i, j) |
---|
191 | |
---|
192 | i = index($0, "\"title\":\"") + 9 |
---|
193 | j = index(substr($0, i), "\",\"") - 1 |
---|
194 | title = substr($0, i, j) |
---|
195 | gsub(" - Teil 1", "", title) |
---|
196 | |
---|
197 | i = index($0, "\"season_name\":\"") + 15 |
---|
198 | j = index(substr($0, i), "\",\"") - 1 |
---|
199 | extra = substr($0, i, j) |
---|
200 | |
---|
201 | i = index($0, "\"season_number\":\"") + 17 |
---|
202 | j = index(substr($0, i), "\",\"") - 1 |
---|
203 | season = substr($0, i, j) |
---|
204 | |
---|
205 | i = index($0, "\"episode_nr\":\"") + 14 |
---|
206 | j = index(substr($0, i), "\",\"") - 1 |
---|
207 | episode = substr($0, i, j) |
---|
208 | |
---|
209 | i = index($0, "\"myspass_url\":\"") + 15 |
---|
210 | j = index(substr($0, i), "\"") - 1 |
---|
211 | newpage = substr($0, i, j) |
---|
212 | gsub(/\\/, "", newpage) |
---|
213 | |
---|
214 | i = index($0, "\"original_image\":\"") + 18 |
---|
215 | j = index(substr($0, i), "\"") - 1 |
---|
216 | pic = substr($0, i, j) |
---|
217 | gsub(/\\/, "", pic) |
---|
218 | |
---|
219 | piccount += 1 |
---|
220 | if ( pic == "" ) |
---|
221 | { |
---|
222 | pic = "http://atemio.dyndns.tv/mediathek/menu/default.jpg" |
---|
223 | } |
---|
224 | print "S" season "E" episode " - " title "#" SRC " " SRC " parts \x27" newpage "\x27#http:" pic "#" PICNAME "." piccount ".jpg#" NAME "#0" |
---|
225 | |
---|
226 | next |
---|
227 | } |
---|
228 | # END |
---|
229 | # { |
---|
230 | # if (curpage != pages) |
---|
231 | # print "Page (" NEXT + 1 "/" pages ")#" SRC " " SRC " " INPUT " \x27" PAGE "\x27 " NEXT + 1 "#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#" NAME "#0" |
---|
232 | # } |
---|
233 | # schreibe alles in die list datei |
---|
234 | ' >$TMP/$FILENAME.list |
---|
235 | fi |
---|
236 | # gebe titan den list namen mit pfad zurueck |
---|
237 | echo "$TMP/$FILENAME.list" |
---|
238 | } |
---|
239 | |
---|
240 | search() |
---|
241 | { |
---|
242 | if [ ! -e "$TMP/$FILENAME.list" ]; then |
---|
243 | $curlbin -o - $URL/$PAGE | sed 's/{"uniqueID":/\n{"uniqueID":/g' | awk -v SRC=$SRC -v NAME=$NAME -v PICNAME=$PICNAME -v INPUT=$INPUT -v PAGE=$PAGE -v NEXT=$NEXT \ |
---|
244 | ' |
---|
245 | # BEGIN variable setzen |
---|
246 | BEGIN \ |
---|
247 | { |
---|
248 | # setzt suchvariable auf 0 vor dem start |
---|
249 | piccount = 0 |
---|
250 | pages = "1" |
---|
251 | } |
---|
252 | /"uniqueID"/ \ |
---|
253 | { |
---|
254 | # print "1111111" $0 |
---|
255 | i = index($0, "\"title\":\"") + 9 |
---|
256 | j = index(substr($0, i), "\",\"") - 1 |
---|
257 | title = substr($0, i, j) |
---|
258 | # print "title: " title |
---|
259 | |
---|
260 | i = index($0, "\"broadcast\":\"") + 13 |
---|
261 | j = index(substr($0, i), "\",\"") - 1 |
---|
262 | extra = substr($0, i, j) |
---|
263 | # print "extra: " extra |
---|
264 | |
---|
265 | i = index($0, "\"url\":\"") + 7 |
---|
266 | j = index(substr($0, i), "\"") - 1 |
---|
267 | newpage = substr($0, i, j) |
---|
268 | gsub(/\\/, "", newpage) |
---|
269 | |
---|
270 | # print "newpage: " newpage |
---|
271 | |
---|
272 | i = index($0, "\"teaser\":\"") + 10 |
---|
273 | j = index(substr($0, i), "\"") - 1 |
---|
274 | pic = substr($0, i, j) |
---|
275 | gsub(/\\/, "", pic) |
---|
276 | # print "pic: " pic |
---|
277 | |
---|
278 | piccount += 1 |
---|
279 | if ( pic == "" ) |
---|
280 | { |
---|
281 | pic = "http://atemio.dyndns.tv/mediathek/menu/default.jpg" |
---|
282 | } |
---|
283 | print title " (" extra ")#" SRC " " SRC " hoster \x27" newpage "\x27#" pic "#" PICNAME "." piccount ".jpg#" NAME "#111" |
---|
284 | next |
---|
285 | } |
---|
286 | # END |
---|
287 | # { |
---|
288 | # if (curpage != pages) |
---|
289 | # print "Page (" NEXT + 1 "/" pages ")#" SRC " " SRC " " INPUT " \x27" PAGE "\x27 " NEXT + 1 "#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#" NAME "#0" |
---|
290 | # } |
---|
291 | # schreibe alles in die list datei |
---|
292 | ' >$TMP/$FILENAME.list |
---|
293 | fi |
---|
294 | # gebe titan den list namen mit pfad zurueck |
---|
295 | echo "$TMP/$FILENAME.list" |
---|
296 | } |
---|
297 | |
---|
298 | hoster() |
---|
299 | { |
---|
300 | echo $URL$PAGE |
---|
301 | } |
---|
302 | |
---|
303 | play() |
---|
304 | { |
---|
305 | echo $URL$PAGE |
---|
306 | } |
---|
307 | |
---|
308 | parts() |
---|
309 | { |
---|
310 | rm $TMP/$FILENAME.list |
---|
311 | if [ ! -e "$TMP/$FILENAME.list" ]; then |
---|
312 | FOUND=`echo $PAGE | sed 's/Teil/\n/g' | grep ^http | sed 's!http://www.myspass.de/myspass!!g' | sed 's!http://www.myspass.de!!g'` |
---|
313 | # IDLIST=`$curlbin "$PAGE" | grep "$FOUND" | sed 's/<a href=/\nfound=/g' | grep ^found= | grep title= | grep -v myspassTeaserTextDesc | cut -d '"' -f2 | sort -u | tr '/' ' ' | awk '{ print $NF }'` |
---|
314 | IDLIST=`$curlbin "$PAGE" | grep "$FOUND"| sed 's/<a href=/\nfound=/g' | grep ^found= | tr -d ' ' | cut -d "/" -f6 | sort -u` |
---|
315 | |
---|
316 | for ROUND in $IDLIST; do |
---|
317 | $curlbin http://www.myspass.de/includes/apps/video/getvideometadataxml.php?id=$ROUND > "$TMP/cache.$FILENAME.$ROUND.1" |
---|
318 | |
---|
319 | # <title><![CDATA[23. September 2006 - Teil 1]]></title> |
---|
320 | # <url_flv><![CDATA[http://x3583brainc11021.s.o.l.lb.core-cdn.net/secdl/9b7b49482bf7ba65145bc28c6c3ac7b5/58ea7331/11021brainpool/ondemand/3583brainpool/163840/myspass2009/82/578/9231/12073/12073_61.mp4]]></url_flv> |
---|
321 | # <imagePreview><![CDATA[//www.myspass.de/myspass/media/images/videos/73/12073_640x360.jpg]]></imagePreview> |
---|
322 | |
---|
323 | TITLE="`cat $TMP/cache.$FILENAME.$ROUND.1 | sed 's/<title><!\[CDATA\[/\nfound=\]/g' | grep ^found= | cut -d"]" -f2`" |
---|
324 | NEWPAGE="`cat $TMP/cache.$FILENAME.$ROUND.1 | sed 's/<url_flv><!\[CDATA\[/\nfound=\]/g' | grep ^found= | cut -d"]" -f2`" |
---|
325 | PIC="http:`cat $TMP/cache.$FILENAME.$ROUND.1 | sed 's/<imagePreview><!\[CDATA\[/\nfound=\]/g' | grep ^found= | cut -d"]" -f2`" |
---|
326 | |
---|
327 | if [ -z "$PIC" ] || "$PIC" = "http:" ] ; then |
---|
328 | PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg" |
---|
329 | fi |
---|
330 | |
---|
331 | echo "$TITLE#$NEWPAGE#$PIC#$PICNAME$piccount.jpg#$NAME#2" >> $TMP/$FILENAME.list |
---|
332 | |
---|
333 | done |
---|
334 | fi |
---|
335 | |
---|
336 | echo "$TMP/$FILENAME.list" |
---|
337 | } |
---|
338 | |
---|
339 | case $INPUT in |
---|
340 | init) $INPUT;; |
---|
341 | mainmenu) $INPUT;; |
---|
342 | search) $INPUT;; |
---|
343 | season) $INPUT;; |
---|
344 | year) $INPUT;; |
---|
345 | episodes) $INPUT;; |
---|
346 | play) $INPUT;; |
---|
347 | parts) $INPUT;; |
---|
348 | esac |
---|