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

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

remove redmenu / puffer png filename translate

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