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

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

tithek add debug

File size: 108.3 KB
Line 
1#ifndef TITHEK_H
2#define TITHEK_H
3
4#define TITHEKPATH "/tmp/tithek"
5int tithekdownloadrun = 0;
6int tithekdownloadcount = 0;
7int tithekrun = 0;
8int tithekexit = 0;
9int tithekmovie4k = 0;
10int tithekkinox = 0;
11int titheksolarmovie = 0;
12int tithekmlehd = 0;
13
14//flag 0        - menu
15//flag 1        - menu pay hidden tithek_pay=0/1 0=hidden
16//flag 2        - http (default streamurl)
17//flag 3        - menu cover
18//flag 4        - youtube
19//flag 5        - rtl2now
20//flag 6        - superrtlnow
21//flag 7        - rtlnow
22//flag 8        - voxnow
23//flag 9        - youtube suche 10
24//flag 10       - youtube suche 25
25//flag 11       - youtube suche 50
26//flag 12       - myvideo
27//flag 13       - myvideo search 50
28//flag 14       - kinox play
29//flag 15       - unbenutzt... old: hoster filenuke
30//flag 16       - superrtlnow pay
31//flag 17       - rtlnow pay
32//flag 18       - voxnow pay
33//flag 19       - rtl2now pay
34//flag 20       - unbenutzt... old: hoster StreamCloud
35//flag 21       - kinox search
36//flag 22       - kinox hoster
37//flag 23       - kinox hoster serie
38//flag 24       - internetradio local serach
39//flag 25       - kinox local serach
40//flag 26       - movie4k local serach
41//flag 27       - solarmovie local serach
42//flag 28       - solarmovie hoster
43//flag 29       - solarmovie search movie
44//flag 30       - solarmovie search serie
45//flag 31       - kinox search cast
46//flag 32       - kinox search cast results
47//flag 33       - movie4k search : serie > open seasons and list episode flag=40 > hoster listed flag=34
48//flag 34       - movie4k hoster de
49//flag 35       - movie4k hoster other
50//flag 36       - movie4k series de > open seasons and list episode flag=39 > hoster listed flag=34
51//flag 37       - movie4k series other > open seasons and list episode flag=39 > hoster listed flag=34
52//flag 38       - mlehd
53//flag 39   - movie4k_hoster_listed
54//flag 40   - movie4k_hoster_series
55//flag 41   - movie4k
56//flag 42   - xvideos
57//flag 43       - solarmovie
58//flag 44       - myvideo Single charts
59//flag 45       - ard
60//flag 46       - ard
61//flag 47   - internettv local serach
62//flag 48   - youtube local serach
63//flag 49   - myvideo local serach
64//flag 50       - beeg
65//flag 51   - ard local serach
66//flag 52   - zdf local serach
67//flag 53   - tectime local serach
68//flag 54   - giga local serach
69//flag 55   - beeg local serach
70//flag 56   - rtl2now local serach
71//flag 57   - rtlnow local serach
72//flag 58   - superrtlnow local serach
73//flag 59   - voxnow local serach
74//flag 60   - xvideos local serach
75//flag 61   - mlehd local serach
76//flag 62   - netzkino local serach
77
78//flag 66   - coming soon dummy
79//flag 1000 - menu pincode
80//flag 9999 - menu hidden codecpack
81
82struct tithek
83{
84        char* title;
85        char* link;
86        char* pic;
87        char* localname;
88        char* menutitle;       
89        int flag;
90        struct tithek* prev;
91        struct tithek* next;
92};
93struct tithek *tithek = NULL;
94
95
96void freetithekcontent(struct tithek* node)
97{
98        if(node == NULL) return;
99
100        free(node->title); node->title = NULL;
101        node->link = NULL;
102        node->pic = NULL;
103        node->localname = NULL;
104        node->menutitle = NULL;
105        node->flag = 0;
106}
107
108int addtithekcontent(struct tithek* node, char *line, int len, int count, int pay)
109{
110        int ret = 0, i = 0, skip = 0, hid = 0, sos = 0;
111        char* tmpstr = NULL, *flag = NULL, *cmd = NULL, *tmp = NULL;
112        if(node == NULL) return 1;
113
114        if(len > 0) tmpstr = malloc(len + 1);
115        if(tmpstr != NULL)
116        {
117                memcpy(tmpstr, line, len);
118                tmpstr[len] = '\0';
119
120                node->title = tmpstr;
121
122                while(tmpstr[0] != '\0')
123                {
124                        if(tmpstr[0] == '#')
125                        {
126                                tmpstr[0] = '\0';
127                                tmpstr++;
128                                switch(ret)
129                                {
130                                        case 0: node->link = tmpstr; break;
131                                        case 1: node->pic = tmpstr; break;
132                                        case 2: node->localname = tmpstr; break;
133                                        case 3: node->menutitle = tmpstr; break;
134                                        case 4: flag = tmpstr; break;
135                                }
136
137                                ret++;
138                        }
139                        else
140                                tmpstr++;
141                }
142        }
143
144        if(ret != 5)
145        {
146                if(count > 0)
147                {
148                        err("tithek line %d not ok (ret=%d)", count, ret);
149                }
150                else
151                {
152                        err("add tithek (ret=%d)", ret);
153                }
154                freetithekcontent(node);
155                return 1;
156        }
157
158        if(flag != NULL) node->flag = atoi(flag);
159       
160        sos = getconfigint("sos", NULL);
161        hid = getconfigint("tithek_hid_xxx", NULL);
162        if(node->flag == 1000 && hid == 1)
163                skip = 1;
164        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"))
165                skip = 1;
166        else if(node->flag == 16 && pay == 0)
167                skip = 1;
168        else if(node->flag == 17 && pay == 0)
169                skip = 1;
170        else if(node->flag == 18 && pay == 0)
171                skip = 1;
172        else if(node->flag == 19 && pay == 0)
173                skip = 1;
174        else if(node->flag == 1 && pay == 0)
175                skip = 1;
176        else if(node->flag == 35 && pay == 0)
177                skip = 1;
178        else if(titheksolarmovie == 1 && node->flag == 9996 && sos == 0)
179        {
180                cmd = ostrcat(cmd, "ww", 1, 0);
181                cmd = ostrcat(cmd, "w.sola", 1, 0);
182                cmd = ostrcat(cmd, "rmovi", 1, 0);
183                cmd = ostrcat(cmd, "e.", 1, 0);
184                cmd = ostrcat(cmd, "so", 1, 0);
185               
186                for(i = 0; i < 3; i++)
187                {
188                        free(tmp); tmp = NULL;
189                        tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2);
190                        if(tmp != NULL) break;
191                }
192                if(tmp == NULL)
193                        skip = 1;
194
195                titheksolarmovie = 0;
196        }
197        else if(tithekmovie4k == 1 && node->flag == 9997 && sos == 0)
198        {
199                cmd = ostrcat(cmd, "ww", 1, 0);
200                cmd = ostrcat(cmd, "w.mov", 1, 0);
201                cmd = ostrcat(cmd, "ie4k", 1, 0);
202                cmd = ostrcat(cmd, ".", 1, 0);
203                cmd = ostrcat(cmd, "to", 1, 0);
204               
205                for(i = 0; i < 3; i++)
206                {
207                        free(tmp); tmp = NULL;
208                        tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2);
209                        if(tmp != NULL) break;
210                }
211                if(tmp == NULL)
212                        skip = 1;
213
214                tithekmovie4k = 0;
215        }               
216        else if(tithekmlehd == 1 && node->flag == 9998 && sos == 0)
217        {
218                cmd = ostrcat(cmd, "ww", 1, 0);
219                cmd = ostrcat(cmd, "w.mle", 1, 0);
220                cmd = ostrcat(cmd, "-hd", 1, 0);
221                cmd = ostrcat(cmd, ".", 1, 0);
222                cmd = ostrcat(cmd, "se", 1, 0);
223               
224                for(i = 0; i < 3; i++)
225                {
226                        free(tmp); tmp = NULL;
227                        tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2);
228                        if(tmp != NULL) break;
229                }
230                if(tmp == NULL)
231                        skip = 1;
232
233                tithekmlehd = 0;
234        }
235        else if(tithekkinox == 1 && node->flag == 9999 && sos == 0)
236        {
237                cmd = ostrcat(cmd, "kin", 1, 0);
238                cmd = ostrcat(cmd, "ox", 1, 0);
239                cmd = ostrcat(cmd, ".", 1, 0);
240                cmd = ostrcat(cmd, "to", 1, 0);
241               
242                for(i = 0; i < 3; i++)
243                {
244                        free(tmp); tmp = NULL;
245                        tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2);
246                        if(tmp != NULL) break;
247                }
248                if(tmp == NULL)
249                        skip = 1;
250
251                tithekkinox = 0;
252        }
253
254        if(skip == 1)
255        {
256                freetithekcontent(node);
257                return 1;
258        }
259
260        free(tmp); tmp = NULL;
261        free(cmd), cmd = NULL;
262               
263        return 0;
264}
265
266struct tithek* addtithek(char *line, int len, int count, struct tithek* last, int pay)
267{
268        //debug(1000, "in");
269        struct tithek *newnode = NULL, *prev = NULL, *node = NULL;
270        int ret = 0;
271
272        if(line == NULL) return NULL;
273
274        newnode = (struct tithek*)calloc(1, sizeof(struct tithek));
275        if(newnode == NULL)
276        {
277                err("no memory");
278                return NULL;
279        }
280
281        ret = addtithekcontent(newnode, line, len, count, pay);
282        if(ret == 1)
283        {
284                free(newnode);
285                return NULL;
286        }
287
288        node = tithek;
289
290        if(last == NULL)
291        {
292                while(node != NULL)
293                {
294                        prev = node;
295                        node = node->next;
296                }
297        }
298        else
299        {
300                prev = last;
301                node = last->next;
302        }
303
304        if(prev == NULL)
305                tithek = newnode;
306        else
307        {
308                prev->next = newnode;
309                newnode->prev = prev;
310        }
311        newnode->next = node;
312        if(node != NULL) node->prev = newnode;
313
314        //debug(1000, "out");
315        return newnode;
316}
317
318struct tithek* createtithek(struct tithek* update, char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
319{
320        int pay = 0;
321        struct tithek* tnode = NULL;
322        char* tmpstr = NULL;
323       
324        pay = getconfigint("tithek_pay", NULL);
325
326        title = stringreplacechar(title, '#', ' ');
327        link = stringreplacechar(link, '#', ' ');
328        pic = stringreplacechar(pic, '#', ' ');
329        localname = stringreplacechar(localname, '#', ' ');
330        menutitle = stringreplacechar(menutitle, '#', ' ');
331       
332        tmpstr = ostrcat(tmpstr, title, 1, 0);
333        tmpstr = ostrcat(tmpstr, "#", 1, 0);
334        tmpstr = ostrcat(tmpstr, link, 1, 0);
335        tmpstr = ostrcat(tmpstr, "#", 1, 0);
336        tmpstr = ostrcat(tmpstr, pic, 1, 0);
337        tmpstr = ostrcat(tmpstr, "#", 1, 0);
338        tmpstr = ostrcat(tmpstr, localname, 1, 0);
339        tmpstr = ostrcat(tmpstr, "#", 1, 0);
340        tmpstr = ostrcat(tmpstr, menutitle, 1, 0);
341        tmpstr = ostrcat(tmpstr, "#", 1, 0);
342        tmpstr = ostrcat(tmpstr, oitoa(flag), 1, 1);
343
344        tmpstr = string_replace_all("\n", "", tmpstr, 1);
345        tmpstr = string_replace_all("\r", "", tmpstr, 1);
346
347        if(update != NULL)
348        {
349                freetithekcontent(update);
350                addtithekcontent(update, tmpstr, strlen(tmpstr), 1, pay);
351                tnode = update;
352        }
353        else
354                tnode = addtithek(tmpstr, strlen(tmpstr), 1, NULL, pay);
355
356        free(tmpstr);
357
358        return tnode;
359}
360
361int readtithek(const char* filename)
362{
363        debug(1000, "in");
364        FILE *fd = NULL;
365        char *fileline = NULL;
366        int linecount = 0, len = 0, pay = 0;
367        struct tithek* last = NULL, *tmplast = NULL;
368
369        fileline = malloc(MINMALLOC);
370        if(fileline == NULL)
371        {
372                err("no memory");
373                return 1;
374        }
375
376        fd = fopen(filename, "r");
377        if(fd == NULL)
378        {
379                perr("can't open %s", filename);
380                free(fileline);
381                return 1;
382        }
383
384        pay = getconfigint("tithek_pay", NULL);
385
386        while(fgets(fileline, MINMALLOC, fd) != NULL)
387        {
388                if(fileline[0] == '\n')
389                        continue;
390                len = strlen(fileline) - 1;
391                if(fileline[len] == '\n')
392                        fileline[len] = '\0';
393                if(fileline[len - 1] == '\r')
394                        fileline[len - 1] = '\0';
395
396                linecount++;
397
398                if(last == NULL) last = tmplast;
399                last = addtithek(fileline, len + 2, linecount, last, pay);
400                if(last != NULL) tmplast = last;
401        }
402
403        free(fileline);
404        fclose(fd);
405        return linecount;
406}
407
408int deltithek(char* link)
409{
410        debug(1000, "in");
411        int ret = 1;
412
413        struct tithek *node = tithek, *prev = tithek;
414
415        while(node != NULL)
416        {
417                if(ostrcmp(link, node->link) == 0)
418                {
419                        ret = 0;
420                        if(node == tithek)
421                        {
422                                tithek = node->next;
423                                if(tithek != NULL)
424                                        tithek->prev = NULL;
425                        }
426                        else
427                        {
428                                prev->next = node->next;
429                                if(node->next != NULL)
430                                        node->next->prev = prev;
431                        }
432
433                        freetithekcontent(node);
434
435                        free(node);
436                        node = NULL;
437
438                        break;
439                }
440
441                prev = node;
442                node = node->next;
443        }
444
445        debug(1000, "out");
446        return ret;
447}
448
449void freetithek()
450{
451        debug(1000, "in");
452        struct tithek *node = tithek, *prev = tithek;
453
454        while(node != NULL)
455        {
456                prev = node;
457                node = node->next;
458                if(prev != NULL)
459                        deltithek(prev->link);
460        }
461
462        debug(1000, "out");
463}
464
465void tithekdownloadthread(struct stimerthread* timernode, struct download* node, int flag)
466{
467        int defpic = 0;
468
469        tithekdownloadcount++;
470
471        if(node != NULL)
472        {
473                m_lock(&status.tithekmutex, 20);
474                if(file_exist(node->filename))
475                {
476                        m_unlock(&status.tithekmutex, 20);
477                        goto end;
478                }
479
480                FILE *fd; fd = fopen(node->filename, "w");
481                if(fd != NULL) fclose(fd);
482                m_unlock(&status.tithekmutex, 20);
483
484                gethttpreal(node->host, node->page, node->port, node->filename, node->auth, NULL, 0, NULL, NULL, node->timeout, 0);
485
486                if(tithekrun == 0)
487                        unlink(node->filename);
488                else
489                {
490                        //check file size
491                        /*
492                        off64_t checkpic = getfilesize(node->filename);
493                        if(checkpic < 200) defpic = 1;
494                        */
495
496                        //check file is gif or html
497                        if(defpic == 0)
498                        {
499                                char* tmp = NULL;
500                                tmp = readbintomem(node->filename, 3);
501                                if(ostrncmp("GIF", tmp, 3) == 0) defpic = 1; //gif
502                                if(ostrncmp("<", tmp, 1) == 0) defpic = 1; //html
503                                free(tmp); tmp = NULL;
504                        }
505
506                        if(defpic == 1)
507                        {
508                                m_lock(&status.tithekmutex, 20);
509                                unlink(node->filename);
510                                symlink("/var/usr/local/share/titan/plugins/tithek/default.jpg", node->filename);
511                                m_unlock(&status.tithekmutex, 20);
512                        }
513                }
514
515end:
516                free(node->host); node->host = NULL;
517                free(node->page); node->page = NULL;
518                free(node->filename); node->filename = NULL;
519                free(node->auth); node->auth = NULL;
520        }
521
522        free(node); node = NULL;
523
524        tithekdownloadcount--;
525        tithekdownloadrun = 1;
526}
527
528char* tithekdownload(char* link, char* localname, char* pw, int pic, int flag)
529{
530        int ret = 1, port = 80, timeout = 10000;
531        char* ip = NULL, *pos = NULL, *path = NULL;
532        char* tmpstr = NULL, *localfile = NULL;
533
534        if(link == NULL) return NULL;
535        if(ostrncmp("http://", link, 7)) return NULL;
536
537        ip = string_replace("http://", "", (char*)link, 0);
538        // tithek security
539        ip = string_replace_all("imageshack.us/md/up/grd/", "atemio.dyndns.tv/", ip, 1);
540
541        if(ip != NULL)
542                pos = strchr(ip, '/');
543        if(pos != NULL)
544        {
545                pos[0] = '\0';
546                path = pos + 1;
547        }
548
549        if(ostrstr(ip, ":") != NULL)
550        {
551                ip = oregex("http://(.*):.*", link);
552                port = atoi(oregex("http://.*:(.*)/.*", link));
553        }
554
555        tmpstr = ostrcat(path, NULL, 0, 0);
556
557        if(flag == 0)
558        {
559                localfile = ostrcat(TITHEKPATH, "/", 0, 0);
560                if(localname == NULL)
561                        localfile = ostrcat(localfile, basename(tmpstr), 1, 0);
562                else
563                        localfile = ostrcat(localfile, localname, 1, 0);
564        }
565        else
566        {
567                localfile = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0);
568                if(localname == NULL)
569                        localfile = ostrcat(localfile, basename(tmpstr), 1, 0);
570                else
571                        localfile = ostrcat(localfile, localname, 1, 0);
572        }
573
574/*
575        debug(99, "---------------------------------------");
576        debug(99, "link: %s", link);
577        debug(99, "localname: %s", localname);
578        debug(99, "---------------------------------------");
579        debug(99, "ip: %s", ip);
580        debug(99, "port: %d", port);
581        debug(99, "path: %s", path);
582        debug(99, "localfile: %s", localfile);
583//      debug(99, "pw: %s", pw);
584        debug(99, "---------------------------------------");
585*/
586        if(flag == 0)
587        {
588                if(localfile != NULL && !file_exist(localfile))
589                {
590                        if(pic == 1)
591                        {
592                                if(tithekdownloadcount >= 24) //start max 24 threads
593                                        gethttp(ip, path, port, localfile, pw, timeout, NULL, 0);
594                                else
595                                {
596                                        //dnode is freed in thread
597                                        struct download* dnode = calloc(1, sizeof(struct download));
598                                        if(dnode != NULL)
599                                        {
600                                                dnode->host = ostrcat(ip, NULL, 0, 0);
601                                                dnode->page = ostrcat(path, NULL, 0, 0);
602                                                dnode->port = port;
603                                                dnode->filename = ostrcat(localfile, NULL, 0, 0);
604                                                dnode->auth = ostrcat(pw, NULL, 0, 0);
605                                                dnode->connfd = -1;
606                                                dnode->ret = -1;
607                                                dnode->timeout = timeout;
608                                                addtimer(&tithekdownloadthread, START, 100, 1, (void*)dnode, NULL, NULL);
609                                        }
610                                }
611                        }
612                        else
613                                gethttp(ip, path, port, localfile, pw, timeout, NULL, 0);                       
614                }
615        }
616        else
617        {
618       
619                if(localfile != NULL && file_exist(localfile))
620                        ret = textbox(_("Message"), _("File exist, overwrite?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0);
621
622                if(localfile != NULL && ret == 1)
623                        screendownload("Download", ip, path, port, localfile, pw, timeout, 0);
624        }
625
626        free(ip); ip = NULL;
627        free(tmpstr); tmpstr = NULL;
628
629        return localfile;
630}
631
632int createtithekplay(char* titheklink, struct skin* grid, struct skin* listbox, struct skin* countlabel, int flag)
633{
634        int gridbr = 0, posx = 0, count = 0, sumcount = 0, count1 = 0, pagecount = 0, skip = 0;
635        int localfile = 0;
636        struct skin* tmp = NULL;
637        char* tithekfile = NULL;
638        char* tmpstr = NULL;
639
640        if(!ostrncmp("http://", titheklink, 7))
641                tithekfile = tithekdownload(titheklink, NULL, HTTPAUTH, 0, 0);
642        else
643        {
644                tithekfile = ostrcat(titheklink, NULL, 0, 0);
645                localfile = 1;
646        }
647
648        delmarkedscreennodes(grid, 1);
649        freetithek();
650//      if(readtithek(tithekfile) != 0) return 1;
651        int linecount = readtithek(tithekfile);
652//      if(linecount == 0) return 1;
653       
654        struct tithek* titheknode = tithek;
655
656        int height = 500;
657        int width = 590;
658        int picheight = 480;
659        int picwidth = 570;
660        int zcount = 2;
661        int fontsize = 25;
662        int pcount = 2;
663
664        if(getconfigint("tithek_cover", NULL) == 0 || getconfigint("tithek_view", NULL) == 0)
665        {
666                if(linecount > 2)
667                {
668                        height = 280;
669                        width = 390;
670                        picheight = 230;
671                        picwidth = 370;
672                        zcount = 3;
673                        fontsize = 20;
674                        pcount = 6;
675                }
676         
677                if(linecount > 8)
678                {
679                        height = 180;
680                        width = 295;
681                        picheight = 130;
682                        picwidth = 270;
683                        zcount = 4;
684                        fontsize = 18;
685                        pcount = 12;
686                }
687
688                if(linecount > 19)
689                {
690                        height = 140;
691                        width = 235;
692                        picheight = 90;
693                        picwidth = 210;
694                        zcount = 5;
695                        fontsize = 16;
696                        pcount = 20;
697                }
698       
699                if(linecount > 25)
700                {
701                        height = 111;
702                        width = 196;
703                        picheight = 60;
704                        picwidth = 150;
705                        zcount = 6;
706                        fontsize = 14;
707                        pcount = 30;
708                }
709        }
710       
711        if((getconfigint("tithek_cover", NULL) == 1 && flag == 3) || (getconfigint("tithek_view", NULL) == 1 && flag != 3))
712        {
713                height = 500;
714                width = 590;
715                picheight = 480;
716                picwidth = 570;
717                zcount = 2;
718                fontsize = 25;
719                pcount = 2;
720        }
721
722        if((getconfigint("tithek_cover", NULL) == 2 && flag == 3) || (getconfigint("tithek_view", NULL) == 2 && flag != 3))
723        {
724                height = 280;
725                width = 390;
726                picheight = 230;
727                picwidth = 370;
728                zcount = 3;
729                fontsize = 20;
730                pcount = 6;
731        }
732
733        if((getconfigint("tithek_cover", NULL) == 3 && flag == 3) || (getconfigint("tithek_view", NULL) == 3 && flag != 3))
734        {
735                height = 180;
736                width = 295;
737                picheight = 130;
738                picwidth = 270;
739                zcount = 4;
740                fontsize = 18;
741                pcount = 12;
742        }
743
744        if((getconfigint("tithek_cover", NULL) == 4 && flag == 3) || (getconfigint("tithek_view", NULL) == 4 && flag != 3))
745        {
746                height = 140;
747                width = 235;
748                picheight = 90;
749                picwidth = 210;
750                zcount = 5;
751                fontsize = 16;
752                pcount = 20;
753        }
754
755        if((getconfigint("tithek_cover", NULL) == 5 && flag == 3) || (getconfigint("tithek_view", NULL) == 5 && flag != 3))
756        {
757                height = 111;
758                width = 196;
759                picheight = 60;
760                picwidth = 150;
761                zcount = 6;
762                fontsize = 14;
763                pcount = 30;
764        }
765
766        if((getconfigint("tithek_cover", NULL) == 6 && flag == 3) || (getconfigint("tithek_view", NULL) == 6 && flag != 3))
767        {
768                height = 50;
769                width = 1160;
770                picheight = 48;
771                picwidth = 1100;
772                zcount = 1;
773                fontsize = 25;
774                pcount = 1;
775        }
776
777        if(getconfigint("tithek_pic_ratio", NULL) == 1)
778        {
779                picwidth = 2;
780                picheight = 2;
781        }
782
783        while(titheknode != NULL)
784        {
785                tmp = addlistbox(grid, listbox, tmp, 1);
786                if(tmp != NULL)
787                {
788                        skip = 0;
789                        sumcount++;
790                        count++;
791                        count1++;
792                        if(gridbr == 0)
793                                tmp->type = GRIDBR;
794                        gridbr = 1;
795                        tmp->wrap = YES;
796
797                        tmp->picheight = picheight;
798                        tmp->picwidth = picwidth;
799                                                               
800                        tmp->fontsize = fontsize;
801                        tmp->height = height;
802                        tmp->width = width;
803                        tmp->prozwidth = 0;
804                        //tmp->bgcol = 0xffffff;
805                        tmp->bgspace = 1;
806                        tmp->vspace = 10;
807                        tmp->hspace = 10;
808                        tmp->posx = posx;
809                        //tmp->fontcol = 0x0000ff;
810                        tmp->halign = CENTER;
811                        tmp->valign = TEXTBOTTOM;
812                        changetext(tmp, titheknode->title);
813                        tmp->handle = (char*)titheknode;
814                        posx += tmp->width;
815                        if(count >= zcount)
816                        {
817                                count = 0;
818                                posx = 0;
819                                gridbr = 0;
820                        }
821                       
822                        if(count1 >= pcount)
823                        {
824                                count1 = 0;
825                                pagecount++;
826                                skip = 1;
827                        }
828                }
829                titheknode = titheknode->next;
830        }
831
832        if(skip == 0)
833                pagecount++;
834
835        tmpstr = oitoa(sumcount);
836
837        char* tmpstr1 = ostrcat(_("found"), NULL, 0, 0);
838        tmpstr1 = ostrcat(tmpstr1, " ", 1, 0);
839        tmpstr1 = ostrcat(tmpstr1, tmpstr, 1, 0);
840        free(tmpstr); tmpstr = NULL;
841        tmpstr1 = ostrcat(tmpstr1, " ", 1, 0);
842        tmpstr1 = ostrcat(tmpstr1, _("Results"), 1, 0);
843        changetext(countlabel, tmpstr1);
844        free(tmpstr1); tmpstr1 = NULL;
845
846        if(localfile == 0)
847                unlink(tithekfile);
848       
849        free(tithekfile); tithekfile = NULL;
850        return pagecount;
851}
852
853void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
854{
855        int count = 0, i = 0;
856        char* tmpstr = NULL, *tmpstr1 = NULL, *input = NULL;
857        struct splitstr* ret = NULL;
858
859        input = ostrcat(input, title, 1, 0);
860        input = ostrcat(input, "#", 1, 0);
861        input = ostrcat(input, link, 1, 0);
862        input = ostrcat(input, "#", 1, 0);
863        input = ostrcat(input, pic, 1, 0);
864        input = ostrcat(input, "#", 1, 0);
865        input = ostrcat(input, localname, 1, 0);
866        input = ostrcat(input, "#", 1, 0);
867        input = ostrcat(input, menutitle, 1, 0);
868        input = ostrcat(input, "#", 1, 0);
869        input = ostrcat(input, oitoa(flag), 1, 1);
870       
871        tmpstr = readfiletomem(getconfig("tithek_fav", NULL), 0);
872       
873        ret = strsplit(tmpstr, "\n", &count);
874
875        if(ret != NULL)
876        {
877                for(i = 0; i < count; i++)
878                {
879                        if(ostrcmp((ret[i]).part, input) != 0)
880                        {
881                                tmpstr1 = ostrcat(tmpstr1, ret[i].part, 1, 0);
882                                tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0);
883                        }
884                        else
885                                printf("remove: %s\n", ret[i].part);
886                }
887        }
888
889        if(tmpstr1 != NULL && strlen(tmpstr1) > 0)
890                tmpstr1[strlen(tmpstr1) - 1] = '\0';
891
892        if(tmpstr1 == NULL)
893                writesys(getconfig("tithek_fav", NULL), "", 0);
894        else
895                writesys(getconfig("tithek_fav", NULL), tmpstr1, 0);
896
897        free(ret); ret = NULL;
898        free(tmpstr); tmpstr = NULL;
899        free(tmpstr1); tmpstr1 = NULL;
900        free(input); input = NULL;
901}
902
903void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
904{
905        int count = 0, i = 0;
906        char* tmpstr = NULL, *tmpstr1 = NULL, *input = NULL;
907        struct splitstr* ret = NULL;
908
909        input = ostrcat(input, title, 1, 0);
910        input = ostrcat(input, "#", 1, 0);
911        input = ostrcat(input, link, 1, 0);
912        input = ostrcat(input, "#", 1, 0);
913        input = ostrcat(input, pic, 1, 0);
914        input = ostrcat(input, "#", 1, 0);
915        input = ostrcat(input, localname, 1, 0);
916        input = ostrcat(input, "#", 1, 0);
917        input = ostrcat(input, menutitle, 1, 0);
918        input = ostrcat(input, "#", 1, 0);
919        input = ostrcat(input, oitoa(flag), 1, 1);
920        // tithek security
921        input = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", input, 1);
922       
923        tmpstr1 = ostrcat(tmpstr1, input, 1, 0);
924        tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0);
925
926        tmpstr = readfiletomem(getconfig("tithek_fav", NULL), 0);
927       
928        ret = strsplit(tmpstr, "\n", &count);
929
930        if(ret != NULL)
931        {
932                for(i = 0; i < count; i++)
933                {
934                        if(ostrcmp((ret[i]).part, input) != 0)
935                        {
936                                tmpstr1 = ostrcat(tmpstr1, ret[i].part, 1, 0);
937                                tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0);
938                        }
939                }
940        }
941
942        if(tmpstr1 != NULL && strlen(tmpstr1) > 0)
943                tmpstr1[strlen(tmpstr1) - 1] = '\0';
944
945        writesys(getconfig("tithek_fav", NULL), tmpstr1, 0);
946
947        free(ret); ret = NULL;
948        free(tmpstr); tmpstr = NULL;
949        free(tmpstr1); tmpstr1 = NULL;
950        free(input); input = NULL;
951}
952
953void cacheplay(char* link, char* filename, int flag)
954{
955        struct skin* load = getscreen("loadingproz");
956        struct skin* proztext = getscreennode(load, "proztext");
957
958        drawscreen(load, 0, 0);
959        int port = 80, count = 0, mcount = 0;
960        off64_t size = 0, msize = 0;
961        char* host = NULL, *pos = NULL, *path = NULL, *file = NULL, *tmpstr = NULL;
962        host = string_replace("http://", "", (char*)link, 0);
963
964        if(host != NULL)
965                pos = strchr(host, '/');
966        if(pos != NULL)
967        {
968                pos[0] = '\0';
969                path = pos + 1;
970        }
971
972        file = ostrcat(getconfig("rec_streampath", NULL), "/.cache.", 0, 0);
973        file = ostrcat(file, filename, 1, 0);
974
975        if(ostrstr(host, ":") != NULL)
976        {
977                host = oregex("http://(.*):.*", link);
978                port = atoi(oregex("http://.*:(.*)/.*", link));
979        }
980
981        debug(99, "---------------------------------------");
982        debug(99, "link: %s", link);
983        debug(99, "---------------------------------------");
984        debug(99, "host: %s", host);
985        debug(99, "port: %d", port);
986        debug(99, "path: %s", path);
987        debug(99, "local: %s", file);
988        debug(99, "---------------------------------------");
989       
990       
991        struct download* dnode = NULL;
992        dnode = calloc(1, sizeof(struct download));
993        if(dnode == NULL)
994        {
995                err("no mem");
996                return;
997        }               
998        dnode->host = host;
999        dnode->page = path;
1000        dnode->port = port;
1001        dnode->filename = file;
1002        dnode->auth = NULL;
1003        dnode->connfd = -1;
1004        dnode->ret = -1;
1005        dnode->timeout = 30000;
1006       
1007        addtimer(&gethttpstruct, START, 1000, 1, (void*)dnode, NULL, NULL);
1008
1009        if(flag == 1)
1010        {
1011                mcount = 120;
1012                msize = 10485760;
1013        }
1014        else if(flag == 2)
1015        {
1016                mcount = 240;
1017                msize = 20971520;
1018        }
1019        else if(flag == 3)
1020        {
1021                mcount = 360;
1022                msize = 31457280;
1023        }
1024                       
1025        while(count < mcount || size >= msize)
1026        {
1027                sleep(1);
1028                count++;
1029                if(file_exist(file))
1030                        size = getfilesize(file);
1031
1032                int proz = 0;
1033                int proz1 = size * 100 / msize;
1034                debug(99, "size (%dprozent)", proz1);
1035
1036                int proz2 = count * 100 / mcount;
1037                debug(99, "time (%dprozent)", proz2);
1038               
1039                if(proz1 > proz2)
1040                        proz = proz1;
1041                else
1042                        proz = proz2;
1043
1044                debug(99, "cacheing...(%lldkb) (%dprozent)", size / 1024, proz);
1045
1046                if(size >= msize)
1047                        break;
1048                if(count >= mcount)
1049                        break;
1050               
1051                tmpstr = ostrcat(_("please wait..."), " (", 0, 0);
1052                tmpstr = ostrcat(tmpstr, oitoa(proz), 1, 1);
1053                tmpstr = ostrcat(tmpstr, "%)", 1, 0);
1054                clearscreen(load);
1055                changetext(proztext, tmpstr);
1056                drawscreen(load, 0, 0);
1057                free(tmpstr), tmpstr = NULL;
1058        }
1059
1060        screenplay(file, filename, 2, 0);
1061        sockclose(&dnode->connfd);
1062        free(dnode); dnode = NULL;
1063
1064        tmpstr = ostrcat(tmpstr, _("Remove Cachefile ?"), 1, 0);
1065        tmpstr = ostrcat(tmpstr, "\n\n", 1, 0);
1066        tmpstr = ostrcat(tmpstr, file, 1, 0);
1067       
1068        if(textbox(_("Message"), tmpstr, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1)
1069        {
1070                unlink(file);
1071        }
1072        free(tmpstr), tmpstr = NULL;
1073        free(file), file = NULL;
1074        free(host), host = NULL;
1075}
1076
1077void backgrounddl(char* link, char* filename)
1078{
1079        int port = 80, ret = 0;
1080        char* host = NULL, *pos = NULL, *path = NULL, *file = NULL, *tmpstr = NULL;
1081        host = string_replace("http://", "", (char*)link, 0);
1082
1083        if(host != NULL)
1084                pos = strchr(host, '/');
1085        if(pos != NULL)
1086        {
1087                pos[0] = '\0';
1088                path = pos + 1;
1089        }
1090
1091        file = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0);
1092        file = ostrcat(file, filename, 1, 0);
1093
1094        if(ostrstr(host, ":") != NULL)
1095        {
1096                host = oregex("http://(.*):.*", link);
1097                port = atoi(oregex("http://.*:(.*)/.*", link));
1098        }
1099
1100        debug(99, "---------------------------------------");
1101        debug(99, "link: %s", link);
1102        debug(99, "---------------------------------------");
1103        debug(99, "host: %s", host);
1104        debug(99, "port: %d", port);
1105        debug(99, "path: %s", path);
1106        debug(99, "local: %s", file);
1107        debug(99, "---------------------------------------");
1108       
1109        ret = startbgdownload(host, path, port, file, NULL, 30000, 1);
1110        if(ret == 1)
1111                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);
1112                                       
1113        free(tmpstr), tmpstr = NULL;
1114        free(file), file = NULL;
1115        free(host), host = NULL;
1116}
1117       
1118void submenu(struct skin* listbox, struct skin* load, char* title)
1119{
1120        int flag = 0;
1121        if(status.security == 1 || checkbox("WHITEBOX") == 1)
1122        {
1123                drawscreen(load, 0, 0);
1124                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1125                char* tmpstr1 = NULL;
1126
1127                if(((struct tithek*)listbox->select->handle)->flag == 2)
1128                {
1129                        if(tmpstr != NULL) tmpstr1 = ostrcat(tmpstr, NULL, 0, 0);
1130                }                                               
1131                else if(((struct tithek*)listbox->select->handle)->flag == 4)
1132                {
1133                        if(tmpstr != NULL) tmpstr1 = youtube(tmpstr, NULL, NULL, 1);
1134                }                                               
1135                else if(((struct tithek*)listbox->select->handle)->flag == 5)
1136                {
1137                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl2now.rtl2.de", "rtl2now", 1);
1138                }
1139                else if(((struct tithek*)listbox->select->handle)->flag == 6)
1140                {
1141                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.superrtlnow.de", "superrtlnow", 1);
1142                }
1143                else if(((struct tithek*)listbox->select->handle)->flag == 7)
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 == 8)
1148                {
1149                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.voxnow.de", "voxnow", 1);
1150                }
1151                else if(((struct tithek*)listbox->select->handle)->flag == 12)
1152                {
1153                        if(tmpstr != NULL) tmpstr1 = myvideo(tmpstr, NULL, NULL, 1);
1154                }
1155                else if(((struct tithek*)listbox->select->handle)->flag == 14)
1156                {
1157                        if(tmpstr != NULL) tmpstr1 = kinox(tmpstr);
1158                }
1159                else if(((struct tithek*)listbox->select->handle)->flag == 16)
1160                {
1161                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.superrtlnow.de", "superrtlnow", 1);
1162                }
1163                else if(((struct tithek*)listbox->select->handle)->flag == 17)
1164                {
1165                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl-now.rtl.de", "rtlnow", 1);
1166                }
1167                else if(((struct tithek*)listbox->select->handle)->flag == 18)
1168                {
1169                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.voxnow.de", "voxnow", 1);
1170                }
1171                else if(((struct tithek*)listbox->select->handle)->flag == 19)
1172                {
1173                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl2now.rtl2.de", "rtl2now", 1);
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                free(tmpstr); tmpstr = NULL;
1204
1205                if(ostrstr(title, "Internet Radio") != NULL)
1206                        flag = 4;
1207
1208                if(ostrstr(tmpstr1, "&") != NULL)
1209                {
1210                        printf("change streamurl from: %s\n", tmpstr1);
1211                        tmpstr1 = string_replace_all("&amp;", "&", tmpstr1, 1);
1212                        printf("change streamurl to: %s\n", tmpstr1);
1213                }
1214               
1215                if(tmpstr1 != NULL)
1216                {
1217                        char* filename = ostrcat(title, "_", 0, 0);
1218                        filename = ostrcat(filename, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1219                        filename = ostrcat(filename, ".mp4", 1, 0);
1220                        filename = string_replace_all(" ", ".", filename, 1);
1221                        filename = string_replace_all("-", "_", filename, 1);
1222                        filename = string_replace_all("._.", "_", filename, 1);
1223                        debug(99, "filename: %s", filename);
1224                               
1225                        char* keyconf = NULL;
1226                        char* skintitle = _("Choice Playback");
1227                        struct menulist* mlist = NULL, *mbox = NULL;
1228
1229                        // needed for autopo
1230                        char* tmptxt = NULL;
1231                        tmptxt = ostrcat(tmptxt, _("Streaming Playback (default)"), 1, 0);
1232                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (0.5MB)"), 1, 0);
1233                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (1MB)"), 1, 0);
1234                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (2MB)"), 1, 0);
1235                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (3MB)"), 1, 0);
1236                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (4MB)"), 1, 0);
1237                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (5MB)"), 1, 0);
1238                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (7.5MB)"), 1, 0);
1239                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (10MB)"), 1, 0);
1240                        tmptxt = ostrcat(tmptxt, _("File Caching Playback (10MB / 120s)"), 1, 0);
1241                        tmptxt = ostrcat(tmptxt, _("File Caching Playback (20MB / 240s)"), 1, 0);
1242                        tmptxt = ostrcat(tmptxt, _("File Caching Playback (30MB / 360s)"), 1, 0);
1243                        tmptxt = ostrcat(tmptxt, _("Download Full File"), 1, 0);
1244                        tmptxt = ostrcat(tmptxt, _("Download Full File (background)"), 1, 0);
1245                        free(tmptxt), tmptxt = NULL;
1246       
1247                        addmenulist(&mlist, "Streaming Playback (default)", NULL, NULL, 0, 0);
1248
1249                        if(!ostrncmp("http://", tmpstr1, 7))
1250                        {
1251                                if(flag == 4)
1252                                {
1253                                        addmenulist(&mlist, "Streaming Playback Caching (0.5MB)", NULL, NULL, 0, 0);
1254                                        addmenulist(&mlist, "Streaming Playback Caching (1MB)", NULL, NULL, 0, 0);
1255                                }       
1256                                else if(!ostrncmp("http://", tmpstr1, 7))
1257                                {
1258//                                      addmenulist(&mlist, "Streaming Playback Caching (1MB)", NULL, NULL, 0, 0);
1259//                                      addmenulist(&mlist, "Streaming Playback Caching (2MB)", NULL, NULL, 0, 0);
1260//                                      addmenulist(&mlist, "Streaming Playback Caching (3MB)", NULL, NULL, 0, 0);
1261//                                      addmenulist(&mlist, "Streaming Playback Caching (4MB)", NULL, NULL, 0, 0);
1262                                        addmenulist(&mlist, "Streaming Playback Caching (5MB)", NULL, NULL, 0, 0);
1263                                        addmenulist(&mlist, "Streaming Playback Caching (7.5MB)", NULL, NULL, 0, 0);
1264                                        addmenulist(&mlist, "Streaming Playback Caching (10MB)", NULL, NULL, 0, 0);
1265                                        if(file_exist(getconfig("rec_streampath", NULL)))
1266                                        {
1267//                                              addmenulist(&mlist, "File Caching Playback (10MB / 120s)", NULL, NULL, 0, 0);
1268//                                              addmenulist(&mlist, "File Caching Playback (20MB / 240s)", NULL, NULL, 0, 0);
1269//                                              addmenulist(&mlist, "File Caching Playback (30MB / 360s)", NULL, NULL, 0, 0);
1270                                                if(status.expertmodus >= 11 || file_exist("/mnt/swapextensions/etc/.codecpack") || file_exist("/var/swap/etc/.codecpack") || file_exist("/var/etc/.codecpack"))
1271                                                {
1272                                                        addmenulist(&mlist, "Download Full File", NULL, NULL, 0, 0);
1273                                                        addmenulist(&mlist, "Download Full File (background)", NULL, NULL, 0, 0);
1274                                                }
1275                                        }
1276                                }
1277                        }
1278                        mbox = menulistbox(mlist, NULL, skintitle, NULL, NULL, 1, 0);
1279                        if(mbox != NULL) keyconf = mbox->name;
1280                        debug(99, "tmpstr1: %s filename: %s flag: %d", tmpstr1, filename, flag);
1281                        if(ostrcmp(keyconf, "Streaming Playback (default)") == 0)
1282                        {
1283                                addconfigtmp("playerbuffersize", "0");
1284                                screenplay(tmpstr1, filename, 2, flag);
1285                                delconfigtmp("playerbuffersize");
1286                        }
1287                        else if(ostrcmp(keyconf, "Streaming Playback Caching (0.5MB)") == 0)
1288                        {
1289                                addconfigtmp("playerbuffersize", "524288");
1290                                screenplay(tmpstr1, filename, 2, flag);
1291                                delconfigtmp("playerbuffersize");
1292                        }
1293                        else if(ostrcmp(keyconf, "Streaming Playback Caching (1MB)") == 0)
1294                        {
1295                                addconfigtmp("playerbuffersize", "1048576");
1296                                screenplay(tmpstr1, filename, 2, flag);
1297                                delconfigtmp("playerbuffersize");
1298                        }
1299                        else if(ostrcmp(keyconf, "Streaming Playback Caching (2MB)") == 0)
1300                        {
1301                                addconfigtmp("playerbuffersize", "2097152");
1302                                screenplay(tmpstr1, filename, 2, flag);
1303                                delconfigtmp("playerbuffersize");
1304                        }
1305                        else if(ostrcmp(keyconf, "Streaming Playback Caching (3MB)") == 0)
1306                        {
1307                                addconfigtmp("playerbuffersize", "3145728");
1308                                screenplay(tmpstr1, filename, 2, flag);
1309                                delconfigtmp("playerbuffersize");
1310                        }
1311                        else if(ostrcmp(keyconf, "Streaming Playback Caching (4MB)") == 0)
1312                        {
1313                                addconfigtmp("playerbuffersize", "4194304");
1314                                screenplay(tmpstr1, filename, 2, flag);
1315                                delconfigtmp("playerbuffersize");
1316                        }
1317                        else if(ostrcmp(keyconf, "Streaming Playback Caching (5MB)") == 0)
1318                        {
1319                                addconfigtmp("playerbuffersize", "5242880");
1320                                screenplay(tmpstr1, filename, 2, flag);
1321                                delconfigtmp("playerbuffersize");
1322                        }
1323                        else if(ostrcmp(keyconf, "Streaming Playback Caching (7.5MB)") == 0)
1324                        {
1325                                addconfigtmp("playerbuffersize", "7864320");
1326                                screenplay(tmpstr1, filename, 2, flag);
1327                                delconfigtmp("playerbuffersize");
1328                        }
1329                        else if(ostrcmp(keyconf, "Streaming Playback Caching (10MB)") == 0)
1330                        {
1331                                addconfigtmp("playerbuffersize", "10485760");
1332                                screenplay(tmpstr1, filename, 2, flag);
1333                                delconfigtmp("playerbuffersize");
1334                        }
1335                        else if(ostrcmp(keyconf, "File Caching Playback (10MB / 120s)") == 0)
1336                        {
1337                                cacheplay(tmpstr1, filename, 1);
1338                        }
1339                        else if(ostrcmp(keyconf, "File Caching Playback (20MB / 240s)") == 0)
1340                        {
1341                                cacheplay(tmpstr1, filename, 2);
1342                        }
1343                        else if(ostrcmp(keyconf, "File Caching Playback (30MB / 360s)") == 0)
1344                        {
1345                                cacheplay(tmpstr1, filename, 3);
1346                        }
1347                        else if(ostrcmp(keyconf, "Download Full File") == 0)
1348                        {
1349                                char* search = textinput(_("Filename"), filename);
1350                                if(search != NULL)
1351                                {       
1352                                        char* tmpstr2 = tithekdownload(tmpstr1, search, NULL, 0, 1);
1353//                                              drawscreen(grid, 0, 0);
1354                                        free(tmpstr2); tmpstr2 = NULL;
1355                               
1356                                        if(textbox(_("Message"), _("Start playback"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1)
1357                                        {
1358                                                tmpstr2 = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0);
1359                                                tmpstr2 = ostrcat(tmpstr2, search, 1, 0);
1360                                                screenplay(tmpstr2, filename, 2, flag);
1361                                                free(tmpstr2); tmpstr2 = NULL;
1362                                        }
1363                                }
1364                                free(search), search = NULL;
1365                        }
1366                        else if(ostrcmp(keyconf, "Download Full File (background)") == 0)
1367                        {
1368                                char* search = textinput(_("Filename"), filename);
1369                                if(search != NULL)
1370                                        backgrounddl(tmpstr1, search);
1371                                free(search), search = NULL;
1372                        }
1373                         
1374                        free(filename), filename = NULL;
1375                        freemenulist(mlist, 1); mlist = NULL;
1376                }
1377                else
1378                        textbox(_("Message"), _("Can't get Streamurl !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0);
1379               
1380                free(tmpstr1); tmpstr1 = NULL;
1381        }
1382        else
1383                textbox(_("Message"), _("Registration needed, please contact Atemio !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 200, 0, 0);
1384}
1385
1386void screentithekplay(char* titheklink, char* title, int first)
1387{
1388        if(!file_exist("/mnt/swapextensions/player"))
1389                mkdir("/mnt/swapextensions/player", 0777);
1390
1391        char* disclaimer = NULL;
1392        disclaimer = ostrcat(disclaimer, "/mnt/swapextensions/player/tithek_disclaimer_accepted", 1, 0);
1393                               
1394        if(!file_exist(disclaimer))
1395        {
1396                char* tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/disclaimer.txt", 80, NULL, HTTPAUTH, 5000, NULL, 0);
1397                if(textbox(_("TitanNit Tithek disclaimer"), _(tmpstr), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1100, 650, 0, 0) == 1)
1398                {
1399                        writesys(disclaimer, tmpstr, 0);                               
1400                        free(tmpstr), tmpstr = NULL;
1401                }
1402                else
1403                {
1404                        free(tmpstr), tmpstr = NULL;
1405                        free(disclaimer), disclaimer = NULL;
1406                        return;
1407                }
1408        }
1409        free(disclaimer), disclaimer = NULL;
1410
1411        int rcret = -1, oaktline = 1, oaktpage = -1, ogridcol = 0, pagecount = 0;
1412
1413        writesysint("/proc/sys/vm/drop_caches", 3, 0);
1414       
1415        if(first == 1)
1416        {
1417                mkdir("/tmp/tithek", 777);
1418                if(status.mcaktiv == 0)
1419                {
1420                        rcret = servicestop(status.aktservice, 1, 1);
1421                        if(rcret == 1) return;
1422                }
1423        }
1424
1425        struct skin* grid = getscreen("titheklist");
1426        struct skin* listbox = getscreennode(grid, "listbox");
1427        struct skin* countlabel = getscreennode(grid, "countlabel");
1428        struct skin* countpage = getscreennode(grid, "countpage");
1429        struct skin* b5 = getscreennode(grid, "b4");
1430        struct skin* b4 = getscreennode(grid, "b5");
1431        struct skin* load = getscreen("loading");
1432        struct skin* tmp = NULL;
1433        char* tithekpic = NULL;
1434
1435        b4->hidden = YES;
1436        b5->hidden = YES;
1437
1438
1439        if (ostrcmp(title, "TiThek - Favoriten") == 0)
1440        {
1441                b4->hidden = NO;
1442                b5->hidden = YES;
1443        }
1444        else
1445        {
1446                b4->hidden = YES;
1447                b5->hidden = NO;
1448        }
1449       
1450        drawscreen(load, 0, 0);
1451       
1452        if(titheklink == NULL) return;
1453       
1454        listbox->aktpage = -1;
1455        listbox->aktline = 1;
1456        listbox->gridcol = 0;
1457        listbox->select = NULL;
1458
1459        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, first);
1460        if(pagecount == 0) return;
1461
1462        changetitle(grid, _(title));
1463        drawscreen(grid, 0, 0);
1464        addscreenrc(grid, listbox);
1465                               
1466        while(1)
1467        {
1468                changetitle(grid, _(title));
1469                changetext(countpage, NULL);
1470                if(listbox->select != NULL && listbox->select->handle != NULL)
1471                {
1472                        tmp = listbox->select;
1473                        while(tmp != NULL)
1474                        {
1475
1476                                if(tmp->pagecount != listbox->aktpage) break;
1477
1478                                char* tmpstr = ostrcat(_("Page"), NULL, 0, 0);
1479                                tmpstr = ostrcat(tmpstr, " ( ", 1, 0);
1480                                tmpstr = ostrcat(tmpstr, oitoa(tmp->pagecount), 1, 1);
1481                                tmpstr = ostrcat(tmpstr, " / ", 1, 0);
1482                                tmpstr = ostrcat(tmpstr, oitoa(pagecount), 1, 1);
1483                                tmpstr = ostrcat(tmpstr, " )", 1, 0);
1484                                changetext(countpage, tmpstr);
1485                                free(tmpstr); tmpstr = NULL;
1486        printf("111111\n");
1487                                if(tmp->handle != NULL && getconfigint("tithek_view", NULL) != 6 && getconfigint("tithek_cover", NULL) != 6)
1488                                {
1489        printf("222222\n");
1490
1491                                        tithekpic = tithekdownload(((struct tithek*)tmp->handle)->pic, ((struct tithek*)tmp->handle)->localname, "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0=", 1, 0);
1492
1493                                        /* not working with thread download
1494                                        off64_t checkpic = getfilesize(tithekpic);
1495                       
1496                                        if(checkpic < 1000)
1497                                        {
1498                                                free(tithekpic); tithekpic = NULL;
1499                                                tithekpic = ostrcat("/var/usr/local/share/titan/plugins/tithek/default.jpg", NULL, 0, 0);
1500                                        }
1501                                        */
1502                       
1503                                        changepic(tmp, tithekpic);
1504                                        free(tithekpic); tithekpic = NULL;
1505                                }
1506                                tmp = tmp->prev;
1507                        }
1508                        tmp = listbox->select;
1509                        if(tmp != NULL) tmp = tmp->next;
1510                        while(tmp != NULL)
1511                        {
1512                       
1513        printf("333333\n");
1514
1515                                if(tmp->pagecount != listbox->aktpage) break;
1516                                if(tmp->handle != NULL && getconfigint("tithek_view", NULL) != 6 && getconfigint("tithek_cover", NULL) != 6)
1517                                {
1518        printf("444444\n");
1519
1520                                        tithekpic = tithekdownload(((struct tithek*)tmp->handle)->pic, ((struct tithek*)tmp->handle)->localname, "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0=", 1, 0);
1521
1522                                        /* not working with thread download
1523                                        off64_t checkpic = getfilesize(tithekpic);
1524
1525                                        if(checkpic < 1000)
1526                                        {
1527                                                free(tithekpic); tithekpic = NULL;
1528                                                tithekpic = ostrcat("/var/usr/local/share/titan/plugins/tithek/default.jpg", NULL, 0, 0);
1529                                        }
1530                                        */
1531
1532                                        changepic(tmp, tithekpic);
1533                                        free(tithekpic); tithekpic = NULL;
1534                                }
1535                                tmp = tmp->next;
1536                        }
1537                }
1538               
1539                int count = getfilecount(TITHEKPATH);
1540                if(count > 500)
1541                        delallfiles(TITHEKPATH, ".jpg");
1542
1543                drawscreen(grid, 0, 0);
1544waitrcstart:
1545                rcret = waitrc(grid, 2000, 2);
1546
1547                if(rcret == RCTIMEOUT)
1548                {
1549                        if(tithekdownloadrun == 1)
1550                        {
1551                                tithekdownloadrun = 0;
1552                                drawscreen(grid, 0, 0);
1553                        }
1554                        goto waitrcstart;
1555                }
1556
1557                if(rcret == getrcconfigint("rcblue", NULL))
1558                {
1559                        tithekexit = 1;
1560                        break;
1561                }
1562
1563                if(rcret == getrcconfigint("rcexit", NULL)) break;
1564                if(rcret == getrcconfigint("rcmenu", NULL))
1565                {
1566                        screentithek_settings();
1567
1568                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, first);
1569                        if(pagecount == 0 || tithekexit == 1) break;
1570
1571                        listbox->aktpage = -1;
1572                        listbox->aktline = 1;
1573                        listbox->gridcol = 1;
1574                        addscreenrc(grid, listbox);
1575                        drawscreen(grid, 0, 0);
1576                }
1577
1578                if (ostrcmp(title, "TiThek - Favoriten") == 0)
1579                {
1580                        b4->hidden = NO;
1581                        b5->hidden = YES;
1582                }
1583                else
1584                {
1585                        b4->hidden = YES;
1586                        b5->hidden = NO;
1587                }
1588
1589                if(rcret == getrcconfigint("rcred", NULL))
1590                {
1591                        if(listbox->select != NULL && listbox->select->handle != NULL)
1592                        {
1593
1594                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->title, NULL, 0, 0);
1595                                debug(99, "tmpstr: %s", tmpstr);
1596                                tmpstr = string_replace("-1 (de)", "", tmpstr, 1);
1597                                tmpstr = string_replace("-1 (en)", "", tmpstr, 1);
1598                                tmpstr = string_replace("-1 (\?\?)", "", tmpstr, 1);
1599                                tmpstr = string_replace("-2 (de)", "", tmpstr, 1);
1600                                tmpstr = string_replace("-2 (en)", "", tmpstr, 1);
1601                                tmpstr = string_replace("-2 (\?\?)", "", tmpstr, 1);
1602                                tmpstr = string_replace("-3 (de)", "", tmpstr, 1);
1603                                tmpstr = string_replace("-3 (en)", "", tmpstr, 1);
1604                                tmpstr = string_replace("-3 (\?\?)", "", tmpstr, 1);
1605                                tmpstr = string_replace(" (de)", "", tmpstr, 1);
1606                                tmpstr = string_replace(" (en)", "", tmpstr, 1);
1607                                tmpstr = string_replace(" (\?\?)", "", tmpstr, 1);
1608                                tmpstr = string_replace_all("_", " ", tmpstr, 1);
1609                                tmpstr = string_replace_all("-", " ", tmpstr, 1);
1610                                tmpstr = string_replace_all(".", " ", tmpstr, 1);                               
1611                                debug(99, "tmpstr: %s", tmpstr);
1612
1613                                int check = playrcred(tmpstr, NULL, 1, 0, 99);
1614                                if(check == 2)
1615                                {
1616                                        if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search", tmpstr, 0) == 0)
1617                                        {
1618                                                oaktpage = listbox->aktpage;
1619                                                oaktline = listbox->aktline;
1620                                                ogridcol = listbox->gridcol;
1621                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1622                                                char* tmpstr1 = ostrcat("KinoX - Search", " - ", 0, 0);
1623                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1624                                                screentithekplay(tmpstr, tmpstr2, 0);
1625                                                free(tmpstr); tmpstr = NULL;
1626                                                free(tmpstr2); tmpstr2 = NULL;
1627                       
1628                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1629                                                if(pagecount == 0 || tithekexit == 1) break;
1630
1631                                                listbox->aktpage = oaktpage;
1632                                                listbox->aktline = oaktline;
1633                                                listbox->gridcol = ogridcol;
1634                                                addscreenrc(grid, listbox);
1635                                        }
1636                                }
1637                                else if(check == 3)
1638                                {
1639                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "SolarMovies - Movie - Search", tmpstr, 0) == 0)
1640                                        {
1641                                                oaktpage = listbox->aktpage;
1642                                                oaktline = listbox->aktline;
1643                                                ogridcol = listbox->gridcol;
1644                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1645                                                char* tmpstr1 = ostrcat("SolarMovies - Movie - Search", " - ", 0, 0);
1646                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1647                                                screentithekplay(tmpstr, tmpstr2, 0);
1648                                                free(tmpstr); tmpstr = NULL;
1649                                                free(tmpstr2); tmpstr2 = NULL;
1650                       
1651                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1652                                                if(pagecount == 0 || tithekexit == 1) break;
1653
1654                                                listbox->aktpage = oaktpage;
1655                                                listbox->aktline = oaktline;
1656                                                listbox->gridcol = ogridcol;
1657                                                addscreenrc(grid, listbox);
1658                                        }
1659                                }
1660                                else if(check == 4)
1661                                {
1662                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "SolarMovies - Tv - Search", tmpstr, 1) == 0)
1663                                        {
1664                                                oaktpage = listbox->aktpage;
1665                                                oaktline = listbox->aktline;
1666                                                ogridcol = listbox->gridcol;
1667                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1668                                                char* tmpstr1 = ostrcat("SolarMovies - Tv - Search", " - ", 0, 0);
1669                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1670                                                screentithekplay(tmpstr, tmpstr2, 0);
1671                                                free(tmpstr); tmpstr = NULL;
1672                                                free(tmpstr2); tmpstr2 = NULL;
1673                       
1674                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1675                                                if(pagecount == 0 || tithekexit == 1) break;
1676
1677                                                listbox->aktpage = oaktpage;
1678                                                listbox->aktline = oaktline;
1679                                                listbox->gridcol = ogridcol;
1680                                                addscreenrc(grid, listbox);
1681                                        }
1682                                }
1683                                else if(check == 5)
1684                                {
1685                                        if(youtube_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Youtube - Search", tmpstr) == 0)
1686                                        {
1687                                                oaktpage = listbox->aktpage;
1688                                                oaktline = listbox->aktline;
1689                                                ogridcol = listbox->gridcol;
1690                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1691                                                char* tmpstr1 = ostrcat("Youtube - Search", " - ", 0, 0);
1692                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1693                                                screentithekplay(tmpstr, tmpstr2, 0);
1694                                                free(tmpstr); tmpstr = NULL;
1695                                                free(tmpstr2); tmpstr2 = NULL;
1696                       
1697                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1698                                                if(pagecount == 0 || tithekexit == 1) break;
1699
1700                                                listbox->aktpage = oaktpage;
1701                                                listbox->aktline = oaktline;
1702                                                listbox->gridcol = ogridcol;
1703                                                addscreenrc(grid, listbox);
1704                                        }
1705                                }
1706                                else if(check == 6)
1707                                {
1708                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "MyVideo - Search", tmpstr, 0) == 0)
1709                                        {
1710                                                oaktpage = listbox->aktpage;
1711                                                oaktline = listbox->aktline;
1712                                                ogridcol = listbox->gridcol;
1713                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1714                                                char* tmpstr1 = ostrcat("MyVideo - Search", " - ", 0, 0);
1715                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1716                                                screentithekplay(tmpstr, tmpstr2, 0);
1717                                                free(tmpstr); tmpstr = NULL;
1718                                                free(tmpstr2); tmpstr2 = NULL;
1719                       
1720                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1721                                                if(pagecount == 0 || tithekexit == 1) break;
1722
1723                                                listbox->aktpage = oaktpage;
1724                                                listbox->aktline = oaktline;
1725                                                listbox->gridcol = ogridcol;
1726                                                addscreenrc(grid, listbox);
1727                                        }
1728                                }
1729                                else if(check == 7)
1730                                {
1731                                        if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search", tmpstr, 0) == 0)
1732                                        {
1733                                                oaktpage = listbox->aktpage;
1734                                                oaktline = listbox->aktline;
1735                                                ogridcol = listbox->gridcol;
1736                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1737                                                char* tmpstr1 = ostrcat("Movie4k - Search", " - ", 0, 0);
1738                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1739                                                screentithekplay(tmpstr, tmpstr2, 0);
1740                                                free(tmpstr); tmpstr = NULL;
1741                                                free(tmpstr2); tmpstr2 = NULL;
1742                       
1743                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1744                                                if(pagecount == 0 || tithekexit == 1) break;
1745
1746                                                listbox->aktpage = oaktpage;
1747                                                listbox->aktline = oaktline;
1748                                                listbox->gridcol = ogridcol;
1749                                                addscreenrc(grid, listbox);
1750                                        }
1751                                }
1752                                else if(check == 8)
1753                                {
1754                                        if(kinox_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search (local)", tmpstr, 0) == 0)
1755                                        {
1756                                                oaktpage = listbox->aktpage;
1757                                                oaktline = listbox->aktline;
1758                                                ogridcol = listbox->gridcol;
1759                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1760                                                char* tmpstr1 = ostrcat("KinoX - Search (local)", " - ", 0, 0);
1761                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1762                                                screentithekplay(tmpstr, tmpstr2, 0);
1763                                                free(tmpstr); tmpstr = NULL;
1764                                                free(tmpstr2); tmpstr2 = NULL;
1765                       
1766                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1767                                                if(pagecount == 0 || tithekexit == 1) break;
1768
1769                                                listbox->aktpage = oaktpage;
1770                                                listbox->aktline = oaktline;
1771                                                listbox->gridcol = ogridcol;
1772                                                addscreenrc(grid, listbox);
1773                                        }
1774                                }
1775                                else if(check == 9)
1776                                {
1777                                        if(solarmovie_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Solarmovies - Search (local)", tmpstr, 0) == 0)
1778                                        {
1779                                                oaktpage = listbox->aktpage;
1780                                                oaktline = listbox->aktline;
1781                                                ogridcol = listbox->gridcol;
1782                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1783                                                char* tmpstr1 = ostrcat("Solarmovies - Search (local)", " - ", 0, 0);
1784                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1785                                                screentithekplay(tmpstr, tmpstr2, 0);
1786                                                free(tmpstr); tmpstr = NULL;
1787                                                free(tmpstr2); tmpstr2 = NULL;
1788                       
1789                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1790                                                if(pagecount == 0 || tithekexit == 1) break;
1791
1792                                                listbox->aktpage = oaktpage;
1793                                                listbox->aktline = oaktline;
1794                                                listbox->gridcol = ogridcol;
1795                                                addscreenrc(grid, listbox);
1796                                        }
1797                                }
1798                                else if(check == 10)
1799                                {
1800                                        if(youtube_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Youtube - Search (local)", tmpstr, 0) == 0)
1801                                        {
1802                                                oaktpage = listbox->aktpage;
1803                                                oaktline = listbox->aktline;
1804                                                ogridcol = listbox->gridcol;
1805                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1806                                                char* tmpstr1 = ostrcat("Youtube - Search (local)", " - ", 0, 0);
1807                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1808                                                screentithekplay(tmpstr, tmpstr2, 0);
1809                                                free(tmpstr); tmpstr = NULL;
1810                                                free(tmpstr2); tmpstr2 = NULL;
1811                       
1812                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1813                                                if(pagecount == 0 || tithekexit == 1) break;
1814
1815                                                listbox->aktpage = oaktpage;
1816                                                listbox->aktline = oaktline;
1817                                                listbox->gridcol = ogridcol;
1818                                                addscreenrc(grid, listbox);
1819                                        }
1820                                }
1821                                else if(check == 11)
1822                                {
1823                                        if(myvideo_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "MyVideo - Search (local)", tmpstr, 0) == 0)
1824                                        {
1825                                                oaktpage = listbox->aktpage;
1826                                                oaktline = listbox->aktline;
1827                                                ogridcol = listbox->gridcol;
1828                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1829                                                char* tmpstr1 = ostrcat("MyVideo - Search (local)", " - ", 0, 0);
1830                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1831                                                screentithekplay(tmpstr, tmpstr2, 0);
1832                                                free(tmpstr); tmpstr = NULL;
1833                                                free(tmpstr2); tmpstr2 = NULL;
1834                       
1835                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1836                                                if(pagecount == 0 || tithekexit == 1) break;
1837
1838                                                listbox->aktpage = oaktpage;
1839                                                listbox->aktline = oaktline;
1840                                                listbox->gridcol = ogridcol;
1841                                                addscreenrc(grid, listbox);
1842                                        }
1843                                }
1844                                else if(check == 12)
1845                                {
1846                                        if(movie4k_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Movie4k - Search (local)", tmpstr, 0) == 0)
1847                                        {
1848                                                oaktpage = listbox->aktpage;
1849                                                oaktline = listbox->aktline;
1850                                                ogridcol = listbox->gridcol;
1851                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1852                                                char* tmpstr1 = ostrcat("Movie4k - Search (local)", " - ", 0, 0);
1853                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1854                                                screentithekplay(tmpstr, tmpstr2, 0);
1855                                                free(tmpstr); tmpstr = NULL;
1856                                                free(tmpstr2); tmpstr2 = NULL;
1857                       
1858                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1859                                                if(pagecount == 0 || tithekexit == 1) break;
1860
1861                                                listbox->aktpage = oaktpage;
1862                                                listbox->aktline = oaktline;
1863                                                listbox->gridcol = ogridcol;
1864                                                addscreenrc(grid, listbox);
1865                                        }
1866                                }
1867                                else if(check == 13)
1868                                {
1869                                        if(internetradio_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Internetradio - Search (local)", tmpstr, 0) == 0)
1870                                        {
1871                                                oaktpage = listbox->aktpage;
1872                                                oaktline = listbox->aktline;
1873                                                ogridcol = listbox->gridcol;
1874                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1875                                                char* tmpstr1 = ostrcat("Internetradio - Search (local)", " - ", 0, 0);
1876                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1877                                                screentithekplay(tmpstr, tmpstr2, 0);
1878                                                free(tmpstr); tmpstr = NULL;
1879                                                free(tmpstr2); tmpstr2 = NULL;
1880                       
1881                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1882                                                if(pagecount == 0 || tithekexit == 1) break;
1883
1884                                                listbox->aktpage = oaktpage;
1885                                                listbox->aktline = oaktline;
1886                                                listbox->gridcol = ogridcol;
1887                                                addscreenrc(grid, listbox);
1888                                        }
1889                                }
1890                                else if(check == 14)
1891                                {
1892                                        if(internettv_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Internettv - Search (local)", tmpstr, 0) == 0)
1893                                        {
1894                                                oaktpage = listbox->aktpage;
1895                                                oaktline = listbox->aktline;
1896                                                ogridcol = listbox->gridcol;
1897                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1898                                                char* tmpstr1 = ostrcat("Internettv - Search (local)", " - ", 0, 0);
1899                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1900                                                screentithekplay(tmpstr, tmpstr2, 0);
1901                                                free(tmpstr); tmpstr = NULL;
1902                                                free(tmpstr2); tmpstr2 = NULL;
1903                       
1904                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1905                                                if(pagecount == 0 || tithekexit == 1) break;
1906
1907                                                listbox->aktpage = oaktpage;
1908                                                listbox->aktline = oaktline;
1909                                                listbox->gridcol = ogridcol;
1910                                                addscreenrc(grid, listbox);
1911                                        }
1912                                }
1913                                else if(check == 15)
1914                                {
1915                                        if(ard_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "ARD - Search (local)", tmpstr, 0) == 0)
1916                                        {
1917                                                oaktpage = listbox->aktpage;
1918                                                oaktline = listbox->aktline;
1919                                                ogridcol = listbox->gridcol;
1920                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1921                                                char* tmpstr1 = ostrcat("ARD - Search (local)", " - ", 0, 0);
1922                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1923                                                screentithekplay(tmpstr, tmpstr2, 0);
1924                                                free(tmpstr); tmpstr = NULL;
1925                                                free(tmpstr2); tmpstr2 = NULL;
1926                       
1927                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1928                                                if(pagecount == 0 || tithekexit == 1) break;
1929
1930                                                listbox->aktpage = oaktpage;
1931                                                listbox->aktline = oaktline;
1932                                                listbox->gridcol = ogridcol;
1933                                                addscreenrc(grid, listbox);
1934                                        }
1935                                }
1936                                else if(check == 16)
1937                                {
1938                                        if(zdf_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "ZDF - Search (local)", tmpstr, 0) == 0)
1939                                        {
1940                                                oaktpage = listbox->aktpage;
1941                                                oaktline = listbox->aktline;
1942                                                ogridcol = listbox->gridcol;
1943                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1944                                                char* tmpstr1 = ostrcat("ZDF - Search (local)", " - ", 0, 0);
1945                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1946                                                screentithekplay(tmpstr, tmpstr2, 0);
1947                                                free(tmpstr); tmpstr = NULL;
1948                                                free(tmpstr2); tmpstr2 = NULL;
1949                       
1950                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1951                                                if(pagecount == 0 || tithekexit == 1) break;
1952
1953                                                listbox->aktpage = oaktpage;
1954                                                listbox->aktline = oaktline;
1955                                                listbox->gridcol = ogridcol;
1956                                                addscreenrc(grid, listbox);
1957                                        }
1958                                }
1959                                else if(check == 17)
1960                                {
1961                                        if(tectime_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "TecTime - Search (local)", tmpstr, 0) == 0)
1962                                        {
1963                                                oaktpage = listbox->aktpage;
1964                                                oaktline = listbox->aktline;
1965                                                ogridcol = listbox->gridcol;
1966                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1967                                                char* tmpstr1 = ostrcat("TecTime - Search (local)", " - ", 0, 0);
1968                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1969                                                screentithekplay(tmpstr, tmpstr2, 0);
1970                                                free(tmpstr); tmpstr = NULL;
1971                                                free(tmpstr2); tmpstr2 = NULL;
1972                       
1973                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1974                                                if(pagecount == 0 || tithekexit == 1) break;
1975
1976                                                listbox->aktpage = oaktpage;
1977                                                listbox->aktline = oaktline;
1978                                                listbox->gridcol = ogridcol;
1979                                                addscreenrc(grid, listbox);
1980                                        }
1981                                }
1982                                else if(check == 18)
1983                                {
1984                                        if(giga_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Giga - Search (local)", tmpstr, 0) == 0)
1985                                        {
1986                                                oaktpage = listbox->aktpage;
1987                                                oaktline = listbox->aktline;
1988                                                ogridcol = listbox->gridcol;
1989                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1990                                                char* tmpstr1 = ostrcat("Giga - Search (local)", " - ", 0, 0);
1991                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1992                                                screentithekplay(tmpstr, tmpstr2, 0);
1993                                                free(tmpstr); tmpstr = NULL;
1994                                                free(tmpstr2); tmpstr2 = NULL;
1995                       
1996                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1997                                                if(pagecount == 0 || tithekexit == 1) break;
1998
1999                                                listbox->aktpage = oaktpage;
2000                                                listbox->aktline = oaktline;
2001                                                listbox->gridcol = ogridcol;
2002                                                addscreenrc(grid, listbox);
2003                                        }
2004                                }
2005                                else if(check == 19)
2006                                {
2007                                        if(beeg_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Beeg - Search (local)", tmpstr, 0) == 0)
2008                                        {
2009                                                oaktpage = listbox->aktpage;
2010                                                oaktline = listbox->aktline;
2011                                                ogridcol = listbox->gridcol;
2012                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2013                                                char* tmpstr1 = ostrcat("Beeg - Search (local)", " - ", 0, 0);
2014                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2015                                                screentithekplay(tmpstr, tmpstr2, 0);
2016                                                free(tmpstr); tmpstr = NULL;
2017                                                free(tmpstr2); tmpstr2 = NULL;
2018                       
2019                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2020                                                if(pagecount == 0 || tithekexit == 1) break;
2021
2022                                                listbox->aktpage = oaktpage;
2023                                                listbox->aktline = oaktline;
2024                                                listbox->gridcol = ogridcol;
2025                                                addscreenrc(grid, listbox);
2026                                        }
2027                                }
2028                                else if(check == 20)
2029                                {
2030                                        if(rtl2now_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Rtl2Now - Search (local)", tmpstr, 0) == 0)
2031                                        {
2032                                                oaktpage = listbox->aktpage;
2033                                                oaktline = listbox->aktline;
2034                                                ogridcol = listbox->gridcol;
2035                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2036                                                char* tmpstr1 = ostrcat("Rtl2Now - Search (local)", " - ", 0, 0);
2037                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2038                                                screentithekplay(tmpstr, tmpstr2, 0);
2039                                                free(tmpstr); tmpstr = NULL;
2040                                                free(tmpstr2); tmpstr2 = NULL;
2041                       
2042                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2043                                                if(pagecount == 0 || tithekexit == 1) break;
2044
2045                                                listbox->aktpage = oaktpage;
2046                                                listbox->aktline = oaktline;
2047                                                listbox->gridcol = ogridcol;
2048                                                addscreenrc(grid, listbox);
2049                                        }
2050                                }
2051                                else if(check == 21)
2052                                {
2053                                        if(rtlnow_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Rtl-Now - Search (local)", tmpstr, 0) == 0)
2054                                        {
2055                                                oaktpage = listbox->aktpage;
2056                                                oaktline = listbox->aktline;
2057                                                ogridcol = listbox->gridcol;
2058                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2059                                                char* tmpstr1 = ostrcat("Rtl-Now - Search (local)", " - ", 0, 0);
2060                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2061                                                screentithekplay(tmpstr, tmpstr2, 0);
2062                                                free(tmpstr); tmpstr = NULL;
2063                                                free(tmpstr2); tmpstr2 = NULL;
2064                       
2065                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2066                                                if(pagecount == 0 || tithekexit == 1) break;
2067
2068                                                listbox->aktpage = oaktpage;
2069                                                listbox->aktline = oaktline;
2070                                                listbox->gridcol = ogridcol;
2071                                                addscreenrc(grid, listbox);
2072                                        }
2073                                }
2074                                else if(check == 22)
2075                                {
2076                                        if(superrtlnow_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "SuperRtlNow - Search (local)", tmpstr, 0) == 0)
2077                                        {
2078                                                oaktpage = listbox->aktpage;
2079                                                oaktline = listbox->aktline;
2080                                                ogridcol = listbox->gridcol;
2081                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2082                                                char* tmpstr1 = ostrcat("SuperRtlNow - Search (local)", " - ", 0, 0);
2083                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2084                                                screentithekplay(tmpstr, tmpstr2, 0);
2085                                                free(tmpstr); tmpstr = NULL;
2086                                                free(tmpstr2); tmpstr2 = NULL;
2087                       
2088                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2089                                                if(pagecount == 0 || tithekexit == 1) break;
2090
2091                                                listbox->aktpage = oaktpage;
2092                                                listbox->aktline = oaktline;
2093                                                listbox->gridcol = ogridcol;
2094                                                addscreenrc(grid, listbox);
2095                                        }
2096                                }
2097                                else if(check == 23)
2098                                {
2099                                        if(voxnow_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "VoxNow - Search (local)", tmpstr, 0) == 0)
2100                                        {
2101                                                oaktpage = listbox->aktpage;
2102                                                oaktline = listbox->aktline;
2103                                                ogridcol = listbox->gridcol;
2104                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2105                                                char* tmpstr1 = ostrcat("VoxNow - Search (local)", " - ", 0, 0);
2106                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2107                                                screentithekplay(tmpstr, tmpstr2, 0);
2108                                                free(tmpstr); tmpstr = NULL;
2109                                                free(tmpstr2); tmpstr2 = NULL;
2110                       
2111                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2112                                                if(pagecount == 0 || tithekexit == 1) break;
2113
2114                                                listbox->aktpage = oaktpage;
2115                                                listbox->aktline = oaktline;
2116                                                listbox->gridcol = ogridcol;
2117                                                addscreenrc(grid, listbox);
2118                                        }
2119                                }
2120                                else if(check == 24)
2121                                {
2122                                        if(xvideos_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Xvideos - Search (local)", tmpstr, 0) == 0)
2123                                        {
2124                                                oaktpage = listbox->aktpage;
2125                                                oaktline = listbox->aktline;
2126                                                ogridcol = listbox->gridcol;
2127                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2128                                                char* tmpstr1 = ostrcat("Xvideos - Search (local)", " - ", 0, 0);
2129                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2130                                                screentithekplay(tmpstr, tmpstr2, 0);
2131                                                free(tmpstr); tmpstr = NULL;
2132                                                free(tmpstr2); tmpstr2 = NULL;
2133                       
2134                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2135                                                if(pagecount == 0 || tithekexit == 1) break;
2136
2137                                                listbox->aktpage = oaktpage;
2138                                                listbox->aktline = oaktline;
2139                                                listbox->gridcol = ogridcol;
2140                                                addscreenrc(grid, listbox);
2141                                        }
2142                                }
2143                                else if(check == 25)
2144                                {
2145                                        if(mlehd_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Mle-HD - Search (local)", tmpstr, 0) == 0)
2146                                        {
2147                                                oaktpage = listbox->aktpage;
2148                                                oaktline = listbox->aktline;
2149                                                ogridcol = listbox->gridcol;
2150                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2151                                                char* tmpstr1 = ostrcat("Mle-HD - Search (local)", " - ", 0, 0);
2152                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2153                                                screentithekplay(tmpstr, tmpstr2, 0);
2154                                                free(tmpstr); tmpstr = NULL;
2155                                                free(tmpstr2); tmpstr2 = NULL;
2156                       
2157                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2158                                                if(pagecount == 0 || tithekexit == 1) break;
2159
2160                                                listbox->aktpage = oaktpage;
2161                                                listbox->aktline = oaktline;
2162                                                listbox->gridcol = ogridcol;
2163                                                addscreenrc(grid, listbox);
2164                                        }
2165                                }
2166                                else if(check == 26)
2167                                {
2168                                        if(netzkino_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Netzkino - Search (local)", tmpstr, 0) == 0)
2169                                        {
2170                                                oaktpage = listbox->aktpage;
2171                                                oaktline = listbox->aktline;
2172                                                ogridcol = listbox->gridcol;
2173                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2174                                                char* tmpstr1 = ostrcat("Netzkino - Search (local)", " - ", 0, 0);
2175                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2176                                                screentithekplay(tmpstr, tmpstr2, 0);
2177                                                free(tmpstr); tmpstr = NULL;
2178                                                free(tmpstr2); tmpstr2 = NULL;
2179                       
2180                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2181                                                if(pagecount == 0 || tithekexit == 1) break;
2182
2183                                                listbox->aktpage = oaktpage;
2184                                                listbox->aktline = oaktline;
2185                                                listbox->gridcol = ogridcol;
2186                                                addscreenrc(grid, listbox);
2187                                        }
2188                                }
2189/*
2190why ?
2191                                else if((((struct tithek*)listbox->select->handle)->flag == 13))
2192                                {
2193                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "MyVideo - Search", tmpstr, 0) == 0)
2194                                        {
2195                                                oaktpage = listbox->aktpage;
2196                                                oaktline = listbox->aktline;
2197                                                ogridcol = listbox->gridcol;
2198                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2199                                                char* tmpstr1 = ostrcat("MyVideo - Search", " - ", 0, 0);
2200                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2201                                                screentithekplay(tmpstr, tmpstr2, 0);
2202                                                free(tmpstr); tmpstr = NULL;
2203                                                free(tmpstr2); tmpstr2 = NULL;
2204                       
2205                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2206                                                if(pagecount == 0 || tithekexit == 1) break;
2207
2208                                                listbox->aktpage = oaktpage;
2209                                                listbox->aktline = oaktline;
2210                                                listbox->gridcol = ogridcol;
2211                                                addscreenrc(grid, listbox);
2212                                        }
2213                                }
2214*/
2215                                free(tmpstr), tmpstr = NULL;
2216                        }
2217                }
2218                else if(rcret == getrcconfigint("rcok", NULL))
2219                {
2220                        if(listbox->select != NULL && listbox->select->handle != NULL)
2221                        {
2222                                clearscreen(grid);
2223
2224                                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 == 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))
2225                                {
2226                                        submenu(listbox, load, title);
2227                                        drawscreen(grid, 0, 0);
2228                                }
2229                                else if((((struct tithek*)listbox->select->handle)->flag == 9) || (((struct tithek*)listbox->select->handle)->flag == 10) || (((struct tithek*)listbox->select->handle)->flag == 11))
2230                                {
2231                                        if(youtube_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL) == 0)
2232                                        {
2233                                                oaktpage = listbox->aktpage;
2234                                                oaktline = listbox->aktline;
2235                                                ogridcol = listbox->gridcol;
2236                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2237                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2238                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2239                                                screentithekplay(tmpstr, tmpstr2, 0);
2240                                                free(tmpstr); tmpstr = NULL;
2241                                                free(tmpstr2); tmpstr2 = NULL;
2242                       
2243                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2244                                                if(pagecount == 0 || tithekexit == 1) break;
2245
2246                                                listbox->aktpage = oaktpage;
2247                                                listbox->aktline = oaktline;
2248                                                listbox->gridcol = ogridcol;
2249                                                addscreenrc(grid, listbox);
2250                                        }
2251                                }
2252                                else if(((struct tithek*)listbox->select->handle)->flag == 13)
2253                                {
2254                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2255                                        {
2256                                                oaktpage = listbox->aktpage;
2257                                                oaktline = listbox->aktline;
2258                                                ogridcol = listbox->gridcol;
2259                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2260                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2261                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2262                                                screentithekplay(tmpstr, tmpstr2, 0);
2263                                                free(tmpstr); tmpstr = NULL;
2264                                                free(tmpstr2); tmpstr2 = NULL;
2265                       
2266                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2267                                                if(pagecount == 0 || tithekexit == 1) break;
2268
2269                                                listbox->aktpage = oaktpage;
2270                                                listbox->aktline = oaktline;
2271                                                listbox->gridcol = ogridcol;
2272                                                addscreenrc(grid, listbox);
2273                                        }
2274                                }
2275                                else if(((struct tithek*)listbox->select->handle)->flag == 24)
2276                                {
2277                                        if(internetradio_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2278                                        {
2279                                                oaktpage = listbox->aktpage;
2280                                                oaktline = listbox->aktline;
2281                                                ogridcol = listbox->gridcol;
2282                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2283                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2284                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2285                                                screentithekplay(tmpstr, tmpstr2, 0);
2286                                                free(tmpstr); tmpstr = NULL;
2287                                                free(tmpstr2); tmpstr2 = NULL;
2288                       
2289                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2290                                                if(pagecount == 0 || tithekexit == 1) break;
2291
2292                                                listbox->aktpage = oaktpage;
2293                                                listbox->aktline = oaktline;
2294                                                listbox->gridcol = ogridcol;
2295                                                addscreenrc(grid, listbox);
2296                                        }
2297                                }
2298                                else if(((struct tithek*)listbox->select->handle)->flag == 25)
2299                                {
2300                                        if(kinox_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2301                                        {
2302                                                oaktpage = listbox->aktpage;
2303                                                oaktline = listbox->aktline;
2304                                                ogridcol = listbox->gridcol;
2305                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2306                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2307                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2308                                                screentithekplay(tmpstr, tmpstr2, 0);
2309                                                free(tmpstr); tmpstr = NULL;
2310                                                free(tmpstr2); tmpstr2 = NULL;
2311                       
2312                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2313                                                if(pagecount == 0 || tithekexit == 1) break;
2314
2315                                                listbox->aktpage = oaktpage;
2316                                                listbox->aktline = oaktline;
2317                                                listbox->gridcol = ogridcol;
2318                                                addscreenrc(grid, listbox);
2319                                        }
2320                                }
2321                                else if(((struct tithek*)listbox->select->handle)->flag == 26)
2322                                {
2323                                        if(movie4k_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2324                                        {
2325                                                oaktpage = listbox->aktpage;
2326                                                oaktline = listbox->aktline;
2327                                                ogridcol = listbox->gridcol;
2328                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2329                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2330                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2331                                                screentithekplay(tmpstr, tmpstr2, 0);
2332                                                free(tmpstr); tmpstr = NULL;
2333                                                free(tmpstr2); tmpstr2 = NULL;
2334                       
2335                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2336                                                if(pagecount == 0 || tithekexit == 1) break;
2337
2338                                                listbox->aktpage = oaktpage;
2339                                                listbox->aktline = oaktline;
2340                                                listbox->gridcol = ogridcol;
2341                                                addscreenrc(grid, listbox);
2342                                        }
2343                                }
2344                                else if(((struct tithek*)listbox->select->handle)->flag == 27)
2345                                {
2346                                        if(solarmovie_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2347                                        {
2348                                                oaktpage = listbox->aktpage;
2349                                                oaktline = listbox->aktline;
2350                                                ogridcol = listbox->gridcol;
2351                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2352                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2353                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2354                                                screentithekplay(tmpstr, tmpstr2, 0);
2355                                                free(tmpstr); tmpstr = NULL;
2356                                                free(tmpstr2); tmpstr2 = NULL;
2357                       
2358                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2359                                                if(pagecount == 0 || tithekexit == 1) break;
2360
2361                                                listbox->aktpage = oaktpage;
2362                                                listbox->aktline = oaktline;
2363                                                listbox->gridcol = ogridcol;
2364                                                addscreenrc(grid, listbox);
2365                                        }
2366                                }
2367                                else if(((struct tithek*)listbox->select->handle)->flag == 47)
2368                                {
2369                                        if(internettv_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2370                                        {
2371                                                oaktpage = listbox->aktpage;
2372                                                oaktline = listbox->aktline;
2373                                                ogridcol = listbox->gridcol;
2374                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2375                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2376                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2377                                                screentithekplay(tmpstr, tmpstr2, 0);
2378                                                free(tmpstr); tmpstr = NULL;
2379                                                free(tmpstr2); tmpstr2 = NULL;
2380                       
2381                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2382                                                if(pagecount == 0 || tithekexit == 1) break;
2383
2384                                                listbox->aktpage = oaktpage;
2385                                                listbox->aktline = oaktline;
2386                                                listbox->gridcol = ogridcol;
2387                                                addscreenrc(grid, listbox);
2388                                        }
2389                                }
2390                                else if(((struct tithek*)listbox->select->handle)->flag == 48)
2391                                {
2392                                        if(youtube_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2393                                        {
2394                                                oaktpage = listbox->aktpage;
2395                                                oaktline = listbox->aktline;
2396                                                ogridcol = listbox->gridcol;
2397                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2398                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2399                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2400                                                screentithekplay(tmpstr, tmpstr2, 0);
2401                                                free(tmpstr); tmpstr = NULL;
2402                                                free(tmpstr2); tmpstr2 = NULL;
2403                       
2404                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2405                                                if(pagecount == 0 || tithekexit == 1) break;
2406
2407                                                listbox->aktpage = oaktpage;
2408                                                listbox->aktline = oaktline;
2409                                                listbox->gridcol = ogridcol;
2410                                                addscreenrc(grid, listbox);
2411                                        }
2412                                }
2413                                else if(((struct tithek*)listbox->select->handle)->flag == 49)
2414                                {
2415                                        if(myvideo_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2416                                        {
2417                                                oaktpage = listbox->aktpage;
2418                                                oaktline = listbox->aktline;
2419                                                ogridcol = listbox->gridcol;
2420                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2421                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2422                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2423                                                screentithekplay(tmpstr, tmpstr2, 0);
2424                                                free(tmpstr); tmpstr = NULL;
2425                                                free(tmpstr2); tmpstr2 = NULL;
2426                       
2427                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2428                                                if(pagecount == 0 || tithekexit == 1) break;
2429
2430                                                listbox->aktpage = oaktpage;
2431                                                listbox->aktline = oaktline;
2432                                                listbox->gridcol = ogridcol;
2433                                                addscreenrc(grid, listbox);
2434                                        }
2435                                }
2436                                else if(((struct tithek*)listbox->select->handle)->flag == 51)
2437                                {
2438                                        if(ard_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2439                                        {
2440                                                oaktpage = listbox->aktpage;
2441                                                oaktline = listbox->aktline;
2442                                                ogridcol = listbox->gridcol;
2443                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2444                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2445                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2446                                                screentithekplay(tmpstr, tmpstr2, 0);
2447                                                free(tmpstr); tmpstr = NULL;
2448                                                free(tmpstr2); tmpstr2 = NULL;
2449                       
2450                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2451                                                if(pagecount == 0 || tithekexit == 1) break;
2452
2453                                                listbox->aktpage = oaktpage;
2454                                                listbox->aktline = oaktline;
2455                                                listbox->gridcol = ogridcol;
2456                                                addscreenrc(grid, listbox);
2457                                        }
2458                                }
2459                                else if(((struct tithek*)listbox->select->handle)->flag == 52)
2460                                {
2461                                        if(zdf_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2462                                        {
2463                                                oaktpage = listbox->aktpage;
2464                                                oaktline = listbox->aktline;
2465                                                ogridcol = listbox->gridcol;
2466                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2467                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2468                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2469                                                screentithekplay(tmpstr, tmpstr2, 0);
2470                                                free(tmpstr); tmpstr = NULL;
2471                                                free(tmpstr2); tmpstr2 = NULL;
2472                       
2473                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2474                                                if(pagecount == 0 || tithekexit == 1) break;
2475
2476                                                listbox->aktpage = oaktpage;
2477                                                listbox->aktline = oaktline;
2478                                                listbox->gridcol = ogridcol;
2479                                                addscreenrc(grid, listbox);
2480                                        }
2481                                }
2482                                else if(((struct tithek*)listbox->select->handle)->flag == 53)
2483                                {
2484                                        if(tectime_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2485                                        {
2486                                                oaktpage = listbox->aktpage;
2487                                                oaktline = listbox->aktline;
2488                                                ogridcol = listbox->gridcol;
2489                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2490                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2491                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2492                                                screentithekplay(tmpstr, tmpstr2, 0);
2493                                                free(tmpstr); tmpstr = NULL;
2494                                                free(tmpstr2); tmpstr2 = NULL;
2495                       
2496                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2497                                                if(pagecount == 0 || tithekexit == 1) break;
2498
2499                                                listbox->aktpage = oaktpage;
2500                                                listbox->aktline = oaktline;
2501                                                listbox->gridcol = ogridcol;
2502                                                addscreenrc(grid, listbox);
2503                                        }
2504                                }
2505                                else if(((struct tithek*)listbox->select->handle)->flag == 54)
2506                                {
2507                                        if(giga_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2508                                        {
2509                                                oaktpage = listbox->aktpage;
2510                                                oaktline = listbox->aktline;
2511                                                ogridcol = listbox->gridcol;
2512                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2513                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2514                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2515                                                screentithekplay(tmpstr, tmpstr2, 0);
2516                                                free(tmpstr); tmpstr = NULL;
2517                                                free(tmpstr2); tmpstr2 = NULL;
2518                       
2519                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2520                                                if(pagecount == 0 || tithekexit == 1) break;
2521
2522                                                listbox->aktpage = oaktpage;
2523                                                listbox->aktline = oaktline;
2524                                                listbox->gridcol = ogridcol;
2525                                                addscreenrc(grid, listbox);
2526                                        }
2527                                }
2528                                else if(((struct tithek*)listbox->select->handle)->flag == 55)
2529                                {
2530                                        if(beeg_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2531                                        {
2532                                                oaktpage = listbox->aktpage;
2533                                                oaktline = listbox->aktline;
2534                                                ogridcol = listbox->gridcol;
2535                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2536                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2537                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2538                                                screentithekplay(tmpstr, tmpstr2, 0);
2539                                                free(tmpstr); tmpstr = NULL;
2540                                                free(tmpstr2); tmpstr2 = NULL;
2541                       
2542                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2543                                                if(pagecount == 0 || tithekexit == 1) break;
2544
2545                                                listbox->aktpage = oaktpage;
2546                                                listbox->aktline = oaktline;
2547                                                listbox->gridcol = ogridcol;
2548                                                addscreenrc(grid, listbox);
2549                                        }
2550                                }
2551                                else if(((struct tithek*)listbox->select->handle)->flag == 56)
2552                                {
2553                                        if(rtl2now_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2554                                        {
2555                                                oaktpage = listbox->aktpage;
2556                                                oaktline = listbox->aktline;
2557                                                ogridcol = listbox->gridcol;
2558                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2559                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2560                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2561                                                screentithekplay(tmpstr, tmpstr2, 0);
2562                                                free(tmpstr); tmpstr = NULL;
2563                                                free(tmpstr2); tmpstr2 = NULL;
2564                       
2565                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2566                                                if(pagecount == 0 || tithekexit == 1) break;
2567
2568                                                listbox->aktpage = oaktpage;
2569                                                listbox->aktline = oaktline;
2570                                                listbox->gridcol = ogridcol;
2571                                                addscreenrc(grid, listbox);
2572                                        }
2573                                }
2574                                else if(((struct tithek*)listbox->select->handle)->flag == 57)
2575                                {
2576                                        if(rtlnow_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2577                                        {
2578                                                oaktpage = listbox->aktpage;
2579                                                oaktline = listbox->aktline;
2580                                                ogridcol = listbox->gridcol;
2581                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2582                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2583                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2584                                                screentithekplay(tmpstr, tmpstr2, 0);
2585                                                free(tmpstr); tmpstr = NULL;
2586                                                free(tmpstr2); tmpstr2 = NULL;
2587                       
2588                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2589                                                if(pagecount == 0 || tithekexit == 1) break;
2590
2591                                                listbox->aktpage = oaktpage;
2592                                                listbox->aktline = oaktline;
2593                                                listbox->gridcol = ogridcol;
2594                                                addscreenrc(grid, listbox);
2595                                        }
2596                                }
2597                                else if(((struct tithek*)listbox->select->handle)->flag == 58)
2598                                {
2599                                        if(superrtlnow_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2600                                        {
2601                                                oaktpage = listbox->aktpage;
2602                                                oaktline = listbox->aktline;
2603                                                ogridcol = listbox->gridcol;
2604                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2605                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2606                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2607                                                screentithekplay(tmpstr, tmpstr2, 0);
2608                                                free(tmpstr); tmpstr = NULL;
2609                                                free(tmpstr2); tmpstr2 = NULL;
2610                       
2611                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2612                                                if(pagecount == 0 || tithekexit == 1) break;
2613
2614                                                listbox->aktpage = oaktpage;
2615                                                listbox->aktline = oaktline;
2616                                                listbox->gridcol = ogridcol;
2617                                                addscreenrc(grid, listbox);
2618                                        }
2619                                }
2620                                else if(((struct tithek*)listbox->select->handle)->flag == 59)
2621                                {
2622                                        if(voxnow_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2623                                        {
2624                                                oaktpage = listbox->aktpage;
2625                                                oaktline = listbox->aktline;
2626                                                ogridcol = listbox->gridcol;
2627                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2628                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2629                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2630                                                screentithekplay(tmpstr, tmpstr2, 0);
2631                                                free(tmpstr); tmpstr = NULL;
2632                                                free(tmpstr2); tmpstr2 = NULL;
2633                       
2634                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2635                                                if(pagecount == 0 || tithekexit == 1) break;
2636
2637                                                listbox->aktpage = oaktpage;
2638                                                listbox->aktline = oaktline;
2639                                                listbox->gridcol = ogridcol;
2640                                                addscreenrc(grid, listbox);
2641                                        }
2642                                }
2643                                else if(((struct tithek*)listbox->select->handle)->flag == 60)
2644                                {
2645                                        if(xvideos_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2646                                        {
2647                                                oaktpage = listbox->aktpage;
2648                                                oaktline = listbox->aktline;
2649                                                ogridcol = listbox->gridcol;
2650                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2651                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2652                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2653                                                screentithekplay(tmpstr, tmpstr2, 0);
2654                                                free(tmpstr); tmpstr = NULL;
2655                                                free(tmpstr2); tmpstr2 = NULL;
2656                       
2657                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2658                                                if(pagecount == 0 || tithekexit == 1) break;
2659
2660                                                listbox->aktpage = oaktpage;
2661                                                listbox->aktline = oaktline;
2662                                                listbox->gridcol = ogridcol;
2663                                                addscreenrc(grid, listbox);
2664                                        }
2665                                }
2666                                else if(((struct tithek*)listbox->select->handle)->flag == 61)
2667                                {
2668                                        if(mlehd_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2669                                        {
2670                                                oaktpage = listbox->aktpage;
2671                                                oaktline = listbox->aktline;
2672                                                ogridcol = listbox->gridcol;
2673                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2674                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2675                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2676                                                screentithekplay(tmpstr, tmpstr2, 0);
2677                                                free(tmpstr); tmpstr = NULL;
2678                                                free(tmpstr2); tmpstr2 = NULL;
2679                       
2680                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2681                                                if(pagecount == 0 || tithekexit == 1) break;
2682
2683                                                listbox->aktpage = oaktpage;
2684                                                listbox->aktline = oaktline;
2685                                                listbox->gridcol = ogridcol;
2686                                                addscreenrc(grid, listbox);
2687                                        }
2688                                }
2689                                else if(((struct tithek*)listbox->select->handle)->flag == 62)
2690                                {
2691                                        if(netzkino_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2692                                        {
2693                                                oaktpage = listbox->aktpage;
2694                                                oaktline = listbox->aktline;
2695                                                ogridcol = listbox->gridcol;
2696                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2697                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2698                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2699                                                screentithekplay(tmpstr, tmpstr2, 0);
2700                                                free(tmpstr); tmpstr = NULL;
2701                                                free(tmpstr2); tmpstr2 = NULL;
2702                       
2703                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2704                                                if(pagecount == 0 || tithekexit == 1) break;
2705
2706                                                listbox->aktpage = oaktpage;
2707                                                listbox->aktline = oaktline;
2708                                                listbox->gridcol = ogridcol;
2709                                                addscreenrc(grid, listbox);
2710                                        }
2711                                }
2712                                else if(((struct tithek*)listbox->select->handle)->flag == 44)
2713                                {
2714                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
2715                                        {
2716                                                oaktpage = listbox->aktpage;
2717                                                oaktline = listbox->aktline;
2718                                                ogridcol = listbox->gridcol;
2719                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2720                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2721                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2722                                                screentithekplay(tmpstr, tmpstr2, 0);
2723                                                free(tmpstr); tmpstr = NULL;
2724                                                free(tmpstr2); tmpstr2 = NULL;
2725                       
2726                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2727                                                if(pagecount == 0 || tithekexit == 1) break;
2728
2729                                                listbox->aktpage = oaktpage;
2730                                                listbox->aktline = oaktline;
2731                                                listbox->gridcol = ogridcol;
2732                                                addscreenrc(grid, listbox);
2733                                        }
2734                                }
2735                                else if((((struct tithek*)listbox->select->handle)->flag == 21))
2736                                {
2737                                        if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2738                                        {
2739                                                oaktpage = listbox->aktpage;
2740                                                oaktline = listbox->aktline;
2741                                                ogridcol = listbox->gridcol;
2742                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2743                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2744                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2745                                                screentithekplay(tmpstr, tmpstr2, 0);
2746                                                free(tmpstr); tmpstr = NULL;
2747                                                free(tmpstr2); tmpstr2 = NULL;
2748
2749                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2750                                                if(pagecount == 0 || tithekexit == 1) break;
2751
2752                                                listbox->aktpage = oaktpage;
2753                                                listbox->aktline = oaktline;
2754                                                listbox->gridcol = ogridcol;
2755                                                addscreenrc(grid, listbox);
2756                                        }
2757                                }
2758                                else if((((struct tithek*)listbox->select->handle)->flag == 33))
2759                                {
2760                                        if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2761                                        {
2762                                                oaktpage = listbox->aktpage;
2763                                                oaktline = listbox->aktline;
2764                                                ogridcol = listbox->gridcol;
2765                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2766                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2767                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2768                                                screentithekplay(tmpstr, tmpstr2, 0);
2769                                                free(tmpstr); tmpstr = NULL;
2770                                                free(tmpstr2); tmpstr2 = NULL;
2771
2772                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2773                                                if(pagecount == 0 || tithekexit == 1) break;
2774
2775                                                listbox->aktpage = oaktpage;
2776                                                listbox->aktline = oaktline;
2777                                                listbox->gridcol = ogridcol;
2778                                                addscreenrc(grid, listbox);
2779                                        }
2780                                }                               
2781                                else if(((struct tithek*)listbox->select->handle)->flag == 29)
2782                                {
2783                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2784                                        {
2785                                                oaktpage = listbox->aktpage;
2786                                                oaktline = listbox->aktline;
2787                                                ogridcol = listbox->gridcol;
2788                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2789                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2790                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2791                                                screentithekplay(tmpstr, tmpstr2, 0);
2792                                                free(tmpstr); tmpstr = NULL;
2793                                                free(tmpstr2); tmpstr2 = NULL;
2794
2795                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2796                                                if(pagecount == 0 || tithekexit == 1) break;
2797
2798                                                listbox->aktpage = oaktpage;
2799                                                listbox->aktline = oaktline;
2800                                                listbox->gridcol = ogridcol;
2801                                                addscreenrc(grid, listbox);
2802                                        }
2803                                }
2804                                else if(((struct tithek*)listbox->select->handle)->flag == 30)
2805                                {
2806                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
2807                                        {
2808                                                oaktpage = listbox->aktpage;
2809                                                oaktline = listbox->aktline;
2810                                                ogridcol = listbox->gridcol;
2811                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2812                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2813                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2814                                                screentithekplay(tmpstr, tmpstr2, 0);
2815                                                free(tmpstr); tmpstr = NULL;
2816                                                free(tmpstr2); tmpstr2 = NULL;
2817
2818                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2819                                                if(pagecount == 0 || tithekexit == 1) break;
2820
2821                                                listbox->aktpage = oaktpage;
2822                                                listbox->aktline = oaktline;
2823                                                listbox->gridcol = ogridcol;
2824                                                addscreenrc(grid, listbox);
2825                                        }
2826                                }
2827                                else if((((struct tithek*)listbox->select->handle)->flag == 31))
2828                                {
2829                                        if(kinox_search_cast(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL) == 0)
2830                                        {
2831                                                oaktpage = listbox->aktpage;
2832                                                oaktline = listbox->aktline;
2833                                                ogridcol = listbox->gridcol;
2834                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2835                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2836                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2837                                                screentithekplay(tmpstr, tmpstr2, 0);
2838                                                free(tmpstr); tmpstr = NULL;
2839                                                free(tmpstr2); tmpstr2 = NULL;
2840
2841                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2842                                                if(pagecount == 0 || tithekexit == 1) break;
2843
2844                                                listbox->aktpage = oaktpage;
2845                                                listbox->aktline = oaktline;
2846                                                listbox->gridcol = ogridcol;
2847                                                addscreenrc(grid, listbox);
2848                                        }
2849                                }
2850                                else if((((struct tithek*)listbox->select->handle)->flag == 32))
2851                                {
2852                                        if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
2853                                        {
2854                                                oaktpage = listbox->aktpage;
2855                                                oaktline = listbox->aktline;
2856                                                ogridcol = listbox->gridcol;
2857                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2858                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2859                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2860                                                screentithekplay(tmpstr, tmpstr2, 0);
2861                                                free(tmpstr); tmpstr = NULL;
2862                                                free(tmpstr2); tmpstr2 = NULL;
2863
2864                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2865                                                if(pagecount == 0 || tithekexit == 1) break;
2866
2867                                                listbox->aktpage = oaktpage;
2868                                                listbox->aktline = oaktline;
2869                                                listbox->gridcol = ogridcol;
2870                                                addscreenrc(grid, listbox);
2871                                        }
2872                                }
2873                                else if((((struct tithek*)listbox->select->handle)->flag == 33))
2874                                {
2875                                        if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
2876                                        {
2877                                                oaktpage = listbox->aktpage;
2878                                                oaktline = listbox->aktline;
2879                                                ogridcol = listbox->gridcol;
2880                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2881                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2882                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2883                                                screentithekplay(tmpstr, tmpstr2, 0);
2884                                                free(tmpstr); tmpstr = NULL;
2885                                                free(tmpstr2); tmpstr2 = NULL;
2886
2887                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 3);
2888                                                if(pagecount == 0 || tithekexit == 1) break;
2889
2890                                                listbox->aktpage = oaktpage;
2891                                                listbox->aktline = oaktline;
2892                                                listbox->gridcol = ogridcol;
2893                                                addscreenrc(grid, listbox);
2894                                        }
2895                                }
2896                                else if((((struct tithek*)listbox->select->handle)->flag == 34) || (((struct tithek*)listbox->select->handle)->flag == 35))
2897                                {
2898                                        if(movie4k_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2899                                        {
2900                                                oaktpage = listbox->aktpage;
2901                                                oaktline = listbox->aktline;
2902                                                ogridcol = listbox->gridcol;
2903                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2904                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2905                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2906                                                screentithekplay(tmpstr, tmpstr2, 0);
2907                                                free(tmpstr); tmpstr = NULL;
2908                                                free(tmpstr2); tmpstr2 = NULL;
2909
2910                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2911                                                if(pagecount == 0 || tithekexit == 1) break;
2912
2913                                                listbox->aktpage = oaktpage;
2914                                                listbox->aktline = oaktline;
2915                                                listbox->gridcol = ogridcol;
2916                                                addscreenrc(grid, listbox);
2917                                        }
2918                                }
2919                                else if((((struct tithek*)listbox->select->handle)->flag == 22))
2920                                {
2921                                        if(kinox_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2922                                        {
2923                                                oaktpage = listbox->aktpage;
2924                                                oaktline = listbox->aktline;
2925                                                ogridcol = listbox->gridcol;
2926                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2927                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2928                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2929                                                screentithekplay(tmpstr, tmpstr2, 0);
2930                                                free(tmpstr); tmpstr = NULL;
2931                                                free(tmpstr2); tmpstr2 = NULL;
2932
2933                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 3);
2934                                                if(pagecount == 0 || tithekexit == 1) break;
2935
2936                                                listbox->aktpage = oaktpage;
2937                                                listbox->aktline = oaktline;
2938                                                listbox->gridcol = ogridcol;
2939                                                addscreenrc(grid, listbox);
2940                                        }
2941                                }
2942                                else if((((struct tithek*)listbox->select->handle)->flag == 28))
2943                                {
2944                                        if(solarmovie_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2945                                        {
2946                                                oaktpage = listbox->aktpage;
2947                                                oaktline = listbox->aktline;
2948                                                ogridcol = listbox->gridcol;
2949                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2950                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2951                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2952                                                screentithekplay(tmpstr, tmpstr2, 0);
2953                                                free(tmpstr); tmpstr = NULL;
2954                                                free(tmpstr2); tmpstr2 = NULL;
2955                       
2956                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 3);
2957                                                if(pagecount == 0 || tithekexit == 1) break;
2958
2959                                                listbox->aktpage = oaktpage;
2960                                                listbox->aktline = oaktline;
2961                                                listbox->gridcol = ogridcol;
2962                                                addscreenrc(grid, listbox);
2963                                        }
2964                                }
2965                                else if((((struct tithek*)listbox->select->handle)->flag == 23))
2966                                {
2967                                        if(kinox_hoster_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2968                                        {
2969                                                oaktpage = listbox->aktpage;
2970                                                oaktline = listbox->aktline;
2971                                                ogridcol = listbox->gridcol;
2972                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2973                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2974                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2975                                                screentithekplay(tmpstr, tmpstr2, 0);
2976                                                free(tmpstr); tmpstr = NULL;
2977                                                free(tmpstr2); tmpstr2 = NULL;
2978                       
2979                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2980                                                if(pagecount == 0 || tithekexit == 1) break;
2981
2982                                                listbox->aktpage = oaktpage;
2983                                                listbox->aktline = oaktline;
2984                                                listbox->gridcol = ogridcol;
2985                                                addscreenrc(grid, listbox);
2986                                        }
2987                                }
2988                                else if((((struct tithek*)listbox->select->handle)->flag == 36) || (((struct tithek*)listbox->select->handle)->flag == 37))
2989                                {
2990                                        if(movie4k_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2991                                        {
2992                                                oaktpage = listbox->aktpage;
2993                                                oaktline = listbox->aktline;
2994                                                ogridcol = listbox->gridcol;
2995                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2996                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2997                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2998                                                screentithekplay(tmpstr, tmpstr2, 0);
2999                                                free(tmpstr); tmpstr = NULL;
3000                                                free(tmpstr2); tmpstr2 = NULL;
3001                       
3002                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3003                                                if(pagecount == 0 || tithekexit == 1) break;
3004
3005                                                listbox->aktpage = oaktpage;
3006                                                listbox->aktline = oaktline;
3007                                                listbox->gridcol = ogridcol;
3008                                                addscreenrc(grid, listbox);
3009                                        }
3010                                }
3011                                else if((((struct tithek*)listbox->select->handle)->flag == 39))
3012                                {
3013                                        if(movie4k_series_listed(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
3014                                        {
3015                                                oaktpage = listbox->aktpage;
3016                                                oaktline = listbox->aktline;
3017                                                ogridcol = listbox->gridcol;
3018                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
3019                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
3020                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
3021                                                screentithekplay(tmpstr, tmpstr2, 0);
3022                                                free(tmpstr); tmpstr = NULL;
3023                                                free(tmpstr2); tmpstr2 = NULL;
3024                       
3025                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3026                                                if(pagecount == 0 || tithekexit == 1) break;
3027
3028                                                listbox->aktpage = oaktpage;
3029                                                listbox->aktline = oaktline;
3030                                                listbox->gridcol = ogridcol;
3031                                                addscreenrc(grid, listbox);
3032                                        }
3033                                }
3034                                else if((((struct tithek*)listbox->select->handle)->flag == 40))
3035                                {
3036                                        if(movie4k_hoster_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
3037                                        {
3038                                                oaktpage = listbox->aktpage;
3039                                                oaktline = listbox->aktline;
3040                                                ogridcol = listbox->gridcol;
3041                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
3042                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
3043                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
3044                                                screentithekplay(tmpstr, tmpstr2, 0);
3045                                                free(tmpstr); tmpstr = NULL;
3046                                                free(tmpstr2); tmpstr2 = NULL;
3047                       
3048                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3049                                                if(pagecount == 0 || tithekexit == 1) break;
3050
3051                                                listbox->aktpage = oaktpage;
3052                                                listbox->aktline = oaktline;
3053                                                listbox->gridcol = ogridcol;
3054                                                addscreenrc(grid, listbox);
3055                                        }
3056                                }
3057                                else if((((struct tithek*)listbox->select->handle)->flag == 66))
3058                                {
3059                                        textbox(_("Message"), _("The hoster is not yet supported !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0);
3060                                        continue;
3061                                }       
3062                                else if((((struct tithek*)listbox->select->handle)->flag == 3))
3063                                {
3064                                        int pincheck = 0;
3065                                        if(((struct tithek*)listbox->select->handle)->flag == 1000)
3066                                                pincheck = screenpincheck(0, NULL);
3067                                        if(pincheck == 0)
3068                                        {
3069                                                oaktpage = listbox->aktpage;
3070                                                oaktline = listbox->aktline;
3071                                                ogridcol = listbox->gridcol;
3072                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
3073                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);                                     
3074                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
3075                                                screentithekplay(tmpstr, tmpstr2, 3);
3076                                                free(tmpstr); tmpstr = NULL;
3077                                                free(tmpstr2); tmpstr2 = NULL; 
3078
3079                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3080                                                if(pagecount == 0 || tithekexit == 1) break;
3081
3082                                                listbox->aktpage = oaktpage;
3083                                                listbox->aktline = oaktline;
3084                                                listbox->gridcol = ogridcol;
3085                                                addscreenrc(grid, listbox);
3086                                        }
3087                                }
3088                                else
3089                                {
3090                                        int pincheck = 0;
3091                                        if(((struct tithek*)listbox->select->handle)->flag == 1000)
3092                                                pincheck = screenpincheck(0, NULL);
3093                                        if(pincheck == 0)
3094                                        {
3095                                                oaktpage = listbox->aktpage;
3096                                                oaktline = listbox->aktline;
3097                                                ogridcol = listbox->gridcol;
3098                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
3099                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);                                     
3100                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
3101                                                screentithekplay(tmpstr, tmpstr2, 0);
3102                                               
3103                                                free(tmpstr); tmpstr = NULL;
3104                                                free(tmpstr2); tmpstr2 = NULL; 
3105
3106                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3107                                                if(pagecount == 0 || tithekexit == 1) break;
3108
3109                                                listbox->aktpage = oaktpage;
3110                                                listbox->aktline = oaktline;
3111                                                listbox->gridcol = ogridcol;
3112                                                addscreenrc(grid, listbox);
3113                                        }
3114                                }
3115                                drawscreen(grid, 0, 0);
3116                        }                       
3117                }
3118                else if(rcret == getrcconfigint("rcyellow", NULL) && ostrcmp(title, "TiThek - Favoriten") == 0)
3119                {
3120                        if(listbox->select != NULL && listbox->select->handle != NULL)
3121                        {
3122                                if(textbox(_("Message"), _("Remove this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0) == 1)
3123                                {
3124                                        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);             
3125                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3126                                        if(pagecount == 0) return;
3127                                               
3128                                        drawscreen(grid, 0, 0);
3129                                }
3130                        }
3131                }
3132                else if(rcret == getrcconfigint("rcgreen", NULL) && ostrcmp(title, "TiThek - Favoriten") != 0)
3133                {
3134                        if(listbox->select != NULL && listbox->select->handle != NULL)
3135                        {
3136                                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)
3137                                {
3138                                        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);         
3139                                }
3140                        }
3141                }
3142
3143                if (ostrcmp(title, "TiThek - Favoriten") == 0)
3144                {
3145                        b4->hidden = NO;
3146                        b5->hidden = YES;
3147                }
3148                else
3149                {
3150                        b4->hidden = YES;
3151                        b5->hidden = NO;
3152                }
3153        }
3154
3155        delmarkedscreennodes(grid, 1);
3156        delownerrc(grid);
3157        clearscreen(grid);
3158
3159        if(first == 1)
3160        {
3161                freetithek();
3162                delallfiles("/tmp/tithek", NULL);
3163                if(status.mcaktiv == 0)
3164                        servicecheckret(servicestart(status.lastservice->channel, NULL, NULL, 0), 0);
3165        }
3166}
3167
3168#endif
Note: See TracBrowser for help on using the repository browser.