source: titan/plugins/tithek/tithek.h @ 24231

Last change on this file since 24231 was 24231, checked in by nit, 10 years ago

[titan] tithek optimize

File size: 68.5 KB
Line 
1#ifndef TITHEK_H
2#define TITHEK_H
3
4#define HTTPAUTH "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0="
5
6#define TITHEKPATH "/tmp/tithek"
7int tithekdownloadrun = 0;
8int tithekdownloadcount = 0;
9int tithekrun = 0;
10int tithekexit = 0;
11int tithekmovie4k = 0;
12int tithekkinox = 0;
13int titheksolarmovie = 0;
14int tithekmlehd = 0;
15
16//flag 0        - menu
17//flag 1        - menu pay hidden tithek_pay=0/1 0=hidden
18//flag 2        - http (default streamurl)
19//flag 3        - menu cover
20//flag 4        - youtube
21//flag 5        - rtl2now
22//flag 6        - superrtlnow
23//flag 7        - rtlnow
24//flag 8        - voxnow
25//flag 9        - youtube suche 10
26//flag 10       - youtube suche 25
27//flag 11       - youtube suche 50
28//flag 12       - myvideo
29//flag 13       - myvideo search 50
30//flag 14       - hoster putlocker/sockshare
31//flag 15       - hoster filenuke
32//flag 16       - superrtlnow pay
33//flag 17       - rtlnow pay
34//flag 18       - voxnow pay
35//flag 19       - rtl2now pay
36//flag 20       - hoster StreamCloud
37//flag 21       - kinox search
38//flag 22       - kinox hoster
39//flag 23       - kinox hoster serie
40//flag 24       - hoster flashx
41//flag 25       - hoster vidstream
42//flag 26       - hoster xvidstage
43//flag 27       - hoster nowvideo
44//flag 28       - solarmovie hoster
45//flag 29       - solarmovie search movie
46//flag 30       - solarmovie search serie
47//flag 31       - kinox search cast
48//flag 32       - kinox search cast results
49//flag 33       - movie4k search : serie > open seasons and list episode flag=40 > hoster listed flag=34
50//flag 34       - movie4k hoster de
51//flag 35       - movie4k hoster other
52//flag 36       - movie4k series de > open seasons and list episode flag=39 > hoster listed flag=34
53//flag 37       - movie4k series other > open seasons and list episode flag=39 > hoster listed flag=34
54//flag 38       - mlehd
55//flag 39   - movie4k_hoster_listed
56//flag 40   - movie4k_hoster_series
57//flag 41   - movie4k
58//flag 42   - xvideos
59//flag 43       - solarmovie
60//flag 44       - myvideo Single charts
61//flag 45       - ard
62//flag 46       - ard
63
64//flag 50       - beeg
65//flag 66   - coming soon dummy
66//flag 1000 - menu pincode
67//flag 9999 - menu hidden codecpack
68
69struct tithek
70{
71        char* title;
72        char* link;
73        char* pic;
74        char* localname;
75        char* menutitle;       
76        int flag;
77        struct tithek* prev;
78        struct tithek* next;
79};
80struct tithek *tithek = NULL;
81
82
83void freetithekcontent(struct tithek* node)
84{
85        if(node == NULL) return;
86
87        free(node->title); node->title = NULL;
88        node->link = NULL;
89        node->pic = NULL;
90        node->localname = NULL;
91        node->menutitle = NULL;
92        node->flag = 0;
93}
94
95int addtithekcontent(struct tithek* node, char *line, int len, int count, int pay)
96{
97        int ret = 0, i = 0, skip = 0, hid = 0, sos = 0;
98        char* tmpstr = NULL, *flag = NULL, *cmd = NULL, *tmp = NULL;
99        if(node == NULL) return 1;
100
101        if(len > 0) tmpstr = malloc(len + 1);
102        if(tmpstr != NULL)
103        {
104                memcpy(tmpstr, line, len);
105                tmpstr[len] = '\0';
106
107                node->title = tmpstr;
108
109                while(tmpstr[0] != '\0')
110                {
111                        if(tmpstr[0] == '#')
112                        {
113                                tmpstr[0] = '\0';
114                                tmpstr++;
115                                switch(ret)
116                                {
117                                        case 0: node->link = tmpstr; break;
118                                        case 1: node->pic = tmpstr; break;
119                                        case 2: node->localname = tmpstr; break;
120                                        case 3: node->menutitle = tmpstr; break;
121                                        case 4: flag = tmpstr; break;
122                                }
123
124                                ret++;
125                        }
126                        else
127                                tmpstr++;
128                }
129        }
130
131        if(ret != 5)
132        {
133                if(count > 0)
134                {
135                        err("tithek line %d not ok (ret=%d)", count, ret);
136                }
137                else
138                {
139                        err("add tithek (ret=%d)", ret);
140                }
141                freetithekcontent(node);
142                return 1;
143        }
144
145        if(flag != NULL) node->flag = atoi(flag);
146       
147        sos = getconfigint("sos", NULL);
148        hid = getconfigint("tithek_hid_xxx", NULL);
149        if(node->flag == 1000 && hid == 1)
150                skip = 1;
151        else if((node->flag == 9996 || node->flag == 9997 || node->flag == 9998 || node->flag == 9999) && !file_exist("/mnt/swapextensions/etc/.codecpack") && !file_exist("/var/swap/etc/.codecpack") && !file_exist("/var/etc/.codecpack"))
152                skip = 1;
153        else if(node->flag == 16 && pay == 0)
154                skip = 1;
155        else if(node->flag == 17 && pay == 0)
156                skip = 1;
157        else if(node->flag == 18 && pay == 0)
158                skip = 1;
159        else if(node->flag == 19 && pay == 0)
160                skip = 1;
161        else if(node->flag == 1 && pay == 0)
162                skip = 1;
163        else if(node->flag == 35 && pay == 0)
164                skip = 1;
165        else if(titheksolarmovie == 1 && node->flag == 9996 && sos == 0)
166        {
167                cmd = ostrcat(cmd, "ww", 1, 0);
168                cmd = ostrcat(cmd, "w.sola", 1, 0);
169                cmd = ostrcat(cmd, "rmovi", 1, 0);
170                cmd = ostrcat(cmd, "e.", 1, 0);
171                cmd = ostrcat(cmd, "so", 1, 0);
172               
173                for(i = 0; i < 3; i++)
174                {
175                        free(tmp); tmp = NULL;
176                        tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2);
177                        if(tmp != NULL) break;
178                }
179                if(tmp == NULL)
180                        skip = 1;
181
182                titheksolarmovie = 0;
183        }
184        else if(tithekmovie4k == 1 && node->flag == 9997 && sos == 0)
185        {
186                cmd = ostrcat(cmd, "ww", 1, 0);
187                cmd = ostrcat(cmd, "w.mov", 1, 0);
188                cmd = ostrcat(cmd, "ie4k", 1, 0);
189                cmd = ostrcat(cmd, ".", 1, 0);
190                cmd = ostrcat(cmd, "to", 1, 0);
191               
192                for(i = 0; i < 3; i++)
193                {
194                        free(tmp); tmp = NULL;
195                        tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2);
196                        if(tmp != NULL) break;
197                }
198                if(tmp == NULL)
199                        skip = 1;
200
201                tithekmovie4k = 0;
202        }               
203        else if(tithekmlehd == 1 && node->flag == 9998 && sos == 0)
204        {
205                cmd = ostrcat(cmd, "ww", 1, 0);
206                cmd = ostrcat(cmd, "w.mle", 1, 0);
207                cmd = ostrcat(cmd, "-hd", 1, 0);
208                cmd = ostrcat(cmd, ".", 1, 0);
209                cmd = ostrcat(cmd, "se", 1, 0);
210               
211                for(i = 0; i < 3; i++)
212                {
213                        free(tmp); tmp = NULL;
214                        tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2);
215                        if(tmp != NULL) break;
216                }
217                if(tmp == NULL)
218                        skip = 1;
219
220                tithekmlehd = 0;
221        }
222        else if(tithekkinox == 1 && node->flag == 9999 && sos == 0)
223        {
224                cmd = ostrcat(cmd, "kin", 1, 0);
225                cmd = ostrcat(cmd, "ox", 1, 0);
226                cmd = ostrcat(cmd, ".", 1, 0);
227                cmd = ostrcat(cmd, "to", 1, 0);
228               
229                for(i = 0; i < 3; i++)
230                {
231                        free(tmp); tmp = NULL;
232                        tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2);
233                        if(tmp != NULL) break;
234                }
235                if(tmp == NULL)
236                        skip = 1;
237
238                tithekkinox = 0;
239        }
240
241        if(skip == 1)
242        {
243                freetithekcontent(node);
244                return 1;
245        }
246
247        free(tmp); tmp = NULL;
248        free(cmd), cmd = NULL;
249               
250        return 0;
251}
252
253struct tithek* addtithek(char *line, int len, int count, struct tithek* last, int pay)
254{
255        //debug(1000, "in");
256        struct tithek *newnode = NULL, *prev = NULL, *node = NULL;
257        int ret = 0;
258
259        if(line == NULL) return NULL;
260
261        newnode = (struct tithek*)calloc(1, sizeof(struct tithek));
262        if(newnode == NULL)
263        {
264                err("no memory");
265                return NULL;
266        }
267
268        ret = addtithekcontent(newnode, line, len, count, pay);
269        if(ret == 1)
270        {
271                free(newnode);
272                return NULL;
273        }
274
275        node = tithek;
276
277        if(last == NULL)
278        {
279                while(node != NULL)
280                {
281                        prev = node;
282                        node = node->next;
283                }
284        }
285        else
286        {
287                prev = last;
288                node = last->next;
289        }
290
291        if(prev == NULL)
292                tithek = newnode;
293        else
294        {
295                prev->next = newnode;
296                newnode->prev = prev;
297        }
298        newnode->next = node;
299        if(node != NULL) node->prev = newnode;
300
301        //debug(1000, "out");
302        return newnode;
303}
304
305struct tithek* createtithek(struct tithek* update, char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
306{
307        int pay = 0;
308        struct tithek* tnode = NULL;
309        char* tmpstr = NULL;
310       
311        pay = getconfigint("tithek_pay", NULL);
312
313        title = stringreplacechar(title, '#', ' ');
314        link = stringreplacechar(link, '#', ' ');
315        pic = stringreplacechar(pic, '#', ' ');
316        localname = stringreplacechar(localname, '#', ' ');
317        menutitle = stringreplacechar(menutitle, '#', ' ');
318       
319        tmpstr = ostrcat(tmpstr, title, 1, 0);
320        tmpstr = ostrcat(tmpstr, "#", 1, 0);
321        tmpstr = ostrcat(tmpstr, link, 1, 0);
322        tmpstr = ostrcat(tmpstr, "#", 1, 0);
323        tmpstr = ostrcat(tmpstr, pic, 1, 0);
324        tmpstr = ostrcat(tmpstr, "#", 1, 0);
325        tmpstr = ostrcat(tmpstr, localname, 1, 0);
326        tmpstr = ostrcat(tmpstr, "#", 1, 0);
327        tmpstr = ostrcat(tmpstr, menutitle, 1, 0);
328        tmpstr = ostrcat(tmpstr, "#", 1, 0);
329        tmpstr = ostrcat(tmpstr, oitoa(flag), 1, 1);
330
331        tmpstr = string_replace_all("\n", "", tmpstr, 1);
332        tmpstr = string_replace_all("\r", "", tmpstr, 1);
333
334        if(update != NULL)
335        {
336                freetithekcontent(update);
337                addtithekcontent(update, tmpstr, strlen(tmpstr), 1, pay);
338                tnode = update;
339        }
340        else
341                tnode = addtithek(tmpstr, strlen(tmpstr), 1, NULL, pay);
342
343        free(tmpstr);
344
345        return tnode;
346}
347
348int readtithek(const char* filename)
349{
350        debug(1000, "in");
351        FILE *fd = NULL;
352        char *fileline = NULL;
353        int linecount = 0, len = 0, pay = 0;
354        struct tithek* last = NULL, *tmplast = NULL;
355
356        fileline = malloc(MINMALLOC);
357        if(fileline == NULL)
358        {
359                err("no memory");
360                return 1;
361        }
362
363        fd = fopen(filename, "r");
364        if(fd == NULL)
365        {
366                perr("can't open %s", filename);
367                free(fileline);
368                return 1;
369        }
370
371        pay = getconfigint("tithek_pay", NULL);
372
373        while(fgets(fileline, MINMALLOC, fd) != NULL)
374        {
375                if(fileline[0] == '\n')
376                        continue;
377                len = strlen(fileline) - 1;
378                if(fileline[len] == '\n')
379                        fileline[len] = '\0';
380                if(fileline[len - 1] == '\r')
381                        fileline[len - 1] = '\0';
382
383                linecount++;
384
385                if(last == NULL) last = tmplast;
386                last = addtithek(fileline, len + 2, linecount, last, pay);
387                if(last != NULL) tmplast = last;
388        }
389
390        free(fileline);
391        fclose(fd);
392        return linecount;
393}
394
395int deltithek(char* link)
396{
397        debug(1000, "in");
398        int ret = 1;
399
400        struct tithek *node = tithek, *prev = tithek;
401
402        while(node != NULL)
403        {
404                if(ostrcmp(link, node->link) == 0)
405                {
406                        ret = 0;
407                        if(node == tithek)
408                        {
409                                tithek = node->next;
410                                if(tithek != NULL)
411                                        tithek->prev = NULL;
412                        }
413                        else
414                        {
415                                prev->next = node->next;
416                                if(node->next != NULL)
417                                        node->next->prev = prev;
418                        }
419
420                        freetithekcontent(node);
421
422                        free(node);
423                        node = NULL;
424
425                        break;
426                }
427
428                prev = node;
429                node = node->next;
430        }
431
432        debug(1000, "out");
433        return ret;
434}
435
436void freetithek()
437{
438        debug(1000, "in");
439        struct tithek *node = tithek, *prev = tithek;
440
441        while(node != NULL)
442        {
443                prev = node;
444                node = node->next;
445                if(prev != NULL)
446                        deltithek(prev->link);
447        }
448
449        debug(1000, "out");
450}
451
452void tithekdownloadthread(struct stimerthread* timernode, struct download* node, int flag)
453{
454        int defpic = 0;
455
456        tithekdownloadcount++;
457
458        if(node != NULL)
459        {
460                m_lock(&status.tithekmutex, 20);
461                if(file_exist(node->filename))
462                {
463                        m_unlock(&status.tithekmutex, 20);
464                        goto end;
465                }
466
467                FILE *fd; fd = fopen(node->filename, "w");
468                if(fd != NULL) fclose(fd);
469                m_unlock(&status.tithekmutex, 20);
470
471                gethttpreal(node->host, node->page, node->port, node->filename, node->auth, NULL, 0, NULL, NULL, node->timeout, 0);
472
473                if(tithekrun == 0)
474                        unlink(node->filename);
475                else
476                {
477                        //check file size
478                        /*
479                        off64_t checkpic = getfilesize(node->filename);
480                        if(checkpic < 200) defpic = 1;
481                        */
482
483                        //check file is gif or html
484                        if(defpic == 0)
485                        {
486                                char* tmp = NULL;
487                                tmp = readbintomem(node->filename, 3);
488                                if(ostrncmp("GIF", tmp, 3) == 0) defpic = 1; //gif
489                                if(ostrncmp("<", tmp, 1) == 0) defpic = 1; //html
490                                free(tmp); tmp = NULL;
491                        }
492
493                        if(defpic == 1)
494                        {
495                                m_lock(&status.tithekmutex, 20);
496                                unlink(node->filename);
497                                symlink("/var/usr/local/share/titan/plugins/tithek/default.jpg", node->filename);
498                                m_unlock(&status.tithekmutex, 20);
499                        }
500                }
501
502end:
503                free(node->host); node->host = NULL;
504                free(node->page); node->page = NULL;
505                free(node->filename); node->filename = NULL;
506                free(node->auth); node->auth = NULL;
507        }
508
509        free(node); node = NULL;
510
511        tithekdownloadcount--;
512        tithekdownloadrun = 1;
513}
514
515char* tithekdownload(char* link, char* localname, char* pw, int pic, int flag)
516{
517        int ret = 1, port = 80, timeout = 10000;
518        char* ip = NULL, *pos = NULL, *path = NULL;
519        char* tmpstr = NULL, *localfile = NULL;
520
521        if(link == NULL) return NULL;
522        if(ostrncmp("http://", link, 7)) return NULL;
523
524        ip = string_replace("http://", "", (char*)link, 0);
525        // tithek security
526        ip = string_replace_all("imageshack.us/md/up/grd/", "atemio.dyndns.tv/", ip, 1);
527
528        if(ip != NULL)
529                pos = strchr(ip, '/');
530        if(pos != NULL)
531        {
532                pos[0] = '\0';
533                path = pos + 1;
534        }
535
536        if(ostrstr(ip, ":") != NULL)
537        {
538                ip = oregex("http://(.*):.*", link);
539                port = atoi(oregex("http://.*:(.*)/.*", link));
540        }
541
542        tmpstr = ostrcat(path, NULL, 0, 0);
543
544        if(flag == 0)
545        {
546                localfile = ostrcat(TITHEKPATH, "/", 0, 0);
547                if(localname == NULL)
548                        localfile = ostrcat(localfile, basename(tmpstr), 1, 0);
549                else
550                        localfile = ostrcat(localfile, localname, 1, 0);
551        }
552        else
553        {
554                localfile = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0);
555                if(localname == NULL)
556                        localfile = ostrcat(localfile, basename(tmpstr), 1, 0);
557                else
558                        localfile = ostrcat(localfile, localname, 1, 0);
559        }
560
561/*
562        debug(99, "---------------------------------------");
563        debug(99, "link: %s", link);
564        debug(99, "localname: %s", localname);
565        debug(99, "---------------------------------------");
566        debug(99, "ip: %s", ip);
567        debug(99, "port: %d", port);
568        debug(99, "path: %s", path);
569        debug(99, "localfile: %s", localfile);
570//      debug(99, "pw: %s", pw);
571        debug(99, "---------------------------------------");
572*/
573        if(flag == 0)
574        {
575                if(localfile != NULL && !file_exist(localfile))
576                {
577                        if(pic == 1)
578                        {
579                                if(tithekdownloadcount >= 24) //start max 24 threads
580                                        gethttp(ip, path, port, localfile, pw, timeout, NULL, 0);
581                                else
582                                {
583                                        //dnode is freed in thread
584                                        struct download* dnode = calloc(1, sizeof(struct download));
585                                        if(dnode != NULL)
586                                        {
587                                                dnode->host = ostrcat(ip, NULL, 0, 0);
588                                                dnode->page = ostrcat(path, NULL, 0, 0);
589                                                dnode->port = port;
590                                                dnode->filename = ostrcat(localfile, NULL, 0, 0);
591                                                dnode->auth = ostrcat(pw, NULL, 0, 0);
592                                                dnode->connfd = -1;
593                                                dnode->ret = -1;
594                                                dnode->timeout = timeout;
595                                                addtimer(&tithekdownloadthread, START, 100, 1, (void*)dnode, NULL, NULL);
596                                        }
597                                }
598                        }
599                        else
600                                gethttp(ip, path, port, localfile, pw, timeout, NULL, 0);                       
601                }
602        }
603        else
604        {
605       
606                if(localfile != NULL && file_exist(localfile))
607                        ret = textbox(_("Message"), _("File exist, overwrite?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0);
608
609                if(localfile != NULL && ret == 1)
610                        screendownload("Download", ip, path, port, localfile, pw, timeout, 0);
611        }
612
613        free(ip); ip = NULL;
614        free(tmpstr); tmpstr = NULL;
615
616        return localfile;
617}
618
619int createtithekplay(char* titheklink, struct skin* grid, struct skin* listbox, struct skin* countlabel, int flag)
620{
621        int gridbr = 0, posx = 0, count = 0, sumcount = 0, count1 = 0, pagecount = 0, skip = 0;
622        int localfile = 0;
623        struct skin* tmp = NULL;
624        char* tithekfile = NULL;
625        char* tmpstr = NULL;
626
627        if(!ostrncmp("http://", titheklink, 7))
628                tithekfile = tithekdownload(titheklink, NULL, HTTPAUTH, 0, 0);
629        else
630        {
631                tithekfile = ostrcat(titheklink, NULL, 0, 0);
632                localfile = 1;
633        }
634
635        delmarkedscreennodes(grid, 1);
636        freetithek();
637//      if(readtithek(tithekfile) != 0) return 1;
638        int linecount = readtithek(tithekfile);
639//      if(linecount == 0) return 1;
640       
641        struct tithek* titheknode = tithek;
642
643        int height = 500;
644        int width = 590;
645        int picheight = 480;
646        int picwidth = 570;
647        int zcount = 2;
648        int fontsize = 25;
649        int pcount = 2;
650
651        if(getconfigint("tithek_cover", NULL) == 0 || getconfigint("tithek_view", NULL) == 0)
652        {
653                if(linecount > 2)
654                {
655                        height = 280;
656                        width = 390;
657                        picheight = 230;
658                        picwidth = 370;
659                        zcount = 3;
660                        fontsize = 20;
661                        pcount = 6;
662                }
663         
664                if(linecount > 8)
665                {
666                        height = 180;
667                        width = 295;
668                        picheight = 130;
669                        picwidth = 270;
670                        zcount = 4;
671                        fontsize = 18;
672                        pcount = 12;
673                }
674
675                if(linecount > 19)
676                {
677                        height = 140;
678                        width = 235;
679                        picheight = 90;
680                        picwidth = 210;
681                        zcount = 5;
682                        fontsize = 16;
683                        pcount = 20;
684                }
685       
686                if(linecount > 25)
687                {
688                        height = 111;
689                        width = 196;
690                        picheight = 60;
691                        picwidth = 150;
692                        zcount = 6;
693                        fontsize = 14;
694                        pcount = 30;
695                }
696        }
697       
698        if((getconfigint("tithek_cover", NULL) == 1 && flag == 3) || (getconfigint("tithek_view", NULL) == 1 && flag != 3))
699        {
700                height = 500;
701                width = 590;
702                picheight = 480;
703                picwidth = 570;
704                zcount = 2;
705                fontsize = 25;
706                pcount = 2;
707        }
708
709        if((getconfigint("tithek_cover", NULL) == 2 && flag == 3) || (getconfigint("tithek_view", NULL) == 2 && flag != 3))
710        {
711                height = 280;
712                width = 390;
713                picheight = 230;
714                picwidth = 370;
715                zcount = 3;
716                fontsize = 20;
717                pcount = 6;
718        }
719
720        if((getconfigint("tithek_cover", NULL) == 3 && flag == 3) || (getconfigint("tithek_view", NULL) == 3 && flag != 3))
721        {
722                height = 180;
723                width = 295;
724                picheight = 130;
725                picwidth = 270;
726                zcount = 4;
727                fontsize = 18;
728                pcount = 12;
729        }
730
731        if((getconfigint("tithek_cover", NULL) == 4 && flag == 3) || (getconfigint("tithek_view", NULL) == 4 && flag != 3))
732        {
733                height = 140;
734                width = 235;
735                picheight = 90;
736                picwidth = 210;
737                zcount = 5;
738                fontsize = 16;
739                pcount = 20;
740        }
741
742        if((getconfigint("tithek_cover", NULL) == 5 && flag == 3) || (getconfigint("tithek_view", NULL) == 5 && flag != 3))
743        {
744                height = 111;
745                width = 196;
746                picheight = 60;
747                picwidth = 150;
748                zcount = 6;
749                fontsize = 14;
750                pcount = 30;
751        }
752
753        if(getconfigint("tithek_pic_ratio", NULL) == 1)
754        {
755                picwidth = 2;
756                picheight = 2;
757        }
758                       
759        while(titheknode != NULL)
760        {
761                tmp = addlistbox(grid, listbox, tmp, 1);
762                if(tmp != NULL)
763                {
764                        skip = 0;
765                        sumcount++;
766                        count++;
767                        count1++;
768                        if(gridbr == 0)
769                                tmp->type = GRIDBR;
770                        gridbr = 1;
771                        tmp->wrap = YES;
772
773                        tmp->picheight = picheight;
774                        tmp->picwidth = picwidth;
775                                                               
776                        tmp->fontsize = fontsize;
777                        tmp->height = height;
778                        tmp->width = width;
779                        tmp->prozwidth = 0;
780                        //tmp->bgcol = 0xffffff;
781                        tmp->bgspace = 1;
782                        tmp->vspace = 10;
783                        tmp->hspace = 10;
784                        tmp->posx = posx;
785                        //tmp->fontcol = 0x0000ff;
786                        tmp->halign = CENTER;
787                        tmp->valign = TEXTBOTTOM;
788                        changetext(tmp, titheknode->title);
789                        tmp->handle = (char*)titheknode;
790                        posx += tmp->width;
791                        if(count >= zcount)
792                        {
793                                count = 0;
794                                posx = 0;
795                                gridbr = 0;
796                        }
797                       
798                        if(count1 >= pcount)
799                        {
800                                count1 = 0;
801                                pagecount++;
802                                skip = 1;
803                        }
804                }
805                titheknode = titheknode->next;
806        }
807
808        if(skip == 0)
809                pagecount++;
810
811        tmpstr = oitoa(sumcount);
812
813        char* tmpstr1 = ostrcat(_("found"), NULL, 0, 0);
814        tmpstr1 = ostrcat(tmpstr1, " ", 1, 0);
815        tmpstr1 = ostrcat(tmpstr1, tmpstr, 1, 0);
816        free(tmpstr); tmpstr = NULL;
817        tmpstr1 = ostrcat(tmpstr1, " ", 1, 0);
818        tmpstr1 = ostrcat(tmpstr1, _("Results"), 1, 0);
819        changetext(countlabel, tmpstr1);
820        free(tmpstr1); tmpstr1 = NULL;
821
822        if(localfile == 0)
823                unlink(tithekfile);
824       
825        free(tithekfile); tithekfile = NULL;
826        return pagecount;
827}
828
829void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
830{
831        int count = 0, i = 0;
832        char* tmpstr = NULL, *tmpstr1 = NULL, *input = NULL;
833        struct splitstr* ret = NULL;
834
835        input = ostrcat(input, title, 1, 0);
836        input = ostrcat(input, "#", 1, 0);
837        input = ostrcat(input, link, 1, 0);
838        input = ostrcat(input, "#", 1, 0);
839        input = ostrcat(input, pic, 1, 0);
840        input = ostrcat(input, "#", 1, 0);
841        input = ostrcat(input, localname, 1, 0);
842        input = ostrcat(input, "#", 1, 0);
843        input = ostrcat(input, menutitle, 1, 0);
844        input = ostrcat(input, "#", 1, 0);
845        input = ostrcat(input, oitoa(flag), 1, 1);
846       
847        tmpstr = readfiletomem(getconfig("tithek_fav", NULL), 0);
848       
849        ret = strsplit(tmpstr, "\n", &count);
850
851        if(ret != NULL)
852        {
853                for(i = 0; i < count; i++)
854                {
855                        if(ostrcmp((ret[i]).part, input) != 0)
856                        {
857                                tmpstr1 = ostrcat(tmpstr1, ret[i].part, 1, 0);
858                                tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0);
859                        }
860                        else
861                                printf("remove: %s\n", ret[i].part);
862                }
863        }
864
865        if(tmpstr1 != NULL && strlen(tmpstr1) > 0)
866                tmpstr1[strlen(tmpstr1) - 1] = '\0';
867
868        if(tmpstr1 == NULL)
869                writesys(getconfig("tithek_fav", NULL), "", 0);
870        else
871                writesys(getconfig("tithek_fav", NULL), tmpstr1, 0);
872
873        free(ret); ret = NULL;
874        free(tmpstr); tmpstr = NULL;
875        free(tmpstr1); tmpstr1 = NULL;
876        free(input); input = NULL;
877}
878
879void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
880{
881        int count = 0, i = 0;
882        char* tmpstr = NULL, *tmpstr1 = NULL, *input = NULL;
883        struct splitstr* ret = NULL;
884
885        input = ostrcat(input, title, 1, 0);
886        input = ostrcat(input, "#", 1, 0);
887        input = ostrcat(input, link, 1, 0);
888        input = ostrcat(input, "#", 1, 0);
889        input = ostrcat(input, pic, 1, 0);
890        input = ostrcat(input, "#", 1, 0);
891        input = ostrcat(input, localname, 1, 0);
892        input = ostrcat(input, "#", 1, 0);
893        input = ostrcat(input, menutitle, 1, 0);
894        input = ostrcat(input, "#", 1, 0);
895        input = ostrcat(input, oitoa(flag), 1, 1);
896        // tithek security
897        input = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", input, 1);
898       
899        tmpstr1 = ostrcat(tmpstr1, input, 1, 0);
900        tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0);
901
902        tmpstr = readfiletomem(getconfig("tithek_fav", NULL), 0);
903       
904        ret = strsplit(tmpstr, "\n", &count);
905
906        if(ret != NULL)
907        {
908                for(i = 0; i < count; i++)
909                {
910                        if(ostrcmp((ret[i]).part, input) != 0)
911                        {
912                                tmpstr1 = ostrcat(tmpstr1, ret[i].part, 1, 0);
913                                tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0);
914                        }
915                }
916        }
917
918        if(tmpstr1 != NULL && strlen(tmpstr1) > 0)
919                tmpstr1[strlen(tmpstr1) - 1] = '\0';
920
921        writesys(getconfig("tithek_fav", NULL), tmpstr1, 0);
922
923        free(ret); ret = NULL;
924        free(tmpstr); tmpstr = NULL;
925        free(tmpstr1); tmpstr1 = NULL;
926        free(input); input = NULL;
927}
928
929void cacheplay(char* link, char* filename, int flag)
930{
931        struct skin* load = getscreen("loadingproz");
932        struct skin* proztext = getscreennode(load, "proztext");
933
934        drawscreen(load, 0, 0);
935        int port = 80, count = 0, mcount = 0;
936        off64_t size = 0, msize = 0;
937        char* host = NULL, *pos = NULL, *path = NULL, *file = NULL, *tmpstr = NULL;
938        host = string_replace("http://", "", (char*)link, 0);
939
940        if(host != NULL)
941                pos = strchr(host, '/');
942        if(pos != NULL)
943        {
944                pos[0] = '\0';
945                path = pos + 1;
946        }
947
948        file = ostrcat(getconfig("rec_streampath", NULL), "/.cache.", 0, 0);
949        file = ostrcat(file, filename, 1, 0);
950
951        if(ostrstr(host, ":") != NULL)
952        {
953                host = oregex("http://(.*):.*", link);
954                port = atoi(oregex("http://.*:(.*)/.*", link));
955        }
956
957        debug(99, "---------------------------------------");
958        debug(99, "link: %s", link);
959        debug(99, "---------------------------------------");
960        debug(99, "host: %s", host);
961        debug(99, "port: %d", port);
962        debug(99, "path: %s", path);
963        debug(99, "local: %s", file);
964        debug(99, "---------------------------------------");
965       
966       
967        struct download* dnode = NULL;
968        dnode = calloc(1, sizeof(struct download));
969        if(dnode == NULL)
970        {
971                err("no mem");
972                return;
973        }               
974        dnode->host = host;
975        dnode->page = path;
976        dnode->port = port;
977        dnode->filename = file;
978        dnode->auth = NULL;
979        dnode->connfd = -1;
980        dnode->ret = -1;
981        dnode->timeout = 30000;
982       
983        addtimer(&gethttpstruct, START, 1000, 1, (void*)dnode, NULL, NULL);
984
985        if(flag == 1)
986        {
987                mcount = 120;
988                msize = 10485760;
989        }
990        else if(flag == 2)
991        {
992                mcount = 240;
993                msize = 20971520;
994        }
995        else if(flag == 3)
996        {
997                mcount = 360;
998                msize = 31457280;
999        }
1000                       
1001        while(count < mcount || size >= msize)
1002        {
1003                sleep(1);
1004                count++;
1005                if(file_exist(file))
1006                        size = getfilesize(file);
1007
1008                int proz = 0;
1009                int proz1 = size * 100 / msize;
1010                debug(99, "size (%dprozent)", proz1);
1011
1012                int proz2 = count * 100 / mcount;
1013                debug(99, "time (%dprozent)", proz2);
1014               
1015                if(proz1 > proz2)
1016                        proz = proz1;
1017                else
1018                        proz = proz2;
1019
1020                debug(99, "cacheing...(%lldkb) (%dprozent)", size / 1024, proz);
1021
1022                if(size >= msize)
1023                        break;
1024                if(count >= mcount)
1025                        break;
1026               
1027                tmpstr = ostrcat(_("please wait..."), " (", 0, 0);
1028                tmpstr = ostrcat(tmpstr, oitoa(proz), 1, 1);
1029                tmpstr = ostrcat(tmpstr, "%)", 1, 0);
1030                clearscreen(load);
1031                changetext(proztext, tmpstr);
1032                drawscreen(load, 0, 0);
1033                free(tmpstr), tmpstr = NULL;
1034        }
1035
1036        screenplay(file, filename, 2, 0);
1037        sockclose(&dnode->connfd);
1038        free(dnode); dnode = NULL;
1039
1040        tmpstr = ostrcat(tmpstr, _("Remove Cachefile ?"), 1, 0);
1041        tmpstr = ostrcat(tmpstr, "\n\n", 1, 0);
1042        tmpstr = ostrcat(tmpstr, file, 1, 0);
1043       
1044        if(textbox(_("Message"), tmpstr, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1)
1045        {
1046                unlink(file);
1047        }
1048        free(tmpstr), tmpstr = NULL;
1049        free(file), file = NULL;
1050        free(host), host = NULL;
1051}
1052
1053void backgrounddl(char* link, char* filename)
1054{
1055        int port = 80, ret = 0;
1056        char* host = NULL, *pos = NULL, *path = NULL, *file = NULL, *tmpstr = NULL;
1057        host = string_replace("http://", "", (char*)link, 0);
1058
1059        if(host != NULL)
1060                pos = strchr(host, '/');
1061        if(pos != NULL)
1062        {
1063                pos[0] = '\0';
1064                path = pos + 1;
1065        }
1066
1067        file = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0);
1068        file = ostrcat(file, filename, 1, 0);
1069
1070        if(ostrstr(host, ":") != NULL)
1071        {
1072                host = oregex("http://(.*):.*", link);
1073                port = atoi(oregex("http://.*:(.*)/.*", link));
1074        }
1075
1076        debug(99, "---------------------------------------");
1077        debug(99, "link: %s", link);
1078        debug(99, "---------------------------------------");
1079        debug(99, "host: %s", host);
1080        debug(99, "port: %d", port);
1081        debug(99, "path: %s", path);
1082        debug(99, "local: %s", file);
1083        debug(99, "---------------------------------------");
1084       
1085        ret = startbgdownload(host, path, port, file, NULL, 30000, 1);
1086        if(ret == 1)
1087                textbox(_("Message"), _("Can't start download.\nPlease try later."), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0);
1088                                       
1089        free(tmpstr), tmpstr = NULL;
1090        free(file), file = NULL;
1091        free(host), host = NULL;
1092}
1093       
1094void submenu(struct skin* listbox, struct skin* load, char* title)
1095{
1096        int flag = 0;
1097        if(status.security == 1 || checkbox("WHITEBOX") == 1)
1098        {
1099                drawscreen(load, 0, 0);
1100                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1101                char* tmpstr1 = NULL;
1102
1103                if(((struct tithek*)listbox->select->handle)->flag == 2)
1104                {
1105                        if(tmpstr != NULL) tmpstr1 = ostrcat(tmpstr, NULL, 0, 0);
1106                }                                               
1107                else if(((struct tithek*)listbox->select->handle)->flag == 4)
1108                {
1109                        if(tmpstr != NULL) tmpstr1 = youtube(tmpstr, NULL, NULL, 1);
1110                }                                               
1111                else if(((struct tithek*)listbox->select->handle)->flag == 5)
1112                {
1113                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl2now.rtl2.de", "rtl2now", 1);
1114                }
1115                else if(((struct tithek*)listbox->select->handle)->flag == 6)
1116                {
1117                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.superrtlnow.de", "superrtlnow", 1);
1118                }
1119                else if(((struct tithek*)listbox->select->handle)->flag == 7)
1120                {
1121                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl-now.rtl.de", "rtlnow", 1);
1122                }
1123                else if(((struct tithek*)listbox->select->handle)->flag == 8)
1124                {
1125                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.voxnow.de", "voxnow", 1);
1126                }
1127                else if(((struct tithek*)listbox->select->handle)->flag == 12)
1128                {
1129                        if(tmpstr != NULL) tmpstr1 = myvideo(tmpstr, NULL, NULL, 1);
1130                }
1131                else if(((struct tithek*)listbox->select->handle)->flag == 14)
1132                {
1133                        if(tmpstr != NULL) tmpstr1 = kinox(tmpstr, NULL, NULL, 1);
1134                }
1135                else if(((struct tithek*)listbox->select->handle)->flag == 15)
1136                {
1137                        if(tmpstr != NULL) tmpstr1 = kinox(tmpstr, NULL, NULL, 2);
1138                }
1139                else if(((struct tithek*)listbox->select->handle)->flag == 16)
1140                {
1141                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.superrtlnow.de", "superrtlnow", 1);
1142                }
1143                else if(((struct tithek*)listbox->select->handle)->flag == 17)
1144                {
1145                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl-now.rtl.de", "rtlnow", 1);
1146                }
1147                else if(((struct tithek*)listbox->select->handle)->flag == 18)
1148                {
1149                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.voxnow.de", "voxnow", 1);
1150                }
1151                else if(((struct tithek*)listbox->select->handle)->flag == 19)
1152                {
1153                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl2now.rtl2.de", "rtl2now", 1);
1154                }
1155                else if(((struct tithek*)listbox->select->handle)->flag == 20)
1156                {
1157                        if(tmpstr != NULL) tmpstr1 = kinox(tmpstr, NULL, NULL, 3);
1158                }
1159                else if(((struct tithek*)listbox->select->handle)->flag == 24)
1160                {
1161                        if(tmpstr != NULL) tmpstr1 = kinox(tmpstr, NULL, NULL, 4);
1162                }
1163                else if(((struct tithek*)listbox->select->handle)->flag == 25)
1164                {
1165                        if(tmpstr != NULL) tmpstr1 = kinox(tmpstr, NULL, NULL, 5);
1166                }
1167                else if(((struct tithek*)listbox->select->handle)->flag == 26)
1168                {
1169                        if(tmpstr != NULL) tmpstr1 = kinox(tmpstr, NULL, NULL, 6);
1170                }
1171                else if(((struct tithek*)listbox->select->handle)->flag == 27)
1172                {
1173                        if(tmpstr != NULL) tmpstr1 = kinox(tmpstr, NULL, NULL, 7);
1174                }
1175                else if(((struct tithek*)listbox->select->handle)->flag == 38)
1176                {
1177                        if(tmpstr != NULL) tmpstr1 = mlehd(tmpstr);
1178                }
1179                else if(((struct tithek*)listbox->select->handle)->flag == 41)
1180                {
1181                        if(tmpstr != NULL) tmpstr1 = movie4k(tmpstr);
1182                }
1183                else if(((struct tithek*)listbox->select->handle)->flag == 42)
1184                {
1185                        if(tmpstr != NULL) tmpstr1 = xvideos(tmpstr);
1186                }
1187                else if(((struct tithek*)listbox->select->handle)->flag == 43)
1188                {
1189                        if(tmpstr != NULL) tmpstr1 = solarmovie(tmpstr);
1190                }
1191                else if(((struct tithek*)listbox->select->handle)->flag == 45)
1192                {
1193                        if(tmpstr != NULL) tmpstr1 = ard(tmpstr);
1194                }
1195                else if(((struct tithek*)listbox->select->handle)->flag == 46)
1196                {
1197                        if(tmpstr != NULL) tmpstr1 = zdf(tmpstr);
1198                }
1199                else if(((struct tithek*)listbox->select->handle)->flag == 50)
1200                {
1201                        if(tmpstr != NULL) tmpstr1 = beeg(tmpstr);
1202                }
1203
1204                free(tmpstr); tmpstr = NULL;
1205
1206                if(ostrcmp(title, "TiThek - Internet Radio") == 0)
1207                        flag = 4;
1208
1209                if(ostrstr(tmpstr1, "&") != NULL)
1210                {
1211                        printf("change streamurl from: %s\n", tmpstr1);
1212                        tmpstr1 = string_replace_all("&amp;", "&", tmpstr1, 1);
1213                        printf("change streamurl to: %s\n", tmpstr1);
1214                }
1215               
1216                if(tmpstr1 != NULL)
1217                {
1218                        char* filename = ostrcat(title, "_", 0, 0);
1219                        filename = ostrcat(filename, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1220                        filename = ostrcat(filename, ".mp4", 1, 0);
1221                        filename = string_replace_all(" ", ".", filename, 1);
1222                        filename = string_replace_all("-", "_", filename, 1);
1223                        filename = string_replace_all("._.", "_", filename, 1);
1224                        debug(99, "filename: %s", filename);
1225                               
1226                        char* keyconf = NULL;
1227                        char* skintitle = "Choice Playback";
1228                        struct menulist* mlist = NULL, *mbox = NULL;
1229                       
1230                        addmenulist(&mlist, "Streaming Playback (default)", NULL, NULL, 0, 0);
1231                       
1232                        if(!ostrncmp("http://", tmpstr1, 7))
1233                        {
1234                                if(flag == 4)
1235                                {
1236                                        addmenulist(&mlist, "Streaming Playback Caching (0.5MB)", NULL, NULL, 0, 0);
1237                                        addmenulist(&mlist, "Streaming Playback Caching (1MB)", NULL, NULL, 0, 0);
1238                                }       
1239                                else if(!ostrncmp("http://", tmpstr1, 7))
1240                                {
1241//                                      addmenulist(&mlist, "Streaming Playback Caching (1MB)", NULL, NULL, 0, 0);
1242//                                      addmenulist(&mlist, "Streaming Playback Caching (2MB)", NULL, NULL, 0, 0);
1243//                                      addmenulist(&mlist, "Streaming Playback Caching (3MB)", NULL, NULL, 0, 0);
1244//                                      addmenulist(&mlist, "Streaming Playback Caching (4MB)", NULL, NULL, 0, 0);
1245                                        addmenulist(&mlist, "Streaming Playback Caching (5MB)", NULL, NULL, 0, 0);
1246                                        addmenulist(&mlist, "Streaming Playback Caching (7.5MB)", NULL, NULL, 0, 0);
1247                                        addmenulist(&mlist, "Streaming Playback Caching (10MB)", NULL, NULL, 0, 0);
1248                                        if(file_exist(getconfig("rec_streampath", NULL)))
1249                                        {
1250//                                              addmenulist(&mlist, "File Caching Playback (10MB / 120s)", NULL, NULL, 0, 0);
1251//                                              addmenulist(&mlist, "File Caching Playback (20MB / 240s)", NULL, NULL, 0, 0);
1252//                                              addmenulist(&mlist, "File Caching Playback (30MB / 360s)", NULL, NULL, 0, 0);
1253                                                if(status.expertmodus >= 11 || file_exist("/mnt/swapextensions/etc/.codecpack") || file_exist("/var/swap/etc/.codecpack") || file_exist("/var/etc/.codecpack"))
1254                                                {
1255                                                        addmenulist(&mlist, "Download Full File", NULL, NULL, 0, 0);
1256                                                        addmenulist(&mlist, "Download Full File (background)", NULL, NULL, 0, 0);
1257                                                }
1258                                        }
1259                                }
1260                        }
1261                        mbox = menulistbox(mlist, NULL, skintitle, NULL, NULL, 1, 0);
1262                        if(mbox != NULL) keyconf = mbox->name;
1263                        if(ostrcmp(keyconf, "Streaming Playback (default)") == 0)
1264                        {
1265                                addconfigtmp("playerbuffersize", "0");
1266                                screenplay(tmpstr1, filename, 2, flag);
1267                                delconfigtmp("playerbuffersize");
1268                        }
1269                        else if(ostrcmp(keyconf, "Streaming Playback Caching (0.5MB)") == 0)
1270                        {
1271                                addconfigtmp("playerbuffersize", "524288");
1272                                screenplay(tmpstr1, filename, 2, flag);
1273                                delconfigtmp("playerbuffersize");
1274                        }
1275                        else if(ostrcmp(keyconf, "Streaming Playback Caching (1MB)") == 0)
1276                        {
1277                                addconfigtmp("playerbuffersize", "1048576");
1278                                screenplay(tmpstr1, filename, 2, flag);
1279                                delconfigtmp("playerbuffersize");
1280                        }
1281                        else if(ostrcmp(keyconf, "Streaming Playback Caching (2MB)") == 0)
1282                        {
1283                                addconfigtmp("playerbuffersize", "2097152");
1284                                screenplay(tmpstr1, filename, 2, flag);
1285                                delconfigtmp("playerbuffersize");
1286                        }
1287                        else if(ostrcmp(keyconf, "Streaming Playback Caching (3MB)") == 0)
1288                        {
1289                                addconfigtmp("playerbuffersize", "3145728");
1290                                screenplay(tmpstr1, filename, 2, flag);
1291                                delconfigtmp("playerbuffersize");
1292                        }
1293                        else if(ostrcmp(keyconf, "Streaming Playback Caching (4MB)") == 0)
1294                        {
1295                                addconfigtmp("playerbuffersize", "4194304");
1296                                screenplay(tmpstr1, filename, 2, flag);
1297                                delconfigtmp("playerbuffersize");
1298                        }
1299                        else if(ostrcmp(keyconf, "Streaming Playback Caching (5MB)") == 0)
1300                        {
1301                                addconfigtmp("playerbuffersize", "5242880");
1302                                screenplay(tmpstr1, filename, 2, flag);
1303                                delconfigtmp("playerbuffersize");
1304                        }
1305                        else if(ostrcmp(keyconf, "Streaming Playback Caching (7.5MB)") == 0)
1306                        {
1307                                addconfigtmp("playerbuffersize", "7864320");
1308                                screenplay(tmpstr1, filename, 2, flag);
1309                                delconfigtmp("playerbuffersize");
1310                        }
1311                        else if(ostrcmp(keyconf, "Streaming Playback Caching (10MB)") == 0)
1312                        {
1313                                addconfigtmp("playerbuffersize", "10485760");
1314                                screenplay(tmpstr1, filename, 2, flag);
1315                                delconfigtmp("playerbuffersize");
1316                        }
1317                        else if(ostrcmp(keyconf, "File Caching Playback (10MB / 120s)") == 0)
1318                        {
1319                                cacheplay(tmpstr1, filename, 1);
1320                        }
1321                        else if(ostrcmp(keyconf, "File Caching Playback (20MB / 240s)") == 0)
1322                        {
1323                                cacheplay(tmpstr1, filename, 2);
1324                        }
1325                        else if(ostrcmp(keyconf, "File Caching Playback (30MB / 360s)") == 0)
1326                        {
1327                                cacheplay(tmpstr1, filename, 3);
1328                        }
1329                        else if(ostrcmp(keyconf, "Download Full File") == 0)
1330                        {
1331                                char* search = textinput("Filename", filename);
1332                                if(search != NULL)
1333                                {       
1334                                        char* tmpstr2 = tithekdownload(tmpstr1, search, NULL, 0, 1);
1335//                                              drawscreen(grid, 0, 0);
1336                                        free(tmpstr2); tmpstr2 = NULL;
1337                               
1338                                        if(textbox(_("Message"), _("Start playback"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1)
1339                                        {
1340                                                tmpstr2 = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0);
1341                                                tmpstr2 = ostrcat(tmpstr2, search, 1, 0);
1342                                                screenplay(tmpstr2, filename, 2, flag);
1343                                                free(tmpstr2); tmpstr2 = NULL;
1344                                        }
1345                                }
1346                                free(search), search = NULL;
1347                        }
1348                        else if(ostrcmp(keyconf, "Download Full File (background)") == 0)
1349                        {
1350                                char* search = textinput("Filename", filename);
1351                                if(search != NULL)
1352                                        backgrounddl(tmpstr1, search);
1353                                free(search), search = NULL;
1354                        }
1355                         
1356                        free(filename), filename = NULL;
1357                        freemenulist(mlist, 1); mlist = NULL;
1358                }
1359                else
1360                        textbox(_("Message"), _("Can't get Streamurl !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0);
1361               
1362                free(tmpstr1); tmpstr1 = NULL;
1363        }
1364        else
1365                textbox(_("Message"), _("Registration needed, please contact Atemio !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 200, 0, 0);
1366}
1367
1368void screentithekplay(char* titheklink, char* title, int first)
1369{
1370        if(!file_exist("/mnt/swapextensions/player"))
1371                mkdir("/mnt/swapextensions/player", 0777);
1372
1373        char* disclaimer = NULL;
1374        disclaimer = ostrcat(disclaimer, "/mnt/swapextensions/player/tithek_disclaimer_accepted", 1, 0);
1375                               
1376        if(!file_exist(disclaimer))
1377        {
1378                char* tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/disclaimer.txt", 80, NULL, HTTPAUTH, 5000, NULL, 0);
1379                if(textbox(_("TitanNit Tithek disclaimer"), _(tmpstr), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1100, 650, 0, 0) == 1)
1380                {
1381                        writesys(disclaimer, tmpstr, 0);                               
1382                        free(tmpstr), tmpstr = NULL;
1383                }
1384                else
1385                {
1386                        free(tmpstr), tmpstr = NULL;
1387                        free(disclaimer), disclaimer = NULL;
1388                        return;
1389                }
1390        }
1391        free(disclaimer), disclaimer = NULL;
1392
1393        int rcret = -1, oaktline = 1, oaktpage = -1, ogridcol = 0, pagecount = 0;
1394
1395        writesysint("/proc/sys/vm/drop_caches", 3, 0);
1396       
1397        if(first == 1)
1398        {
1399                delallfiles("/tmp/tithek", NULL);
1400                mkdir("/tmp/tithek", 777);
1401                if(status.mcaktiv == 0)
1402                {
1403                        rcret = servicestop(status.aktservice, 1, 1);
1404                        if(rcret == 1) return;
1405                }
1406        }
1407
1408        struct skin* grid = getscreen("titheklist");
1409        struct skin* listbox = getscreennode(grid, "listbox");
1410        struct skin* countlabel = getscreennode(grid, "countlabel");
1411        struct skin* countpage = getscreennode(grid, "countpage");
1412        struct skin* load = getscreen("loading");
1413        struct skin* tmp = NULL;
1414        char* tithekpic = NULL;
1415       
1416        drawscreen(load, 0, 0);
1417       
1418        if(titheklink == NULL) return;
1419       
1420        listbox->aktpage = -1;
1421        listbox->aktline = 1;
1422        listbox->gridcol = 0;
1423        listbox->select = NULL;
1424
1425        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, first);
1426        if(pagecount == 0) return;
1427
1428        changetitle(grid, _(title));
1429        drawscreen(grid, 0, 0);
1430        addscreenrc(grid, listbox);
1431                               
1432        while(1)
1433        {
1434                changetitle(grid, _(title));
1435                changetext(countpage, NULL);
1436                if(listbox->select != NULL && listbox->select->handle != NULL)
1437                {
1438                        tmp = listbox->select;
1439                        while(tmp != NULL)
1440                        {
1441
1442                                if(tmp->pagecount != listbox->aktpage) break;
1443
1444                                char* tmpstr = ostrcat(_("Page"), NULL, 0, 0);
1445                                tmpstr = ostrcat(tmpstr, " ( ", 1, 0);
1446                                tmpstr = ostrcat(tmpstr, oitoa(tmp->pagecount), 1, 1);
1447                                tmpstr = ostrcat(tmpstr, " / ", 1, 0);
1448                                tmpstr = ostrcat(tmpstr, oitoa(pagecount), 1, 1);
1449                                tmpstr = ostrcat(tmpstr, " )", 1, 0);
1450                                changetext(countpage, tmpstr);
1451                                free(tmpstr); tmpstr = NULL;
1452       
1453                                if(tmp->handle != NULL)
1454                                {
1455                                        tithekpic = tithekdownload(((struct tithek*)tmp->handle)->pic, ((struct tithek*)tmp->handle)->localname, "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0=", 1, 0);
1456
1457                                        /* not working with thread download
1458                                        off64_t checkpic = getfilesize(tithekpic);
1459                       
1460                                        if(checkpic < 1000)
1461                                        {
1462                                                free(tithekpic); tithekpic = NULL;
1463                                                tithekpic = ostrcat("/var/usr/local/share/titan/plugins/tithek/default.jpg", NULL, 0, 0);
1464                                        }
1465                                        */
1466                       
1467                                        changepic(tmp, tithekpic);
1468                                        free(tithekpic); tithekpic = NULL;
1469                                }
1470                                tmp = tmp->prev;
1471                        }
1472                        tmp = listbox->select;
1473                        if(tmp != NULL) tmp = tmp->next;
1474                        while(tmp != NULL)
1475                        {
1476                                if(tmp->pagecount != listbox->aktpage) break;
1477                                if(tmp->handle != NULL)
1478                                {
1479                                        tithekpic = tithekdownload(((struct tithek*)tmp->handle)->pic, ((struct tithek*)tmp->handle)->localname, "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0=", 1, 0);
1480
1481                                        /* not working with thread download
1482                                        off64_t checkpic = getfilesize(tithekpic);
1483
1484                                        if(checkpic < 1000)
1485                                        {
1486                                                free(tithekpic); tithekpic = NULL;
1487                                                tithekpic = ostrcat("/var/usr/local/share/titan/plugins/tithek/default.jpg", NULL, 0, 0);
1488                                        }
1489                                        */
1490
1491                                        changepic(tmp, tithekpic);
1492                                        free(tithekpic); tithekpic = NULL;
1493                                }
1494                                tmp = tmp->next;
1495                        }
1496                }
1497               
1498                int count = getfilecount(TITHEKPATH);
1499                if(count > 500)
1500                        delallfiles(TITHEKPATH, ".jpg");
1501
1502                drawscreen(grid, 0, 0);
1503waitrcstart:
1504                rcret = waitrc(grid, 2000, 2);
1505
1506                if(rcret == RCTIMEOUT)
1507                {
1508                        if(tithekdownloadrun == 1)
1509                        {
1510                                tithekdownloadrun = 0;
1511                                drawscreen(grid, 0, 0);
1512                        }
1513                        goto waitrcstart;
1514                }
1515
1516                if(rcret == getrcconfigint("rcblue", NULL))
1517                {
1518                        tithekexit = 1;
1519                        break;
1520                }
1521
1522                if(rcret == getrcconfigint("rcexit", NULL)) break;
1523                if(rcret == getrcconfigint("rcmenu", NULL))
1524                {
1525                        screentithek_settings();
1526
1527                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, first);
1528                        if(pagecount == 0 || tithekexit == 1) break;
1529
1530                        listbox->aktpage = -1;
1531                        listbox->aktline = 1;
1532                        listbox->gridcol = 1;
1533                        addscreenrc(grid, listbox);
1534                        drawscreen(grid, 0, 0);
1535                }
1536               
1537                if(rcret == getrcconfigint("rcred", NULL))
1538                {
1539                        if(listbox->select != NULL && listbox->select->handle != NULL)
1540                        {
1541
1542                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->title, NULL, 0, 0);
1543                                debug(99, "tmpstr: %s", tmpstr);
1544                                tmpstr = string_replace("-1 (de)", "", tmpstr, 1);
1545                                tmpstr = string_replace("-1 (en)", "", tmpstr, 1);
1546                                tmpstr = string_replace("-1 (\?\?)", "", tmpstr, 1);
1547                                tmpstr = string_replace("-2 (de)", "", tmpstr, 1);
1548                                tmpstr = string_replace("-2 (en)", "", tmpstr, 1);
1549                                tmpstr = string_replace("-2 (\?\?)", "", tmpstr, 1);
1550                                tmpstr = string_replace("-3 (de)", "", tmpstr, 1);
1551                                tmpstr = string_replace("-3 (en)", "", tmpstr, 1);
1552                                tmpstr = string_replace("-3 (\?\?)", "", tmpstr, 1);
1553                                tmpstr = string_replace(" (de)", "", tmpstr, 1);
1554                                tmpstr = string_replace(" (en)", "", tmpstr, 1);
1555                                tmpstr = string_replace(" (\?\?)", "", tmpstr, 1);
1556                                tmpstr = string_replace_all("_", " ", tmpstr, 1);
1557                                tmpstr = string_replace_all("-", " ", tmpstr, 1);
1558                                tmpstr = string_replace_all(".", " ", tmpstr, 1);                               
1559                                debug(99, "tmpstr: %s", tmpstr);
1560
1561                                int check = playrcred(tmpstr, NULL, 1, 0, 99);
1562                                if(check == 2)
1563                                {
1564                                        if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search", tmpstr, 0) == 0)
1565                                        {
1566                                                oaktpage = listbox->aktpage;
1567                                                oaktline = listbox->aktline;
1568                                                ogridcol = listbox->gridcol;
1569                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1570                                                char* tmpstr1 = ostrcat("KinoX - Search", " - ", 0, 0);
1571                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1572                                                screentithekplay(tmpstr, tmpstr2, 0);
1573                                                free(tmpstr); tmpstr = NULL;
1574                                                free(tmpstr2); tmpstr2 = NULL;
1575                       
1576                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1577                                                if(pagecount == 0 || tithekexit == 1) break;
1578
1579                                                listbox->aktpage = oaktpage;
1580                                                listbox->aktline = oaktline;
1581                                                listbox->gridcol = ogridcol;
1582                                                addscreenrc(grid, listbox);
1583                                        }
1584                                }
1585                                else if(check == 3)
1586                                {
1587                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "SolarMovies - Movie - Search", tmpstr, 0) == 0)
1588                                        {
1589                                                oaktpage = listbox->aktpage;
1590                                                oaktline = listbox->aktline;
1591                                                ogridcol = listbox->gridcol;
1592                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1593                                                char* tmpstr1 = ostrcat("SolarMovies - Movie - Search", " - ", 0, 0);
1594                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1595                                                screentithekplay(tmpstr, tmpstr2, 0);
1596                                                free(tmpstr); tmpstr = NULL;
1597                                                free(tmpstr2); tmpstr2 = NULL;
1598                       
1599                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1600                                                if(pagecount == 0 || tithekexit == 1) break;
1601
1602                                                listbox->aktpage = oaktpage;
1603                                                listbox->aktline = oaktline;
1604                                                listbox->gridcol = ogridcol;
1605                                                addscreenrc(grid, listbox);
1606                                        }
1607                                }
1608                                else if(check == 4)
1609                                {
1610                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "SolarMovies - Tv - Search", tmpstr, 1) == 0)
1611                                        {
1612                                                oaktpage = listbox->aktpage;
1613                                                oaktline = listbox->aktline;
1614                                                ogridcol = listbox->gridcol;
1615                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1616                                                char* tmpstr1 = ostrcat("SolarMovies - Tv - Search", " - ", 0, 0);
1617                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1618                                                screentithekplay(tmpstr, tmpstr2, 0);
1619                                                free(tmpstr); tmpstr = NULL;
1620                                                free(tmpstr2); tmpstr2 = NULL;
1621                       
1622                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1623                                                if(pagecount == 0 || tithekexit == 1) break;
1624
1625                                                listbox->aktpage = oaktpage;
1626                                                listbox->aktline = oaktline;
1627                                                listbox->gridcol = ogridcol;
1628                                                addscreenrc(grid, listbox);
1629                                        }
1630                                }
1631                                else if(check == 5)
1632                                {
1633                                        if(youtube_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Youtube - Search", tmpstr) == 0)
1634                                        {
1635                                                oaktpage = listbox->aktpage;
1636                                                oaktline = listbox->aktline;
1637                                                ogridcol = listbox->gridcol;
1638                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1639                                                char* tmpstr1 = ostrcat("Youtube - Search", " - ", 0, 0);
1640                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1641                                                screentithekplay(tmpstr, tmpstr2, 0);
1642                                                free(tmpstr); tmpstr = NULL;
1643                                                free(tmpstr2); tmpstr2 = NULL;
1644                       
1645                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1646                                                if(pagecount == 0 || tithekexit == 1) break;
1647
1648                                                listbox->aktpage = oaktpage;
1649                                                listbox->aktline = oaktline;
1650                                                listbox->gridcol = ogridcol;
1651                                                addscreenrc(grid, listbox);
1652                                        }
1653                                }
1654                                else if(check == 7)
1655                                {
1656                                        if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search", tmpstr, 0) == 0)
1657                                        {
1658                                                oaktpage = listbox->aktpage;
1659                                                oaktline = listbox->aktline;
1660                                                ogridcol = listbox->gridcol;
1661                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1662                                                char* tmpstr1 = ostrcat("Movie4k - Search", " - ", 0, 0);
1663                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1664                                                screentithekplay(tmpstr, tmpstr2, 0);
1665                                                free(tmpstr); tmpstr = NULL;
1666                                                free(tmpstr2); tmpstr2 = NULL;
1667                       
1668                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1669                                                if(pagecount == 0 || tithekexit == 1) break;
1670
1671                                                listbox->aktpage = oaktpage;
1672                                                listbox->aktline = oaktline;
1673                                                listbox->gridcol = ogridcol;
1674                                                addscreenrc(grid, listbox);
1675                                        }
1676                                }
1677                                else if((((struct tithek*)listbox->select->handle)->flag == 13))
1678                                {
1679                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "MyVideo - Search", tmpstr, 0) == 0)
1680                                        {
1681                                                oaktpage = listbox->aktpage;
1682                                                oaktline = listbox->aktline;
1683                                                ogridcol = listbox->gridcol;
1684                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1685                                                char* tmpstr1 = ostrcat("MyVideo - Search", " - ", 0, 0);
1686                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1687                                                screentithekplay(tmpstr, tmpstr2, 0);
1688                                                free(tmpstr); tmpstr = NULL;
1689                                                free(tmpstr2); tmpstr2 = NULL;
1690                       
1691                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1692                                                if(pagecount == 0 || tithekexit == 1) break;
1693
1694                                                listbox->aktpage = oaktpage;
1695                                                listbox->aktline = oaktline;
1696                                                listbox->gridcol = ogridcol;
1697                                                addscreenrc(grid, listbox);
1698                                        }
1699                                }
1700
1701                                free(tmpstr), tmpstr = NULL;
1702                        }
1703                }
1704                else if(rcret == getrcconfigint("rcok", NULL))
1705                {
1706                        if(listbox->select != NULL && listbox->select->handle != NULL)
1707                        {
1708                                clearscreen(grid);
1709
1710                                if((((struct tithek*)listbox->select->handle)->flag == 2) || (((struct tithek*)listbox->select->handle)->flag == 4) || (((struct tithek*)listbox->select->handle)->flag == 5) || (((struct tithek*)listbox->select->handle)->flag == 6) || (((struct tithek*)listbox->select->handle)->flag == 7) || (((struct tithek*)listbox->select->handle)->flag == 8) || (((struct tithek*)listbox->select->handle)->flag == 12) || (((struct tithek*)listbox->select->handle)->flag == 14) || (((struct tithek*)listbox->select->handle)->flag == 15) || (((struct tithek*)listbox->select->handle)->flag == 16) || (((struct tithek*)listbox->select->handle)->flag == 17) || (((struct tithek*)listbox->select->handle)->flag == 18) || (((struct tithek*)listbox->select->handle)->flag == 19) || (((struct tithek*)listbox->select->handle)->flag == 20) || (((struct tithek*)listbox->select->handle)->flag == 24) || (((struct tithek*)listbox->select->handle)->flag == 25) || (((struct tithek*)listbox->select->handle)->flag == 26) || (((struct tithek*)listbox->select->handle)->flag == 27) || (((struct tithek*)listbox->select->handle)->flag == 38) || (((struct tithek*)listbox->select->handle)->flag == 42) || (((struct tithek*)listbox->select->handle)->flag == 45) || (((struct tithek*)listbox->select->handle)->flag == 46) || (((struct tithek*)listbox->select->handle)->flag == 50) || (((struct tithek*)listbox->select->handle)->flag == 41) || (((struct tithek*)listbox->select->handle)->flag == 43))
1711                                {
1712                                        submenu(listbox, load, title);
1713                                        drawscreen(grid, 0, 0);
1714                                }
1715                                else if((((struct tithek*)listbox->select->handle)->flag == 9) || (((struct tithek*)listbox->select->handle)->flag == 10) || (((struct tithek*)listbox->select->handle)->flag == 11))
1716                                {
1717                                        if(youtube_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL) == 0)
1718                                        {
1719                                                oaktpage = listbox->aktpage;
1720                                                oaktline = listbox->aktline;
1721                                                ogridcol = listbox->gridcol;
1722                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1723                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
1724                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1725                                                screentithekplay(tmpstr, tmpstr2, 0);
1726                                                free(tmpstr); tmpstr = NULL;
1727                                                free(tmpstr2); tmpstr2 = NULL;
1728                       
1729                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1730                                                if(pagecount == 0 || tithekexit == 1) break;
1731
1732                                                listbox->aktpage = oaktpage;
1733                                                listbox->aktline = oaktline;
1734                                                listbox->gridcol = ogridcol;
1735                                                addscreenrc(grid, listbox);
1736                                        }
1737                                }
1738                                else if(((struct tithek*)listbox->select->handle)->flag == 13)
1739                                {
1740                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
1741                                        {
1742                                                oaktpage = listbox->aktpage;
1743                                                oaktline = listbox->aktline;
1744                                                ogridcol = listbox->gridcol;
1745                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1746                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
1747                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1748                                                screentithekplay(tmpstr, tmpstr2, 0);
1749                                                free(tmpstr); tmpstr = NULL;
1750                                                free(tmpstr2); tmpstr2 = NULL;
1751                       
1752                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1753                                                if(pagecount == 0 || tithekexit == 1) break;
1754
1755                                                listbox->aktpage = oaktpage;
1756                                                listbox->aktline = oaktline;
1757                                                listbox->gridcol = ogridcol;
1758                                                addscreenrc(grid, listbox);
1759                                        }
1760                                }
1761                                else if(((struct tithek*)listbox->select->handle)->flag == 44)
1762                                {
1763                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
1764                                        {
1765                                                oaktpage = listbox->aktpage;
1766                                                oaktline = listbox->aktline;
1767                                                ogridcol = listbox->gridcol;
1768                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1769                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
1770                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1771                                                screentithekplay(tmpstr, tmpstr2, 0);
1772                                                free(tmpstr); tmpstr = NULL;
1773                                                free(tmpstr2); tmpstr2 = NULL;
1774                       
1775                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1776                                                if(pagecount == 0 || tithekexit == 1) break;
1777
1778                                                listbox->aktpage = oaktpage;
1779                                                listbox->aktline = oaktline;
1780                                                listbox->gridcol = ogridcol;
1781                                                addscreenrc(grid, listbox);
1782                                        }
1783                                }
1784                                else if((((struct tithek*)listbox->select->handle)->flag == 21))
1785                                {
1786                                        if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
1787                                        {
1788                                                oaktpage = listbox->aktpage;
1789                                                oaktline = listbox->aktline;
1790                                                ogridcol = listbox->gridcol;
1791                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1792                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
1793                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1794                                                screentithekplay(tmpstr, tmpstr2, 0);
1795                                                free(tmpstr); tmpstr = NULL;
1796                                                free(tmpstr2); tmpstr2 = NULL;
1797
1798                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1799                                                if(pagecount == 0 || tithekexit == 1) break;
1800
1801                                                listbox->aktpage = oaktpage;
1802                                                listbox->aktline = oaktline;
1803                                                listbox->gridcol = ogridcol;
1804                                                addscreenrc(grid, listbox);
1805                                        }
1806                                }
1807                                else if((((struct tithek*)listbox->select->handle)->flag == 33))
1808                                {
1809                                        if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
1810                                        {
1811                                                oaktpage = listbox->aktpage;
1812                                                oaktline = listbox->aktline;
1813                                                ogridcol = listbox->gridcol;
1814                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1815                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
1816                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1817                                                screentithekplay(tmpstr, tmpstr2, 0);
1818                                                free(tmpstr); tmpstr = NULL;
1819                                                free(tmpstr2); tmpstr2 = NULL;
1820
1821                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1822                                                if(pagecount == 0 || tithekexit == 1) break;
1823
1824                                                listbox->aktpage = oaktpage;
1825                                                listbox->aktline = oaktline;
1826                                                listbox->gridcol = ogridcol;
1827                                                addscreenrc(grid, listbox);
1828                                        }
1829                                }                               
1830                                else if(((struct tithek*)listbox->select->handle)->flag == 29)
1831                                {
1832                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
1833                                        {
1834                                                oaktpage = listbox->aktpage;
1835                                                oaktline = listbox->aktline;
1836                                                ogridcol = listbox->gridcol;
1837                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1838                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
1839                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1840                                                screentithekplay(tmpstr, tmpstr2, 0);
1841                                                free(tmpstr); tmpstr = NULL;
1842                                                free(tmpstr2); tmpstr2 = NULL;
1843
1844                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1845                                                if(pagecount == 0 || tithekexit == 1) break;
1846
1847                                                listbox->aktpage = oaktpage;
1848                                                listbox->aktline = oaktline;
1849                                                listbox->gridcol = ogridcol;
1850                                                addscreenrc(grid, listbox);
1851                                        }
1852                                }
1853                                else if(((struct tithek*)listbox->select->handle)->flag == 30)
1854                                {
1855                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
1856                                        {
1857                                                oaktpage = listbox->aktpage;
1858                                                oaktline = listbox->aktline;
1859                                                ogridcol = listbox->gridcol;
1860                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1861                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
1862                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1863                                                screentithekplay(tmpstr, tmpstr2, 0);
1864                                                free(tmpstr); tmpstr = NULL;
1865                                                free(tmpstr2); tmpstr2 = NULL;
1866
1867                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1868                                                if(pagecount == 0 || tithekexit == 1) break;
1869
1870                                                listbox->aktpage = oaktpage;
1871                                                listbox->aktline = oaktline;
1872                                                listbox->gridcol = ogridcol;
1873                                                addscreenrc(grid, listbox);
1874                                        }
1875                                }
1876                                else if((((struct tithek*)listbox->select->handle)->flag == 31))
1877                                {
1878                                        if(kinox_search_cast(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL) == 0)
1879                                        {
1880                                                oaktpage = listbox->aktpage;
1881                                                oaktline = listbox->aktline;
1882                                                ogridcol = listbox->gridcol;
1883                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1884                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
1885                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1886                                                screentithekplay(tmpstr, tmpstr2, 0);
1887                                                free(tmpstr); tmpstr = NULL;
1888                                                free(tmpstr2); tmpstr2 = NULL;
1889
1890                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1891                                                if(pagecount == 0 || tithekexit == 1) break;
1892
1893                                                listbox->aktpage = oaktpage;
1894                                                listbox->aktline = oaktline;
1895                                                listbox->gridcol = ogridcol;
1896                                                addscreenrc(grid, listbox);
1897                                        }
1898                                }
1899                                else if((((struct tithek*)listbox->select->handle)->flag == 32))
1900                                {
1901                                        if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
1902                                        {
1903                                                oaktpage = listbox->aktpage;
1904                                                oaktline = listbox->aktline;
1905                                                ogridcol = listbox->gridcol;
1906                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1907                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
1908                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1909                                                screentithekplay(tmpstr, tmpstr2, 0);
1910                                                free(tmpstr); tmpstr = NULL;
1911                                                free(tmpstr2); tmpstr2 = NULL;
1912
1913                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1914                                                if(pagecount == 0 || tithekexit == 1) break;
1915
1916                                                listbox->aktpage = oaktpage;
1917                                                listbox->aktline = oaktline;
1918                                                listbox->gridcol = ogridcol;
1919                                                addscreenrc(grid, listbox);
1920                                        }
1921                                }
1922                                else if((((struct tithek*)listbox->select->handle)->flag == 33))
1923                                {
1924                                        if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
1925                                        {
1926                                                oaktpage = listbox->aktpage;
1927                                                oaktline = listbox->aktline;
1928                                                ogridcol = listbox->gridcol;
1929                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1930                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
1931                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1932                                                screentithekplay(tmpstr, tmpstr2, 0);
1933                                                free(tmpstr); tmpstr = NULL;
1934                                                free(tmpstr2); tmpstr2 = NULL;
1935
1936                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 3);
1937                                                if(pagecount == 0 || tithekexit == 1) break;
1938
1939                                                listbox->aktpage = oaktpage;
1940                                                listbox->aktline = oaktline;
1941                                                listbox->gridcol = ogridcol;
1942                                                addscreenrc(grid, listbox);
1943                                        }
1944                                }
1945                                else if((((struct tithek*)listbox->select->handle)->flag == 34) || (((struct tithek*)listbox->select->handle)->flag == 35))
1946                                {
1947                                        if(movie4k_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
1948                                        {
1949                                                oaktpage = listbox->aktpage;
1950                                                oaktline = listbox->aktline;
1951                                                ogridcol = listbox->gridcol;
1952                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1953                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
1954                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1955                                                screentithekplay(tmpstr, tmpstr2, 0);
1956                                                free(tmpstr); tmpstr = NULL;
1957                                                free(tmpstr2); tmpstr2 = NULL;
1958
1959                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1960                                                if(pagecount == 0 || tithekexit == 1) break;
1961
1962                                                listbox->aktpage = oaktpage;
1963                                                listbox->aktline = oaktline;
1964                                                listbox->gridcol = ogridcol;
1965                                                addscreenrc(grid, listbox);
1966                                        }
1967                                }
1968                                else if((((struct tithek*)listbox->select->handle)->flag == 22))
1969                                {
1970                                        if(kinox_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
1971                                        {
1972                                                oaktpage = listbox->aktpage;
1973                                                oaktline = listbox->aktline;
1974                                                ogridcol = listbox->gridcol;
1975                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1976                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
1977                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1978                                                screentithekplay(tmpstr, tmpstr2, 0);
1979                                                free(tmpstr); tmpstr = NULL;
1980                                                free(tmpstr2); tmpstr2 = NULL;
1981
1982                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 3);
1983                                                if(pagecount == 0 || tithekexit == 1) break;
1984
1985                                                listbox->aktpage = oaktpage;
1986                                                listbox->aktline = oaktline;
1987                                                listbox->gridcol = ogridcol;
1988                                                addscreenrc(grid, listbox);
1989                                        }
1990                                }
1991                                else if((((struct tithek*)listbox->select->handle)->flag == 28))
1992                                {
1993                                        if(solarmovie_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
1994                                        {
1995                                                oaktpage = listbox->aktpage;
1996                                                oaktline = listbox->aktline;
1997                                                ogridcol = listbox->gridcol;
1998                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1999                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2000                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2001                                                screentithekplay(tmpstr, tmpstr2, 0);
2002                                                free(tmpstr); tmpstr = NULL;
2003                                                free(tmpstr2); tmpstr2 = NULL;
2004                       
2005                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 3);
2006                                                if(pagecount == 0 || tithekexit == 1) break;
2007
2008                                                listbox->aktpage = oaktpage;
2009                                                listbox->aktline = oaktline;
2010                                                listbox->gridcol = ogridcol;
2011                                                addscreenrc(grid, listbox);
2012                                        }
2013                                }
2014                                else if((((struct tithek*)listbox->select->handle)->flag == 23))
2015                                {
2016                                        if(kinox_hoster_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2017                                        {
2018                                                oaktpage = listbox->aktpage;
2019                                                oaktline = listbox->aktline;
2020                                                ogridcol = listbox->gridcol;
2021                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2022                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2023                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2024                                                screentithekplay(tmpstr, tmpstr2, 0);
2025                                                free(tmpstr); tmpstr = NULL;
2026                                                free(tmpstr2); tmpstr2 = NULL;
2027                       
2028                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2029                                                if(pagecount == 0 || tithekexit == 1) break;
2030
2031                                                listbox->aktpage = oaktpage;
2032                                                listbox->aktline = oaktline;
2033                                                listbox->gridcol = ogridcol;
2034                                                addscreenrc(grid, listbox);
2035                                        }
2036                                }
2037                                else if((((struct tithek*)listbox->select->handle)->flag == 36) || (((struct tithek*)listbox->select->handle)->flag == 37))
2038                                {
2039                                        if(movie4k_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2040                                        {
2041                                                oaktpage = listbox->aktpage;
2042                                                oaktline = listbox->aktline;
2043                                                ogridcol = listbox->gridcol;
2044                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2045                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2046                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2047                                                screentithekplay(tmpstr, tmpstr2, 0);
2048                                                free(tmpstr); tmpstr = NULL;
2049                                                free(tmpstr2); tmpstr2 = NULL;
2050                       
2051                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2052                                                if(pagecount == 0 || tithekexit == 1) break;
2053
2054                                                listbox->aktpage = oaktpage;
2055                                                listbox->aktline = oaktline;
2056                                                listbox->gridcol = ogridcol;
2057                                                addscreenrc(grid, listbox);
2058                                        }
2059                                }
2060                                else if((((struct tithek*)listbox->select->handle)->flag == 39))
2061                                {
2062                                        if(movie4k_series_listed(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2063                                        {
2064                                                oaktpage = listbox->aktpage;
2065                                                oaktline = listbox->aktline;
2066                                                ogridcol = listbox->gridcol;
2067                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2068                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2069                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2070                                                screentithekplay(tmpstr, tmpstr2, 0);
2071                                                free(tmpstr); tmpstr = NULL;
2072                                                free(tmpstr2); tmpstr2 = NULL;
2073                       
2074                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2075                                                if(pagecount == 0 || tithekexit == 1) break;
2076
2077                                                listbox->aktpage = oaktpage;
2078                                                listbox->aktline = oaktline;
2079                                                listbox->gridcol = ogridcol;
2080                                                addscreenrc(grid, listbox);
2081                                        }
2082                                }
2083                                else if((((struct tithek*)listbox->select->handle)->flag == 40))
2084                                {
2085                                        if(movie4k_hoster_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2086                                        {
2087                                                oaktpage = listbox->aktpage;
2088                                                oaktline = listbox->aktline;
2089                                                ogridcol = listbox->gridcol;
2090                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2091                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2092                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2093                                                screentithekplay(tmpstr, tmpstr2, 0);
2094                                                free(tmpstr); tmpstr = NULL;
2095                                                free(tmpstr2); tmpstr2 = NULL;
2096                       
2097                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2098                                                if(pagecount == 0 || tithekexit == 1) break;
2099
2100                                                listbox->aktpage = oaktpage;
2101                                                listbox->aktline = oaktline;
2102                                                listbox->gridcol = ogridcol;
2103                                                addscreenrc(grid, listbox);
2104                                        }
2105                                }
2106                                else if((((struct tithek*)listbox->select->handle)->flag == 66))
2107                                {
2108                                        textbox(_("Message"), _("The hoster is not yet supported !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0);
2109                                        continue;
2110                                }       
2111                                else if((((struct tithek*)listbox->select->handle)->flag == 3))
2112                                {
2113                                        int pincheck = 0;
2114                                        if(((struct tithek*)listbox->select->handle)->flag == 1000)
2115                                                pincheck = screenpincheck(0, NULL);
2116                                        if(pincheck == 0)
2117                                        {
2118                                                oaktpage = listbox->aktpage;
2119                                                oaktline = listbox->aktline;
2120                                                ogridcol = listbox->gridcol;
2121                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2122                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);                                     
2123                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2124                                                screentithekplay(tmpstr, tmpstr2, 3);
2125                                                free(tmpstr); tmpstr = NULL;
2126                                                free(tmpstr2); tmpstr2 = NULL; 
2127
2128                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2129                                                if(pagecount == 0 || tithekexit == 1) break;
2130
2131                                                listbox->aktpage = oaktpage;
2132                                                listbox->aktline = oaktline;
2133                                                listbox->gridcol = ogridcol;
2134                                                addscreenrc(grid, listbox);
2135                                        }
2136                                }
2137                                else
2138                                {
2139                                        int pincheck = 0;
2140                                        if(((struct tithek*)listbox->select->handle)->flag == 1000)
2141                                                pincheck = screenpincheck(0, NULL);
2142                                        if(pincheck == 0)
2143                                        {
2144                                                oaktpage = listbox->aktpage;
2145                                                oaktline = listbox->aktline;
2146                                                ogridcol = listbox->gridcol;
2147                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2148                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);                                     
2149                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2150                                                screentithekplay(tmpstr, tmpstr2, 0);
2151                                                free(tmpstr); tmpstr = NULL;
2152                                                free(tmpstr2); tmpstr2 = NULL; 
2153
2154                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2155                                                if(pagecount == 0 || tithekexit == 1) break;
2156
2157                                                listbox->aktpage = oaktpage;
2158                                                listbox->aktline = oaktline;
2159                                                listbox->gridcol = ogridcol;
2160                                                addscreenrc(grid, listbox);
2161                                        }
2162                                }
2163                                drawscreen(grid, 0, 0);
2164                        }                       
2165                }
2166                else if(rcret == getrcconfigint("rcyellow", NULL) && ostrcmp(title, "TiThek - Favoriten") == 0)
2167                {
2168                        if(listbox->select != NULL && listbox->select->handle != NULL)
2169                        {
2170                                if(textbox(_("Message"), _("Remove this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0) == 1)
2171                                {
2172                                        removefav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag);             
2173                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2174                                        if(pagecount == 0) return;
2175                                               
2176                                        drawscreen(grid, 0, 0);
2177                                }
2178                        }
2179                }
2180                else if(rcret == getrcconfigint("rcgreen", NULL) && ostrcmp(title, "TiThek - Favoriten") != 0)
2181                {
2182                        if(listbox->select != NULL && listbox->select->handle != NULL)
2183                        {
2184                                if(textbox(_("Message"), _("Add this link as Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0) == 1)
2185                                {
2186                                        addfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag);         
2187                                }
2188                        }
2189                }
2190        }
2191
2192        delmarkedscreennodes(grid, 1);
2193        delownerrc(grid);
2194        clearscreen(grid);
2195
2196        if(first == 1)
2197        {
2198                freetithek();
2199                delallfiles("/tmp/tithek", ".list");
2200                if(status.mcaktiv == 0)
2201                        servicecheckret(servicestart(status.lastservice->channel, NULL, NULL, 0), 0);
2202        }
2203}
2204
2205#endif
Note: See TracBrowser for help on using the repository browser.