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