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

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

[tithek] add internet radio search

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