source: titan/plugins/tithek/kinox.h @ 24319

Last change on this file since 24319 was 24319, checked in by obi, 10 years ago

[tithek] update and add hoster movshare

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