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 | char* newurl = NULL; |
---|
56 | char *cmd = NULL; |
---|
57 | |
---|
58 | search = strstrip(search); |
---|
59 | search = stringreplacechar(search, ' ', '+'); |
---|
60 | debug(99, "search: %s", search); |
---|
61 | |
---|
62 | if(flag == 0) |
---|
63 | path = ostrcat("Search.html?q=", search, 0, 0); |
---|
64 | else |
---|
65 | { |
---|
66 | path = ostrcat(search, NULL, 0, 0); |
---|
67 | // path = string_replace_all("kinox.to", "", path, 0); |
---|
68 | // path = string_replace_all(getconfig("tithek_kinox_url", NULL), "", path, 0); |
---|
69 | // path = string_replace_all("http:///", "", path, 0); |
---|
70 | // path = string_replace_all("https:///", "", path, 0); |
---|
71 | } |
---|
72 | // tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
73 | newurl = ostrcat(getconfig("tithek_kinox_url", NULL), "/", 0, 0); |
---|
74 | newurl = ostrcat(newurl, path, 1, 0); |
---|
75 | // tmpstr = gethttps(newurl, NULL, NULL, NULL, NULL, NULL, 1); |
---|
76 | // new start |
---|
77 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", newurl, 0, 0); |
---|
78 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
79 | debug(99, "cmd: %s", cmd); |
---|
80 | tmpstr = command(cmd); |
---|
81 | free(cmd), cmd = NULL; |
---|
82 | // new end |
---|
83 | free(newurl), newurl = NULL; |
---|
84 | |
---|
85 | if(!ostrncmp("errormsg=", tmpstr, 9)) |
---|
86 | { |
---|
87 | tmpstr1 = ostrcat(_("Found error Msg:"), "\n\n", 0, 0); |
---|
88 | tmpstr1 = ostrcat(tmpstr1, tmpstr, 1, 0); |
---|
89 | tmpstr1 = string_replace("errormsg=", "", tmpstr1, 1); |
---|
90 | |
---|
91 | debug(99, "Found error Msg: %s", tmpstr); |
---|
92 | textbox(_("Message"), tmpstr1, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1100, 300, 0, 2); |
---|
93 | free(tmpstr); tmpstr = NULL; |
---|
94 | free(tmpstr1); tmpstr1 = NULL; |
---|
95 | } |
---|
96 | |
---|
97 | tmpstr = string_resub("<div id=\"beep\" class=\"beep\"></div>", "</table>", tmpstr, 0); |
---|
98 | |
---|
99 | titheklog(debuglevel, "/tmp/kinox1_tmpstr", NULL, NULL, NULL, tmpstr); |
---|
100 | |
---|
101 | int count = 0; |
---|
102 | int incount = 0; |
---|
103 | int i = 0; |
---|
104 | struct splitstr* ret1 = NULL; |
---|
105 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
106 | |
---|
107 | if(ret1 != NULL) |
---|
108 | { |
---|
109 | int max = count; |
---|
110 | for(i = 0; i < max; i++) |
---|
111 | { |
---|
112 | if(oregex(".*src=\"/gr/sys/lng/(.*)\" alt=\"language\"></td>.*", ret1[i].part) != NULL) |
---|
113 | { |
---|
114 | free(langck), langck = NULL; |
---|
115 | langck = oregex(".*src=\"/gr/sys/lng/(.*)\" alt=\"language\"></td>.*", ret1[i].part); |
---|
116 | } |
---|
117 | |
---|
118 | if(oregex(".*<td class=\"Title\"><a href=\"(.*)\" onclick=.*", ret1[i].part) != NULL) |
---|
119 | { |
---|
120 | int rcret = waitrc(NULL, 10, 0); |
---|
121 | if(rcret == getrcconfigint("rcexit", NULL)) break; |
---|
122 | free(path), path = NULL; |
---|
123 | path = oregex(".*<td class=\"Title\"><a href=\"(.*)\" onclick=.*", ret1[i].part); |
---|
124 | |
---|
125 | if(ostrstr(langck, "1.png") != NULL) |
---|
126 | lang = ostrcat(lang, " (de)", 1, 0); |
---|
127 | else if(ostrstr(langck, "2.png") != NULL) |
---|
128 | lang = ostrcat(lang, " (en)", 1, 0); |
---|
129 | else |
---|
130 | lang = ostrcat(lang, " (\?\?)", 1, 0); |
---|
131 | |
---|
132 | // tmpstr1 = gethttp("kinox.to", path, 80, NULL, NULL, 10000, NULL, 0); |
---|
133 | newurl = ostrcat(getconfig("tithek_kinox_url", NULL), "/", 0, 0); |
---|
134 | newurl = ostrcat(newurl, path, 1, 0); |
---|
135 | // tmpstr1 = gethttps(newurl, NULL, NULL, NULL, NULL, NULL, 1); |
---|
136 | // new start |
---|
137 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", newurl, 0, 0); |
---|
138 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
139 | debug(99, "cmd: %s", cmd); |
---|
140 | tmpstr1 = command(cmd); |
---|
141 | free(cmd), cmd = NULL; |
---|
142 | // new end |
---|
143 | |
---|
144 | free(newurl), newurl = NULL; |
---|
145 | |
---|
146 | from = ostrcat("<div class=\"Grahpics\"><a href=\"", path, 0, 0); |
---|
147 | from = ostrcat(from, "\"><img src=\"", 1, 0); |
---|
148 | |
---|
149 | pic = string_resub(from, "\" alt=\"", tmpstr1, 0); |
---|
150 | |
---|
151 | if(pic == NULL) |
---|
152 | pic = ostrcat("dummy", NULL, 0, 0); |
---|
153 | |
---|
154 | title = ostrcat(path, NULL, 0, 0); |
---|
155 | title = string_replace_all("/Stream/", "", title, 1); |
---|
156 | title = string_replace_all(".html", "", title, 1); |
---|
157 | title = stringreplacechar(title, '_', ' '); |
---|
158 | title = ostrcat(title , lang, 1, 0); |
---|
159 | |
---|
160 | url = ostrcat(getconfig("tithek_kinox_url", NULL), "/", 0, 0); |
---|
161 | url = ostrcat(url, path, 1, 0); |
---|
162 | |
---|
163 | debug(99, "---------------------------"); |
---|
164 | debug(99, "langck: %s", langck); |
---|
165 | debug(99, "pic: %s", pic); |
---|
166 | debug(99, "title: %s", title); |
---|
167 | debug(99, "url: %s", url); |
---|
168 | debug(99, "---------------------------"); |
---|
169 | |
---|
170 | if(url != NULL) |
---|
171 | { |
---|
172 | incount += 1; |
---|
173 | line = ostrcat(line, title, 1, 0); |
---|
174 | line = ostrcat(line, "#", 1, 0); |
---|
175 | line = ostrcat(line, url, 1, 0); |
---|
176 | line = ostrcat(line, "#", 1, 0); |
---|
177 | // line = ostrcat(line, getconfig("tithek_kinox_url", NULL), 1, 0); |
---|
178 | line = ostrcat(line, "http://kinox.to", 1, 0); |
---|
179 | line = ostrcat(line, "/", 1, 0); |
---|
180 | line = ostrcat(line, pic, 1, 0); |
---|
181 | line = ostrcat(line, "#kinox_search_", 1, 0); |
---|
182 | /* |
---|
183 | line = ostrcat(line, "#/tmp/localhoster/hoster.sh get '", 1, 0); |
---|
184 | line = ostrcat(line, getconfig("tithek_kinox_url", NULL), 1, 0); |
---|
185 | line = ostrcat(line, "/", 1, 0); |
---|
186 | line = ostrcat(line, pic, 1, 0); |
---|
187 | line = ostrcat(line, "'#kinox_search_", 1, 0); |
---|
188 | */ |
---|
189 | |
---|
190 | line = ostrcat(line, oitoa(incount + time(NULL)), 1, 1); |
---|
191 | line = ostrcat(line, ".jpg#KinoX - Search#22\n", 1, 0); |
---|
192 | } |
---|
193 | free(url), url = NULL; |
---|
194 | free(path), path = NULL; |
---|
195 | free(title), title = NULL; |
---|
196 | free(pic), pic = NULL; |
---|
197 | free(from), from = NULL; |
---|
198 | free(tmpstr1), tmpstr1 = NULL; |
---|
199 | free(lang), lang = NULL; |
---|
200 | free(langck), langck = NULL; |
---|
201 | } |
---|
202 | } |
---|
203 | free(ret1), ret1 = NULL; |
---|
204 | if(line != NULL) |
---|
205 | { |
---|
206 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
207 | menu = ostrcat("/tmp/tithek/kinox.search.", oitoa(time(NULL)), 0, 1); |
---|
208 | menu = ostrcat(menu, ".list", 1, 0); |
---|
209 | |
---|
210 | writesys(menu, line, 0); |
---|
211 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
212 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
213 | ret = 0; |
---|
214 | } |
---|
215 | |
---|
216 | } |
---|
217 | free(tmpstr), tmpstr = NULL; |
---|
218 | free(ip), ip = NULL; |
---|
219 | } |
---|
220 | free(search), search = NULL; |
---|
221 | return ret; |
---|
222 | } |
---|
223 | |
---|
224 | int kinox_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag) |
---|
225 | { |
---|
226 | char* tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *menu = NULL, *search = NULL; |
---|
227 | int ret = 1, count = 0, i = 0; |
---|
228 | |
---|
229 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
230 | return ret; |
---|
231 | |
---|
232 | if(searchstr == NULL) |
---|
233 | search = textinputhist(_("Search"), " ", "searchhist"); |
---|
234 | else |
---|
235 | search = textinputhist(_("Search"), searchstr, "searchhist"); |
---|
236 | |
---|
237 | if(search != NULL) |
---|
238 | { |
---|
239 | drawscreen(load, 0, 0); |
---|
240 | |
---|
241 | strstrip(search); |
---|
242 | string_tolower(search); |
---|
243 | |
---|
244 | tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/kinox/streams/kinox.all-sorted.list", 80, NULL, HTTPAUTH, 5000, NULL, 0); |
---|
245 | |
---|
246 | struct splitstr* ret1 = NULL; |
---|
247 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
248 | |
---|
249 | if(ret1 != NULL) |
---|
250 | { |
---|
251 | int max = count; |
---|
252 | for(i = 0; i < max; i++) |
---|
253 | { |
---|
254 | |
---|
255 | tmpstr1 = ostrcat(ret1[i].part, NULL, 0, 0); |
---|
256 | tmpstr1 = stringreplacecharonce(tmpstr1, '#', '\0'); |
---|
257 | string_tolower(tmpstr1); |
---|
258 | |
---|
259 | if(ostrstr(tmpstr1, search) != NULL) |
---|
260 | { |
---|
261 | printf("found: %s\n", ret1[i].part); |
---|
262 | int rcret = waitrc(NULL, 10, 0); |
---|
263 | if(rcret == getrcconfigint("rcexit", NULL)) break; |
---|
264 | |
---|
265 | line = ostrcat(line, ret1[i].part, 1, 0); |
---|
266 | line = ostrcat(line, "\n", 0, 0); |
---|
267 | } |
---|
268 | free(tmpstr1), tmpstr1 = NULL; |
---|
269 | } |
---|
270 | free(ret1), ret1 = NULL; |
---|
271 | |
---|
272 | if(line != NULL) |
---|
273 | { |
---|
274 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
275 | menu = ostrcat("/tmp/tithek/kinox.search.", oitoa(time(NULL)), 0, 1); |
---|
276 | menu = ostrcat(menu, ".list", 1, 0); |
---|
277 | |
---|
278 | writesys(menu, line, 0); |
---|
279 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
280 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
281 | ret = 0; |
---|
282 | } |
---|
283 | } |
---|
284 | free(tmpstr), tmpstr = NULL; |
---|
285 | } |
---|
286 | free(search), search = NULL; |
---|
287 | return ret; |
---|
288 | } |
---|
289 | |
---|
290 | int kinox_hoster(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title) |
---|
291 | { |
---|
292 | debug(99, "link: %s", link); |
---|
293 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
294 | int ret = 1, series = 0; |
---|
295 | char* ip = NULL, *pos = NULL, *path = NULL, *tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *tmpstr3 = NULL, *pichname = NULL; |
---|
296 | char* tmpstr4 = NULL, *tmpstr5 = NULL, *line = NULL, *url = NULL, *url2 = NULL, *url3 = NULL, *url4 = NULL, *pathnew = NULL, *extra = NULL; |
---|
297 | char* newurl = NULL; |
---|
298 | char* cmd = NULL; |
---|
299 | |
---|
300 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
301 | return ret; |
---|
302 | |
---|
303 | ip = string_replace("http://", "", (char*)link, 0); |
---|
304 | |
---|
305 | if(ip != NULL) |
---|
306 | pos = strchr(ip, '/'); |
---|
307 | if(pos != NULL) |
---|
308 | { |
---|
309 | pos[0] = '\0'; |
---|
310 | path = pos + 1; |
---|
311 | } |
---|
312 | |
---|
313 | int cloudflare = 1; |
---|
314 | int localhoster = 1; |
---|
315 | newurl = ostrcat(getconfig("tithek_kinox_url", NULL), "/", 0, 0); |
---|
316 | newurl = ostrcat(newurl, path, 1, 0); |
---|
317 | |
---|
318 | if(cloudflare == 0) |
---|
319 | { |
---|
320 | // tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
321 | // tmpstr = gethttps(link, NULL, NULL, NULL, NULL, NULL, 1); |
---|
322 | tmpstr = gethttps(newurl, NULL, NULL, NULL, NULL, NULL, 1); |
---|
323 | } |
---|
324 | else |
---|
325 | { |
---|
326 | // new start |
---|
327 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", newurl, 0, 0); |
---|
328 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
329 | debug(99, "cmd: %s", cmd); |
---|
330 | tmpstr = command(cmd); |
---|
331 | free(cmd), cmd = NULL; |
---|
332 | // new end |
---|
333 | } |
---|
334 | titheklog(debuglevel, "/tmp/kinox2_tmpstr", NULL, NULL, NULL, tmpstr); |
---|
335 | |
---|
336 | if(!ostrncmp("errormsg=", tmpstr, 9)) |
---|
337 | { |
---|
338 | tmpstr1 = ostrcat(_("Found error Msg:"), "\n\n", 0, 0); |
---|
339 | tmpstr1 = ostrcat(tmpstr1, tmpstr, 1, 0); |
---|
340 | tmpstr1 = string_replace("errormsg=", "", tmpstr1, 1); |
---|
341 | |
---|
342 | debug(99, "Found error Msg: %s", tmpstr); |
---|
343 | textbox(_("Message"), tmpstr1, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1100, 300, 0, 2); |
---|
344 | free(tmpstr); tmpstr = NULL; |
---|
345 | free(tmpstr1); tmpstr1 = NULL; |
---|
346 | } |
---|
347 | |
---|
348 | if(tmpstr != NULL) |
---|
349 | { |
---|
350 | drawscreen(load, 0, 0); |
---|
351 | if(ostrstr(tmpstr, "SeriesID") != NULL) |
---|
352 | { |
---|
353 | char* pos1 = NULL; |
---|
354 | char* from = NULL; |
---|
355 | char* folgen = NULL; |
---|
356 | int i; |
---|
357 | |
---|
358 | series = 1; |
---|
359 | |
---|
360 | for(i = 1; i < 30; i++) |
---|
361 | { |
---|
362 | from = ostrcat(from, "<option value=\"", 1, 0); |
---|
363 | from = ostrcat(from, oitoa(i), 1, 0); |
---|
364 | from = ostrcat(from, "\" rel=", 1, 0); |
---|
365 | |
---|
366 | pos1 = ostrstr(tmpstr, from); |
---|
367 | folgen = getxmlentry(ostrstr(tmpstr, from), "rel="); |
---|
368 | printf("Season %d folgen: %s\n",i , folgen); |
---|
369 | |
---|
370 | if(folgen != NULL) |
---|
371 | { |
---|
372 | int count = 0; |
---|
373 | int incount = 0; |
---|
374 | int j; |
---|
375 | struct splitstr* ret1 = NULL; |
---|
376 | ret1 = strsplit(folgen, ",", &count); |
---|
377 | |
---|
378 | if(ret1 != NULL && count > 0) |
---|
379 | { |
---|
380 | int max = count + 1; |
---|
381 | for(j = 1; j < max; j++) |
---|
382 | { |
---|
383 | incount += 1; |
---|
384 | line = ostrcat(line, _("Season"), 1, 0); |
---|
385 | line = ostrcat(line, " ", 1, 0); |
---|
386 | line = ostrcat(line, oitoa(i), 1, 0); |
---|
387 | line = ostrcat(line, " ", 1, 0); |
---|
388 | line = ostrcat(line, _("Episode"), 1, 0); |
---|
389 | line = ostrcat(line, " ", 1, 0); |
---|
390 | line = ostrcat(line, oitoa(j), 1, 0); |
---|
391 | line = ostrcat(line, "#", 1, 0); |
---|
392 | line = ostrcat(line, link, 1, 0); |
---|
393 | line = ostrcat(line, ";", 1, 0); |
---|
394 | line = ostrcat(line, oitoa(i), 1, 0); |
---|
395 | line = ostrcat(line, ";", 1, 0); |
---|
396 | line = ostrcat(line, oitoa(j), 1, 0); |
---|
397 | line = ostrcat(line, "#", 1, 0); |
---|
398 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/s", 1, 0); |
---|
399 | line = ostrcat(line, oitoa(i), 1, 0); |
---|
400 | line = ostrcat(line, "e", 1, 0); |
---|
401 | line = ostrcat(line, oitoa(j), 1, 0); |
---|
402 | line = ostrcat(line, ".jpg", 1, 0); |
---|
403 | line = ostrcat(line, "#kinox_search_", 1, 0); |
---|
404 | line = ostrcat(line, oitoa(i), 1, 0); |
---|
405 | line = ostrcat(line, "e", 1, 0); |
---|
406 | line = ostrcat(line, oitoa(j), 1, 0); |
---|
407 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
408 | line = ostrcat(line, title, 1, 0); |
---|
409 | line = ostrcat(line, "#23\n", 1, 0); |
---|
410 | } |
---|
411 | } |
---|
412 | free(ret1), ret1 = NULL; |
---|
413 | } |
---|
414 | free(from), from = NULL; |
---|
415 | free(folgen), folgen = NULL; |
---|
416 | } |
---|
417 | } |
---|
418 | else |
---|
419 | { |
---|
420 | tmpstr = string_resub("<ul id=\"HosterList\" class=\"Sortable\">", "</ul>", tmpstr, 0); |
---|
421 | titheklog(debuglevel, "/tmp/kinox3_tmpstr", NULL, NULL, NULL, tmpstr); |
---|
422 | |
---|
423 | int type = 14; |
---|
424 | int count = 0; |
---|
425 | int incount = 0; |
---|
426 | int i; |
---|
427 | struct splitstr* ret1 = NULL; |
---|
428 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
429 | |
---|
430 | char* hname = NULL; |
---|
431 | char* hnr = NULL; |
---|
432 | char* hlink = NULL; |
---|
433 | |
---|
434 | if(ret1 != NULL && count > 0) |
---|
435 | { |
---|
436 | int max = count; |
---|
437 | for(i = 0; i < max; i++) |
---|
438 | { |
---|
439 | char *mirrormaxtmp = NULL; |
---|
440 | char *pathnewtmp = NULL; |
---|
441 | int mirrormax = 1; |
---|
442 | int j = 0; |
---|
443 | |
---|
444 | mirrormaxtmp = oregex("<b>Mirror</b>: .*/(.*)<br/>.*", ret1[i].part); |
---|
445 | |
---|
446 | if(mirrormaxtmp != NULL) |
---|
447 | mirrormax = atoi(mirrormaxtmp); |
---|
448 | |
---|
449 | debug(99, "### START ####################################################"); |
---|
450 | |
---|
451 | for(j = 1; j < mirrormax + 1; j++) |
---|
452 | { |
---|
453 | debug(99, "(%d/%d) (%d/%d) ret1[i].part: %s",i ,max ,j ,mirrormax, ret1[i].part); |
---|
454 | |
---|
455 | hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0); |
---|
456 | |
---|
457 | hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0); |
---|
458 | |
---|
459 | if (hlink == NULL) |
---|
460 | { |
---|
461 | hlink = string_resub("rel=\"", "\">", ret1[i].part, 0); |
---|
462 | hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); |
---|
463 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
464 | pathnewtmp = ostrcat(getconfig("tithek_kinox_url", NULL), "/aGET/Mirror/", 0, 0); |
---|
465 | pathnewtmp = ostrcat(pathnewtmp, hlink, 1, 0); |
---|
466 | pathnew = ostrcat(pathnewtmp, NULL, 0, 0); |
---|
467 | } |
---|
468 | else |
---|
469 | { |
---|
470 | hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); |
---|
471 | hlink = ostrcat(hlink, "Mirror=", 0, 0); |
---|
472 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
473 | pathnewtmp = ostrcat(getconfig("tithek_kinox_url", NULL), "/aGET/Mirror/", 0, 0); |
---|
474 | pathnewtmp = ostrcat(pathnewtmp, hlink, 1, 0); |
---|
475 | pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1); |
---|
476 | } |
---|
477 | debug(99, "(%d/%d) (%d/%d)hnr: %s hlink: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,hname ,pathnewtmp); |
---|
478 | free(pathnewtmp), pathnewtmp= NULL; |
---|
479 | |
---|
480 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
481 | string_tolower(pichname); |
---|
482 | pichname = stringreplacecharonce(pichname, '.', '\0'); |
---|
483 | |
---|
484 | extra = string_resub("<b>Vom</b>: ", "</div>", ret1[i].part, 0); |
---|
485 | |
---|
486 | titheklog(debuglevel, "/tmp/kinox4_pathnew1", hname, NULL, NULL, pathnew); |
---|
487 | |
---|
488 | |
---|
489 | if(cloudflare == 0) |
---|
490 | { |
---|
491 | // tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
492 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
493 | } |
---|
494 | else if(localhoster == 1) |
---|
495 | { |
---|
496 | cmd = ostrcat("/tmp/localhoster/hoster.sh hoster '", pathnew, 0, 0); |
---|
497 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
498 | debug(99, "cmd: %s", cmd); |
---|
499 | url = ostrcat(cmd, NULL, 0, 0); |
---|
500 | } |
---|
501 | else |
---|
502 | { |
---|
503 | // new start |
---|
504 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", pathnew, 0, 0); |
---|
505 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
506 | debug(99, "cmd: %s", cmd); |
---|
507 | tmpstr1 = command(cmd); |
---|
508 | free(cmd), cmd = NULL; |
---|
509 | // new end |
---|
510 | } |
---|
511 | if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL) |
---|
512 | { |
---|
513 | sleep(1); |
---|
514 | if(cloudflare == 0) |
---|
515 | { |
---|
516 | // tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
517 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
518 | } |
---|
519 | else |
---|
520 | { |
---|
521 | // new start |
---|
522 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", pathnew, 0, 0); |
---|
523 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
524 | debug(99, "cmd: %s", cmd); |
---|
525 | tmpstr1 = command(cmd); |
---|
526 | free(cmd), cmd = NULL; |
---|
527 | // new end |
---|
528 | } |
---|
529 | } |
---|
530 | if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL) |
---|
531 | { |
---|
532 | sleep(1); |
---|
533 | if(cloudflare == 0) |
---|
534 | { |
---|
535 | // tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
536 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
537 | } |
---|
538 | else |
---|
539 | { |
---|
540 | // new start |
---|
541 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", pathnew, 0, 0); |
---|
542 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
543 | debug(99, "cmd: %s", cmd); |
---|
544 | tmpstr1 = command(cmd); |
---|
545 | free(cmd), cmd = NULL; |
---|
546 | // new end |
---|
547 | } |
---|
548 | } |
---|
549 | if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL) |
---|
550 | { |
---|
551 | sleep(1); |
---|
552 | if(cloudflare == 0) |
---|
553 | { |
---|
554 | // tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
555 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
556 | } |
---|
557 | else |
---|
558 | { |
---|
559 | // new start |
---|
560 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", pathnew, 0, 0); |
---|
561 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
562 | debug(99, "cmd: %s", cmd); |
---|
563 | tmpstr1 = command(cmd); |
---|
564 | free(cmd), cmd = NULL; |
---|
565 | // new end |
---|
566 | } |
---|
567 | } |
---|
568 | if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL) |
---|
569 | { |
---|
570 | sleep(1); |
---|
571 | if(cloudflare == 0) |
---|
572 | { |
---|
573 | // tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
574 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
575 | } |
---|
576 | else |
---|
577 | { |
---|
578 | // new start |
---|
579 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", pathnew, 0, 0); |
---|
580 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
581 | debug(99, "cmd: %s", cmd); |
---|
582 | tmpstr1 = command(cmd); |
---|
583 | free(cmd), cmd = NULL; |
---|
584 | // new end |
---|
585 | } |
---|
586 | } |
---|
587 | free(pathnew), pathnew = NULL; |
---|
588 | |
---|
589 | titheklog(debuglevel, "/tmp/kinox5_tmpstr1", hname, NULL, NULL, tmpstr1); |
---|
590 | |
---|
591 | |
---|
592 | tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); |
---|
593 | |
---|
594 | if(localhoster == 0) |
---|
595 | { |
---|
596 | if(ostrstr(tmpstr1, "iframe src") != NULL) |
---|
597 | url = string_resub("<iframe src=\"", "\"", tmpstr1, 0); |
---|
598 | else |
---|
599 | url = string_resub("<a href=\"", "\"", tmpstr1, 0); |
---|
600 | } |
---|
601 | |
---|
602 | //url = ostrcat(tmpstr1, NULL, 0, 0); |
---|
603 | //////////////// |
---|
604 | /* |
---|
605 | free(pathnew), pathnew = NULL; |
---|
606 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
607 | pathnew = ostrcat(pathnew, "&Part=2", 1, 0); |
---|
608 | |
---|
609 | titheklog(debuglevel, "/tmp/kinox6_pathnew2", hname, NULL, NULL, pathnew); |
---|
610 | |
---|
611 | tmpstr3 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
612 | if(ostrstr(tmpstr3, "503 Service Temporarily Unavailable") != NULL) |
---|
613 | { |
---|
614 | sleep(1); |
---|
615 | tmpstr3 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
616 | } |
---|
617 | free(pathnew), pathnew = NULL; |
---|
618 | |
---|
619 | titheklog(debuglevel, "/tmp/kinox7_tmpstr3", hname, NULL, NULL, tmpstr3); |
---|
620 | |
---|
621 | tmpstr3 = string_replace_all("\\", "", tmpstr3, 1); |
---|
622 | if(ostrstr(tmpstr3, "iframe src") != NULL) |
---|
623 | url2 = string_resub("<iframe src=\"", "\"", tmpstr3, 0); |
---|
624 | else |
---|
625 | url2 = string_resub("<a href=\"", "\"", tmpstr3, 0); |
---|
626 | // url2 = ostrcat(tmpstr3, NULL, 0, 0); |
---|
627 | //////////////// |
---|
628 | free(pathnew), pathnew = NULL; |
---|
629 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
630 | pathnew = ostrcat(pathnew, "&Part=3", 1, 0); |
---|
631 | |
---|
632 | titheklog(debuglevel, "/tmp/kinox6_pathnew3", hname, NULL, NULL, pathnew); |
---|
633 | |
---|
634 | tmpstr4 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
635 | if(ostrstr(tmpstr4, "503 Service Temporarily Unavailable") != NULL) |
---|
636 | { |
---|
637 | sleep(1); |
---|
638 | tmpstr4 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
639 | } |
---|
640 | free(pathnew), pathnew = NULL; |
---|
641 | |
---|
642 | titheklog(debuglevel, "/tmp/kinox7_tmpstr4", hname, NULL, NULL, tmpstr4); |
---|
643 | |
---|
644 | tmpstr4 = string_replace_all("\\", "", tmpstr4, 1); |
---|
645 | if(ostrstr(tmpstr4, "iframe src") != NULL) |
---|
646 | url3 = string_resub("<iframe src=\"", "\"", tmpstr4, 0); |
---|
647 | else |
---|
648 | url3 = string_resub("<a href=\"", "\"", tmpstr4, 0); |
---|
649 | // url3 = ostrcat(tmpstr4, NULL, 0, 0); |
---|
650 | //////////////// |
---|
651 | free(pathnew), pathnew = NULL; |
---|
652 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
653 | pathnew = ostrcat(pathnew, "&Part=4", 1, 0); |
---|
654 | |
---|
655 | titheklog(debuglevel, "/tmp/kinox6_pathnew4", hname, NULL, NULL, pathnew); |
---|
656 | |
---|
657 | tmpstr5 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
658 | if(ostrstr(tmpstr5, "503 Service Temporarily Unavailable") != NULL) |
---|
659 | { |
---|
660 | sleep(1); |
---|
661 | tmpstr5 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
662 | } |
---|
663 | free(pathnew), pathnew = NULL; |
---|
664 | |
---|
665 | titheklog(debuglevel, "/tmp/kinox7_tmpstr5", hname, NULL, NULL, tmpstr5); |
---|
666 | |
---|
667 | tmpstr5 = string_replace_all("\\", "", tmpstr5, 1); |
---|
668 | if(ostrstr(tmpstr5, "iframe src") != NULL) |
---|
669 | url4 = string_resub("<iframe src=\"", "\"", tmpstr5, 0); |
---|
670 | else |
---|
671 | url4 = string_resub("<a href=\"", "\"", tmpstr5, 0); |
---|
672 | // url4 = ostrcat(tmpstr5, NULL, 0, 0); |
---|
673 | //////////////// |
---|
674 | */ |
---|
675 | type = 14; |
---|
676 | if(localhoster == 1) |
---|
677 | type = 111; |
---|
678 | |
---|
679 | debug(99, "-------------------------------"); |
---|
680 | // if(ostrcmp(url, url2) != 0) |
---|
681 | // { |
---|
682 | // debug(99, "(%d/%d) (%d/%d) %s (Part1) url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra); |
---|
683 | // } |
---|
684 | // else |
---|
685 | // { |
---|
686 | debug(99, "(%d/%d) (%d/%d) %s url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra); |
---|
687 | // } |
---|
688 | debug(99, "-------------------------------"); |
---|
689 | |
---|
690 | incount += 1; |
---|
691 | line = ostrcat(line, hname, 1, 0); |
---|
692 | |
---|
693 | if(url == NULL) |
---|
694 | line = ostrcat(line, " (Error)", 1, 0); |
---|
695 | |
---|
696 | if(url2 != NULL && ostrcmp(url, url2) != 0) |
---|
697 | line = ostrcat(line, " (Part1)", 1, 0); |
---|
698 | if(extra != NULL) |
---|
699 | { |
---|
700 | line = ostrcat(line, " (", 1, 0); |
---|
701 | line = ostrcat(line, extra, 1, 0); |
---|
702 | line = ostrcat(line, ")", 1, 0); |
---|
703 | } |
---|
704 | |
---|
705 | line = ostrcat(line, " (Mirror ", 1, 0); |
---|
706 | line = ostrcat(line, oitoa(j), 1, 1); |
---|
707 | line = ostrcat(line, "/", 1, 0); |
---|
708 | line = ostrcat(line, oitoa(mirrormax), 1, 1); |
---|
709 | line = ostrcat(line, ")", 1, 0); |
---|
710 | |
---|
711 | |
---|
712 | line = ostrcat(line, "#", 1, 0); |
---|
713 | if(!ostrncmp("//", url, 2)) |
---|
714 | line = ostrcat(line, "http:", 1, 0); |
---|
715 | line = ostrcat(line, url, 1, 0); |
---|
716 | line = ostrcat(line, "#", 1, 0); |
---|
717 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
718 | line = ostrcat(line, pichname, 1, 0); |
---|
719 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
720 | line = ostrcat(line, pichname, 1, 0); |
---|
721 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
722 | line = ostrcat(line, title, 1, 0); |
---|
723 | line = ostrcat(line, "#", 1, 0); |
---|
724 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
725 | line = ostrcat(line, "\n", 1, 0); |
---|
726 | /* |
---|
727 | if((url != NULL && url2 != NULL) && ostrcmp(url, url2) != 0) |
---|
728 | { |
---|
729 | free(tmpstr2), tmpstr2 = NULL; |
---|
730 | free(hname), hname = NULL; |
---|
731 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
732 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
733 | string_tolower(pichname); |
---|
734 | pichname = stringreplacecharonce(pichname, '\n', '\0'); |
---|
735 | |
---|
736 | type = 14; |
---|
737 | |
---|
738 | debug(99, "-------------------------------"); |
---|
739 | debug(99, "(%d/%d) %s (Part2) url: %s extra: %s",i ,max, hname, url2, extra); |
---|
740 | |
---|
741 | incount += 1; |
---|
742 | line = ostrcat(line, hname, 1, 0); |
---|
743 | line = ostrcat(line, " (Part2)", 1, 0); |
---|
744 | if(extra != NULL) |
---|
745 | { |
---|
746 | line = ostrcat(line, " (", 1, 0); |
---|
747 | line = ostrcat(line, extra, 1, 0); |
---|
748 | line = ostrcat(line, ")", 1, 0); |
---|
749 | } |
---|
750 | line = ostrcat(line, "#", 1, 0); |
---|
751 | line = ostrcat(line, url2, 1, 0); |
---|
752 | line = ostrcat(line, "#", 1, 0); |
---|
753 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
754 | line = ostrcat(line, pichname, 1, 0); |
---|
755 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
756 | line = ostrcat(line, pichname, 1, 0); |
---|
757 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
758 | line = ostrcat(line, title, 1, 0); |
---|
759 | line = ostrcat(line, "#", 1, 0); |
---|
760 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
761 | line = ostrcat(line, "\n", 1, 0); |
---|
762 | free(tmpstr2), tmpstr2 = NULL; |
---|
763 | } |
---|
764 | |
---|
765 | if((url != NULL && url3 != NULL) && ostrcmp(url, url3) != 0 && ostrcmp(url2, url3) != 0) |
---|
766 | { |
---|
767 | free(tmpstr2), tmpstr2 = NULL; |
---|
768 | free(hname), hname = NULL; |
---|
769 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
770 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
771 | string_tolower(pichname); |
---|
772 | pichname = stringreplacecharonce(pichname, '\n', '\0'); |
---|
773 | type = 14; |
---|
774 | |
---|
775 | debug(99, "-------------------------------"); |
---|
776 | debug(99, "(%d/%d) %s (Part3) url: %s extra: %s",i ,max , hname, url3, extra); |
---|
777 | |
---|
778 | incount += 1; |
---|
779 | line = ostrcat(line, hname, 1, 0); |
---|
780 | if(extra != NULL) |
---|
781 | line = ostrcat(line, " (Part3)", 1, 0); |
---|
782 | if(extra != NULL) |
---|
783 | { |
---|
784 | line = ostrcat(line, " (", 1, 0); |
---|
785 | line = ostrcat(line, extra, 1, 0); |
---|
786 | line = ostrcat(line, ")", 1, 0); |
---|
787 | } |
---|
788 | line = ostrcat(line, "#", 1, 0); |
---|
789 | line = ostrcat(line, url3, 1, 0); |
---|
790 | line = ostrcat(line, "#", 1, 0); |
---|
791 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
792 | line = ostrcat(line, pichname, 1, 0); |
---|
793 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
794 | line = ostrcat(line, pichname, 1, 0); |
---|
795 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
796 | line = ostrcat(line, title, 1, 0); |
---|
797 | line = ostrcat(line, "#", 1, 0); |
---|
798 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
799 | line = ostrcat(line, "\n", 1, 0); |
---|
800 | free(tmpstr2), tmpstr2 = NULL; |
---|
801 | } |
---|
802 | |
---|
803 | if((url != NULL && url4 != NULL) && ostrcmp(url, url4) != 0 && ostrcmp(url2, url4) != 0 && ostrcmp(url3, url4) != 0) |
---|
804 | { |
---|
805 | free(tmpstr2), tmpstr2 = NULL; |
---|
806 | free(hname), hname = NULL; |
---|
807 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
808 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
809 | string_tolower(pichname); |
---|
810 | pichname = stringreplacecharonce(pichname, '\n', '\0'); |
---|
811 | type = 14; |
---|
812 | debug(99, "-------------------------------"); |
---|
813 | debug(99, "(%d/%d) %s (Part4) url: %s extra: %s",i ,max , hname, url4, extra); |
---|
814 | |
---|
815 | incount += 1; |
---|
816 | line = ostrcat(line, hname, 1, 0); |
---|
817 | line = ostrcat(line, " (Part4)", 1, 0); |
---|
818 | if(extra != NULL) |
---|
819 | { |
---|
820 | line = ostrcat(line, " (", 1, 0); |
---|
821 | line = ostrcat(line, extra, 1, 0); |
---|
822 | line = ostrcat(line, ")", 1, 0); |
---|
823 | } |
---|
824 | line = ostrcat(line, "#", 1, 0); |
---|
825 | line = ostrcat(line, url4, 1, 0); |
---|
826 | line = ostrcat(line, "#", 1, 0); |
---|
827 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
828 | line = ostrcat(line, pichname, 1, 0); |
---|
829 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
830 | line = ostrcat(line, pichname, 1, 0); |
---|
831 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
832 | line = ostrcat(line, title, 1, 0); |
---|
833 | line = ostrcat(line, "#", 1, 0); |
---|
834 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
835 | line = ostrcat(line, "\n", 1, 0); |
---|
836 | free(tmpstr2), tmpstr2 = NULL; |
---|
837 | } |
---|
838 | */ |
---|
839 | free(tmpstr1), tmpstr1 = NULL; |
---|
840 | free(tmpstr2), tmpstr2 = NULL; |
---|
841 | free(tmpstr3), tmpstr3 = NULL; |
---|
842 | free(tmpstr4), tmpstr4 = NULL; |
---|
843 | free(tmpstr5), tmpstr5 = NULL; |
---|
844 | free(hname), hname = NULL; |
---|
845 | free(hnr), hnr = NULL; |
---|
846 | free(hlink), hlink = NULL; |
---|
847 | free(url), url = NULL; |
---|
848 | free(url2), url2 = NULL; |
---|
849 | free(url3), url3 = NULL; |
---|
850 | free(url4), url4 = NULL; |
---|
851 | free(pathnew), pathnew = NULL; |
---|
852 | free(pichname), pichname = NULL; |
---|
853 | free(extra), extra = NULL; |
---|
854 | } |
---|
855 | debug(99, "### END #####################################################"); |
---|
856 | } |
---|
857 | } |
---|
858 | free(ret1), ret1 = NULL; |
---|
859 | } |
---|
860 | } |
---|
861 | free(tmpstr), tmpstr = NULL; |
---|
862 | |
---|
863 | if(line != NULL) |
---|
864 | { |
---|
865 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
866 | if(series == 0) |
---|
867 | { |
---|
868 | tmpstr = ostrcat("/tmp/tithek/kinox.hoster.", oitoa(time(NULL)), 0, 1); |
---|
869 | tmpstr = ostrcat(tmpstr, ".list", 1, 0); |
---|
870 | } |
---|
871 | else |
---|
872 | { |
---|
873 | tmpstr = ostrcat("/tmp/tithek/kinox.hoster.ser.", oitoa(time(NULL)), 0, 1); |
---|
874 | tmpstr = ostrcat(tmpstr, ".list", 1, 0); |
---|
875 | } |
---|
876 | writesys(tmpstr, line, 0); |
---|
877 | |
---|
878 | titheklog(debuglevel, "/tmp/kinox8_line", NULL, NULL, NULL, line); |
---|
879 | |
---|
880 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
881 | createtithek(tnode, tnode->title, tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
882 | ret = 0; |
---|
883 | } |
---|
884 | |
---|
885 | return ret; |
---|
886 | } |
---|
887 | |
---|
888 | int kinox_hoster_series(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title) |
---|
889 | { |
---|
890 | debug(99, "link: %s", link); |
---|
891 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
892 | int ret = 1; |
---|
893 | 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; |
---|
894 | char* pichname = NULL, *extra= NULL; |
---|
895 | char* newurl = NULL; |
---|
896 | char *cmd = NULL; |
---|
897 | |
---|
898 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
899 | return ret; |
---|
900 | |
---|
901 | int count0 = 0; |
---|
902 | struct splitstr* ret0 = NULL; |
---|
903 | ret0 = strsplit(link, ";", &count0); |
---|
904 | if(ret0 != NULL && count0 >= 3) |
---|
905 | { |
---|
906 | url = ostrcat(url, ret0[0].part, 1, 0); |
---|
907 | debug(99, "url: %s", url); |
---|
908 | |
---|
909 | session = ostrcat(session, ret0[1].part, 1, 0); |
---|
910 | debug(99, "Season: %s", session); |
---|
911 | |
---|
912 | episode = ostrcat(episode, ret0[2].part, 1, 0); |
---|
913 | debug(99, "episode: %s", episode); |
---|
914 | |
---|
915 | searchname = ostrcat(searchname, ret0[0].part, 1, 0); |
---|
916 | |
---|
917 | searchname = string_replace("kinox.to", "", searchname, 0); |
---|
918 | searchname = string_replace(getconfig("tithek_kinox_url", NULL), "", searchname, 0); |
---|
919 | searchname = string_replace("http:////Stream/", "", searchname, 0); |
---|
920 | searchname = string_replace("http:///Stream/", "", searchname, 0); |
---|
921 | searchname = string_replace("http://Stream/", "", searchname, 0); |
---|
922 | searchname = string_replace("https:////Stream/", "", searchname, 0); |
---|
923 | searchname = string_replace("https:///Stream/", "", searchname, 0); |
---|
924 | searchname = string_replace("https://Stream/", "", searchname, 0); |
---|
925 | searchname = string_replace("//Stream/", "", searchname, 0); |
---|
926 | searchname = string_replace("/Stream/", "", searchname, 0); |
---|
927 | searchname = string_replace(".html", "", searchname, 0); |
---|
928 | debug(99, "searchname: %s", searchname); |
---|
929 | free(searchname), searchname = NULL; |
---|
930 | |
---|
931 | searchname = oregex("://.*/Stream/(.*).html.*", ret0[0].part); |
---|
932 | debug(99, "new searchname: %s", searchname); |
---|
933 | } |
---|
934 | free(ret0), ret0 = NULL; |
---|
935 | |
---|
936 | ip = string_replace("http://", "", url, 0); |
---|
937 | |
---|
938 | if(ip != NULL) |
---|
939 | pos = strchr(ip, '/'); |
---|
940 | if(pos != NULL) |
---|
941 | { |
---|
942 | pos[0] = '\0'; |
---|
943 | path = pos + 1; |
---|
944 | } |
---|
945 | |
---|
946 | pathnew = oregex("://.*/(.*).*", link); |
---|
947 | printf("new pathnew: %s\n",pathnew); |
---|
948 | |
---|
949 | int cloudflare = 1; |
---|
950 | int localhoster = 1; |
---|
951 | newurl = ostrcat(getconfig("tithek_kinox_url", NULL), "/", 0, 0); |
---|
952 | newurl = ostrcat(newurl, pathnew, 1, 0); |
---|
953 | |
---|
954 | if(cloudflare == 0) |
---|
955 | { |
---|
956 | // tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
957 | // tmpstr = gethttps(link, NULL, NULL, NULL, NULL, NULL, 1); |
---|
958 | tmpstr = gethttps(newurl, NULL, NULL, NULL, NULL, NULL, 1); |
---|
959 | } |
---|
960 | else |
---|
961 | { |
---|
962 | // new start |
---|
963 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", newurl, 0, 0); |
---|
964 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
965 | debug(99, "cmd: %s", cmd); |
---|
966 | tmpstr = command(cmd); |
---|
967 | free(cmd), cmd = NULL; |
---|
968 | // new end |
---|
969 | } |
---|
970 | |
---|
971 | debug(99, "tmpstr: %s", tmpstr); |
---|
972 | free(newurl), newurl = NULL; |
---|
973 | |
---|
974 | if(tmpstr != NULL) |
---|
975 | { |
---|
976 | drawscreen(load, 0, 0); |
---|
977 | |
---|
978 | seriesid = string_resub("SeriesID=", "\"", tmpstr, 0); |
---|
979 | debug(99, "seriesid: %s", seriesid); |
---|
980 | |
---|
981 | pathnew = ostrcat("/aGET/MirrorByEpisode/&?Addr=", searchname, 0, 0); |
---|
982 | pathnew = ostrcat(pathnew, "&SeriesID=", 1, 0); |
---|
983 | pathnew = ostrcat(pathnew, seriesid, 1, 0); |
---|
984 | pathnew = ostrcat(pathnew, "&Season=", 1, 0); |
---|
985 | pathnew = ostrcat(pathnew, session, 1, 0); |
---|
986 | pathnew = ostrcat(pathnew, "&Episode=", 1, 0); |
---|
987 | pathnew = ostrcat(pathnew, episode, 1, 0); |
---|
988 | debug(99, "pathnew: %s", pathnew); |
---|
989 | |
---|
990 | free(tmpstr), tmpstr = NULL; |
---|
991 | // tmpstr = gethttp(getconfig("tithek_kinox_url", NULL, pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
992 | newurl = ostrcat(getconfig("tithek_kinox_url", NULL), "/", 0, 0); |
---|
993 | newurl = ostrcat(newurl, pathnew, 1, 0); |
---|
994 | // tmpstr = gethttps(newurl, NULL, NULL, NULL, NULL, NULL, 1); |
---|
995 | // new start |
---|
996 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", newurl, 0, 0); |
---|
997 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
998 | debug(99, "cmd: %s", cmd); |
---|
999 | tmpstr = command(cmd); |
---|
1000 | free(cmd), cmd = NULL; |
---|
1001 | // new end |
---|
1002 | free(newurl), newurl = NULL; |
---|
1003 | |
---|
1004 | free(pathnew), pathnew = NULL; |
---|
1005 | |
---|
1006 | if(tmpstr != NULL) |
---|
1007 | { |
---|
1008 | tmpstr = string_resub("<ul id=\"HosterList\" class=\"Sortable\">", "</ul>", tmpstr, 0); |
---|
1009 | |
---|
1010 | int type = 14; |
---|
1011 | int count = 0; |
---|
1012 | int incount = 0; |
---|
1013 | int i; |
---|
1014 | struct splitstr* ret1 = NULL; |
---|
1015 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
1016 | |
---|
1017 | char* hname = NULL; |
---|
1018 | char* hnr = NULL; |
---|
1019 | char* hlink = NULL; |
---|
1020 | |
---|
1021 | if(ret1 != NULL && count > 0) |
---|
1022 | { |
---|
1023 | int max = count; |
---|
1024 | for(i = 0; i < max; i++) |
---|
1025 | { |
---|
1026 | char *mirrormaxtmp = NULL; |
---|
1027 | char *pathnewtmp = NULL; |
---|
1028 | char *season = NULL; |
---|
1029 | int mirrormax = 1; |
---|
1030 | int j = 0; |
---|
1031 | |
---|
1032 | mirrormaxtmp = oregex("<b>Mirror</b>: .*/(.*)<br.*", ret1[i].part); |
---|
1033 | |
---|
1034 | if(mirrormaxtmp != NULL) |
---|
1035 | mirrormax = atoi(mirrormaxtmp); |
---|
1036 | free(mirrormaxtmp), mirrormaxtmp= NULL; |
---|
1037 | |
---|
1038 | debug(99, "### START ####################################################"); |
---|
1039 | |
---|
1040 | for(j = 1; j < mirrormax + 1; j++) |
---|
1041 | { |
---|
1042 | debug(99, "(%d/%d) (%d/%d) ret1[i].part: %s",i ,max ,j ,mirrormax, ret1[i].part); |
---|
1043 | |
---|
1044 | hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0); |
---|
1045 | |
---|
1046 | // hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0); |
---|
1047 | // hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); |
---|
1048 | // hlink = ostrcat(hlink, "Mirror=", 0, 0); |
---|
1049 | |
---|
1050 | ////////// |
---|
1051 | hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0); |
---|
1052 | |
---|
1053 | if (hlink == NULL) |
---|
1054 | { |
---|
1055 | hlink = string_resub("rel=\"", "\">", ret1[i].part, 0); |
---|
1056 | hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); |
---|
1057 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
1058 | pathnewtmp = ostrcat(getconfig("tithek_kinox_url", NULL), "/aGET/Mirror/", 0, 0); |
---|
1059 | pathnewtmp = ostrcat(pathnewtmp, hlink, 1, 0); |
---|
1060 | pathnew = ostrcat(pathnewtmp, NULL, 0, 0); |
---|
1061 | } |
---|
1062 | else |
---|
1063 | { |
---|
1064 | hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); |
---|
1065 | hlink = ostrcat(hlink, "Mirror=", 0, 0); |
---|
1066 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
1067 | pathnewtmp = ostrcat(getconfig("tithek_kinox_url", NULL), "/aGET/Mirror/", 0, 0); |
---|
1068 | pathnewtmp = ostrcat(pathnewtmp, hlink, 1, 0); |
---|
1069 | pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1); |
---|
1070 | } |
---|
1071 | debug(99, "(%d/%d) (%d/%d)hnr: %s hlink: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,hname ,pathnewtmp); |
---|
1072 | free(pathnewtmp), pathnewtmp = NULL; |
---|
1073 | ////////// |
---|
1074 | // hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
1075 | // pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
1076 | |
---|
1077 | season = string_resub("&Season=", "\">", ret1[i].part, 0); |
---|
1078 | season = string_replace_all("amp;", "", season, 1); |
---|
1079 | |
---|
1080 | // pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1); |
---|
1081 | pathnew = ostrcat(pathnew, "&Season=", 1, 0); |
---|
1082 | pathnew = ostrcat(pathnew, season, 1, 0); |
---|
1083 | |
---|
1084 | 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); |
---|
1085 | |
---|
1086 | free(season), season= NULL; |
---|
1087 | free(pathnewtmp), pathnewtmp = NULL; |
---|
1088 | |
---|
1089 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
1090 | string_tolower(pichname); |
---|
1091 | pichname = stringreplacecharonce(pichname, '.', '\0'); |
---|
1092 | |
---|
1093 | extra = string_resub("<b>Vom</b>: ", "</div>", ret1[i].part, 0); |
---|
1094 | |
---|
1095 | hlink = string_replace("kinox.to", "", hlink, 1); |
---|
1096 | hlink = string_replace(getconfig("tithek_kinox_url", NULL), "", hlink, 1); |
---|
1097 | hlink = string_replace("http:////Stream/", "", hlink, 1); |
---|
1098 | hlink = string_replace("http:///Stream/", "", hlink, 1); |
---|
1099 | hlink = string_replace("https:////Stream/", "", hlink, 1); |
---|
1100 | hlink = string_replace("https:///Stream/", "", hlink, 1); |
---|
1101 | |
---|
1102 | if(cloudflare == 0) |
---|
1103 | { |
---|
1104 | // tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
1105 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
1106 | } |
---|
1107 | else if(localhoster == 1) |
---|
1108 | { |
---|
1109 | cmd = ostrcat("/tmp/localhoster/hoster.sh hoster '", pathnew, 0, 0); |
---|
1110 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
1111 | debug(99, "cmd: %s", cmd); |
---|
1112 | url = ostrcat(cmd, NULL, 0, 0); |
---|
1113 | } |
---|
1114 | else |
---|
1115 | { |
---|
1116 | // new start |
---|
1117 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", pathnew, 0, 0); |
---|
1118 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
1119 | debug(99, "cmd: %s", cmd); |
---|
1120 | tmpstr1 = command(cmd); |
---|
1121 | free(cmd), cmd = NULL; |
---|
1122 | // new end |
---|
1123 | } |
---|
1124 | /* |
---|
1125 | // debug(99, "pathnew: %s", pathnew); |
---|
1126 | // tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
1127 | // tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
1128 | // new start |
---|
1129 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", pathnew, 0, 0); |
---|
1130 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
1131 | debug(99, "cmd: %s", cmd); |
---|
1132 | tmpstr1 = command(cmd); |
---|
1133 | free(cmd), cmd = NULL; |
---|
1134 | // new end |
---|
1135 | // debug(99, "tmpstr1 1: %s", tmpstr1); |
---|
1136 | */ |
---|
1137 | tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); |
---|
1138 | // debug(99, "tmpstr1 2: %s", tmpstr1); |
---|
1139 | |
---|
1140 | if(localhoster == 0) |
---|
1141 | { |
---|
1142 | if(ostrstr(tmpstr1, "<iframe src=") != NULL) |
---|
1143 | { |
---|
1144 | url = string_resub("<iframe src=\"", "\"", tmpstr1, 0); |
---|
1145 | // debug(99, "iframe1.1 url: %s", url); |
---|
1146 | } |
---|
1147 | else if(ostrstr(tmpstr1, "/iframe>") != NULL) |
---|
1148 | { |
---|
1149 | free(pathnew), pathnew = NULL; |
---|
1150 | pathnew = ostrcat(getconfig("tithek_kinox_url", NULL), "/aGET/Mirror/", 0, 0); |
---|
1151 | pathnew = ostrcat(pathnew, hlink, 1, 0); |
---|
1152 | // debug(99, "iframe2.1 pathnew: %s", pathnew); |
---|
1153 | free(tmpstr1), tmpstr1 = NULL; |
---|
1154 | // tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
1155 | // new start |
---|
1156 | cmd = ostrcat("/tmp/localhoster/hoster.sh get '", pathnew, 0, 0); |
---|
1157 | cmd = ostrcat(cmd, "'", 1, 0); |
---|
1158 | debug(99, "cmd: %s", cmd); |
---|
1159 | tmpstr1 = command(cmd); |
---|
1160 | free(cmd), cmd = NULL; |
---|
1161 | // new end |
---|
1162 | // debug(99, "iframe2.2 tmpstr1: %s", tmpstr1); |
---|
1163 | tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); |
---|
1164 | // debug(99, "iframe2.3 tmpstr1: %s", tmpstr1); |
---|
1165 | |
---|
1166 | if(ostrstr(tmpstr1, "<iframe src=") != NULL) |
---|
1167 | { |
---|
1168 | url = string_resub("<iframe src=\"", "\"", tmpstr1, 0); |
---|
1169 | // debug(99, "iframe2.4 url: %s", url); |
---|
1170 | } |
---|
1171 | } |
---|
1172 | else |
---|
1173 | { |
---|
1174 | tmpstr1 = string_resub("<a href=\"", "\"", tmpstr1, 0); |
---|
1175 | // debug(99, "tmpstr1 3: %s", tmpstr1); |
---|
1176 | url = ostrcat(tmpstr1, NULL, 0, 0); |
---|
1177 | } |
---|
1178 | } |
---|
1179 | |
---|
1180 | type = 14; |
---|
1181 | if(localhoster == 1) |
---|
1182 | type = 111; |
---|
1183 | |
---|
1184 | debug(99, "-------------------------------"); |
---|
1185 | debug(99, "(%d/%d) (%d/%d) %s url: %s extra: %s", i, max, j, mirrormax, hname, url, extra); |
---|
1186 | debug(99, "-------------------------------"); |
---|
1187 | |
---|
1188 | incount += 1; |
---|
1189 | |
---|
1190 | line = ostrcat(line, hname, 1, 0); |
---|
1191 | |
---|
1192 | if(url == NULL) |
---|
1193 | line = ostrcat(line, " (Error)", 1, 0); |
---|
1194 | |
---|
1195 | if(extra != NULL) |
---|
1196 | { |
---|
1197 | line = ostrcat(line, " (", 1, 0); |
---|
1198 | line = ostrcat(line, extra, 1, 0); |
---|
1199 | line = ostrcat(line, ")", 1, 0); |
---|
1200 | } |
---|
1201 | |
---|
1202 | line = ostrcat(line, " (Mirror ", 1, 0); |
---|
1203 | line = ostrcat(line, oitoa(j), 1, 1); |
---|
1204 | line = ostrcat(line, "/", 1, 0); |
---|
1205 | line = ostrcat(line, oitoa(mirrormax), 1, 1); |
---|
1206 | line = ostrcat(line, ")", 1, 0); |
---|
1207 | |
---|
1208 | |
---|
1209 | line = ostrcat(line, "#", 1, 0); |
---|
1210 | line = ostrcat(line, url, 1, 0); |
---|
1211 | line = ostrcat(line, "#", 1, 0); |
---|
1212 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
1213 | line = ostrcat(line, pichname, 1, 0); |
---|
1214 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
1215 | line = ostrcat(line, pichname, 1, 0); |
---|
1216 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
1217 | line = ostrcat(line, title, 1, 0); |
---|
1218 | line = ostrcat(line, "#", 1, 0); |
---|
1219 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
1220 | line = ostrcat(line, "\n", 1, 0); |
---|
1221 | |
---|
1222 | free(tmpstr1), tmpstr1 = NULL; |
---|
1223 | free(tmpstr2), tmpstr2 = NULL; |
---|
1224 | free(hname), hname = NULL; |
---|
1225 | free(hnr), hnr = NULL; |
---|
1226 | free(hlink), hlink = NULL; |
---|
1227 | free(url), url = NULL; |
---|
1228 | free(pathnew), pathnew = NULL; |
---|
1229 | free(pichname), pichname = NULL; |
---|
1230 | free(extra), extra = NULL; |
---|
1231 | } |
---|
1232 | debug(99, "### END #####################################################"); |
---|
1233 | } |
---|
1234 | } |
---|
1235 | free(ret1), ret1 = NULL; |
---|
1236 | } |
---|
1237 | } |
---|
1238 | |
---|
1239 | free(tmpstr), tmpstr = NULL; |
---|
1240 | if(line != NULL) |
---|
1241 | { |
---|
1242 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
1243 | tmpstr = ostrcat("/tmp/tithek/kinox.hoster.series.", oitoa(time(NULL)), 0, 1); |
---|
1244 | tmpstr = ostrcat(tmpstr, ".list", 1, 0); |
---|
1245 | |
---|
1246 | writesys(tmpstr, line, 0); |
---|
1247 | |
---|
1248 | titheklog(debuglevel, "/tmp/kinox9_line", NULL, NULL, NULL, line); |
---|
1249 | |
---|
1250 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
1251 | createtithek(tnode, tnode->title, tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
1252 | ret = 0; |
---|
1253 | } |
---|
1254 | |
---|
1255 | return ret; |
---|
1256 | } |
---|
1257 | |
---|
1258 | int kinox_search_cast(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr) |
---|
1259 | { |
---|
1260 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
1261 | int ret = 1; |
---|
1262 | |
---|
1263 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
1264 | return ret; |
---|
1265 | |
---|
1266 | char* search = NULL; |
---|
1267 | if(searchstr == NULL) |
---|
1268 | search = textinputhist(_("Search"), " ", "searchhist"); |
---|
1269 | else |
---|
1270 | search = textinputhist(_("Search"), searchstr, "searchhist"); |
---|
1271 | |
---|
1272 | if(search != NULL) |
---|
1273 | { |
---|
1274 | drawscreen(load, 0, 0); |
---|
1275 | search = strstrip(search); |
---|
1276 | search = stringreplacechar(search, ' ', '+'); |
---|
1277 | debug(99, "search: %s", search); |
---|
1278 | |
---|
1279 | char* tmpstr = NULL; |
---|
1280 | char* tmpstr1 = NULL; |
---|
1281 | char* ip = NULL; |
---|
1282 | char* path = NULL; |
---|
1283 | |
---|
1284 | char* line = NULL; |
---|
1285 | char* menu = NULL; |
---|
1286 | |
---|
1287 | ip = ostrcat("www.imdb.com", NULL, 0, 0); |
---|
1288 | path = ostrcat("find?q=", search, 0, 0); |
---|
1289 | path = ostrcat(path, "&s=nm", 1, 0); |
---|
1290 | |
---|
1291 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
1292 | titheklog(debuglevel, "/tmp/kinox10_cast_tmpstr1", NULL, NULL, NULL, tmpstr); |
---|
1293 | tmpstr = string_replace_all("<td class=\"primary_photo\"> <a href=\"/name/", "\nfound=\"", tmpstr, 1); |
---|
1294 | titheklog(debuglevel, "/tmp/kinox10_cast_tmpstr2", NULL, NULL, NULL, tmpstr); |
---|
1295 | |
---|
1296 | tmpstr1 = string_resub("<table class=\"findList\">", "</div>", tmpstr, 0); |
---|
1297 | titheklog(debuglevel, "/tmp/kinox10_cast_tmpstr3", NULL, NULL, NULL, tmpstr1); |
---|
1298 | free(tmpstr), tmpstr = NULL; |
---|
1299 | |
---|
1300 | int count = 0; |
---|
1301 | int incount = 0; |
---|
1302 | int i; |
---|
1303 | struct splitstr* ret1 = NULL; |
---|
1304 | ret1 = strsplit(tmpstr1, "\n", &count); |
---|
1305 | |
---|
1306 | char* url = NULL; |
---|
1307 | char* pic = NULL; |
---|
1308 | char* name = NULL; |
---|
1309 | |
---|
1310 | if(ret1 != NULL && count > 0) |
---|
1311 | { |
---|
1312 | int max = count; |
---|
1313 | for(i = 0; i < max; i++) |
---|
1314 | { |
---|
1315 | url = string_resub("found=\"", "/", ret1[i].part, 0); |
---|
1316 | pic = string_resub("<img src=\"", "\"", ret1[i].part, 0); |
---|
1317 | |
---|
1318 | tmpstr = string_resub("found=\"", "<small>", ret1[i].part, 0); |
---|
1319 | // name = oregex(".*<a href=\"/name/nm.*\ >(.*)</a>", tmpstr); |
---|
1320 | name = oregex(".*<a href=\"/name/nm.* >(.*)</a>", tmpstr); |
---|
1321 | |
---|
1322 | debug(99, "(%d/%d) name: %s url: %s pic: %s\n",i, count, name, url, pic); |
---|
1323 | debug(99, "-------------------------------"); |
---|
1324 | |
---|
1325 | pic = string_replace_all(",", "%2C", pic, 1); |
---|
1326 | |
---|
1327 | if(url != NULL) |
---|
1328 | { |
---|
1329 | incount++; |
---|
1330 | line = ostrcat(line, name, 1, 0); |
---|
1331 | line = ostrcat(line, "#", 1, 0); |
---|
1332 | line = ostrcat(line, getconfig("tithek_kinox_url", NULL), 1, 0); |
---|
1333 | line = ostrcat(line, "/People/", 1, 0); |
---|
1334 | line = ostrcat(line, url, 1, 0); |
---|
1335 | line = ostrcat(line, "#", 1, 0); |
---|
1336 | line = ostrcat(line, pic, 1, 0); |
---|
1337 | line = ostrcat(line, "#kinox_search_", 1, 0); |
---|
1338 | line = ostrcat(line, oitoa(incount + time(NULL)), 1, 1); |
---|
1339 | line = ostrcat(line, ".jpg#KinoX - Cast Search#32\n", 1, 0); |
---|
1340 | } |
---|
1341 | |
---|
1342 | free(url), url = NULL; |
---|
1343 | free(pic), pic = NULL; |
---|
1344 | free(name), name = NULL; |
---|
1345 | free(tmpstr), tmpstr = NULL; |
---|
1346 | } |
---|
1347 | |
---|
1348 | free(ret1), ret1 = NULL; |
---|
1349 | if(line != NULL) |
---|
1350 | { |
---|
1351 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
1352 | menu = ostrcat("/tmp/tithek/kinox.search.cast.", oitoa(time(NULL)), 0, 1); |
---|
1353 | menu = ostrcat(menu, ".list", 1, 0); |
---|
1354 | |
---|
1355 | writesys(menu, line, 0); |
---|
1356 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
1357 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
1358 | ret = 0; |
---|
1359 | } |
---|
1360 | |
---|
1361 | } |
---|
1362 | free(tmpstr), tmpstr = NULL; |
---|
1363 | free(ip), ip = NULL; |
---|
1364 | } |
---|
1365 | free(search), search = NULL; |
---|
1366 | return ret; |
---|
1367 | } |
---|
1368 | |
---|
1369 | #endif |
---|