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

Last change on this file since 22715 was 22715, checked in by obi, 11 years ago

fix

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