1 | #ifndef KINOX_H |
---|
2 | #define KINOX_H |
---|
3 | |
---|
4 | // flag 1 = putlocker/sockshare |
---|
5 | // flag 2 = filenuke |
---|
6 | |
---|
7 | char* kinox(char* link) |
---|
8 | { |
---|
9 | debug(99, "link: %s", link); |
---|
10 | char* streamurl = NULL; |
---|
11 | |
---|
12 | streamurl = hoster(link); |
---|
13 | // debug(99, "streamurl1: %s", streamurl); |
---|
14 | |
---|
15 | // streamurl = string_replace_all("amp;", "", streamurl, 1); |
---|
16 | // debug(99, "streamurl2: %s", streamurl); |
---|
17 | |
---|
18 | return streamurl; |
---|
19 | } |
---|
20 | |
---|
21 | int kinox_search(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag) |
---|
22 | { |
---|
23 | int ret = 1; |
---|
24 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
25 | |
---|
26 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
27 | return ret; |
---|
28 | |
---|
29 | char* search = NULL; |
---|
30 | if(flag == 0) |
---|
31 | { |
---|
32 | if(searchstr == NULL) |
---|
33 | search = textinputhist(_("Search"), " ", "searchhist"); |
---|
34 | else |
---|
35 | search = textinputhist(_("Search"), searchstr, "searchhist"); |
---|
36 | } |
---|
37 | else |
---|
38 | search = ostrcat(link, NULL, 0, 0); |
---|
39 | |
---|
40 | if(search != NULL) |
---|
41 | { |
---|
42 | drawscreen(load, 0, 0); |
---|
43 | char* tmpstr = NULL; |
---|
44 | char* tmpstr1 = NULL; |
---|
45 | char* line = NULL; |
---|
46 | char* pic = NULL; |
---|
47 | char* title = NULL; |
---|
48 | char* lang = NULL; |
---|
49 | char* langck = NULL; |
---|
50 | char* from = NULL; |
---|
51 | char* url = NULL; |
---|
52 | char* ip = NULL; |
---|
53 | char* path = NULL; |
---|
54 | char* menu = NULL; |
---|
55 | |
---|
56 | search = strstrip(search); |
---|
57 | search = stringreplacechar(search, ' ', '+'); |
---|
58 | debug(99, "search: %s", search); |
---|
59 | |
---|
60 | ip = ostrcat("kinox.me", NULL, 0, 0); |
---|
61 | if(flag == 0) |
---|
62 | path = ostrcat("Search.html?q=", search, 0, 0); |
---|
63 | else |
---|
64 | path = string_replace_all("http://kinox.me/", "", search, 0); |
---|
65 | |
---|
66 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
67 | tmpstr = string_resub("<div id=\"beep\" class=\"beep\"></div>", "</table>", tmpstr, 0); |
---|
68 | |
---|
69 | titheklog(debuglevel, "/tmp/kinox1_tmpstr", NULL, NULL, NULL, tmpstr); |
---|
70 | |
---|
71 | int count = 0; |
---|
72 | int incount = 0; |
---|
73 | int i = 0; |
---|
74 | struct splitstr* ret1 = NULL; |
---|
75 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
76 | |
---|
77 | if(ret1 != NULL) |
---|
78 | { |
---|
79 | int max = count; |
---|
80 | for(i = 0; i < max; i++) |
---|
81 | { |
---|
82 | if(oregex(".*src=\"/gr/sys/lng/(.*)\" alt=\"language\"></td>.*", ret1[i].part) != NULL) |
---|
83 | { |
---|
84 | free(langck), langck = NULL; |
---|
85 | langck = oregex(".*src=\"/gr/sys/lng/(.*)\" alt=\"language\"></td>.*", ret1[i].part); |
---|
86 | } |
---|
87 | |
---|
88 | if(oregex(".*<td class=\"Title\"><a href=\"(.*)\" onclick=.*", ret1[i].part) != NULL) |
---|
89 | { |
---|
90 | int rcret = waitrc(NULL, 10, 0); |
---|
91 | if(rcret == getrcconfigint("rcexit", NULL)) break; |
---|
92 | free(path), path = NULL; |
---|
93 | path = oregex(".*<td class=\"Title\"><a href=\"(.*)\" onclick=.*", ret1[i].part); |
---|
94 | |
---|
95 | if(ostrstr(langck, "1.png") != NULL) |
---|
96 | lang = ostrcat(lang, " (de)", 1, 0); |
---|
97 | else if(ostrstr(langck, "2.png") != NULL) |
---|
98 | lang = ostrcat(lang, " (en)", 1, 0); |
---|
99 | else |
---|
100 | lang = ostrcat(lang, " (\?\?)", 1, 0); |
---|
101 | |
---|
102 | tmpstr1 = gethttp("kinox.me", path, 80, NULL, NULL, 10000, NULL, 0); |
---|
103 | |
---|
104 | from = ostrcat("<div class=\"Grahpics\"><a href=\"", path, 0, 0); |
---|
105 | from = ostrcat(from, "\"><img src=\"", 1, 0); |
---|
106 | |
---|
107 | pic = string_resub(from, "\" alt=\"", tmpstr1, 0); |
---|
108 | |
---|
109 | if(pic == NULL) |
---|
110 | pic = ostrcat("dummy", NULL, 0, 0); |
---|
111 | |
---|
112 | title = ostrcat(path, NULL, 0, 0); |
---|
113 | title = string_replace_all("/Stream/", "", title, 1); |
---|
114 | title = string_replace_all(".html", "", title, 1); |
---|
115 | title = stringreplacechar(title, '_', ' '); |
---|
116 | title = ostrcat(title , lang, 1, 0); |
---|
117 | |
---|
118 | url = ostrcat("http://kinox.me", path, 0, 0); |
---|
119 | |
---|
120 | debug(99, "---------------------------"); |
---|
121 | debug(99, "langck: %s", langck); |
---|
122 | debug(99, "pic: %s", pic); |
---|
123 | debug(99, "title: %s", title); |
---|
124 | debug(99, "url: %s", url); |
---|
125 | debug(99, "---------------------------"); |
---|
126 | |
---|
127 | if(url != NULL) |
---|
128 | { |
---|
129 | incount += 1; |
---|
130 | line = ostrcat(line, title, 1, 0); |
---|
131 | line = ostrcat(line, "#", 1, 0); |
---|
132 | line = ostrcat(line, url, 1, 0); |
---|
133 | line = ostrcat(line, "#http://kinox.me/", 1, 0); |
---|
134 | line = ostrcat(line, pic, 1, 0); |
---|
135 | line = ostrcat(line, "#kinox_search_", 1, 0); |
---|
136 | line = ostrcat(line, oitoa(incount + time(NULL)), 1, 1); |
---|
137 | line = ostrcat(line, ".jpg#KinoX - Search#22\n", 1, 0); |
---|
138 | } |
---|
139 | free(url), url = NULL; |
---|
140 | free(path), path = NULL; |
---|
141 | free(title), title = NULL; |
---|
142 | free(pic), pic = NULL; |
---|
143 | free(from), from = NULL; |
---|
144 | free(tmpstr1), tmpstr1 = NULL; |
---|
145 | free(lang), lang = NULL; |
---|
146 | free(langck), langck = NULL; |
---|
147 | } |
---|
148 | } |
---|
149 | free(ret1), ret1 = NULL; |
---|
150 | if(line != NULL) |
---|
151 | { |
---|
152 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
153 | menu = ostrcat("/tmp/tithek/kinox.search.", oitoa(time(NULL)), 0, 1); |
---|
154 | menu = ostrcat(menu, ".list", 1, 0); |
---|
155 | |
---|
156 | writesys(menu, line, 0); |
---|
157 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
158 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
159 | ret = 0; |
---|
160 | } |
---|
161 | |
---|
162 | } |
---|
163 | free(tmpstr), tmpstr = NULL; |
---|
164 | free(ip), ip = NULL; |
---|
165 | } |
---|
166 | free(search), search = NULL; |
---|
167 | return ret; |
---|
168 | } |
---|
169 | |
---|
170 | int kinox_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag) |
---|
171 | { |
---|
172 | char* tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *menu = NULL, *search = NULL; |
---|
173 | int ret = 1, count = 0, i = 0; |
---|
174 | |
---|
175 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
176 | return ret; |
---|
177 | |
---|
178 | if(searchstr == NULL) |
---|
179 | search = textinputhist(_("Search"), " ", "searchhist"); |
---|
180 | else |
---|
181 | search = textinputhist(_("Search"), searchstr, "searchhist"); |
---|
182 | |
---|
183 | if(search != NULL) |
---|
184 | { |
---|
185 | drawscreen(load, 0, 0); |
---|
186 | |
---|
187 | strstrip(search); |
---|
188 | string_tolower(search); |
---|
189 | |
---|
190 | tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/kinox/streams/kinox.all-sorted.list", 80, NULL, HTTPAUTH, 5000, NULL, 0); |
---|
191 | |
---|
192 | struct splitstr* ret1 = NULL; |
---|
193 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
194 | |
---|
195 | if(ret1 != NULL) |
---|
196 | { |
---|
197 | int max = count; |
---|
198 | for(i = 0; i < max; i++) |
---|
199 | { |
---|
200 | |
---|
201 | tmpstr1 = ostrcat(ret1[i].part, NULL, 0, 0); |
---|
202 | tmpstr1 = stringreplacecharonce(tmpstr1, '#', '\0'); |
---|
203 | string_tolower(tmpstr1); |
---|
204 | |
---|
205 | if(ostrstr(tmpstr1, search) != NULL) |
---|
206 | { |
---|
207 | printf("found: %s\n", ret1[i].part); |
---|
208 | int rcret = waitrc(NULL, 10, 0); |
---|
209 | if(rcret == getrcconfigint("rcexit", NULL)) break; |
---|
210 | |
---|
211 | line = ostrcat(line, ret1[i].part, 1, 0); |
---|
212 | line = ostrcat(line, "\n", 0, 0); |
---|
213 | } |
---|
214 | free(tmpstr1), tmpstr1 = NULL; |
---|
215 | } |
---|
216 | free(ret1), ret1 = NULL; |
---|
217 | |
---|
218 | if(line != NULL) |
---|
219 | { |
---|
220 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
221 | menu = ostrcat("/tmp/tithek/kinox.search.", oitoa(time(NULL)), 0, 1); |
---|
222 | menu = ostrcat(menu, ".list", 1, 0); |
---|
223 | |
---|
224 | writesys(menu, line, 0); |
---|
225 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
226 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
227 | ret = 0; |
---|
228 | } |
---|
229 | } |
---|
230 | free(tmpstr), tmpstr = NULL; |
---|
231 | } |
---|
232 | free(search), search = NULL; |
---|
233 | return ret; |
---|
234 | } |
---|
235 | |
---|
236 | int kinox_hoster(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title) |
---|
237 | { |
---|
238 | debug(99, "link: %s", link); |
---|
239 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
240 | int ret = 1, series = 0; |
---|
241 | char* ip = NULL, *pos = NULL, *path = NULL, *tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *tmpstr3 = NULL, *pichname = NULL; |
---|
242 | char* tmpstr4 = NULL, *tmpstr5 = NULL, *line = NULL, *url = NULL, *url2 = NULL, *url3 = NULL, *url4 = NULL, *pathnew = NULL, *extra = NULL; |
---|
243 | |
---|
244 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
245 | return ret; |
---|
246 | |
---|
247 | ip = string_replace("http://", "", (char*)link, 0); |
---|
248 | |
---|
249 | if(ip != NULL) |
---|
250 | pos = strchr(ip, '/'); |
---|
251 | if(pos != NULL) |
---|
252 | { |
---|
253 | pos[0] = '\0'; |
---|
254 | path = pos + 1; |
---|
255 | } |
---|
256 | |
---|
257 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
258 | titheklog(debuglevel, "/tmp/kinox2_tmpstr", NULL, NULL, NULL, tmpstr); |
---|
259 | |
---|
260 | if(tmpstr != NULL) |
---|
261 | { |
---|
262 | drawscreen(load, 0, 0); |
---|
263 | if(ostrstr(tmpstr, "SeriesID") != NULL) |
---|
264 | { |
---|
265 | char* pos1 = NULL; |
---|
266 | char* from = NULL; |
---|
267 | char* folgen = NULL; |
---|
268 | int i; |
---|
269 | |
---|
270 | series = 1; |
---|
271 | |
---|
272 | for(i = 1; i < 30; i++) |
---|
273 | { |
---|
274 | from = ostrcat(from, "<option value=\"", 1, 0); |
---|
275 | from = ostrcat(from, oitoa(i), 1, 0); |
---|
276 | from = ostrcat(from, "\" rel=", 1, 0); |
---|
277 | |
---|
278 | pos1 = ostrstr(tmpstr, from); |
---|
279 | folgen = getxmlentry(ostrstr(tmpstr, from), "rel="); |
---|
280 | printf("Season %d folgen: %s\n",i , folgen); |
---|
281 | |
---|
282 | if(folgen != NULL) |
---|
283 | { |
---|
284 | int count = 0; |
---|
285 | int incount = 0; |
---|
286 | int j; |
---|
287 | struct splitstr* ret1 = NULL; |
---|
288 | ret1 = strsplit(folgen, ",", &count); |
---|
289 | |
---|
290 | if(ret1 != NULL && count > 0) |
---|
291 | { |
---|
292 | int max = count + 1; |
---|
293 | for(j = 1; j < max; j++) |
---|
294 | { |
---|
295 | incount += 1; |
---|
296 | line = ostrcat(line, _("Season"), 1, 0); |
---|
297 | line = ostrcat(line, " ", 1, 0); |
---|
298 | line = ostrcat(line, oitoa(i), 1, 0); |
---|
299 | line = ostrcat(line, " ", 1, 0); |
---|
300 | line = ostrcat(line, _("Episode"), 1, 0); |
---|
301 | line = ostrcat(line, " ", 1, 0); |
---|
302 | line = ostrcat(line, oitoa(j), 1, 0); |
---|
303 | line = ostrcat(line, "#", 1, 0); |
---|
304 | line = ostrcat(line, link, 1, 0); |
---|
305 | line = ostrcat(line, ";", 1, 0); |
---|
306 | line = ostrcat(line, oitoa(i), 1, 0); |
---|
307 | line = ostrcat(line, ";", 1, 0); |
---|
308 | line = ostrcat(line, oitoa(j), 1, 0); |
---|
309 | line = ostrcat(line, "#", 1, 0); |
---|
310 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/s", 1, 0); |
---|
311 | line = ostrcat(line, oitoa(i), 1, 0); |
---|
312 | line = ostrcat(line, "e", 1, 0); |
---|
313 | line = ostrcat(line, oitoa(j), 1, 0); |
---|
314 | line = ostrcat(line, ".jpg", 1, 0); |
---|
315 | line = ostrcat(line, "#kinox_search_", 1, 0); |
---|
316 | line = ostrcat(line, oitoa(i), 1, 0); |
---|
317 | line = ostrcat(line, "e", 1, 0); |
---|
318 | line = ostrcat(line, oitoa(j), 1, 0); |
---|
319 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
320 | line = ostrcat(line, title, 1, 0); |
---|
321 | line = ostrcat(line, "#23\n", 1, 0); |
---|
322 | } |
---|
323 | } |
---|
324 | free(ret1), ret1 = NULL; |
---|
325 | } |
---|
326 | free(from), from = NULL; |
---|
327 | free(folgen), folgen = NULL; |
---|
328 | } |
---|
329 | } |
---|
330 | else |
---|
331 | { |
---|
332 | tmpstr = string_resub("<ul id=\"HosterList\" class=\"Sortable\">", "</ul>", tmpstr, 0); |
---|
333 | titheklog(debuglevel, "/tmp/kinox3_tmpstr", NULL, NULL, NULL, tmpstr); |
---|
334 | |
---|
335 | int type = 14; |
---|
336 | int count = 0; |
---|
337 | int incount = 0; |
---|
338 | int i; |
---|
339 | struct splitstr* ret1 = NULL; |
---|
340 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
341 | |
---|
342 | char* hname = NULL; |
---|
343 | char* hnr = NULL; |
---|
344 | char* hlink = NULL; |
---|
345 | |
---|
346 | if(ret1 != NULL && count > 0) |
---|
347 | { |
---|
348 | int max = count; |
---|
349 | for(i = 0; i < max; i++) |
---|
350 | { |
---|
351 | char *mirrormaxtmp = NULL; |
---|
352 | char *pathnewtmp = NULL; |
---|
353 | int mirrormax = 1; |
---|
354 | int j = 0; |
---|
355 | |
---|
356 | mirrormaxtmp = oregex("<b>Mirror</b>: .*/(.*)<br/>.*", ret1[i].part); |
---|
357 | |
---|
358 | if(mirrormaxtmp != NULL) |
---|
359 | mirrormax = atoi(mirrormaxtmp); |
---|
360 | |
---|
361 | debug(99, "### START ####################################################"); |
---|
362 | |
---|
363 | for(j = 1; j < mirrormax + 1; j++) |
---|
364 | { |
---|
365 | debug(99, "(%d/%d) (%d/%d) ret1[i].part: %s",i ,max ,j ,mirrormax, ret1[i].part); |
---|
366 | |
---|
367 | hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0); |
---|
368 | |
---|
369 | hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0); |
---|
370 | |
---|
371 | if (hlink == NULL) |
---|
372 | { |
---|
373 | hlink = string_resub("rel=\"", "\">", ret1[i].part, 0); |
---|
374 | hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); |
---|
375 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
376 | pathnewtmp = ostrcat("kinox.me/aGET/Mirror/", hlink, 0, 0); |
---|
377 | pathnew = ostrcat(pathnewtmp, NULL, 0, 0); |
---|
378 | } |
---|
379 | else |
---|
380 | { |
---|
381 | hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); |
---|
382 | hlink = ostrcat(hlink, "Mirror=", 0, 0); |
---|
383 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
384 | pathnewtmp = ostrcat("kinox.me/aGET/Mirror/", hlink, 0, 0); |
---|
385 | pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1); |
---|
386 | } |
---|
387 | debug(99, "(%d/%d) (%d/%d)hnr: %s hlink: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,hname ,pathnewtmp); |
---|
388 | free(pathnewtmp), pathnewtmp= NULL; |
---|
389 | |
---|
390 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
391 | string_tolower(pichname); |
---|
392 | pichname = stringreplacecharonce(pichname, '.', '\0'); |
---|
393 | |
---|
394 | extra = string_resub("<b>Vom</b>: ", "</div>", ret1[i].part, 0); |
---|
395 | |
---|
396 | titheklog(debuglevel, "/tmp/kinox4_pathnew1", hname, NULL, NULL, pathnew); |
---|
397 | |
---|
398 | |
---|
399 | // tmpstr1 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
400 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
401 | |
---|
402 | if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL) |
---|
403 | { |
---|
404 | sleep(1); |
---|
405 | // tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
406 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
407 | } |
---|
408 | if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL) |
---|
409 | { |
---|
410 | sleep(1); |
---|
411 | // tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
412 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
413 | } |
---|
414 | if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL) |
---|
415 | { |
---|
416 | sleep(1); |
---|
417 | // tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
418 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
419 | } |
---|
420 | if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL) |
---|
421 | { |
---|
422 | sleep(1); |
---|
423 | // tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
424 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
425 | } |
---|
426 | free(pathnew), pathnew = NULL; |
---|
427 | |
---|
428 | titheklog(debuglevel, "/tmp/kinox5_tmpstr1", hname, NULL, NULL, tmpstr1); |
---|
429 | |
---|
430 | tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); |
---|
431 | if(ostrstr(tmpstr1, "iframe src") != NULL) |
---|
432 | url = string_resub("<iframe src=\"", "\"", tmpstr1, 0); |
---|
433 | else |
---|
434 | url = string_resub("<a href=\"", "\"", tmpstr1, 0); |
---|
435 | |
---|
436 | //url = ostrcat(tmpstr1, NULL, 0, 0); |
---|
437 | //////////////// |
---|
438 | /* |
---|
439 | free(pathnew), pathnew = NULL; |
---|
440 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
441 | pathnew = ostrcat(pathnew, "&Part=2", 1, 0); |
---|
442 | |
---|
443 | titheklog(debuglevel, "/tmp/kinox6_pathnew2", hname, NULL, NULL, pathnew); |
---|
444 | |
---|
445 | tmpstr3 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
446 | if(ostrstr(tmpstr3, "503 Service Temporarily Unavailable") != NULL) |
---|
447 | { |
---|
448 | sleep(1); |
---|
449 | tmpstr3 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
450 | } |
---|
451 | free(pathnew), pathnew = NULL; |
---|
452 | |
---|
453 | titheklog(debuglevel, "/tmp/kinox7_tmpstr3", hname, NULL, NULL, tmpstr3); |
---|
454 | |
---|
455 | tmpstr3 = string_replace_all("\\", "", tmpstr3, 1); |
---|
456 | if(ostrstr(tmpstr3, "iframe src") != NULL) |
---|
457 | url2 = string_resub("<iframe src=\"", "\"", tmpstr3, 0); |
---|
458 | else |
---|
459 | url2 = string_resub("<a href=\"", "\"", tmpstr3, 0); |
---|
460 | // url2 = ostrcat(tmpstr3, NULL, 0, 0); |
---|
461 | //////////////// |
---|
462 | free(pathnew), pathnew = NULL; |
---|
463 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
464 | pathnew = ostrcat(pathnew, "&Part=3", 1, 0); |
---|
465 | |
---|
466 | titheklog(debuglevel, "/tmp/kinox6_pathnew3", hname, NULL, NULL, pathnew); |
---|
467 | |
---|
468 | tmpstr4 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
469 | if(ostrstr(tmpstr4, "503 Service Temporarily Unavailable") != NULL) |
---|
470 | { |
---|
471 | sleep(1); |
---|
472 | tmpstr4 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
473 | } |
---|
474 | free(pathnew), pathnew = NULL; |
---|
475 | |
---|
476 | titheklog(debuglevel, "/tmp/kinox7_tmpstr4", hname, NULL, NULL, tmpstr4); |
---|
477 | |
---|
478 | tmpstr4 = string_replace_all("\\", "", tmpstr4, 1); |
---|
479 | if(ostrstr(tmpstr4, "iframe src") != NULL) |
---|
480 | url3 = string_resub("<iframe src=\"", "\"", tmpstr4, 0); |
---|
481 | else |
---|
482 | url3 = string_resub("<a href=\"", "\"", tmpstr4, 0); |
---|
483 | // url3 = ostrcat(tmpstr4, NULL, 0, 0); |
---|
484 | //////////////// |
---|
485 | free(pathnew), pathnew = NULL; |
---|
486 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
487 | pathnew = ostrcat(pathnew, "&Part=4", 1, 0); |
---|
488 | |
---|
489 | titheklog(debuglevel, "/tmp/kinox6_pathnew4", hname, NULL, NULL, pathnew); |
---|
490 | |
---|
491 | tmpstr5 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
492 | if(ostrstr(tmpstr5, "503 Service Temporarily Unavailable") != NULL) |
---|
493 | { |
---|
494 | sleep(1); |
---|
495 | tmpstr5 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
496 | } |
---|
497 | free(pathnew), pathnew = NULL; |
---|
498 | |
---|
499 | titheklog(debuglevel, "/tmp/kinox7_tmpstr5", hname, NULL, NULL, tmpstr5); |
---|
500 | |
---|
501 | tmpstr5 = string_replace_all("\\", "", tmpstr5, 1); |
---|
502 | if(ostrstr(tmpstr5, "iframe src") != NULL) |
---|
503 | url4 = string_resub("<iframe src=\"", "\"", tmpstr5, 0); |
---|
504 | else |
---|
505 | url4 = string_resub("<a href=\"", "\"", tmpstr5, 0); |
---|
506 | // url4 = ostrcat(tmpstr5, NULL, 0, 0); |
---|
507 | //////////////// |
---|
508 | */ |
---|
509 | type = 14; |
---|
510 | |
---|
511 | debug(99, "-------------------------------"); |
---|
512 | // if(ostrcmp(url, url2) != 0) |
---|
513 | // { |
---|
514 | // debug(99, "(%d/%d) (%d/%d) %s (Part1) url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra); |
---|
515 | // } |
---|
516 | // else |
---|
517 | // { |
---|
518 | debug(99, "(%d/%d) (%d/%d) %s url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra); |
---|
519 | // } |
---|
520 | debug(99, "-------------------------------"); |
---|
521 | |
---|
522 | incount += 1; |
---|
523 | line = ostrcat(line, hname, 1, 0); |
---|
524 | |
---|
525 | if(url == NULL) |
---|
526 | line = ostrcat(line, " (Error)", 1, 0); |
---|
527 | |
---|
528 | if(url2 != NULL && ostrcmp(url, url2) != 0) |
---|
529 | line = ostrcat(line, " (Part1)", 1, 0); |
---|
530 | if(extra != NULL) |
---|
531 | { |
---|
532 | line = ostrcat(line, " (", 1, 0); |
---|
533 | line = ostrcat(line, extra, 1, 0); |
---|
534 | line = ostrcat(line, ")", 1, 0); |
---|
535 | } |
---|
536 | |
---|
537 | line = ostrcat(line, " (Mirror ", 1, 0); |
---|
538 | line = ostrcat(line, oitoa(j), 1, 1); |
---|
539 | line = ostrcat(line, "/", 1, 0); |
---|
540 | line = ostrcat(line, oitoa(mirrormax), 1, 1); |
---|
541 | line = ostrcat(line, ")", 1, 0); |
---|
542 | |
---|
543 | |
---|
544 | line = ostrcat(line, "#", 1, 0); |
---|
545 | line = ostrcat(line, url, 1, 0); |
---|
546 | line = ostrcat(line, "#", 1, 0); |
---|
547 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
548 | line = ostrcat(line, pichname, 1, 0); |
---|
549 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
550 | line = ostrcat(line, pichname, 1, 0); |
---|
551 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
552 | line = ostrcat(line, title, 1, 0); |
---|
553 | line = ostrcat(line, "#", 1, 0); |
---|
554 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
555 | line = ostrcat(line, "\n", 1, 0); |
---|
556 | /* |
---|
557 | if((url != NULL && url2 != NULL) && ostrcmp(url, url2) != 0) |
---|
558 | { |
---|
559 | free(tmpstr2), tmpstr2 = NULL; |
---|
560 | free(hname), hname = NULL; |
---|
561 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
562 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
563 | string_tolower(pichname); |
---|
564 | pichname = stringreplacecharonce(pichname, '\n', '\0'); |
---|
565 | |
---|
566 | type = 14; |
---|
567 | |
---|
568 | debug(99, "-------------------------------"); |
---|
569 | debug(99, "(%d/%d) %s (Part2) url: %s extra: %s",i ,max, hname, url2, extra); |
---|
570 | |
---|
571 | incount += 1; |
---|
572 | line = ostrcat(line, hname, 1, 0); |
---|
573 | line = ostrcat(line, " (Part2)", 1, 0); |
---|
574 | if(extra != NULL) |
---|
575 | { |
---|
576 | line = ostrcat(line, " (", 1, 0); |
---|
577 | line = ostrcat(line, extra, 1, 0); |
---|
578 | line = ostrcat(line, ")", 1, 0); |
---|
579 | } |
---|
580 | line = ostrcat(line, "#", 1, 0); |
---|
581 | line = ostrcat(line, url2, 1, 0); |
---|
582 | line = ostrcat(line, "#", 1, 0); |
---|
583 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
584 | line = ostrcat(line, pichname, 1, 0); |
---|
585 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
586 | line = ostrcat(line, pichname, 1, 0); |
---|
587 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
588 | line = ostrcat(line, title, 1, 0); |
---|
589 | line = ostrcat(line, "#", 1, 0); |
---|
590 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
591 | line = ostrcat(line, "\n", 1, 0); |
---|
592 | free(tmpstr2), tmpstr2 = NULL; |
---|
593 | } |
---|
594 | |
---|
595 | if((url != NULL && url3 != NULL) && ostrcmp(url, url3) != 0 && ostrcmp(url2, url3) != 0) |
---|
596 | { |
---|
597 | free(tmpstr2), tmpstr2 = NULL; |
---|
598 | free(hname), hname = NULL; |
---|
599 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
600 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
601 | string_tolower(pichname); |
---|
602 | pichname = stringreplacecharonce(pichname, '\n', '\0'); |
---|
603 | type = 14; |
---|
604 | |
---|
605 | debug(99, "-------------------------------"); |
---|
606 | debug(99, "(%d/%d) %s (Part3) url: %s extra: %s",i ,max , hname, url3, extra); |
---|
607 | |
---|
608 | incount += 1; |
---|
609 | line = ostrcat(line, hname, 1, 0); |
---|
610 | if(extra != NULL) |
---|
611 | line = ostrcat(line, " (Part3)", 1, 0); |
---|
612 | if(extra != NULL) |
---|
613 | { |
---|
614 | line = ostrcat(line, " (", 1, 0); |
---|
615 | line = ostrcat(line, extra, 1, 0); |
---|
616 | line = ostrcat(line, ")", 1, 0); |
---|
617 | } |
---|
618 | line = ostrcat(line, "#", 1, 0); |
---|
619 | line = ostrcat(line, url3, 1, 0); |
---|
620 | line = ostrcat(line, "#", 1, 0); |
---|
621 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
622 | line = ostrcat(line, pichname, 1, 0); |
---|
623 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
624 | line = ostrcat(line, pichname, 1, 0); |
---|
625 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
626 | line = ostrcat(line, title, 1, 0); |
---|
627 | line = ostrcat(line, "#", 1, 0); |
---|
628 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
629 | line = ostrcat(line, "\n", 1, 0); |
---|
630 | free(tmpstr2), tmpstr2 = NULL; |
---|
631 | } |
---|
632 | |
---|
633 | if((url != NULL && url4 != NULL) && ostrcmp(url, url4) != 0 && ostrcmp(url2, url4) != 0 && ostrcmp(url3, url4) != 0) |
---|
634 | { |
---|
635 | free(tmpstr2), tmpstr2 = NULL; |
---|
636 | free(hname), hname = NULL; |
---|
637 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
638 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
639 | string_tolower(pichname); |
---|
640 | pichname = stringreplacecharonce(pichname, '\n', '\0'); |
---|
641 | type = 14; |
---|
642 | |
---|
643 | debug(99, "-------------------------------"); |
---|
644 | debug(99, "(%d/%d) %s (Part4) url: %s extra: %s",i ,max , hname, url4, extra); |
---|
645 | |
---|
646 | incount += 1; |
---|
647 | line = ostrcat(line, hname, 1, 0); |
---|
648 | line = ostrcat(line, " (Part4)", 1, 0); |
---|
649 | if(extra != NULL) |
---|
650 | { |
---|
651 | line = ostrcat(line, " (", 1, 0); |
---|
652 | line = ostrcat(line, extra, 1, 0); |
---|
653 | line = ostrcat(line, ")", 1, 0); |
---|
654 | } |
---|
655 | line = ostrcat(line, "#", 1, 0); |
---|
656 | line = ostrcat(line, url4, 1, 0); |
---|
657 | line = ostrcat(line, "#", 1, 0); |
---|
658 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
659 | line = ostrcat(line, pichname, 1, 0); |
---|
660 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
661 | line = ostrcat(line, pichname, 1, 0); |
---|
662 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
663 | line = ostrcat(line, title, 1, 0); |
---|
664 | line = ostrcat(line, "#", 1, 0); |
---|
665 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
666 | line = ostrcat(line, "\n", 1, 0); |
---|
667 | free(tmpstr2), tmpstr2 = NULL; |
---|
668 | } |
---|
669 | */ |
---|
670 | free(tmpstr1), tmpstr1 = NULL; |
---|
671 | free(tmpstr2), tmpstr2 = NULL; |
---|
672 | free(tmpstr3), tmpstr3 = NULL; |
---|
673 | free(tmpstr4), tmpstr4 = NULL; |
---|
674 | free(tmpstr5), tmpstr5 = NULL; |
---|
675 | free(hname), hname = NULL; |
---|
676 | free(hnr), hnr = NULL; |
---|
677 | free(hlink), hlink = NULL; |
---|
678 | free(url), url = NULL; |
---|
679 | free(url2), url2 = NULL; |
---|
680 | free(url3), url3 = NULL; |
---|
681 | free(url4), url4 = NULL; |
---|
682 | free(pathnew), pathnew = NULL; |
---|
683 | free(pichname), pichname = NULL; |
---|
684 | free(extra), extra = NULL; |
---|
685 | } |
---|
686 | debug(99, "### END #####################################################"); |
---|
687 | } |
---|
688 | } |
---|
689 | free(ret1), ret1 = NULL; |
---|
690 | } |
---|
691 | } |
---|
692 | free(tmpstr), tmpstr = NULL; |
---|
693 | |
---|
694 | if(line != NULL) |
---|
695 | { |
---|
696 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
697 | if(series == 0) |
---|
698 | { |
---|
699 | tmpstr = ostrcat("/tmp/tithek/kinox.hoster.", oitoa(time(NULL)), 0, 1); |
---|
700 | tmpstr = ostrcat(tmpstr, ".list", 1, 0); |
---|
701 | } |
---|
702 | else |
---|
703 | { |
---|
704 | tmpstr = ostrcat("/tmp/tithek/kinox.hoster.ser.", oitoa(time(NULL)), 0, 1); |
---|
705 | tmpstr = ostrcat(tmpstr, ".list", 1, 0); |
---|
706 | } |
---|
707 | writesys(tmpstr, line, 0); |
---|
708 | |
---|
709 | titheklog(debuglevel, "/tmp/kinox8_line", NULL, NULL, NULL, line); |
---|
710 | |
---|
711 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
712 | createtithek(tnode, tnode->title, tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
713 | ret = 0; |
---|
714 | } |
---|
715 | |
---|
716 | return ret; |
---|
717 | } |
---|
718 | |
---|
719 | int kinox_hoster_series(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title) |
---|
720 | { |
---|
721 | debug(99, "link: %s", link); |
---|
722 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
723 | int ret = 1; |
---|
724 | char* ip = NULL, *pathnew = NULL, *seriesid = NULL, *searchname = NULL, *url = NULL, *session = NULL, *episode = NULL, *pos = NULL, *path = NULL, *tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *line = NULL; |
---|
725 | char* pichname = NULL, *extra= NULL; |
---|
726 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
727 | return ret; |
---|
728 | |
---|
729 | int count0 = 0; |
---|
730 | struct splitstr* ret0 = NULL; |
---|
731 | ret0 = strsplit(link, ";", &count0); |
---|
732 | if(ret0 != NULL && count0 >= 3) |
---|
733 | { |
---|
734 | url = ostrcat(url, ret0[0].part, 1, 0); |
---|
735 | debug(99, "url: %s", url); |
---|
736 | |
---|
737 | session = ostrcat(session, ret0[1].part, 1, 0); |
---|
738 | debug(99, "Season: %s", session); |
---|
739 | |
---|
740 | episode = ostrcat(episode, ret0[2].part, 1, 0); |
---|
741 | debug(99, "episode: %s", episode); |
---|
742 | |
---|
743 | searchname = ostrcat(searchname, ret0[0].part, 1, 0); |
---|
744 | searchname = string_replace("http://kinox.me//Stream/", "", searchname, 0); |
---|
745 | searchname = string_replace("http://kinox.me/Stream/", "", searchname, 0); |
---|
746 | searchname = string_replace(".html", "", searchname, 0); |
---|
747 | debug(99, "searchname: %s", searchname); |
---|
748 | } |
---|
749 | free(ret0), ret0 = NULL; |
---|
750 | |
---|
751 | ip = string_replace("http://", "", url, 0); |
---|
752 | |
---|
753 | if(ip != NULL) |
---|
754 | pos = strchr(ip, '/'); |
---|
755 | if(pos != NULL) |
---|
756 | { |
---|
757 | pos[0] = '\0'; |
---|
758 | path = pos + 1; |
---|
759 | } |
---|
760 | |
---|
761 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
762 | |
---|
763 | if(tmpstr != NULL) |
---|
764 | { |
---|
765 | drawscreen(load, 0, 0); |
---|
766 | |
---|
767 | seriesid = string_resub("SeriesID=", "\"", tmpstr, 0); |
---|
768 | debug(99, "seriesid: %s", seriesid); |
---|
769 | |
---|
770 | pathnew = ostrcat("/aGET/MirrorByEpisode/&?Addr=", searchname, 0, 0); |
---|
771 | pathnew = ostrcat(pathnew, "&SeriesID=", 1, 0); |
---|
772 | pathnew = ostrcat(pathnew, seriesid, 1, 0); |
---|
773 | pathnew = ostrcat(pathnew, "&Season=", 1, 0); |
---|
774 | pathnew = ostrcat(pathnew, session, 1, 0); |
---|
775 | pathnew = ostrcat(pathnew, "&Episode=", 1, 0); |
---|
776 | pathnew = ostrcat(pathnew, episode, 1, 0); |
---|
777 | debug(99, "pathnew: %s", pathnew); |
---|
778 | |
---|
779 | free(tmpstr), tmpstr = NULL; |
---|
780 | tmpstr = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
781 | free(pathnew), pathnew = NULL; |
---|
782 | |
---|
783 | if(tmpstr != NULL) |
---|
784 | { |
---|
785 | tmpstr = string_resub("<ul id=\"HosterList\" class=\"Sortable\">", "</ul>", tmpstr, 0); |
---|
786 | |
---|
787 | int type = 14; |
---|
788 | int count = 0; |
---|
789 | int incount = 0; |
---|
790 | int i; |
---|
791 | struct splitstr* ret1 = NULL; |
---|
792 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
793 | |
---|
794 | char* hname = NULL; |
---|
795 | char* hnr = NULL; |
---|
796 | char* hlink = NULL; |
---|
797 | |
---|
798 | if(ret1 != NULL && count > 0) |
---|
799 | { |
---|
800 | int max = count; |
---|
801 | for(i = 0; i < max; i++) |
---|
802 | { |
---|
803 | char *mirrormaxtmp = NULL; |
---|
804 | char *pathnewtmp = NULL; |
---|
805 | char *season = NULL; |
---|
806 | int mirrormax = 1; |
---|
807 | int j = 0; |
---|
808 | |
---|
809 | mirrormaxtmp = oregex("<b>Mirror</b>: .*/(.*)<br.*", ret1[i].part); |
---|
810 | |
---|
811 | if(mirrormaxtmp != NULL) |
---|
812 | mirrormax = atoi(mirrormaxtmp); |
---|
813 | free(mirrormaxtmp), mirrormaxtmp= NULL; |
---|
814 | |
---|
815 | debug(99, "### START ####################################################"); |
---|
816 | |
---|
817 | for(j = 1; j < mirrormax + 1; j++) |
---|
818 | { |
---|
819 | debug(99, "(%d/%d) (%d/%d) ret1[i].part: %s",i ,max ,j ,mirrormax, ret1[i].part); |
---|
820 | |
---|
821 | hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0); |
---|
822 | |
---|
823 | // hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0); |
---|
824 | // hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); |
---|
825 | // hlink = ostrcat(hlink, "Mirror=", 0, 0); |
---|
826 | |
---|
827 | ////////// |
---|
828 | hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0); |
---|
829 | |
---|
830 | if (hlink == NULL) |
---|
831 | { |
---|
832 | hlink = string_resub("rel=\"", "\">", ret1[i].part, 0); |
---|
833 | hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); |
---|
834 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
835 | pathnewtmp = ostrcat("kinox.me/aGET/Mirror/", hlink, 0, 0); |
---|
836 | pathnew = ostrcat(pathnewtmp, NULL, 0, 0); |
---|
837 | } |
---|
838 | else |
---|
839 | { |
---|
840 | hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); |
---|
841 | hlink = ostrcat(hlink, "Mirror=", 0, 0); |
---|
842 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
843 | pathnewtmp = ostrcat("kinox.me/aGET/Mirror/", hlink, 0, 0); |
---|
844 | pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1); |
---|
845 | } |
---|
846 | debug(99, "(%d/%d) (%d/%d)hnr: %s hlink: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,hname ,pathnewtmp); |
---|
847 | free(pathnewtmp), pathnewtmp= NULL; |
---|
848 | ////////// |
---|
849 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
850 | pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
851 | |
---|
852 | season = string_resub("&Season=", "\">", ret1[i].part, 0); |
---|
853 | season = string_replace_all("amp;", "", season, 1); |
---|
854 | |
---|
855 | pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1); |
---|
856 | pathnew = ostrcat(pathnew, "&Season=", 1, 0); |
---|
857 | pathnew = ostrcat(pathnew, season, 1, 0); |
---|
858 | |
---|
859 | debug(99, "(%d/%d) (%d/%d) hnr: %s hlink: %s season: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,season ,hname ,pathnewtmp); |
---|
860 | |
---|
861 | free(season), season= NULL; |
---|
862 | free(pathnewtmp), pathnewtmp= NULL; |
---|
863 | |
---|
864 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
865 | string_tolower(pichname); |
---|
866 | pichname = stringreplacecharonce(pichname, '.', '\0'); |
---|
867 | |
---|
868 | extra = string_resub("<b>Vom</b>: ", "</div>", ret1[i].part, 0); |
---|
869 | |
---|
870 | hlink = string_replace("http://kinox.me//Stream/", "", hlink, 1); |
---|
871 | hlink = string_replace("http://kinox.me/Stream/", "", hlink, 1); |
---|
872 | |
---|
873 | // debug(99, "pathnew: %s", pathnew); |
---|
874 | // tmpstr1 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
875 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
876 | // debug(99, "tmpstr1 1: %s", tmpstr1); |
---|
877 | |
---|
878 | tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); |
---|
879 | // debug(99, "tmpstr1 2: %s", tmpstr1); |
---|
880 | |
---|
881 | if(ostrstr(tmpstr1, "<iframe src=") != NULL) |
---|
882 | { |
---|
883 | url = string_resub("<iframe src=\"", "\"", tmpstr1, 0); |
---|
884 | // debug(99, "iframe1.1 url: %s", url); |
---|
885 | } |
---|
886 | else if(ostrstr(tmpstr1, "/iframe>") != NULL) |
---|
887 | { |
---|
888 | free(pathnew), pathnew = NULL; |
---|
889 | pathnew = ostrcat("kinox.me/aGET/Mirror/", hlink, 0, 0); |
---|
890 | // debug(99, "iframe2.1 pathnew: %s", pathnew); |
---|
891 | free(tmpstr1), tmpstr1 = NULL; |
---|
892 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
893 | // debug(99, "iframe2.2 tmpstr1: %s", tmpstr1); |
---|
894 | tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); |
---|
895 | // debug(99, "iframe2.3 tmpstr1: %s", tmpstr1); |
---|
896 | |
---|
897 | if(ostrstr(tmpstr1, "<iframe src=") != NULL) |
---|
898 | { |
---|
899 | url = string_resub("<iframe src=\"", "\"", tmpstr1, 0); |
---|
900 | // debug(99, "iframe2.4 url: %s", url); |
---|
901 | } |
---|
902 | } |
---|
903 | else |
---|
904 | { |
---|
905 | tmpstr1 = string_resub("<a href=\"", "\"", tmpstr1, 0); |
---|
906 | // debug(99, "tmpstr1 3: %s", tmpstr1); |
---|
907 | url = ostrcat(tmpstr1, NULL, 0, 0); |
---|
908 | } |
---|
909 | |
---|
910 | type = 14; |
---|
911 | |
---|
912 | debug(99, "-------------------------------"); |
---|
913 | debug(99, "(%d/%d) (%d/%d) %s url: %s extra: %s", i, max, j, mirrormax, hname, url, extra); |
---|
914 | debug(99, "-------------------------------"); |
---|
915 | |
---|
916 | incount += 1; |
---|
917 | |
---|
918 | line = ostrcat(line, hname, 1, 0); |
---|
919 | |
---|
920 | if(url == NULL) |
---|
921 | line = ostrcat(line, " (Error)", 1, 0); |
---|
922 | |
---|
923 | if(extra != NULL) |
---|
924 | { |
---|
925 | line = ostrcat(line, " (", 1, 0); |
---|
926 | line = ostrcat(line, extra, 1, 0); |
---|
927 | line = ostrcat(line, ")", 1, 0); |
---|
928 | } |
---|
929 | |
---|
930 | line = ostrcat(line, " (Mirror ", 1, 0); |
---|
931 | line = ostrcat(line, oitoa(j), 1, 1); |
---|
932 | line = ostrcat(line, "/", 1, 0); |
---|
933 | line = ostrcat(line, oitoa(mirrormax), 1, 1); |
---|
934 | line = ostrcat(line, ")", 1, 0); |
---|
935 | |
---|
936 | |
---|
937 | line = ostrcat(line, "#", 1, 0); |
---|
938 | line = ostrcat(line, url, 1, 0); |
---|
939 | line = ostrcat(line, "#", 1, 0); |
---|
940 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
941 | line = ostrcat(line, pichname, 1, 0); |
---|
942 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
943 | line = ostrcat(line, pichname, 1, 0); |
---|
944 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
945 | line = ostrcat(line, title, 1, 0); |
---|
946 | line = ostrcat(line, "#", 1, 0); |
---|
947 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
948 | line = ostrcat(line, "\n", 1, 0); |
---|
949 | |
---|
950 | free(tmpstr1), tmpstr1 = NULL; |
---|
951 | free(tmpstr2), tmpstr2 = NULL; |
---|
952 | free(hname), hname = NULL; |
---|
953 | free(hnr), hnr = NULL; |
---|
954 | free(hlink), hlink = NULL; |
---|
955 | free(url), url = NULL; |
---|
956 | free(pathnew), pathnew = NULL; |
---|
957 | free(pichname), pichname = NULL; |
---|
958 | free(extra), extra = NULL; |
---|
959 | } |
---|
960 | debug(99, "### END #####################################################"); |
---|
961 | } |
---|
962 | } |
---|
963 | free(ret1), ret1 = NULL; |
---|
964 | } |
---|
965 | } |
---|
966 | |
---|
967 | free(tmpstr), tmpstr = NULL; |
---|
968 | if(line != NULL) |
---|
969 | { |
---|
970 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
971 | tmpstr = ostrcat("/tmp/tithek/kinox.hoster.series.", oitoa(time(NULL)), 0, 1); |
---|
972 | tmpstr = ostrcat(tmpstr, ".list", 1, 0); |
---|
973 | |
---|
974 | writesys(tmpstr, line, 0); |
---|
975 | |
---|
976 | titheklog(debuglevel, "/tmp/kinox9_line", NULL, NULL, NULL, line); |
---|
977 | |
---|
978 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
979 | createtithek(tnode, tnode->title, tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
980 | ret = 0; |
---|
981 | } |
---|
982 | |
---|
983 | return ret; |
---|
984 | } |
---|
985 | |
---|
986 | int kinox_search_cast(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr) |
---|
987 | { |
---|
988 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
989 | int ret = 1; |
---|
990 | |
---|
991 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
992 | return ret; |
---|
993 | |
---|
994 | char* search = NULL; |
---|
995 | if(searchstr == NULL) |
---|
996 | search = textinputhist(_("Search"), " ", "searchhist"); |
---|
997 | else |
---|
998 | search = textinputhist(_("Search"), searchstr, "searchhist"); |
---|
999 | |
---|
1000 | if(search != NULL) |
---|
1001 | { |
---|
1002 | drawscreen(load, 0, 0); |
---|
1003 | search = strstrip(search); |
---|
1004 | search = stringreplacechar(search, ' ', '+'); |
---|
1005 | debug(99, "search: %s", search); |
---|
1006 | |
---|
1007 | char* tmpstr = NULL; |
---|
1008 | char* tmpstr1 = NULL; |
---|
1009 | char* ip = NULL; |
---|
1010 | char* path = NULL; |
---|
1011 | |
---|
1012 | char* line = NULL; |
---|
1013 | char* menu = NULL; |
---|
1014 | |
---|
1015 | ip = ostrcat("www.imdb.com", NULL, 0, 0); |
---|
1016 | path = ostrcat("find?q=", search, 0, 0); |
---|
1017 | path = ostrcat(path, "&s=nm", 1, 0); |
---|
1018 | |
---|
1019 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
1020 | titheklog(debuglevel, "/tmp/kinox10_cast_tmpstr1", NULL, NULL, NULL, tmpstr); |
---|
1021 | tmpstr = string_replace_all("<td class=\"primary_photo\"> <a href=\"/name/", "\nfound=\"", tmpstr, 1); |
---|
1022 | titheklog(debuglevel, "/tmp/kinox10_cast_tmpstr2", NULL, NULL, NULL, tmpstr); |
---|
1023 | |
---|
1024 | tmpstr1 = string_resub("<table class=\"findList\">", "</div>", tmpstr, 0); |
---|
1025 | titheklog(debuglevel, "/tmp/kinox10_cast_tmpstr3", NULL, NULL, NULL, tmpstr1); |
---|
1026 | free(tmpstr), tmpstr = NULL; |
---|
1027 | |
---|
1028 | int count = 0; |
---|
1029 | int incount = 0; |
---|
1030 | int i; |
---|
1031 | struct splitstr* ret1 = NULL; |
---|
1032 | ret1 = strsplit(tmpstr1, "\n", &count); |
---|
1033 | |
---|
1034 | char* url = NULL; |
---|
1035 | char* pic = NULL; |
---|
1036 | char* name = NULL; |
---|
1037 | |
---|
1038 | if(ret1 != NULL && count > 0) |
---|
1039 | { |
---|
1040 | int max = count; |
---|
1041 | for(i = 0; i < max; i++) |
---|
1042 | { |
---|
1043 | url = string_resub("found=\"", "/", ret1[i].part, 0); |
---|
1044 | pic = string_resub("<img src=\"", "\"", ret1[i].part, 0); |
---|
1045 | |
---|
1046 | tmpstr = string_resub("found=\"", "<small>", ret1[i].part, 0); |
---|
1047 | // name = oregex(".*<a href=\"/name/nm.*\ >(.*)</a>", tmpstr); |
---|
1048 | name = oregex(".*<a href=\"/name/nm.* >(.*)</a>", tmpstr); |
---|
1049 | |
---|
1050 | debug(99, "(%d/%d) name: %s url: %s pic: %s\n",i, count, name, url, pic); |
---|
1051 | debug(99, "-------------------------------"); |
---|
1052 | |
---|
1053 | pic = string_replace_all(",", "%2C", pic, 1); |
---|
1054 | |
---|
1055 | if(url != NULL) |
---|
1056 | { |
---|
1057 | incount++; |
---|
1058 | line = ostrcat(line, name, 1, 0); |
---|
1059 | line = ostrcat(line, "#http://kinox.me/People/", 1, 0); |
---|
1060 | line = ostrcat(line, url, 1, 0); |
---|
1061 | line = ostrcat(line, "#", 1, 0); |
---|
1062 | line = ostrcat(line, pic, 1, 0); |
---|
1063 | line = ostrcat(line, "#kinox_search_", 1, 0); |
---|
1064 | line = ostrcat(line, oitoa(incount + time(NULL)), 1, 1); |
---|
1065 | line = ostrcat(line, ".jpg#KinoX - Cast Search#32\n", 1, 0); |
---|
1066 | } |
---|
1067 | |
---|
1068 | free(url), url = NULL; |
---|
1069 | free(pic), pic = NULL; |
---|
1070 | free(name), name = NULL; |
---|
1071 | free(tmpstr), tmpstr = NULL; |
---|
1072 | } |
---|
1073 | |
---|
1074 | free(ret1), ret1 = NULL; |
---|
1075 | if(line != NULL) |
---|
1076 | { |
---|
1077 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
1078 | menu = ostrcat("/tmp/tithek/kinox.search.cast.", oitoa(time(NULL)), 0, 1); |
---|
1079 | menu = ostrcat(menu, ".list", 1, 0); |
---|
1080 | |
---|
1081 | writesys(menu, line, 0); |
---|
1082 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
1083 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
1084 | ret = 0; |
---|
1085 | } |
---|
1086 | |
---|
1087 | } |
---|
1088 | free(tmpstr), tmpstr = NULL; |
---|
1089 | free(ip), ip = NULL; |
---|
1090 | } |
---|
1091 | free(search), search = NULL; |
---|
1092 | return ret; |
---|
1093 | } |
---|
1094 | |
---|
1095 | #endif |
---|