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

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

ufs910 fix

File size: 110.7 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 editfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
954{
955        int rcret = 0, type = 0;
956        struct skin* tithekedit = getscreen("tithekedit");
957        struct skin* listbox = getscreennode(tithekedit, "listbox");
958        struct skin* skin_title = getscreennode(tithekedit, "title");
959        struct skin* skin_link = getscreennode(tithekedit, "link");
960        struct skin* skin_pic = getscreennode(tithekedit, "pic");
961        struct skin* skin_localname = getscreennode(tithekedit, "localname");
962        struct skin* skin_menutitle = getscreennode(tithekedit, "menutitle");
963        struct skin* skin_type = getscreennode(tithekedit, "type");
964
965        struct skin* tmp = NULL;
966        struct skin* load = getscreen("loading");
967
968        changeinput(skin_title, title);
969        changeinput(skin_link, link);
970        changeinput(skin_pic, pic);
971        changeinput(skin_localname, localname);
972        changeinput(skin_menutitle, menutitle);
973        changeinput(skin_type, oitoa(type));
974
975        addscreenrc(tithekedit, listbox);
976        drawscreen(tithekedit, 0, 0);
977
978        tmp = listbox->select;
979        while(1)
980        {
981                addscreenrc(tithekedit, tmp);
982                rcret = waitrcext(tithekedit, 0, 0, 1000);
983                delownerrc(tithekedit);
984                addscreenrc(tithekedit, listbox);
985                tmp = listbox->select;
986
987                if(rcret == getrcconfigint("rcexit", NULL)) break;
988                if(rcret == getrcconfigint("rcok", NULL))
989                {
990                        drawscreen(load, 0, 0);
991                        addfav(skin_title->ret, skin_link->ret, skin_pic->ret, skin_localname->ret, skin_menutitle->ret, atoi(skin_type->ret));
992                        clearscreen(load);
993                        break;
994                }
995        }
996
997        delownerrc(tithekedit);
998        clearscreen(tithekedit);
999}
1000
1001void cacheplay(char* link, char* filename, int flag)
1002{
1003        struct skin* load = getscreen("loadingproz");
1004        struct skin* proztext = getscreennode(load, "proztext");
1005
1006        drawscreen(load, 0, 0);
1007        int port = 80, count = 0, mcount = 0;
1008        off64_t size = 0, msize = 0;
1009        char* host = NULL, *pos = NULL, *path = NULL, *file = NULL, *tmpstr = NULL;
1010        host = string_replace("http://", "", (char*)link, 0);
1011
1012        if(host != NULL)
1013                pos = strchr(host, '/');
1014        if(pos != NULL)
1015        {
1016                pos[0] = '\0';
1017                path = pos + 1;
1018        }
1019
1020        file = ostrcat(getconfig("rec_streampath", NULL), "/.cache.", 0, 0);
1021        file = ostrcat(file, filename, 1, 0);
1022
1023        if(ostrstr(host, ":") != NULL)
1024        {
1025                host = oregex("http://(.*):.*", link);
1026                port = atoi(oregex("http://.*:(.*)/.*", link));
1027        }
1028
1029        debug(99, "---------------------------------------");
1030        debug(99, "link: %s", link);
1031        debug(99, "---------------------------------------");
1032        debug(99, "host: %s", host);
1033        debug(99, "port: %d", port);
1034        debug(99, "path: %s", path);
1035        debug(99, "local: %s", file);
1036        debug(99, "---------------------------------------");
1037       
1038       
1039        struct download* dnode = NULL;
1040        dnode = calloc(1, sizeof(struct download));
1041        if(dnode == NULL)
1042        {
1043                err("no mem");
1044                return;
1045        }               
1046        dnode->host = host;
1047        dnode->page = path;
1048        dnode->port = port;
1049        dnode->filename = file;
1050        dnode->auth = NULL;
1051        dnode->connfd = -1;
1052        dnode->ret = -1;
1053        dnode->timeout = 30000;
1054       
1055        addtimer(&gethttpstruct, START, 1000, 1, (void*)dnode, NULL, NULL);
1056
1057        if(flag == 1)
1058        {
1059                mcount = 120;
1060                msize = 10485760;
1061        }
1062        else if(flag == 2)
1063        {
1064                mcount = 240;
1065                msize = 20971520;
1066        }
1067        else if(flag == 3)
1068        {
1069                mcount = 360;
1070                msize = 31457280;
1071        }
1072                       
1073        while(count < mcount || size >= msize)
1074        {
1075                sleep(1);
1076                count++;
1077                if(file_exist(file))
1078                        size = getfilesize(file);
1079
1080                int proz = 0;
1081                int proz1 = size * 100 / msize;
1082                debug(99, "size (%dprozent)", proz1);
1083
1084                int proz2 = count * 100 / mcount;
1085                debug(99, "time (%dprozent)", proz2);
1086               
1087                if(proz1 > proz2)
1088                        proz = proz1;
1089                else
1090                        proz = proz2;
1091
1092                debug(99, "cacheing...(%lldkb) (%dprozent)", size / 1024, proz);
1093
1094                if(size >= msize)
1095                        break;
1096                if(count >= mcount)
1097                        break;
1098               
1099                tmpstr = ostrcat(_("please wait..."), " (", 0, 0);
1100                tmpstr = ostrcat(tmpstr, oitoa(proz), 1, 1);
1101                tmpstr = ostrcat(tmpstr, "%)", 1, 0);
1102                clearscreen(load);
1103                changetext(proztext, tmpstr);
1104                drawscreen(load, 0, 0);
1105                free(tmpstr), tmpstr = NULL;
1106        }
1107
1108        screenplay(file, filename, 2, 0);
1109        sockclose(&dnode->connfd);
1110        free(dnode); dnode = NULL;
1111
1112        tmpstr = ostrcat(tmpstr, _("Remove Cachefile ?"), 1, 0);
1113        tmpstr = ostrcat(tmpstr, "\n\n", 1, 0);
1114        tmpstr = ostrcat(tmpstr, file, 1, 0);
1115       
1116        if(textbox(_("Message"), tmpstr, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1)
1117        {
1118                unlink(file);
1119        }
1120        free(tmpstr), tmpstr = NULL;
1121        free(file), file = NULL;
1122        free(host), host = NULL;
1123}
1124
1125void backgrounddl(char* link, char* filename)
1126{
1127        int port = 80, ret = 0;
1128        char* host = NULL, *pos = NULL, *path = NULL, *file = NULL, *tmpstr = NULL;
1129        host = string_replace("http://", "", (char*)link, 0);
1130
1131        if(host != NULL)
1132                pos = strchr(host, '/');
1133        if(pos != NULL)
1134        {
1135                pos[0] = '\0';
1136                path = pos + 1;
1137        }
1138
1139        file = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0);
1140        file = ostrcat(file, filename, 1, 0);
1141
1142        if(ostrstr(host, ":") != NULL)
1143        {
1144                host = oregex("http://(.*):.*", link);
1145                port = atoi(oregex("http://.*:(.*)/.*", link));
1146        }
1147
1148        debug(99, "---------------------------------------");
1149        debug(99, "link: %s", link);
1150        debug(99, "---------------------------------------");
1151        debug(99, "host: %s", host);
1152        debug(99, "port: %d", port);
1153        debug(99, "path: %s", path);
1154        debug(99, "local: %s", file);
1155        debug(99, "---------------------------------------");
1156       
1157        ret = startbgdownload(host, path, port, file, NULL, 30000, 1);
1158        if(ret == 1)
1159                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);
1160                                       
1161        free(tmpstr), tmpstr = NULL;
1162        free(file), file = NULL;
1163        free(host), host = NULL;
1164}
1165       
1166void submenu(struct skin* listbox, struct skin* load, char* title)
1167{
1168        int flag = 0;
1169        if(status.security == 1 || checkbox("WHITEBOX") == 1)
1170        {
1171                drawscreen(load, 0, 0);
1172                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1173                char* tmpstr1 = NULL;
1174
1175                if(((struct tithek*)listbox->select->handle)->flag == 2)
1176                {
1177                        if(tmpstr != NULL) tmpstr1 = ostrcat(tmpstr, NULL, 0, 0);
1178                }                                               
1179                else if(((struct tithek*)listbox->select->handle)->flag == 4)
1180                {
1181                        if(tmpstr != NULL) tmpstr1 = youtube(tmpstr, NULL, NULL, 1);
1182                }                                               
1183                else if(((struct tithek*)listbox->select->handle)->flag == 5)
1184                {
1185                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl2now.rtl2.de", "rtl2now", 1);
1186                }
1187                else if(((struct tithek*)listbox->select->handle)->flag == 6)
1188                {
1189                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.superrtlnow.de", "superrtlnow", 1);
1190                }
1191                else if(((struct tithek*)listbox->select->handle)->flag == 7)
1192                {
1193                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl-now.rtl.de", "rtlnow", 1);
1194                }
1195                else if(((struct tithek*)listbox->select->handle)->flag == 8)
1196                {
1197                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.voxnow.de", "voxnow", 1);
1198                }
1199                else if(((struct tithek*)listbox->select->handle)->flag == 12)
1200                {
1201                        if(tmpstr != NULL) tmpstr1 = myvideo(tmpstr, NULL, NULL, 1);
1202                }
1203                else if(((struct tithek*)listbox->select->handle)->flag == 14)
1204                {
1205                        if(tmpstr != NULL) tmpstr1 = kinox(tmpstr);
1206                }
1207                else if(((struct tithek*)listbox->select->handle)->flag == 16)
1208                {
1209                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.superrtlnow.de", "superrtlnow", 1);
1210                }
1211                else if(((struct tithek*)listbox->select->handle)->flag == 17)
1212                {
1213                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl-now.rtl.de", "rtlnow", 1);
1214                }
1215                else if(((struct tithek*)listbox->select->handle)->flag == 18)
1216                {
1217                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.voxnow.de", "voxnow", 1);
1218                }
1219                else if(((struct tithek*)listbox->select->handle)->flag == 19)
1220                {
1221                        if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl2now.rtl2.de", "rtl2now", 1);
1222                }
1223                else if(((struct tithek*)listbox->select->handle)->flag == 38)
1224                {
1225                        if(tmpstr != NULL) tmpstr1 = mlehd(tmpstr);
1226                }
1227                else if(((struct tithek*)listbox->select->handle)->flag == 41)
1228                {
1229                        if(tmpstr != NULL) tmpstr1 = movie4k(tmpstr);
1230                }
1231                else if(((struct tithek*)listbox->select->handle)->flag == 42)
1232                {
1233                        if(tmpstr != NULL) tmpstr1 = xvideos(tmpstr);
1234                }
1235                else if(((struct tithek*)listbox->select->handle)->flag == 43)
1236                {
1237                        if(tmpstr != NULL) tmpstr1 = solarmovie(tmpstr);
1238                }
1239                else if(((struct tithek*)listbox->select->handle)->flag == 45)
1240                {
1241                        if(tmpstr != NULL) tmpstr1 = ard(tmpstr);
1242                }
1243                else if(((struct tithek*)listbox->select->handle)->flag == 46)
1244                {
1245                        if(tmpstr != NULL) tmpstr1 = zdf(tmpstr);
1246                }
1247                else if(((struct tithek*)listbox->select->handle)->flag == 50)
1248                {
1249                        if(tmpstr != NULL) tmpstr1 = beeg(tmpstr);
1250                }
1251                free(tmpstr); tmpstr = NULL;
1252
1253                if(ostrstr(title, "Internet Radio") != NULL)
1254                        flag = 4;
1255
1256                if(ostrstr(tmpstr1, "&") != NULL)
1257                {
1258                        printf("change streamurl from: %s\n", tmpstr1);
1259                        tmpstr1 = string_replace_all("&amp;", "&", tmpstr1, 1);
1260                        printf("change streamurl to: %s\n", tmpstr1);
1261                }
1262               
1263                if(tmpstr1 != NULL)
1264                {
1265                        char* filename = ostrcat(title, "_", 0, 0);
1266                        filename = ostrcat(filename, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1267                        filename = ostrcat(filename, ".mp4", 1, 0);
1268                        filename = string_replace_all(" ", ".", filename, 1);
1269                        filename = string_replace_all("-", "_", filename, 1);
1270                        filename = string_replace_all("._.", "_", filename, 1);
1271                        debug(99, "filename: %s", filename);
1272                               
1273                        char* keyconf = NULL;
1274                        char* skintitle = _("Choice Playback");
1275                        struct menulist* mlist = NULL, *mbox = NULL;
1276
1277                        // needed for autopo
1278                        char* tmptxt = NULL;
1279                        tmptxt = ostrcat(tmptxt, _("Streaming Playback (default)"), 1, 0);
1280                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (0.5MB)"), 1, 0);
1281                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (1MB)"), 1, 0);
1282                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (2MB)"), 1, 0);
1283                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (3MB)"), 1, 0);
1284                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (4MB)"), 1, 0);
1285                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (5MB)"), 1, 0);
1286                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (7.5MB)"), 1, 0);
1287                        tmptxt = ostrcat(tmptxt, _("Streaming Playback Caching (10MB)"), 1, 0);
1288                        tmptxt = ostrcat(tmptxt, _("File Caching Playback (10MB / 120s)"), 1, 0);
1289                        tmptxt = ostrcat(tmptxt, _("File Caching Playback (20MB / 240s)"), 1, 0);
1290                        tmptxt = ostrcat(tmptxt, _("File Caching Playback (30MB / 360s)"), 1, 0);
1291                        tmptxt = ostrcat(tmptxt, _("Download Full File"), 1, 0);
1292                        tmptxt = ostrcat(tmptxt, _("Download Full File (background)"), 1, 0);
1293                        free(tmptxt), tmptxt = NULL;
1294       
1295                        addmenulist(&mlist, "Streaming Playback (default)", NULL, NULL, 0, 0);
1296
1297                        if(!ostrncmp("http://", tmpstr1, 7))
1298                        {
1299                                if(flag == 4)
1300                                {
1301#ifdef EPLAYER3
1302                                        addmenulist(&mlist, "Streaming Playback Caching (0.5MB)", NULL, NULL, 0, 0);
1303                                        addmenulist(&mlist, "Streaming Playback Caching (1MB)", NULL, NULL, 0, 0);
1304#endif
1305                                }       
1306                                else if(!ostrncmp("http://", tmpstr1, 7))
1307                                {
1308#ifdef EPLAYER3
1309//                                      addmenulist(&mlist, "Streaming Playback Caching (1MB)", NULL, NULL, 0, 0);
1310//                                      addmenulist(&mlist, "Streaming Playback Caching (2MB)", NULL, NULL, 0, 0);
1311//                                      addmenulist(&mlist, "Streaming Playback Caching (3MB)", NULL, NULL, 0, 0);
1312//                                      addmenulist(&mlist, "Streaming Playback Caching (4MB)", NULL, NULL, 0, 0);
1313                                        if(checkbox("UFS910") == 1 && !file_exist("/var/swapdir/swapfile"))
1314                                                addmenulist(&mlist, "Streaming Playback Caching (5MB)", NULL, NULL, 0, 0);
1315                                        else
1316                                        {
1317//                                              addmenulist(&mlist, "Streaming Playback Caching (7.5MB)", NULL, NULL, 0, 0);
1318                                                addmenulist(&mlist, "Streaming Playback Caching (10MB)", NULL, NULL, 0, 0);
1319                                        }
1320#endif
1321                                        if(file_exist(getconfig("rec_streampath", NULL)) && (status.expertmodus >= 11 || file_exist("/mnt/swapextensions/etc/.codecpack") || file_exist("/var/swap/etc/.codecpack") || file_exist("/var/etc/.codecpack")))
1322                                        {
1323#ifndef EPLAYER3
1324                                                addmenulist(&mlist, "File Caching Playback (10MB / 120s)", NULL, NULL, 0, 0);
1325                                                addmenulist(&mlist, "File Caching Playback (20MB / 240s)", NULL, NULL, 0, 0);
1326                                                addmenulist(&mlist, "File Caching Playback (30MB / 360s)", NULL, NULL, 0, 0);
1327#endif
1328                                                addmenulist(&mlist, "Download Full File", NULL, NULL, 0, 0);
1329                                                addmenulist(&mlist, "Download Full File (background)", NULL, NULL, 0, 0);
1330                                        }
1331                                }
1332                        }
1333                        mbox = menulistbox(mlist, NULL, skintitle, _("Choose your Streaming Playback Modus from the following list"), NULL, NULL, 1, 0);
1334                        if(mbox != NULL) keyconf = mbox->name;
1335                        debug(99, "tmpstr1: %s filename: %s flag: %d", tmpstr1, filename, flag);
1336                        if(ostrcmp(keyconf, "Streaming Playback (default)") == 0)
1337                        {
1338                                addconfigtmp("playerbuffersize", "0");
1339                                screenplay(tmpstr1, filename, 2, flag);
1340                                delconfigtmp("playerbuffersize");
1341                        }
1342                        else if(ostrcmp(keyconf, "Streaming Playback Caching (0.5MB)") == 0)
1343                        {
1344                                addconfigtmp("playerbuffersize", "524288");
1345                                screenplay(tmpstr1, filename, 2, flag);
1346                                delconfigtmp("playerbuffersize");
1347                        }
1348                        else if(ostrcmp(keyconf, "Streaming Playback Caching (1MB)") == 0)
1349                        {
1350                                addconfigtmp("playerbuffersize", "1048576");
1351                                screenplay(tmpstr1, filename, 2, flag);
1352                                delconfigtmp("playerbuffersize");
1353                        }
1354                        else if(ostrcmp(keyconf, "Streaming Playback Caching (2MB)") == 0)
1355                        {
1356                                addconfigtmp("playerbuffersize", "2097152");
1357                                screenplay(tmpstr1, filename, 2, flag);
1358                                delconfigtmp("playerbuffersize");
1359                        }
1360                        else if(ostrcmp(keyconf, "Streaming Playback Caching (3MB)") == 0)
1361                        {
1362                                addconfigtmp("playerbuffersize", "3145728");
1363                                screenplay(tmpstr1, filename, 2, flag);
1364                                delconfigtmp("playerbuffersize");
1365                        }
1366                        else if(ostrcmp(keyconf, "Streaming Playback Caching (4MB)") == 0)
1367                        {
1368                                addconfigtmp("playerbuffersize", "4194304");
1369                                screenplay(tmpstr1, filename, 2, flag);
1370                                delconfigtmp("playerbuffersize");
1371                        }
1372                        else if(ostrcmp(keyconf, "Streaming Playback Caching (5MB)") == 0)
1373                        {
1374                                addconfigtmp("playerbuffersize", "5242880");
1375                                screenplay(tmpstr1, filename, 2, flag);
1376                                delconfigtmp("playerbuffersize");
1377                        }
1378                        else if(ostrcmp(keyconf, "Streaming Playback Caching (7.5MB)") == 0)
1379                        {
1380                                addconfigtmp("playerbuffersize", "7864320");
1381                                screenplay(tmpstr1, filename, 2, flag);
1382                                delconfigtmp("playerbuffersize");
1383                        }
1384                        else if(ostrcmp(keyconf, "Streaming Playback Caching (10MB)") == 0)
1385                        {
1386                                addconfigtmp("playerbuffersize", "10485760");
1387                                screenplay(tmpstr1, filename, 2, flag);
1388                                delconfigtmp("playerbuffersize");
1389                        }
1390                        else if(ostrcmp(keyconf, "File Caching Playback (10MB / 120s)") == 0)
1391                        {
1392                                cacheplay(tmpstr1, filename, 1);
1393                        }
1394                        else if(ostrcmp(keyconf, "File Caching Playback (20MB / 240s)") == 0)
1395                        {
1396                                cacheplay(tmpstr1, filename, 2);
1397                        }
1398                        else if(ostrcmp(keyconf, "File Caching Playback (30MB / 360s)") == 0)
1399                        {
1400                                cacheplay(tmpstr1, filename, 3);
1401                        }
1402                        else if(ostrcmp(keyconf, "Download Full File") == 0)
1403                        {
1404                                char* search = textinput(_("Filename"), filename);
1405                                if(search != NULL)
1406                                {       
1407                                        char* tmpstr2 = tithekdownload(tmpstr1, search, NULL, 0, 1);
1408//                                              drawscreen(grid, 0, 0);
1409                                        free(tmpstr2); tmpstr2 = NULL;
1410                               
1411                                        if(textbox(_("Message"), _("Start playback"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1)
1412                                        {
1413                                                tmpstr2 = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0);
1414                                                tmpstr2 = ostrcat(tmpstr2, search, 1, 0);
1415                                                screenplay(tmpstr2, filename, 2, flag);
1416                                                free(tmpstr2); tmpstr2 = NULL;
1417                                        }
1418                                }
1419                                free(search), search = NULL;
1420                        }
1421                        else if(ostrcmp(keyconf, "Download Full File (background)") == 0)
1422                        {
1423                                char* search = textinput(_("Filename"), filename);
1424                                if(search != NULL)
1425                                        backgrounddl(tmpstr1, search);
1426                                free(search), search = NULL;
1427                        }
1428                         
1429                        free(filename), filename = NULL;
1430                        freemenulist(mlist, 1); mlist = NULL;
1431                }
1432                else
1433                        textbox(_("Message"), _("Can't get Streamurl !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0);
1434               
1435                free(tmpstr1); tmpstr1 = NULL;
1436        }
1437        else
1438                textbox(_("Message"), _("Registration needed, please contact Atemio !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 200, 0, 0);
1439}
1440
1441void screentithekplay(char* titheklink, char* title, int first)
1442{
1443        if(!file_exist("/mnt/swapextensions/player"))
1444                mkdir("/mnt/swapextensions/player", 0777);
1445
1446        char* disclaimer = NULL;
1447        disclaimer = ostrcat(disclaimer, "/mnt/swapextensions/player/tithek_disclaimer_accepted", 1, 0);
1448                               
1449        if(!file_exist(disclaimer))
1450        {
1451                char* tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/disclaimer.txt", 80, NULL, HTTPAUTH, 5000, NULL, 0);
1452                if(textbox(_("TitanNit Tithek disclaimer"), _(tmpstr), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1100, 650, 0, 0) == 1)
1453                {
1454                        writesys(disclaimer, tmpstr, 0);                               
1455                        free(tmpstr), tmpstr = NULL;
1456                }
1457                else
1458                {
1459                        free(tmpstr), tmpstr = NULL;
1460                        free(disclaimer), disclaimer = NULL;
1461                        return;
1462                }
1463        }
1464        free(disclaimer), disclaimer = NULL;
1465
1466        int rcret = -1, oaktline = 1, oaktpage = -1, ogridcol = 0, pagecount = 0;
1467
1468        writesysint("/proc/sys/vm/drop_caches", 3, 0);
1469       
1470        if(first == 1)
1471        {
1472                mkdir("/tmp/tithek", 777);
1473                if(status.mcaktiv == 0)
1474                {
1475                        rcret = servicestop(status.aktservice, 1, 1);
1476                        if(rcret == 1) return;
1477                }
1478        }
1479
1480        struct skin* grid = getscreen("titheklist");
1481        struct skin* listbox = getscreennode(grid, "listbox");
1482        struct skin* countlabel = getscreennode(grid, "countlabel");
1483        struct skin* countpage = getscreennode(grid, "countpage");
1484        struct skin* b4 = getscreennode(grid, "b4");
1485        struct skin* b5 = getscreennode(grid, "b5");
1486        struct skin* load = getscreen("loading");
1487        struct skin* tmp = NULL;
1488        char* tithekpic = NULL;
1489
1490        if (ostrcmp(title, "TiThek - Favoriten") == 0)
1491        {
1492                changetext(b4, _("EDIT FAV"));
1493                b5->hidden = NO;
1494        }
1495        else
1496        {
1497                changetext(b4, _("ADD FAV"));
1498                b5->hidden = YES;
1499        }
1500
1501        drawscreen(load, 0, 0);
1502       
1503        if(titheklink == NULL) return;
1504       
1505        listbox->aktpage = -1;
1506        listbox->aktline = 1;
1507        listbox->gridcol = 0;
1508        listbox->select = NULL;
1509
1510        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, first);
1511        if(pagecount == 0) return;
1512
1513        changetitle(grid, _(title));
1514        drawscreen(grid, 0, 0);
1515        addscreenrc(grid, listbox);
1516                               
1517        while(1)
1518        {
1519                changetitle(grid, _(title));
1520                changetext(countpage, NULL);
1521                if(listbox->select != NULL && listbox->select->handle != NULL)
1522                {
1523                        tmp = listbox->select;
1524                        while(tmp != NULL)
1525                        {
1526
1527                                if(tmp->pagecount != listbox->aktpage) break;
1528
1529                                char* tmpstr = ostrcat(_("Page"), NULL, 0, 0);
1530                                tmpstr = ostrcat(tmpstr, " ( ", 1, 0);
1531                                tmpstr = ostrcat(tmpstr, oitoa(tmp->pagecount), 1, 1);
1532                                tmpstr = ostrcat(tmpstr, " / ", 1, 0);
1533                                tmpstr = ostrcat(tmpstr, oitoa(pagecount), 1, 1);
1534                                tmpstr = ostrcat(tmpstr, " )", 1, 0);
1535                                changetext(countpage, tmpstr);
1536                                free(tmpstr); tmpstr = NULL;
1537
1538                                if(tmp->handle != NULL && getconfigint("tithek_view", NULL) != 6 && getconfigint("tithek_cover", NULL) != 6)
1539                                {
1540                                        tithekpic = tithekdownload(((struct tithek*)tmp->handle)->pic, ((struct tithek*)tmp->handle)->localname, "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0=", 1, 0);
1541
1542                                        /* not working with thread download
1543                                        off64_t checkpic = getfilesize(tithekpic);
1544                       
1545                                        if(checkpic < 1000)
1546                                        {
1547                                                free(tithekpic); tithekpic = NULL;
1548                                                tithekpic = ostrcat("/var/usr/local/share/titan/plugins/tithek/default.jpg", NULL, 0, 0);
1549                                        }
1550                                        */
1551                       
1552                                        changepic(tmp, tithekpic);
1553                                        free(tithekpic); tithekpic = NULL;
1554                                }
1555                                tmp = tmp->prev;
1556                        }
1557                        tmp = listbox->select;
1558                        if(tmp != NULL) tmp = tmp->next;
1559                        while(tmp != NULL)
1560                        {
1561                                if(tmp->pagecount != listbox->aktpage) break;
1562                                if(tmp->handle != NULL && getconfigint("tithek_view", NULL) != 6 && getconfigint("tithek_cover", NULL) != 6)
1563                                {
1564                                        tithekpic = tithekdownload(((struct tithek*)tmp->handle)->pic, ((struct tithek*)tmp->handle)->localname, "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0=", 1, 0);
1565
1566                                        /* not working with thread download
1567                                        off64_t checkpic = getfilesize(tithekpic);
1568
1569                                        if(checkpic < 1000)
1570                                        {
1571                                                free(tithekpic); tithekpic = NULL;
1572                                                tithekpic = ostrcat("/var/usr/local/share/titan/plugins/tithek/default.jpg", NULL, 0, 0);
1573                                        }
1574                                        */
1575
1576                                        changepic(tmp, tithekpic);
1577                                        free(tithekpic); tithekpic = NULL;
1578                                }
1579                                tmp = tmp->next;
1580                        }
1581                }
1582               
1583                int count = getfilecount(TITHEKPATH);
1584                if(count > 500)
1585                        delallfiles(TITHEKPATH, ".jpg");
1586
1587                drawscreen(grid, 0, 0);
1588waitrcstart:
1589                rcret = waitrc(grid, 2000, 2);
1590
1591                if(rcret == RCTIMEOUT)
1592                {
1593                        if(tithekdownloadrun == 1)
1594                        {
1595                                tithekdownloadrun = 0;
1596                                drawscreen(grid, 0, 0);
1597                        }
1598                        goto waitrcstart;
1599                }
1600
1601                if(rcret == getrcconfigint("rcblue", NULL))
1602                {
1603                        tithekexit = 1;
1604                        break;
1605                }
1606
1607                if(rcret == getrcconfigint("rcexit", NULL)) break;
1608                if(rcret == getrcconfigint("rcmenu", NULL))
1609                {
1610                        screentithek_settings();
1611
1612                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, first);
1613                        if(pagecount == 0 || tithekexit == 1) break;
1614
1615                        listbox->aktpage = -1;
1616                        listbox->aktline = 1;
1617                        listbox->gridcol = 1;
1618                        addscreenrc(grid, listbox);
1619                        drawscreen(grid, 0, 0);
1620                }
1621
1622                if (ostrcmp(title, "TiThek - Favoriten") == 0)
1623                {
1624                        changetext(b4, _("EDIT FAV"));
1625                        b5->hidden = NO;
1626                }
1627                else
1628                {
1629                        changetext(b4, _("ADD FAV"));
1630                        b5->hidden = YES;
1631                }
1632
1633                if(rcret == getrcconfigint("rcred", NULL))
1634                {
1635                        if(listbox->select != NULL && listbox->select->handle != NULL)
1636                        {
1637
1638                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->title, NULL, 0, 0);
1639                                debug(99, "tmpstr: %s", tmpstr);
1640                                tmpstr = string_replace("-1 (de)", "", tmpstr, 1);
1641                                tmpstr = string_replace("-1 (en)", "", tmpstr, 1);
1642                                tmpstr = string_replace("-1 (\?\?)", "", tmpstr, 1);
1643                                tmpstr = string_replace("-2 (de)", "", tmpstr, 1);
1644                                tmpstr = string_replace("-2 (en)", "", tmpstr, 1);
1645                                tmpstr = string_replace("-2 (\?\?)", "", tmpstr, 1);
1646                                tmpstr = string_replace("-3 (de)", "", tmpstr, 1);
1647                                tmpstr = string_replace("-3 (en)", "", tmpstr, 1);
1648                                tmpstr = string_replace("-3 (\?\?)", "", tmpstr, 1);
1649                                tmpstr = string_replace(" (de)", "", tmpstr, 1);
1650                                tmpstr = string_replace(" (en)", "", tmpstr, 1);
1651                                tmpstr = string_replace(" (\?\?)", "", tmpstr, 1);
1652                                tmpstr = string_replace_all("_", " ", tmpstr, 1);
1653                                tmpstr = string_replace_all("-", " ", tmpstr, 1);
1654                                tmpstr = string_replace_all(".", " ", tmpstr, 1);                               
1655                                debug(99, "tmpstr: %s", tmpstr);
1656
1657                                int check = playrcred(tmpstr, NULL, 1, 0, 99);
1658                                if(check == 2)
1659                                {
1660                                        if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search", tmpstr, 0) == 0)
1661                                        {
1662                                                oaktpage = listbox->aktpage;
1663                                                oaktline = listbox->aktline;
1664                                                ogridcol = listbox->gridcol;
1665                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1666                                                char* tmpstr1 = ostrcat("KinoX - Search", " - ", 0, 0);
1667                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1668                                                screentithekplay(tmpstr, tmpstr2, 0);
1669                                                free(tmpstr); tmpstr = NULL;
1670                                                free(tmpstr2); tmpstr2 = NULL;
1671                       
1672                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1673                                                if(pagecount == 0 || tithekexit == 1) break;
1674
1675                                                listbox->aktpage = oaktpage;
1676                                                listbox->aktline = oaktline;
1677                                                listbox->gridcol = ogridcol;
1678                                                addscreenrc(grid, listbox);
1679                                        }
1680                                }
1681                                else if(check == 3)
1682                                {
1683                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "SolarMovies - Movie - Search", tmpstr, 0) == 0)
1684                                        {
1685                                                oaktpage = listbox->aktpage;
1686                                                oaktline = listbox->aktline;
1687                                                ogridcol = listbox->gridcol;
1688                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1689                                                char* tmpstr1 = ostrcat("SolarMovies - Movie - Search", " - ", 0, 0);
1690                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1691                                                screentithekplay(tmpstr, tmpstr2, 0);
1692                                                free(tmpstr); tmpstr = NULL;
1693                                                free(tmpstr2); tmpstr2 = NULL;
1694                       
1695                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1696                                                if(pagecount == 0 || tithekexit == 1) break;
1697
1698                                                listbox->aktpage = oaktpage;
1699                                                listbox->aktline = oaktline;
1700                                                listbox->gridcol = ogridcol;
1701                                                addscreenrc(grid, listbox);
1702                                        }
1703                                }
1704                                else if(check == 4)
1705                                {
1706                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "SolarMovies - Tv - Search", tmpstr, 1) == 0)
1707                                        {
1708                                                oaktpage = listbox->aktpage;
1709                                                oaktline = listbox->aktline;
1710                                                ogridcol = listbox->gridcol;
1711                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1712                                                char* tmpstr1 = ostrcat("SolarMovies - Tv - Search", " - ", 0, 0);
1713                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1714                                                screentithekplay(tmpstr, tmpstr2, 0);
1715                                                free(tmpstr); tmpstr = NULL;
1716                                                free(tmpstr2); tmpstr2 = NULL;
1717                       
1718                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1719                                                if(pagecount == 0 || tithekexit == 1) break;
1720
1721                                                listbox->aktpage = oaktpage;
1722                                                listbox->aktline = oaktline;
1723                                                listbox->gridcol = ogridcol;
1724                                                addscreenrc(grid, listbox);
1725                                        }
1726                                }
1727                                else if(check == 5)
1728                                {
1729                                        if(youtube_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Youtube - Search", tmpstr) == 0)
1730                                        {
1731                                                oaktpage = listbox->aktpage;
1732                                                oaktline = listbox->aktline;
1733                                                ogridcol = listbox->gridcol;
1734                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1735                                                char* tmpstr1 = ostrcat("Youtube - Search", " - ", 0, 0);
1736                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1737                                                screentithekplay(tmpstr, tmpstr2, 0);
1738                                                free(tmpstr); tmpstr = NULL;
1739                                                free(tmpstr2); tmpstr2 = NULL;
1740                       
1741                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1742                                                if(pagecount == 0 || tithekexit == 1) break;
1743
1744                                                listbox->aktpage = oaktpage;
1745                                                listbox->aktline = oaktline;
1746                                                listbox->gridcol = ogridcol;
1747                                                addscreenrc(grid, listbox);
1748                                        }
1749                                }
1750                                else if(check == 6)
1751                                {
1752                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "MyVideo - Search", tmpstr, 0) == 0)
1753                                        {
1754                                                oaktpage = listbox->aktpage;
1755                                                oaktline = listbox->aktline;
1756                                                ogridcol = listbox->gridcol;
1757                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1758                                                char* tmpstr1 = ostrcat("MyVideo - Search", " - ", 0, 0);
1759                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1760                                                screentithekplay(tmpstr, tmpstr2, 0);
1761                                                free(tmpstr); tmpstr = NULL;
1762                                                free(tmpstr2); tmpstr2 = NULL;
1763                       
1764                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1765                                                if(pagecount == 0 || tithekexit == 1) break;
1766
1767                                                listbox->aktpage = oaktpage;
1768                                                listbox->aktline = oaktline;
1769                                                listbox->gridcol = ogridcol;
1770                                                addscreenrc(grid, listbox);
1771                                        }
1772                                }
1773                                else if(check == 7)
1774                                {
1775                                        if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search", tmpstr, 0) == 0)
1776                                        {
1777                                                oaktpage = listbox->aktpage;
1778                                                oaktline = listbox->aktline;
1779                                                ogridcol = listbox->gridcol;
1780                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1781                                                char* tmpstr1 = ostrcat("Movie4k - Search", " - ", 0, 0);
1782                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1783                                                screentithekplay(tmpstr, tmpstr2, 0);
1784                                                free(tmpstr); tmpstr = NULL;
1785                                                free(tmpstr2); tmpstr2 = NULL;
1786                       
1787                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1788                                                if(pagecount == 0 || tithekexit == 1) break;
1789
1790                                                listbox->aktpage = oaktpage;
1791                                                listbox->aktline = oaktline;
1792                                                listbox->gridcol = ogridcol;
1793                                                addscreenrc(grid, listbox);
1794                                        }
1795                                }
1796                                else if(check == 8)
1797                                {
1798                                        if(kinox_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search (local)", tmpstr, 0) == 0)
1799                                        {
1800                                                oaktpage = listbox->aktpage;
1801                                                oaktline = listbox->aktline;
1802                                                ogridcol = listbox->gridcol;
1803                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1804                                                char* tmpstr1 = ostrcat("KinoX - Search (local)", " - ", 0, 0);
1805                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1806                                                screentithekplay(tmpstr, tmpstr2, 0);
1807                                                free(tmpstr); tmpstr = NULL;
1808                                                free(tmpstr2); tmpstr2 = NULL;
1809                       
1810                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1811                                                if(pagecount == 0 || tithekexit == 1) break;
1812
1813                                                listbox->aktpage = oaktpage;
1814                                                listbox->aktline = oaktline;
1815                                                listbox->gridcol = ogridcol;
1816                                                addscreenrc(grid, listbox);
1817                                        }
1818                                }
1819                                else if(check == 9)
1820                                {
1821                                        if(solarmovie_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Solarmovies - Search (local)", tmpstr, 0) == 0)
1822                                        {
1823                                                oaktpage = listbox->aktpage;
1824                                                oaktline = listbox->aktline;
1825                                                ogridcol = listbox->gridcol;
1826                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1827                                                char* tmpstr1 = ostrcat("Solarmovies - Search (local)", " - ", 0, 0);
1828                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1829                                                screentithekplay(tmpstr, tmpstr2, 0);
1830                                                free(tmpstr); tmpstr = NULL;
1831                                                free(tmpstr2); tmpstr2 = NULL;
1832                       
1833                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1834                                                if(pagecount == 0 || tithekexit == 1) break;
1835
1836                                                listbox->aktpage = oaktpage;
1837                                                listbox->aktline = oaktline;
1838                                                listbox->gridcol = ogridcol;
1839                                                addscreenrc(grid, listbox);
1840                                        }
1841                                }
1842                                else if(check == 10)
1843                                {
1844                                        if(youtube_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Youtube - Search (local)", tmpstr, 0) == 0)
1845                                        {
1846                                                oaktpage = listbox->aktpage;
1847                                                oaktline = listbox->aktline;
1848                                                ogridcol = listbox->gridcol;
1849                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1850                                                char* tmpstr1 = ostrcat("Youtube - Search (local)", " - ", 0, 0);
1851                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1852                                                screentithekplay(tmpstr, tmpstr2, 0);
1853                                                free(tmpstr); tmpstr = NULL;
1854                                                free(tmpstr2); tmpstr2 = NULL;
1855                       
1856                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1857                                                if(pagecount == 0 || tithekexit == 1) break;
1858
1859                                                listbox->aktpage = oaktpage;
1860                                                listbox->aktline = oaktline;
1861                                                listbox->gridcol = ogridcol;
1862                                                addscreenrc(grid, listbox);
1863                                        }
1864                                }
1865                                else if(check == 11)
1866                                {
1867                                        if(myvideo_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "MyVideo - Search (local)", tmpstr, 0) == 0)
1868                                        {
1869                                                oaktpage = listbox->aktpage;
1870                                                oaktline = listbox->aktline;
1871                                                ogridcol = listbox->gridcol;
1872                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1873                                                char* tmpstr1 = ostrcat("MyVideo - Search (local)", " - ", 0, 0);
1874                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1875                                                screentithekplay(tmpstr, tmpstr2, 0);
1876                                                free(tmpstr); tmpstr = NULL;
1877                                                free(tmpstr2); tmpstr2 = NULL;
1878                       
1879                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1880                                                if(pagecount == 0 || tithekexit == 1) break;
1881
1882                                                listbox->aktpage = oaktpage;
1883                                                listbox->aktline = oaktline;
1884                                                listbox->gridcol = ogridcol;
1885                                                addscreenrc(grid, listbox);
1886                                        }
1887                                }
1888                                else if(check == 12)
1889                                {
1890                                        if(movie4k_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Movie4k - Search (local)", tmpstr, 0) == 0)
1891                                        {
1892                                                oaktpage = listbox->aktpage;
1893                                                oaktline = listbox->aktline;
1894                                                ogridcol = listbox->gridcol;
1895                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1896                                                char* tmpstr1 = ostrcat("Movie4k - Search (local)", " - ", 0, 0);
1897                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1898                                                screentithekplay(tmpstr, tmpstr2, 0);
1899                                                free(tmpstr); tmpstr = NULL;
1900                                                free(tmpstr2); tmpstr2 = NULL;
1901                       
1902                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1903                                                if(pagecount == 0 || tithekexit == 1) break;
1904
1905                                                listbox->aktpage = oaktpage;
1906                                                listbox->aktline = oaktline;
1907                                                listbox->gridcol = ogridcol;
1908                                                addscreenrc(grid, listbox);
1909                                        }
1910                                }
1911                                else if(check == 13)
1912                                {
1913                                        if(internetradio_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Internetradio - Search (local)", tmpstr, 0) == 0)
1914                                        {
1915                                                oaktpage = listbox->aktpage;
1916                                                oaktline = listbox->aktline;
1917                                                ogridcol = listbox->gridcol;
1918                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1919                                                char* tmpstr1 = ostrcat("Internetradio - Search (local)", " - ", 0, 0);
1920                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1921                                                screentithekplay(tmpstr, tmpstr2, 0);
1922                                                free(tmpstr); tmpstr = NULL;
1923                                                free(tmpstr2); tmpstr2 = NULL;
1924                       
1925                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1926                                                if(pagecount == 0 || tithekexit == 1) break;
1927
1928                                                listbox->aktpage = oaktpage;
1929                                                listbox->aktline = oaktline;
1930                                                listbox->gridcol = ogridcol;
1931                                                addscreenrc(grid, listbox);
1932                                        }
1933                                }
1934                                else if(check == 14)
1935                                {
1936                                        if(internettv_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Internettv - Search (local)", tmpstr, 0) == 0)
1937                                        {
1938                                                oaktpage = listbox->aktpage;
1939                                                oaktline = listbox->aktline;
1940                                                ogridcol = listbox->gridcol;
1941                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1942                                                char* tmpstr1 = ostrcat("Internettv - Search (local)", " - ", 0, 0);
1943                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1944                                                screentithekplay(tmpstr, tmpstr2, 0);
1945                                                free(tmpstr); tmpstr = NULL;
1946                                                free(tmpstr2); tmpstr2 = NULL;
1947                       
1948                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1949                                                if(pagecount == 0 || tithekexit == 1) break;
1950
1951                                                listbox->aktpage = oaktpage;
1952                                                listbox->aktline = oaktline;
1953                                                listbox->gridcol = ogridcol;
1954                                                addscreenrc(grid, listbox);
1955                                        }
1956                                }
1957                                else if(check == 15)
1958                                {
1959                                        if(ard_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "ARD - Search (local)", tmpstr, 0) == 0)
1960                                        {
1961                                                oaktpage = listbox->aktpage;
1962                                                oaktline = listbox->aktline;
1963                                                ogridcol = listbox->gridcol;
1964                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1965                                                char* tmpstr1 = ostrcat("ARD - Search (local)", " - ", 0, 0);
1966                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1967                                                screentithekplay(tmpstr, tmpstr2, 0);
1968                                                free(tmpstr); tmpstr = NULL;
1969                                                free(tmpstr2); tmpstr2 = NULL;
1970                       
1971                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1972                                                if(pagecount == 0 || tithekexit == 1) break;
1973
1974                                                listbox->aktpage = oaktpage;
1975                                                listbox->aktline = oaktline;
1976                                                listbox->gridcol = ogridcol;
1977                                                addscreenrc(grid, listbox);
1978                                        }
1979                                }
1980                                else if(check == 16)
1981                                {
1982                                        if(zdf_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "ZDF - Search (local)", tmpstr, 0) == 0)
1983                                        {
1984                                                oaktpage = listbox->aktpage;
1985                                                oaktline = listbox->aktline;
1986                                                ogridcol = listbox->gridcol;
1987                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1988                                                char* tmpstr1 = ostrcat("ZDF - Search (local)", " - ", 0, 0);
1989                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1990                                                screentithekplay(tmpstr, tmpstr2, 0);
1991                                                free(tmpstr); tmpstr = NULL;
1992                                                free(tmpstr2); tmpstr2 = NULL;
1993                       
1994                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1995                                                if(pagecount == 0 || tithekexit == 1) break;
1996
1997                                                listbox->aktpage = oaktpage;
1998                                                listbox->aktline = oaktline;
1999                                                listbox->gridcol = ogridcol;
2000                                                addscreenrc(grid, listbox);
2001                                        }
2002                                }
2003                                else if(check == 17)
2004                                {
2005                                        if(tectime_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "TecTime - Search (local)", tmpstr, 0) == 0)
2006                                        {
2007                                                oaktpage = listbox->aktpage;
2008                                                oaktline = listbox->aktline;
2009                                                ogridcol = listbox->gridcol;
2010                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2011                                                char* tmpstr1 = ostrcat("TecTime - Search (local)", " - ", 0, 0);
2012                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2013                                                screentithekplay(tmpstr, tmpstr2, 0);
2014                                                free(tmpstr); tmpstr = NULL;
2015                                                free(tmpstr2); tmpstr2 = NULL;
2016                       
2017                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2018                                                if(pagecount == 0 || tithekexit == 1) break;
2019
2020                                                listbox->aktpage = oaktpage;
2021                                                listbox->aktline = oaktline;
2022                                                listbox->gridcol = ogridcol;
2023                                                addscreenrc(grid, listbox);
2024                                        }
2025                                }
2026                                else if(check == 18)
2027                                {
2028                                        if(giga_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Giga - Search (local)", tmpstr, 0) == 0)
2029                                        {
2030                                                oaktpage = listbox->aktpage;
2031                                                oaktline = listbox->aktline;
2032                                                ogridcol = listbox->gridcol;
2033                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2034                                                char* tmpstr1 = ostrcat("Giga - Search (local)", " - ", 0, 0);
2035                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2036                                                screentithekplay(tmpstr, tmpstr2, 0);
2037                                                free(tmpstr); tmpstr = NULL;
2038                                                free(tmpstr2); tmpstr2 = NULL;
2039                       
2040                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2041                                                if(pagecount == 0 || tithekexit == 1) break;
2042
2043                                                listbox->aktpage = oaktpage;
2044                                                listbox->aktline = oaktline;
2045                                                listbox->gridcol = ogridcol;
2046                                                addscreenrc(grid, listbox);
2047                                        }
2048                                }
2049                                else if(check == 19)
2050                                {
2051                                        if(beeg_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Beeg - Search (local)", tmpstr, 0) == 0)
2052                                        {
2053                                                oaktpage = listbox->aktpage;
2054                                                oaktline = listbox->aktline;
2055                                                ogridcol = listbox->gridcol;
2056                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2057                                                char* tmpstr1 = ostrcat("Beeg - Search (local)", " - ", 0, 0);
2058                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2059                                                screentithekplay(tmpstr, tmpstr2, 0);
2060                                                free(tmpstr); tmpstr = NULL;
2061                                                free(tmpstr2); tmpstr2 = NULL;
2062                       
2063                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2064                                                if(pagecount == 0 || tithekexit == 1) break;
2065
2066                                                listbox->aktpage = oaktpage;
2067                                                listbox->aktline = oaktline;
2068                                                listbox->gridcol = ogridcol;
2069                                                addscreenrc(grid, listbox);
2070                                        }
2071                                }
2072                                else if(check == 20)
2073                                {
2074                                        if(rtl2now_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Rtl2Now - Search (local)", tmpstr, 0) == 0)
2075                                        {
2076                                                oaktpage = listbox->aktpage;
2077                                                oaktline = listbox->aktline;
2078                                                ogridcol = listbox->gridcol;
2079                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2080                                                char* tmpstr1 = ostrcat("Rtl2Now - Search (local)", " - ", 0, 0);
2081                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2082                                                screentithekplay(tmpstr, tmpstr2, 0);
2083                                                free(tmpstr); tmpstr = NULL;
2084                                                free(tmpstr2); tmpstr2 = NULL;
2085                       
2086                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2087                                                if(pagecount == 0 || tithekexit == 1) break;
2088
2089                                                listbox->aktpage = oaktpage;
2090                                                listbox->aktline = oaktline;
2091                                                listbox->gridcol = ogridcol;
2092                                                addscreenrc(grid, listbox);
2093                                        }
2094                                }
2095                                else if(check == 21)
2096                                {
2097                                        if(rtlnow_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Rtl-Now - Search (local)", tmpstr, 0) == 0)
2098                                        {
2099                                                oaktpage = listbox->aktpage;
2100                                                oaktline = listbox->aktline;
2101                                                ogridcol = listbox->gridcol;
2102                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2103                                                char* tmpstr1 = ostrcat("Rtl-Now - Search (local)", " - ", 0, 0);
2104                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2105                                                screentithekplay(tmpstr, tmpstr2, 0);
2106                                                free(tmpstr); tmpstr = NULL;
2107                                                free(tmpstr2); tmpstr2 = NULL;
2108                       
2109                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2110                                                if(pagecount == 0 || tithekexit == 1) break;
2111
2112                                                listbox->aktpage = oaktpage;
2113                                                listbox->aktline = oaktline;
2114                                                listbox->gridcol = ogridcol;
2115                                                addscreenrc(grid, listbox);
2116                                        }
2117                                }
2118                                else if(check == 22)
2119                                {
2120                                        if(superrtlnow_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "SuperRtlNow - Search (local)", tmpstr, 0) == 0)
2121                                        {
2122                                                oaktpage = listbox->aktpage;
2123                                                oaktline = listbox->aktline;
2124                                                ogridcol = listbox->gridcol;
2125                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2126                                                char* tmpstr1 = ostrcat("SuperRtlNow - Search (local)", " - ", 0, 0);
2127                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2128                                                screentithekplay(tmpstr, tmpstr2, 0);
2129                                                free(tmpstr); tmpstr = NULL;
2130                                                free(tmpstr2); tmpstr2 = NULL;
2131                       
2132                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2133                                                if(pagecount == 0 || tithekexit == 1) break;
2134
2135                                                listbox->aktpage = oaktpage;
2136                                                listbox->aktline = oaktline;
2137                                                listbox->gridcol = ogridcol;
2138                                                addscreenrc(grid, listbox);
2139                                        }
2140                                }
2141                                else if(check == 23)
2142                                {
2143                                        if(voxnow_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "VoxNow - Search (local)", tmpstr, 0) == 0)
2144                                        {
2145                                                oaktpage = listbox->aktpage;
2146                                                oaktline = listbox->aktline;
2147                                                ogridcol = listbox->gridcol;
2148                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2149                                                char* tmpstr1 = ostrcat("VoxNow - Search (local)", " - ", 0, 0);
2150                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2151                                                screentithekplay(tmpstr, tmpstr2, 0);
2152                                                free(tmpstr); tmpstr = NULL;
2153                                                free(tmpstr2); tmpstr2 = NULL;
2154                       
2155                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2156                                                if(pagecount == 0 || tithekexit == 1) break;
2157
2158                                                listbox->aktpage = oaktpage;
2159                                                listbox->aktline = oaktline;
2160                                                listbox->gridcol = ogridcol;
2161                                                addscreenrc(grid, listbox);
2162                                        }
2163                                }
2164                                else if(check == 24)
2165                                {
2166                                        if(xvideos_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Xvideos - Search (local)", tmpstr, 0) == 0)
2167                                        {
2168                                                oaktpage = listbox->aktpage;
2169                                                oaktline = listbox->aktline;
2170                                                ogridcol = listbox->gridcol;
2171                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2172                                                char* tmpstr1 = ostrcat("Xvideos - Search (local)", " - ", 0, 0);
2173                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2174                                                screentithekplay(tmpstr, tmpstr2, 0);
2175                                                free(tmpstr); tmpstr = NULL;
2176                                                free(tmpstr2); tmpstr2 = NULL;
2177                       
2178                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2179                                                if(pagecount == 0 || tithekexit == 1) break;
2180
2181                                                listbox->aktpage = oaktpage;
2182                                                listbox->aktline = oaktline;
2183                                                listbox->gridcol = ogridcol;
2184                                                addscreenrc(grid, listbox);
2185                                        }
2186                                }
2187                                else if(check == 25)
2188                                {
2189                                        if(mlehd_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Mle-HD - Search (local)", tmpstr, 0) == 0)
2190                                        {
2191                                                oaktpage = listbox->aktpage;
2192                                                oaktline = listbox->aktline;
2193                                                ogridcol = listbox->gridcol;
2194                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2195                                                char* tmpstr1 = ostrcat("Mle-HD - Search (local)", " - ", 0, 0);
2196                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2197                                                screentithekplay(tmpstr, tmpstr2, 0);
2198                                                free(tmpstr); tmpstr = NULL;
2199                                                free(tmpstr2); tmpstr2 = NULL;
2200                       
2201                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2202                                                if(pagecount == 0 || tithekexit == 1) break;
2203
2204                                                listbox->aktpage = oaktpage;
2205                                                listbox->aktline = oaktline;
2206                                                listbox->gridcol = ogridcol;
2207                                                addscreenrc(grid, listbox);
2208                                        }
2209                                }
2210                                else if(check == 26)
2211                                {
2212                                        if(netzkino_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Netzkino - Search (local)", tmpstr, 0) == 0)
2213                                        {
2214                                                oaktpage = listbox->aktpage;
2215                                                oaktline = listbox->aktline;
2216                                                ogridcol = listbox->gridcol;
2217                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2218                                                char* tmpstr1 = ostrcat("Netzkino - Search (local)", " - ", 0, 0);
2219                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2220                                                screentithekplay(tmpstr, tmpstr2, 0);
2221                                                free(tmpstr); tmpstr = NULL;
2222                                                free(tmpstr2); tmpstr2 = NULL;
2223                       
2224                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2225                                                if(pagecount == 0 || tithekexit == 1) break;
2226
2227                                                listbox->aktpage = oaktpage;
2228                                                listbox->aktline = oaktline;
2229                                                listbox->gridcol = ogridcol;
2230                                                addscreenrc(grid, listbox);
2231                                        }
2232                                }
2233/*
2234why ?
2235                                else if((((struct tithek*)listbox->select->handle)->flag == 13))
2236                                {
2237                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "MyVideo - Search", tmpstr, 0) == 0)
2238                                        {
2239                                                oaktpage = listbox->aktpage;
2240                                                oaktline = listbox->aktline;
2241                                                ogridcol = listbox->gridcol;
2242                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2243                                                char* tmpstr1 = ostrcat("MyVideo - Search", " - ", 0, 0);
2244                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2245                                                screentithekplay(tmpstr, tmpstr2, 0);
2246                                                free(tmpstr); tmpstr = NULL;
2247                                                free(tmpstr2); tmpstr2 = NULL;
2248                       
2249                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2250                                                if(pagecount == 0 || tithekexit == 1) break;
2251
2252                                                listbox->aktpage = oaktpage;
2253                                                listbox->aktline = oaktline;
2254                                                listbox->gridcol = ogridcol;
2255                                                addscreenrc(grid, listbox);
2256                                        }
2257                                }
2258*/
2259                                free(tmpstr), tmpstr = NULL;
2260                        }
2261                }
2262                else if(rcret == getrcconfigint("rcok", NULL))
2263                {
2264                        if(listbox->select != NULL && listbox->select->handle != NULL)
2265                        {
2266                                clearscreen(grid);
2267
2268                                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))
2269                                {
2270                                        submenu(listbox, load, title);
2271                                        drawscreen(grid, 0, 0);
2272                                }
2273                                else if((((struct tithek*)listbox->select->handle)->flag == 9) || (((struct tithek*)listbox->select->handle)->flag == 10) || (((struct tithek*)listbox->select->handle)->flag == 11))
2274                                {
2275                                        if(youtube_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL) == 0)
2276                                        {
2277                                                oaktpage = listbox->aktpage;
2278                                                oaktline = listbox->aktline;
2279                                                ogridcol = listbox->gridcol;
2280                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2281                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2282                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2283                                                screentithekplay(tmpstr, tmpstr2, 0);
2284                                                free(tmpstr); tmpstr = NULL;
2285                                                free(tmpstr2); tmpstr2 = NULL;
2286                       
2287                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2288                                                if(pagecount == 0 || tithekexit == 1) break;
2289
2290                                                listbox->aktpage = oaktpage;
2291                                                listbox->aktline = oaktline;
2292                                                listbox->gridcol = ogridcol;
2293                                                addscreenrc(grid, listbox);
2294                                        }
2295                                }
2296                                else if(((struct tithek*)listbox->select->handle)->flag == 13)
2297                                {
2298                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2299                                        {
2300                                                oaktpage = listbox->aktpage;
2301                                                oaktline = listbox->aktline;
2302                                                ogridcol = listbox->gridcol;
2303                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2304                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2305                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2306                                                screentithekplay(tmpstr, tmpstr2, 0);
2307                                                free(tmpstr); tmpstr = NULL;
2308                                                free(tmpstr2); tmpstr2 = NULL;
2309                       
2310                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2311                                                if(pagecount == 0 || tithekexit == 1) break;
2312
2313                                                listbox->aktpage = oaktpage;
2314                                                listbox->aktline = oaktline;
2315                                                listbox->gridcol = ogridcol;
2316                                                addscreenrc(grid, listbox);
2317                                        }
2318                                }
2319                                else if(((struct tithek*)listbox->select->handle)->flag == 24)
2320                                {
2321                                        if(internetradio_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2322                                        {
2323                                                oaktpage = listbox->aktpage;
2324                                                oaktline = listbox->aktline;
2325                                                ogridcol = listbox->gridcol;
2326                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2327                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2328                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2329                                                screentithekplay(tmpstr, tmpstr2, 0);
2330                                                free(tmpstr); tmpstr = NULL;
2331                                                free(tmpstr2); tmpstr2 = NULL;
2332                       
2333                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2334                                                if(pagecount == 0 || tithekexit == 1) break;
2335
2336                                                listbox->aktpage = oaktpage;
2337                                                listbox->aktline = oaktline;
2338                                                listbox->gridcol = ogridcol;
2339                                                addscreenrc(grid, listbox);
2340                                        }
2341                                }
2342                                else if(((struct tithek*)listbox->select->handle)->flag == 25)
2343                                {
2344                                        if(kinox_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2345                                        {
2346                                                oaktpage = listbox->aktpage;
2347                                                oaktline = listbox->aktline;
2348                                                ogridcol = listbox->gridcol;
2349                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2350                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2351                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2352                                                screentithekplay(tmpstr, tmpstr2, 0);
2353                                                free(tmpstr); tmpstr = NULL;
2354                                                free(tmpstr2); tmpstr2 = NULL;
2355                       
2356                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2357                                                if(pagecount == 0 || tithekexit == 1) break;
2358
2359                                                listbox->aktpage = oaktpage;
2360                                                listbox->aktline = oaktline;
2361                                                listbox->gridcol = ogridcol;
2362                                                addscreenrc(grid, listbox);
2363                                        }
2364                                }
2365                                else if(((struct tithek*)listbox->select->handle)->flag == 26)
2366                                {
2367                                        if(movie4k_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2368                                        {
2369                                                oaktpage = listbox->aktpage;
2370                                                oaktline = listbox->aktline;
2371                                                ogridcol = listbox->gridcol;
2372                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2373                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2374                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2375                                                screentithekplay(tmpstr, tmpstr2, 0);
2376                                                free(tmpstr); tmpstr = NULL;
2377                                                free(tmpstr2); tmpstr2 = NULL;
2378                       
2379                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2380                                                if(pagecount == 0 || tithekexit == 1) break;
2381
2382                                                listbox->aktpage = oaktpage;
2383                                                listbox->aktline = oaktline;
2384                                                listbox->gridcol = ogridcol;
2385                                                addscreenrc(grid, listbox);
2386                                        }
2387                                }
2388                                else if(((struct tithek*)listbox->select->handle)->flag == 27)
2389                                {
2390                                        if(solarmovie_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2391                                        {
2392                                                oaktpage = listbox->aktpage;
2393                                                oaktline = listbox->aktline;
2394                                                ogridcol = listbox->gridcol;
2395                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2396                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2397                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2398                                                screentithekplay(tmpstr, tmpstr2, 0);
2399                                                free(tmpstr); tmpstr = NULL;
2400                                                free(tmpstr2); tmpstr2 = NULL;
2401                       
2402                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2403                                                if(pagecount == 0 || tithekexit == 1) break;
2404
2405                                                listbox->aktpage = oaktpage;
2406                                                listbox->aktline = oaktline;
2407                                                listbox->gridcol = ogridcol;
2408                                                addscreenrc(grid, listbox);
2409                                        }
2410                                }
2411                                else if(((struct tithek*)listbox->select->handle)->flag == 47)
2412                                {
2413                                        if(internettv_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2414                                        {
2415                                                oaktpage = listbox->aktpage;
2416                                                oaktline = listbox->aktline;
2417                                                ogridcol = listbox->gridcol;
2418                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2419                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2420                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2421                                                screentithekplay(tmpstr, tmpstr2, 0);
2422                                                free(tmpstr); tmpstr = NULL;
2423                                                free(tmpstr2); tmpstr2 = NULL;
2424                       
2425                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2426                                                if(pagecount == 0 || tithekexit == 1) break;
2427
2428                                                listbox->aktpage = oaktpage;
2429                                                listbox->aktline = oaktline;
2430                                                listbox->gridcol = ogridcol;
2431                                                addscreenrc(grid, listbox);
2432                                        }
2433                                }
2434                                else if(((struct tithek*)listbox->select->handle)->flag == 48)
2435                                {
2436                                        if(youtube_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2437                                        {
2438                                                oaktpage = listbox->aktpage;
2439                                                oaktline = listbox->aktline;
2440                                                ogridcol = listbox->gridcol;
2441                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2442                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2443                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2444                                                screentithekplay(tmpstr, tmpstr2, 0);
2445                                                free(tmpstr); tmpstr = NULL;
2446                                                free(tmpstr2); tmpstr2 = NULL;
2447                       
2448                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2449                                                if(pagecount == 0 || tithekexit == 1) break;
2450
2451                                                listbox->aktpage = oaktpage;
2452                                                listbox->aktline = oaktline;
2453                                                listbox->gridcol = ogridcol;
2454                                                addscreenrc(grid, listbox);
2455                                        }
2456                                }
2457                                else if(((struct tithek*)listbox->select->handle)->flag == 49)
2458                                {
2459                                        if(myvideo_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2460                                        {
2461                                                oaktpage = listbox->aktpage;
2462                                                oaktline = listbox->aktline;
2463                                                ogridcol = listbox->gridcol;
2464                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2465                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2466                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2467                                                screentithekplay(tmpstr, tmpstr2, 0);
2468                                                free(tmpstr); tmpstr = NULL;
2469                                                free(tmpstr2); tmpstr2 = NULL;
2470                       
2471                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2472                                                if(pagecount == 0 || tithekexit == 1) break;
2473
2474                                                listbox->aktpage = oaktpage;
2475                                                listbox->aktline = oaktline;
2476                                                listbox->gridcol = ogridcol;
2477                                                addscreenrc(grid, listbox);
2478                                        }
2479                                }
2480                                else if(((struct tithek*)listbox->select->handle)->flag == 51)
2481                                {
2482                                        if(ard_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2483                                        {
2484                                                oaktpage = listbox->aktpage;
2485                                                oaktline = listbox->aktline;
2486                                                ogridcol = listbox->gridcol;
2487                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2488                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2489                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2490                                                screentithekplay(tmpstr, tmpstr2, 0);
2491                                                free(tmpstr); tmpstr = NULL;
2492                                                free(tmpstr2); tmpstr2 = NULL;
2493                       
2494                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2495                                                if(pagecount == 0 || tithekexit == 1) break;
2496
2497                                                listbox->aktpage = oaktpage;
2498                                                listbox->aktline = oaktline;
2499                                                listbox->gridcol = ogridcol;
2500                                                addscreenrc(grid, listbox);
2501                                        }
2502                                }
2503                                else if(((struct tithek*)listbox->select->handle)->flag == 52)
2504                                {
2505                                        if(zdf_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2506                                        {
2507                                                oaktpage = listbox->aktpage;
2508                                                oaktline = listbox->aktline;
2509                                                ogridcol = listbox->gridcol;
2510                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2511                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2512                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2513                                                screentithekplay(tmpstr, tmpstr2, 0);
2514                                                free(tmpstr); tmpstr = NULL;
2515                                                free(tmpstr2); tmpstr2 = NULL;
2516                       
2517                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2518                                                if(pagecount == 0 || tithekexit == 1) break;
2519
2520                                                listbox->aktpage = oaktpage;
2521                                                listbox->aktline = oaktline;
2522                                                listbox->gridcol = ogridcol;
2523                                                addscreenrc(grid, listbox);
2524                                        }
2525                                }
2526                                else if(((struct tithek*)listbox->select->handle)->flag == 53)
2527                                {
2528                                        if(tectime_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2529                                        {
2530                                                oaktpage = listbox->aktpage;
2531                                                oaktline = listbox->aktline;
2532                                                ogridcol = listbox->gridcol;
2533                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2534                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2535                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2536                                                screentithekplay(tmpstr, tmpstr2, 0);
2537                                                free(tmpstr); tmpstr = NULL;
2538                                                free(tmpstr2); tmpstr2 = NULL;
2539                       
2540                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2541                                                if(pagecount == 0 || tithekexit == 1) break;
2542
2543                                                listbox->aktpage = oaktpage;
2544                                                listbox->aktline = oaktline;
2545                                                listbox->gridcol = ogridcol;
2546                                                addscreenrc(grid, listbox);
2547                                        }
2548                                }
2549                                else if(((struct tithek*)listbox->select->handle)->flag == 54)
2550                                {
2551                                        if(giga_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2552                                        {
2553                                                oaktpage = listbox->aktpage;
2554                                                oaktline = listbox->aktline;
2555                                                ogridcol = listbox->gridcol;
2556                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2557                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2558                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2559                                                screentithekplay(tmpstr, tmpstr2, 0);
2560                                                free(tmpstr); tmpstr = NULL;
2561                                                free(tmpstr2); tmpstr2 = NULL;
2562                       
2563                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2564                                                if(pagecount == 0 || tithekexit == 1) break;
2565
2566                                                listbox->aktpage = oaktpage;
2567                                                listbox->aktline = oaktline;
2568                                                listbox->gridcol = ogridcol;
2569                                                addscreenrc(grid, listbox);
2570                                        }
2571                                }
2572                                else if(((struct tithek*)listbox->select->handle)->flag == 55)
2573                                {
2574                                        if(beeg_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2575                                        {
2576                                                oaktpage = listbox->aktpage;
2577                                                oaktline = listbox->aktline;
2578                                                ogridcol = listbox->gridcol;
2579                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2580                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2581                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2582                                                screentithekplay(tmpstr, tmpstr2, 0);
2583                                                free(tmpstr); tmpstr = NULL;
2584                                                free(tmpstr2); tmpstr2 = NULL;
2585                       
2586                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2587                                                if(pagecount == 0 || tithekexit == 1) break;
2588
2589                                                listbox->aktpage = oaktpage;
2590                                                listbox->aktline = oaktline;
2591                                                listbox->gridcol = ogridcol;
2592                                                addscreenrc(grid, listbox);
2593                                        }
2594                                }
2595                                else if(((struct tithek*)listbox->select->handle)->flag == 56)
2596                                {
2597                                        if(rtl2now_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2598                                        {
2599                                                oaktpage = listbox->aktpage;
2600                                                oaktline = listbox->aktline;
2601                                                ogridcol = listbox->gridcol;
2602                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2603                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2604                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2605                                                screentithekplay(tmpstr, tmpstr2, 0);
2606                                                free(tmpstr); tmpstr = NULL;
2607                                                free(tmpstr2); tmpstr2 = NULL;
2608                       
2609                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2610                                                if(pagecount == 0 || tithekexit == 1) break;
2611
2612                                                listbox->aktpage = oaktpage;
2613                                                listbox->aktline = oaktline;
2614                                                listbox->gridcol = ogridcol;
2615                                                addscreenrc(grid, listbox);
2616                                        }
2617                                }
2618                                else if(((struct tithek*)listbox->select->handle)->flag == 57)
2619                                {
2620                                        if(rtlnow_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2621                                        {
2622                                                oaktpage = listbox->aktpage;
2623                                                oaktline = listbox->aktline;
2624                                                ogridcol = listbox->gridcol;
2625                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2626                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2627                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2628                                                screentithekplay(tmpstr, tmpstr2, 0);
2629                                                free(tmpstr); tmpstr = NULL;
2630                                                free(tmpstr2); tmpstr2 = NULL;
2631                       
2632                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2633                                                if(pagecount == 0 || tithekexit == 1) break;
2634
2635                                                listbox->aktpage = oaktpage;
2636                                                listbox->aktline = oaktline;
2637                                                listbox->gridcol = ogridcol;
2638                                                addscreenrc(grid, listbox);
2639                                        }
2640                                }
2641                                else if(((struct tithek*)listbox->select->handle)->flag == 58)
2642                                {
2643                                        if(superrtlnow_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2644                                        {
2645                                                oaktpage = listbox->aktpage;
2646                                                oaktline = listbox->aktline;
2647                                                ogridcol = listbox->gridcol;
2648                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2649                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2650                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2651                                                screentithekplay(tmpstr, tmpstr2, 0);
2652                                                free(tmpstr); tmpstr = NULL;
2653                                                free(tmpstr2); tmpstr2 = NULL;
2654                       
2655                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2656                                                if(pagecount == 0 || tithekexit == 1) break;
2657
2658                                                listbox->aktpage = oaktpage;
2659                                                listbox->aktline = oaktline;
2660                                                listbox->gridcol = ogridcol;
2661                                                addscreenrc(grid, listbox);
2662                                        }
2663                                }
2664                                else if(((struct tithek*)listbox->select->handle)->flag == 59)
2665                                {
2666                                        if(voxnow_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2667                                        {
2668                                                oaktpage = listbox->aktpage;
2669                                                oaktline = listbox->aktline;
2670                                                ogridcol = listbox->gridcol;
2671                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2672                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2673                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2674                                                screentithekplay(tmpstr, tmpstr2, 0);
2675                                                free(tmpstr); tmpstr = NULL;
2676                                                free(tmpstr2); tmpstr2 = NULL;
2677                       
2678                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2679                                                if(pagecount == 0 || tithekexit == 1) break;
2680
2681                                                listbox->aktpage = oaktpage;
2682                                                listbox->aktline = oaktline;
2683                                                listbox->gridcol = ogridcol;
2684                                                addscreenrc(grid, listbox);
2685                                        }
2686                                }
2687                                else if(((struct tithek*)listbox->select->handle)->flag == 60)
2688                                {
2689                                        if(xvideos_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2690                                        {
2691                                                oaktpage = listbox->aktpage;
2692                                                oaktline = listbox->aktline;
2693                                                ogridcol = listbox->gridcol;
2694                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2695                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2696                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2697                                                screentithekplay(tmpstr, tmpstr2, 0);
2698                                                free(tmpstr); tmpstr = NULL;
2699                                                free(tmpstr2); tmpstr2 = NULL;
2700                       
2701                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2702                                                if(pagecount == 0 || tithekexit == 1) break;
2703
2704                                                listbox->aktpage = oaktpage;
2705                                                listbox->aktline = oaktline;
2706                                                listbox->gridcol = ogridcol;
2707                                                addscreenrc(grid, listbox);
2708                                        }
2709                                }
2710                                else if(((struct tithek*)listbox->select->handle)->flag == 61)
2711                                {
2712                                        if(mlehd_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2713                                        {
2714                                                oaktpage = listbox->aktpage;
2715                                                oaktline = listbox->aktline;
2716                                                ogridcol = listbox->gridcol;
2717                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2718                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2719                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2720                                                screentithekplay(tmpstr, tmpstr2, 0);
2721                                                free(tmpstr); tmpstr = NULL;
2722                                                free(tmpstr2); tmpstr2 = NULL;
2723                       
2724                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2725                                                if(pagecount == 0 || tithekexit == 1) break;
2726
2727                                                listbox->aktpage = oaktpage;
2728                                                listbox->aktline = oaktline;
2729                                                listbox->gridcol = ogridcol;
2730                                                addscreenrc(grid, listbox);
2731                                        }
2732                                }
2733                                else if(((struct tithek*)listbox->select->handle)->flag == 62)
2734                                {
2735                                        if(netzkino_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2736                                        {
2737                                                oaktpage = listbox->aktpage;
2738                                                oaktline = listbox->aktline;
2739                                                ogridcol = listbox->gridcol;
2740                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2741                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2742                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2743                                                screentithekplay(tmpstr, tmpstr2, 0);
2744                                                free(tmpstr); tmpstr = NULL;
2745                                                free(tmpstr2); tmpstr2 = NULL;
2746                       
2747                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2748                                                if(pagecount == 0 || tithekexit == 1) break;
2749
2750                                                listbox->aktpage = oaktpage;
2751                                                listbox->aktline = oaktline;
2752                                                listbox->gridcol = ogridcol;
2753                                                addscreenrc(grid, listbox);
2754                                        }
2755                                }
2756                                else if(((struct tithek*)listbox->select->handle)->flag == 44)
2757                                {
2758                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
2759                                        {
2760                                                oaktpage = listbox->aktpage;
2761                                                oaktline = listbox->aktline;
2762                                                ogridcol = listbox->gridcol;
2763                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2764                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2765                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2766                                                screentithekplay(tmpstr, tmpstr2, 0);
2767                                                free(tmpstr); tmpstr = NULL;
2768                                                free(tmpstr2); tmpstr2 = NULL;
2769                       
2770                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2771                                                if(pagecount == 0 || tithekexit == 1) break;
2772
2773                                                listbox->aktpage = oaktpage;
2774                                                listbox->aktline = oaktline;
2775                                                listbox->gridcol = ogridcol;
2776                                                addscreenrc(grid, listbox);
2777                                        }
2778                                }
2779                                else if((((struct tithek*)listbox->select->handle)->flag == 21))
2780                                {
2781                                        if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2782                                        {
2783                                                oaktpage = listbox->aktpage;
2784                                                oaktline = listbox->aktline;
2785                                                ogridcol = listbox->gridcol;
2786                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2787                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2788                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2789                                                screentithekplay(tmpstr, tmpstr2, 0);
2790                                                free(tmpstr); tmpstr = NULL;
2791                                                free(tmpstr2); tmpstr2 = NULL;
2792
2793                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2794                                                if(pagecount == 0 || tithekexit == 1) break;
2795
2796                                                listbox->aktpage = oaktpage;
2797                                                listbox->aktline = oaktline;
2798                                                listbox->gridcol = ogridcol;
2799                                                addscreenrc(grid, listbox);
2800                                        }
2801                                }
2802                                else if((((struct tithek*)listbox->select->handle)->flag == 33))
2803                                {
2804                                        if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2805                                        {
2806                                                oaktpage = listbox->aktpage;
2807                                                oaktline = listbox->aktline;
2808                                                ogridcol = listbox->gridcol;
2809                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2810                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2811                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2812                                                screentithekplay(tmpstr, tmpstr2, 0);
2813                                                free(tmpstr); tmpstr = NULL;
2814                                                free(tmpstr2); tmpstr2 = NULL;
2815
2816                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2817                                                if(pagecount == 0 || tithekexit == 1) break;
2818
2819                                                listbox->aktpage = oaktpage;
2820                                                listbox->aktline = oaktline;
2821                                                listbox->gridcol = ogridcol;
2822                                                addscreenrc(grid, listbox);
2823                                        }
2824                                }                               
2825                                else if(((struct tithek*)listbox->select->handle)->flag == 29)
2826                                {
2827                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2828                                        {
2829                                                oaktpage = listbox->aktpage;
2830                                                oaktline = listbox->aktline;
2831                                                ogridcol = listbox->gridcol;
2832                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2833                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2834                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2835                                                screentithekplay(tmpstr, tmpstr2, 0);
2836                                                free(tmpstr); tmpstr = NULL;
2837                                                free(tmpstr2); tmpstr2 = NULL;
2838
2839                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2840                                                if(pagecount == 0 || tithekexit == 1) break;
2841
2842                                                listbox->aktpage = oaktpage;
2843                                                listbox->aktline = oaktline;
2844                                                listbox->gridcol = ogridcol;
2845                                                addscreenrc(grid, listbox);
2846                                        }
2847                                }
2848                                else if(((struct tithek*)listbox->select->handle)->flag == 30)
2849                                {
2850                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
2851                                        {
2852                                                oaktpage = listbox->aktpage;
2853                                                oaktline = listbox->aktline;
2854                                                ogridcol = listbox->gridcol;
2855                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2856                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2857                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2858                                                screentithekplay(tmpstr, tmpstr2, 0);
2859                                                free(tmpstr); tmpstr = NULL;
2860                                                free(tmpstr2); tmpstr2 = NULL;
2861
2862                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2863                                                if(pagecount == 0 || tithekexit == 1) break;
2864
2865                                                listbox->aktpage = oaktpage;
2866                                                listbox->aktline = oaktline;
2867                                                listbox->gridcol = ogridcol;
2868                                                addscreenrc(grid, listbox);
2869                                        }
2870                                }
2871                                else if((((struct tithek*)listbox->select->handle)->flag == 31))
2872                                {
2873                                        if(kinox_search_cast(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL) == 0)
2874                                        {
2875                                                oaktpage = listbox->aktpage;
2876                                                oaktline = listbox->aktline;
2877                                                ogridcol = listbox->gridcol;
2878                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2879                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2880                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2881                                                screentithekplay(tmpstr, tmpstr2, 0);
2882                                                free(tmpstr); tmpstr = NULL;
2883                                                free(tmpstr2); tmpstr2 = NULL;
2884
2885                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2886                                                if(pagecount == 0 || tithekexit == 1) break;
2887
2888                                                listbox->aktpage = oaktpage;
2889                                                listbox->aktline = oaktline;
2890                                                listbox->gridcol = ogridcol;
2891                                                addscreenrc(grid, listbox);
2892                                        }
2893                                }
2894                                else if((((struct tithek*)listbox->select->handle)->flag == 32))
2895                                {
2896                                        if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
2897                                        {
2898                                                oaktpage = listbox->aktpage;
2899                                                oaktline = listbox->aktline;
2900                                                ogridcol = listbox->gridcol;
2901                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2902                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2903                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2904                                                screentithekplay(tmpstr, tmpstr2, 0);
2905                                                free(tmpstr); tmpstr = NULL;
2906                                                free(tmpstr2); tmpstr2 = NULL;
2907
2908                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2909                                                if(pagecount == 0 || tithekexit == 1) break;
2910
2911                                                listbox->aktpage = oaktpage;
2912                                                listbox->aktline = oaktline;
2913                                                listbox->gridcol = ogridcol;
2914                                                addscreenrc(grid, listbox);
2915                                        }
2916                                }
2917                                else if((((struct tithek*)listbox->select->handle)->flag == 33))
2918                                {
2919                                        if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
2920                                        {
2921                                                oaktpage = listbox->aktpage;
2922                                                oaktline = listbox->aktline;
2923                                                ogridcol = listbox->gridcol;
2924                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2925                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2926                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2927                                                screentithekplay(tmpstr, tmpstr2, 0);
2928                                                free(tmpstr); tmpstr = NULL;
2929                                                free(tmpstr2); tmpstr2 = NULL;
2930
2931                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 3);
2932                                                if(pagecount == 0 || tithekexit == 1) break;
2933
2934                                                listbox->aktpage = oaktpage;
2935                                                listbox->aktline = oaktline;
2936                                                listbox->gridcol = ogridcol;
2937                                                addscreenrc(grid, listbox);
2938                                        }
2939                                }
2940                                else if((((struct tithek*)listbox->select->handle)->flag == 34) || (((struct tithek*)listbox->select->handle)->flag == 35))
2941                                {
2942                                        if(movie4k_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2943                                        {
2944                                                oaktpage = listbox->aktpage;
2945                                                oaktline = listbox->aktline;
2946                                                ogridcol = listbox->gridcol;
2947                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2948                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2949                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2950                                                screentithekplay(tmpstr, tmpstr2, 0);
2951                                                free(tmpstr); tmpstr = NULL;
2952                                                free(tmpstr2); tmpstr2 = NULL;
2953
2954                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2955                                                if(pagecount == 0 || tithekexit == 1) break;
2956
2957                                                listbox->aktpage = oaktpage;
2958                                                listbox->aktline = oaktline;
2959                                                listbox->gridcol = ogridcol;
2960                                                addscreenrc(grid, listbox);
2961                                        }
2962                                }
2963                                else if((((struct tithek*)listbox->select->handle)->flag == 22))
2964                                {
2965                                        if(kinox_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2966                                        {
2967                                                oaktpage = listbox->aktpage;
2968                                                oaktline = listbox->aktline;
2969                                                ogridcol = listbox->gridcol;
2970                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2971                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2972                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2973                                                screentithekplay(tmpstr, tmpstr2, 0);
2974                                                free(tmpstr); tmpstr = NULL;
2975                                                free(tmpstr2); tmpstr2 = NULL;
2976
2977                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 3);
2978                                                if(pagecount == 0 || tithekexit == 1) break;
2979
2980                                                listbox->aktpage = oaktpage;
2981                                                listbox->aktline = oaktline;
2982                                                listbox->gridcol = ogridcol;
2983                                                addscreenrc(grid, listbox);
2984                                        }
2985                                }
2986                                else if((((struct tithek*)listbox->select->handle)->flag == 28))
2987                                {
2988                                        if(solarmovie_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2989                                        {
2990                                                oaktpage = listbox->aktpage;
2991                                                oaktline = listbox->aktline;
2992                                                ogridcol = listbox->gridcol;
2993                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
2994                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
2995                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
2996                                                screentithekplay(tmpstr, tmpstr2, 0);
2997                                                free(tmpstr); tmpstr = NULL;
2998                                                free(tmpstr2); tmpstr2 = NULL;
2999                       
3000                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 3);
3001                                                if(pagecount == 0 || tithekexit == 1) break;
3002
3003                                                listbox->aktpage = oaktpage;
3004                                                listbox->aktline = oaktline;
3005                                                listbox->gridcol = ogridcol;
3006                                                addscreenrc(grid, listbox);
3007                                        }
3008                                }
3009                                else if((((struct tithek*)listbox->select->handle)->flag == 23))
3010                                {
3011                                        if(kinox_hoster_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
3012                                        {
3013                                                oaktpage = listbox->aktpage;
3014                                                oaktline = listbox->aktline;
3015                                                ogridcol = listbox->gridcol;
3016                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
3017                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
3018                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
3019                                                screentithekplay(tmpstr, tmpstr2, 0);
3020                                                free(tmpstr); tmpstr = NULL;
3021                                                free(tmpstr2); tmpstr2 = NULL;
3022                       
3023                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3024                                                if(pagecount == 0 || tithekexit == 1) break;
3025
3026                                                listbox->aktpage = oaktpage;
3027                                                listbox->aktline = oaktline;
3028                                                listbox->gridcol = ogridcol;
3029                                                addscreenrc(grid, listbox);
3030                                        }
3031                                }
3032                                else if((((struct tithek*)listbox->select->handle)->flag == 36) || (((struct tithek*)listbox->select->handle)->flag == 37))
3033                                {
3034                                        if(movie4k_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
3035                                        {
3036                                                oaktpage = listbox->aktpage;
3037                                                oaktline = listbox->aktline;
3038                                                ogridcol = listbox->gridcol;
3039                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
3040                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
3041                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
3042                                                screentithekplay(tmpstr, tmpstr2, 0);
3043                                                free(tmpstr); tmpstr = NULL;
3044                                                free(tmpstr2); tmpstr2 = NULL;
3045                       
3046                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3047                                                if(pagecount == 0 || tithekexit == 1) break;
3048
3049                                                listbox->aktpage = oaktpage;
3050                                                listbox->aktline = oaktline;
3051                                                listbox->gridcol = ogridcol;
3052                                                addscreenrc(grid, listbox);
3053                                        }
3054                                }
3055                                else if((((struct tithek*)listbox->select->handle)->flag == 39))
3056                                {
3057                                        if(movie4k_series_listed(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
3058                                        {
3059                                                oaktpage = listbox->aktpage;
3060                                                oaktline = listbox->aktline;
3061                                                ogridcol = listbox->gridcol;
3062                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
3063                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
3064                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
3065                                                screentithekplay(tmpstr, tmpstr2, 0);
3066                                                free(tmpstr); tmpstr = NULL;
3067                                                free(tmpstr2); tmpstr2 = NULL;
3068                       
3069                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3070                                                if(pagecount == 0 || tithekexit == 1) break;
3071
3072                                                listbox->aktpage = oaktpage;
3073                                                listbox->aktline = oaktline;
3074                                                listbox->gridcol = ogridcol;
3075                                                addscreenrc(grid, listbox);
3076                                        }
3077                                }
3078                                else if((((struct tithek*)listbox->select->handle)->flag == 40))
3079                                {
3080                                        if(movie4k_hoster_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
3081                                        {
3082                                                oaktpage = listbox->aktpage;
3083                                                oaktline = listbox->aktline;
3084                                                ogridcol = listbox->gridcol;
3085                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
3086                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);
3087                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
3088                                                screentithekplay(tmpstr, tmpstr2, 0);
3089                                                free(tmpstr); tmpstr = NULL;
3090                                                free(tmpstr2); tmpstr2 = NULL;
3091                       
3092                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3093                                                if(pagecount == 0 || tithekexit == 1) break;
3094
3095                                                listbox->aktpage = oaktpage;
3096                                                listbox->aktline = oaktline;
3097                                                listbox->gridcol = ogridcol;
3098                                                addscreenrc(grid, listbox);
3099                                        }
3100                                }
3101                                else if((((struct tithek*)listbox->select->handle)->flag == 66))
3102                                {
3103                                        textbox(_("Message"), _("The hoster is not yet supported !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0);
3104                                        continue;
3105                                }       
3106                                else if((((struct tithek*)listbox->select->handle)->flag == 3))
3107                                {
3108                                        int pincheck = 0;
3109                                        if(((struct tithek*)listbox->select->handle)->flag == 1000)
3110                                                pincheck = screenpincheck(0, NULL);
3111                                        if(pincheck == 0)
3112                                        {
3113                                                oaktpage = listbox->aktpage;
3114                                                oaktline = listbox->aktline;
3115                                                ogridcol = listbox->gridcol;
3116                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
3117                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);                                     
3118                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
3119                                                screentithekplay(tmpstr, tmpstr2, 3);
3120                                                free(tmpstr); tmpstr = NULL;
3121                                                free(tmpstr2); tmpstr2 = NULL; 
3122
3123                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3124                                                if(pagecount == 0 || tithekexit == 1) break;
3125
3126                                                listbox->aktpage = oaktpage;
3127                                                listbox->aktline = oaktline;
3128                                                listbox->gridcol = ogridcol;
3129                                                addscreenrc(grid, listbox);
3130                                        }
3131                                }
3132                                else
3133                                {
3134                                        int pincheck = 0;
3135                                        if(((struct tithek*)listbox->select->handle)->flag == 1000)
3136                                                pincheck = screenpincheck(0, NULL);
3137                                        if(pincheck == 0)
3138                                        {
3139                                                oaktpage = listbox->aktpage;
3140                                                oaktline = listbox->aktline;
3141                                                ogridcol = listbox->gridcol;
3142                                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
3143                                                char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0);                                     
3144                                                char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0);
3145                                                screentithekplay(tmpstr, tmpstr2, 0);
3146                                               
3147                                                free(tmpstr); tmpstr = NULL;
3148                                                free(tmpstr2); tmpstr2 = NULL; 
3149
3150                                                pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3151                                                if(pagecount == 0 || tithekexit == 1) break;
3152
3153                                                listbox->aktpage = oaktpage;
3154                                                listbox->aktline = oaktline;
3155                                                listbox->gridcol = ogridcol;
3156                                                addscreenrc(grid, listbox);
3157                                        }
3158                                }
3159                                drawscreen(grid, 0, 0);
3160                        }                       
3161                }
3162                else if(rcret == getrcconfigint("rcyellow", NULL) && ostrcmp(title, "TiThek - Favoriten") == 0)
3163                {
3164                        if(listbox->select != NULL && listbox->select->handle != NULL)
3165                        {
3166                                if(textbox(_("Message"), _("Remove this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0) == 1)
3167                                {
3168                                        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);             
3169                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3170                                        if(pagecount == 0) return;
3171                                               
3172                                        drawscreen(grid, 0, 0);
3173                                }
3174                        }
3175                }
3176                else if(rcret == getrcconfigint("rcgreen", NULL) && ostrcmp(title, "TiThek - Favoriten") != 0)
3177                {
3178                        if(listbox->select != NULL && listbox->select->handle != NULL)
3179                        {
3180                                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)
3181                                {
3182                                        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);         
3183                                }
3184                        }
3185                }
3186                else if(rcret == getrcconfigint("rcgreen", NULL) && ostrcmp(title, "TiThek - Favoriten") == 0)
3187                {
3188                        if(listbox->select != NULL && listbox->select->handle != NULL)
3189                        {
3190                                if(textbox(_("Message"), _("Edit this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0) == 1)
3191                                {
3192                                        editfav(((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);               
3193                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
3194                                        if(pagecount == 0) return;
3195                                               
3196                                        drawscreen(grid, 0, 0);
3197                                }
3198                        }
3199                }
3200
3201                if (ostrcmp(title, "TiThek - Favoriten") == 0)
3202                {
3203                        changetext(b4, _("EDIT FAV"));
3204                        b5->hidden = NO;
3205                }
3206                else
3207                {
3208                        changetext(b4, _("ADD FAV"));
3209                        b5->hidden = YES;
3210                }
3211        }
3212
3213        delmarkedscreennodes(grid, 1);
3214        delownerrc(grid);
3215        clearscreen(grid);
3216
3217        if(first == 1)
3218        {
3219                freetithek();
3220                delallfiles("/tmp/tithek", NULL);
3221                if(status.mcaktiv == 0)
3222                        servicecheckret(servicestart(status.lastservice->channel, NULL, NULL, 0), 0);
3223        }
3224}
3225
3226#endif
Note: See TracBrowser for help on using the repository browser.