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

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

fix error redmenu / tithek

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