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

Last change on this file since 39576 was 39576, checked in by gost, 7 years ago

test

File size: 89.5 KB
RevLine 
[18027]1#ifndef TITHEK_H
2#define TITHEK_H
3
4#define TITHEKPATH "/tmp/tithek"
[19570]5int tithekdownloadrun = 0;
6int tithekdownloadcount = 0;
7int tithekrun = 0;
[19572]8int tithekexit = 0;
[22215]9int tithekmovie4k = 0;
10int tithekkinox = 0;
11int titheksolarmovie = 0;
12int tithekmlehd = 0;
[36122]13int amazonlogin = 0;
[18027]14
15//flag 0        - menu
16//flag 1        - menu pay hidden tithek_pay=0/1 0=hidden
17//flag 2        - http (default streamurl)
[36122]18//flag 3        - http radio
[18027]19//flag 4        - youtube
[34605]20//flag 5        - nowtv //rtl2now
21//flag 6        - nowtv pay //superrtlnow
22//flag 7        - nowtv local serach //rtlnow
23//flag 8        - nowtv search //voxnow
[39009]24//flag 9        - youtube suche 10
[18027]25//flag 10       - youtube suche 25
26//flag 11       - youtube suche 50
27//flag 12       - myvideo
28//flag 13       - myvideo search 50
[25163]29//flag 14       - kinox play
[36168]30//flag 15       - giga old: hoster filenuke
[18027]31//flag 16       - superrtlnow pay
32//flag 17       - rtlnow pay
33//flag 18       - voxnow pay
34//flag 19       - rtl2now pay
[36172]35//flag 20       - netstream old: hoster StreamCloud
[18064]36//flag 21       - kinox search
37//flag 22       - kinox hoster
38//flag 23       - kinox hoster serie
[25158]39//flag 24       - internetradio local serach
40//flag 25       - kinox local serach
41//flag 26       - movie4k local serach
42//flag 27       - solarmovie local serach
[20021]43//flag 28       - solarmovie hoster
[20483]44//flag 29       - solarmovie search movie
45//flag 30       - solarmovie search serie
[20836]46//flag 31       - kinox search cast
[20840]47//flag 32       - kinox search cast results
[22215]48//flag 33       - movie4k search : serie > open seasons and list episode flag=40 > hoster listed flag=34
[22175]49//flag 34       - movie4k hoster de
50//flag 35       - movie4k hoster other
[39009]51//flag 36       - movie4k series de > open seasons and list episode flag=39 > hoster listed flag=34
[22215]52//flag 37       - movie4k series other > open seasons and list episode flag=39 > hoster listed flag=34
[22211]53//flag 38       - mlehd
[22215]54//flag 39   - movie4k_hoster_listed
55//flag 40   - movie4k_hoster_series
[22241]56//flag 41   - movie4k
[22584]57//flag 42   - xvideos
[23699]58//flag 43       - solarmovie
[23758]59//flag 44       - myvideo Single charts
[23995]60//flag 45       - ard
[24002]61//flag 46       - ard
[25158]62//flag 47   - internettv local serach
63//flag 48   - youtube local serach
64//flag 49   - myvideo local serach
65//flag 50       - beeg
66//flag 51   - ard local serach
67//flag 52   - zdf local serach
[25767]68//flag 53   - tectime local serach
[25158]69//flag 54   - giga local serach
70//flag 55   - beeg local serach
71//flag 56   - rtl2now local serach
72//flag 57   - rtlnow local serach
73//flag 58   - superrtlnow local serach
74//flag 59   - voxnow local serach
[25163]75//flag 60   - xvideos local serach
[25165]76//flag 61   - mlehd local serach
77//flag 62   - netzkino local serach
[28659]78//flag 63   - filmon local serach
[28839]79//flag 64   - tvtoast
80//flag 65   - tvtoast local serach
[28948]81//flag 66   - coming soon dummy
82//flag 67   - rtlnitronow
83//flag 68   - rtlnitronow pay
84//flag 69   - rtlnitronow local search
85//flag 70   - ntvnow
86//flag 71   - ntvnow pay
87//flag 72   - ntvnow local search
[30009]88//flag 73   - watchmovies movie
89//flag 74   - watchmovies series
90//flag 75   - watchmovies local search
[35286]91//flag 75   - amazon
[36122]92//flag 76   - amazon movie search
93//flag 77   - amazon series search
94//flag 78   - amazon series listed search
95//flag 79   - amazon watchlist movie
96//flag 80   - amazon watchlist tv
97//flag 81   - amazon popularity.rank movie
98//flag 82   - amazon next page
99//flag 83   - amazon popularity.rank tv
100//flag 84   - amazon popularity.kids movie
101//flag 85   - amazon popularity.kids tv
102//flag 86   - amazon currently movie
103//flag 87   - amazon genre movie
104//flag 88   - amazon genre movie listed
105//flag 89   - amazon genre tv
106//flag 90   - amazon genre tv listed
107//flag 91   - streamlive
[36132]108//flag 92   - cricfree
[36143]109//flag 93   - liveonlinetv
[36158]110//flag 94   - movie2k 41 movie4k
111//flag 95       - movie2k 34 movie4k hoster de
112//flag 96       - movie2k 35 movie4k hoster other
[36162]113//flag 97   - movie2k 26 movie4k local serach
[36254]114//flag 98   - nbaondemand
[36122]115
[34615]116//flag 100  - all local search
[36981]117//flag 111  - local parser parser.sh hoster/play
118//flag 112  - local parser parser.sh search
[18027]119//flag 1000 - menu pincode
120//flag 9999 - menu hidden codecpack
121
[28661]122// redmenu
123//check 1       - screenbgdownload(1)
124//check 2       - Search on KinoX
125//check 8       - Search on KinoX (local)
126//check 3       - Search on Solarmovies (movie)
127//check 4       - Search on Solarmovies (serie)
[28668]128//check 9       - Search on Solarmovies (local)
[28661]129//check 5       - Search on Youtube
130//check 10  - Search on Youtube (local)
131//check 6       - Search on MyVideo
132//check 11  - Search on MyVideo (local)
133//check 7       - Search on Movie4k
134//check 12  - Search on Movie4k (local)
135//check 13  - Search on InternetRadio (local)
136//check 14  - Search on InternetTv (local)
137//check 15      - Search on ARD (local)
138//check 16      - Search on ZDF (local)"
139//check 17      - Search on TecTime (local)
140//check 18      - Search on Giga (local)
141//check 19      - Search on Beeg (local)
[34615]142//check 20      - Search on NowTv (local)
[34617]143//check 21      - Search on All (local)
[34615]144
[34617]145//check 24      - Search on Xvideos (local)
146//check 25      - Search on Mle-HD (local)
147//check 26      - Search on Netzkino (local)
148//check 27      - Search on FilmOn (local)
149
150//removed
[28661]151//check 20      - Search on Rtl2-Now (local)
152//check 21      - Search on Rtl-Now (local)
153//check 22      - Search on SuperRTL-Now (local)
154//check 23      - Search on VOX-Now (local)
[28948]155//check 28      - Search on RtlNitro-Now (local)
156//check 29      - Search on NTV-Now (local)
[28661]157
[18027]158struct tithek
159{
160        char* title;
161        char* link;
162        char* pic;
163        char* localname;
[39009]164        char* menutitle;
[18027]165        int flag;
166        struct tithek* prev;
167        struct tithek* next;
168};
169struct tithek *tithek = NULL;
170
[19529]171
[19471]172void freetithekcontent(struct tithek* node)
173{
174        if(node == NULL) return;
175
176        free(node->title); node->title = NULL;
177        node->link = NULL;
178        node->pic = NULL;
179        node->localname = NULL;
180        node->menutitle = NULL;
181        node->flag = 0;
182}
183
184int addtithekcontent(struct tithek* node, char *line, int len, int count, int pay)
185{
[24153]186        int ret = 0, i = 0, skip = 0, hid = 0, sos = 0;
[22199]187        char* tmpstr = NULL, *flag = NULL, *cmd = NULL, *tmp = NULL;
[19471]188        if(node == NULL) return 1;
189
190        if(len > 0) tmpstr = malloc(len + 1);
191        if(tmpstr != NULL)
192        {
193                memcpy(tmpstr, line, len);
194                tmpstr[len] = '\0';
195
196                node->title = tmpstr;
197
198                while(tmpstr[0] != '\0')
199                {
200                        if(tmpstr[0] == '#')
201                        {
202                                tmpstr[0] = '\0';
203                                tmpstr++;
204                                switch(ret)
205                                {
206                                        case 0: node->link = tmpstr; break;
207                                        case 1: node->pic = tmpstr; break;
208                                        case 2: node->localname = tmpstr; break;
209                                        case 3: node->menutitle = tmpstr; break;
210                                        case 4: flag = tmpstr; break;
211                                }
212
213                                ret++;
214                        }
215                        else
216                                tmpstr++;
217                }
218        }
219
220        if(ret != 5)
221        {
222                if(count > 0)
223                {
224                        err("tithek line %d not ok (ret=%d)", count, ret);
225                }
226                else
227                {
228                        err("add tithek (ret=%d)", ret);
229                }
230                freetithekcontent(node);
231                return 1;
232        }
233
234        if(flag != NULL) node->flag = atoi(flag);
[39009]235
[24153]236        sos = getconfigint("sos", NULL);
[22712]237        hid = getconfigint("tithek_hid_xxx", NULL);
[22715]238        if(node->flag == 1000 && hid == 1)
[22712]239                skip = 1;
[23572]240        else if((node->flag == 9996 || node->flag == 9997 || node->flag == 9998 || node->flag == 9999) && !file_exist("/mnt/swapextensions/etc/.codecpack") && !file_exist("/var/swap/etc/.codecpack") && !file_exist("/var/etc/.codecpack"))
[19471]241                skip = 1;
[34605]242        else if(node->flag == 6 && pay == 0)
[19471]243                skip = 1;
244        else if(node->flag == 1 && pay == 0)
245                skip = 1;
[22175]246        else if(node->flag == 35 && pay == 0)
247                skip = 1;
[36158]248        else if(node->flag == 96 && pay == 0)
249                skip = 1;
[24153]250        else if(titheksolarmovie == 1 && node->flag == 9996 && sos == 0)
[19471]251        {
[38233]252                cmd = ostrcat(cmd, "www.thesolarmovie.me", 1, 0);
[39009]253
[22215]254                for(i = 0; i < 3; i++)
[22211]255                {
[22215]256                        free(tmp); tmp = NULL;
[24231]257                        tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2);
[22215]258                        if(tmp != NULL) break;
[22211]259                }
[22215]260                if(tmp == NULL)
261                        skip = 1;
262
263                titheksolarmovie = 0;
264        }
[24153]265        else if(tithekmovie4k == 1 && node->flag == 9997 && sos == 0)
[22215]266        {
[38233]267                cmd = ostrcat(cmd, "www.movie4k.to", 1, 0);
[39009]268
[22215]269                for(i = 0; i < 3; i++)
[22211]270                {
[22215]271                        free(tmp); tmp = NULL;
[24231]272                        tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2);
[22215]273                        if(tmp != NULL) break;
[22211]274                }
[22215]275                if(tmp == NULL)
276                        skip = 1;
277
278                tithekmovie4k = 0;
[39009]279        }
[24153]280        else if(tithekmlehd == 1 && node->flag == 9998 && sos == 0)
[22215]281        {
[38233]282                cmd = ostrcat(cmd, "www.mle-hd.se", 1, 0);
[39009]283
[22215]284                for(i = 0; i < 3; i++)
[22211]285                {
[22215]286                        free(tmp); tmp = NULL;
[24231]287                        tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2);
[22215]288                        if(tmp != NULL) break;
[22211]289                }
[22215]290                if(tmp == NULL)
291                        skip = 1;
292
293                tithekmlehd = 0;
294        }
[24153]295        else if(tithekkinox == 1 && node->flag == 9999 && sos == 0)
[22215]296        {
[38233]297                cmd = ostrcat(cmd, "kinox.me", 1, 0);
[39009]298
[19471]299                for(i = 0; i < 3; i++)
300                {
301                        free(tmp); tmp = NULL;
[24231]302                        tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2);
[19471]303                        if(tmp != NULL) break;
304                }
305                if(tmp == NULL)
306                        skip = 1;
[22215]307
308                tithekkinox = 0;
[19471]309        }
[22243]310
[19471]311        if(skip == 1)
312        {
313                freetithekcontent(node);
314                return 1;
315        }
316
[22199]317        free(tmp); tmp = NULL;
318        free(cmd), cmd = NULL;
[39009]319
[19471]320        return 0;
321}
322
323struct tithek* addtithek(char *line, int len, int count, struct tithek* last, int pay)
324{
325        //debug(1000, "in");
326        struct tithek *newnode = NULL, *prev = NULL, *node = NULL;
327        int ret = 0;
328
329        if(line == NULL) return NULL;
330
331        newnode = (struct tithek*)calloc(1, sizeof(struct tithek));
332        if(newnode == NULL)
333        {
334                err("no memory");
335                return NULL;
336        }
337
338        ret = addtithekcontent(newnode, line, len, count, pay);
339        if(ret == 1)
340        {
341                free(newnode);
342                return NULL;
343        }
344
345        node = tithek;
346
347        if(last == NULL)
348        {
349                while(node != NULL)
350                {
351                        prev = node;
352                        node = node->next;
353                }
354        }
355        else
356        {
357                prev = last;
358                node = last->next;
359        }
360
361        if(prev == NULL)
362                tithek = newnode;
363        else
364        {
365                prev->next = newnode;
366                newnode->prev = prev;
367        }
368        newnode->next = node;
369        if(node != NULL) node->prev = newnode;
370
371        //debug(1000, "out");
372        return newnode;
373}
374
[19535]375struct tithek* createtithek(struct tithek* update, char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
376{
377        int pay = 0;
378        struct tithek* tnode = NULL;
379        char* tmpstr = NULL;
[39009]380
[19535]381        pay = getconfigint("tithek_pay", NULL);
382
383        title = stringreplacechar(title, '#', ' ');
384        link = stringreplacechar(link, '#', ' ');
385        pic = stringreplacechar(pic, '#', ' ');
386        localname = stringreplacechar(localname, '#', ' ');
387        menutitle = stringreplacechar(menutitle, '#', ' ');
[39009]388
[19535]389        tmpstr = ostrcat(tmpstr, title, 1, 0);
390        tmpstr = ostrcat(tmpstr, "#", 1, 0);
391        tmpstr = ostrcat(tmpstr, link, 1, 0);
392        tmpstr = ostrcat(tmpstr, "#", 1, 0);
393        tmpstr = ostrcat(tmpstr, pic, 1, 0);
394        tmpstr = ostrcat(tmpstr, "#", 1, 0);
395        tmpstr = ostrcat(tmpstr, localname, 1, 0);
396        tmpstr = ostrcat(tmpstr, "#", 1, 0);
397        tmpstr = ostrcat(tmpstr, menutitle, 1, 0);
398        tmpstr = ostrcat(tmpstr, "#", 1, 0);
399        tmpstr = ostrcat(tmpstr, oitoa(flag), 1, 1);
400
401        tmpstr = string_replace_all("\n", "", tmpstr, 1);
402        tmpstr = string_replace_all("\r", "", tmpstr, 1);
403
404        if(update != NULL)
405        {
406                freetithekcontent(update);
407                addtithekcontent(update, tmpstr, strlen(tmpstr), 1, pay);
408                tnode = update;
409        }
410        else
411                tnode = addtithek(tmpstr, strlen(tmpstr), 1, NULL, pay);
412
413        free(tmpstr);
414
415        return tnode;
416}
417
[36211]418int readtithek(char* filename)
[18027]419{
420        debug(1000, "in");
421        FILE *fd = NULL;
[36211]422        char *fileline = NULL, *file = NULL;
[19471]423        int linecount = 0, len = 0, pay = 0;
424        struct tithek* last = NULL, *tmplast = NULL;
425
426        fileline = malloc(MINMALLOC);
427        if(fileline == NULL)
428        {
429                err("no memory");
430                return 1;
431        }
432
[36211]433//      if(cmpfilenameext(filename, ".sh") == 0)
[36966]434        if(ostrstr(filename, ".sh ") != NULL && ostrstr(filename, ".sh init") == NULL)
[36211]435        {
436                printf("[tithek] cmd: %s\n", filename);
437                debug(10, "cmd: %s", filename);
438                file = command(filename);
439                file = string_newline(file);
440                printf("[tithek] file: %s\n", file);
441                debug(10, "file: %s", file);
442        }
443        else
[39009]444                file = ostrcat(filename, NULL, 0, 0);
[36211]445
446        fd = fopen(file, "r");
[19471]447        if(fd == NULL)
448        {
[36211]449                perr("can't open %s", file);
[19471]450                free(fileline);
451                return 1;
452        }
453
454        pay = getconfigint("tithek_pay", NULL);
455
[36961]456        char* tmpstr = NULL;
457
[19471]458        while(fgets(fileline, MINMALLOC, fd) != NULL)
459        {
460                if(fileline[0] == '\n')
461                        continue;
462
[36966]463                len = strlen(fileline) - 1;
464                if(fileline[len] == '\n')
465                        fileline[len] = '\0';
466                if(fileline[len - 1] == '\r')
467                        fileline[len - 1] = '\0';
[36961]468
[19471]469                linecount++;
470
471                if(last == NULL) last = tmplast;
[36966]472                last = addtithek(fileline, len + 2, linecount, last, pay);
[19471]473                if(last != NULL) tmplast = last;
[36961]474                free(tmpstr), tmpstr = NULL;
[19471]475        }
476
477        free(fileline);
478        fclose(fd);
479        return linecount;
480}
481
[18027]482int deltithek(char* link)
483{
484        debug(1000, "in");
485        int ret = 1;
[19471]486
[18027]487        struct tithek *node = tithek, *prev = tithek;
488
489        while(node != NULL)
490        {
491                if(ostrcmp(link, node->link) == 0)
492                {
493                        ret = 0;
494                        if(node == tithek)
495                        {
496                                tithek = node->next;
497                                if(tithek != NULL)
498                                        tithek->prev = NULL;
499                        }
500                        else
501                        {
502                                prev->next = node->next;
503                                if(node->next != NULL)
504                                        node->next->prev = prev;
505                        }
506
[19471]507                        freetithekcontent(node);
508
509                        free(node);
510                        node = NULL;
511
512                        break;
513                }
514
515                prev = node;
516                node = node->next;
517        }
518
519        debug(1000, "out");
520        return ret;
521}
522
523void freetithek()
524{
525        debug(1000, "in");
526        struct tithek *node = tithek, *prev = tithek;
527
528        while(node != NULL)
529        {
530                prev = node;
531                node = node->next;
532                if(prev != NULL)
533                        deltithek(prev->link);
534        }
535
536        debug(1000, "out");
537}
538
[19554]539void tithekdownloadthread(struct stimerthread* timernode, struct download* node, int flag)
540{
[19832]541        int defpic = 0;
542
[19570]543        tithekdownloadcount++;
[19839]544
[19554]545        if(node != NULL)
[19568]546        {
[19841]547                m_lock(&status.tithekmutex, 20);
[19839]548                if(file_exist(node->filename))
549                {
[19841]550                        m_unlock(&status.tithekmutex, 20);
[19839]551                        goto end;
552                }
[19570]553
[19839]554                FILE *fd; fd = fopen(node->filename, "w");
555                if(fd != NULL) fclose(fd);
[19841]556                m_unlock(&status.tithekmutex, 20);
[19839]557
[19884]558                gethttpreal(node->host, node->page, node->port, node->filename, node->auth, NULL, 0, NULL, NULL, node->timeout, 0);
[19839]559
[19891]560                if(tithekrun == 0)
561                        unlink(node->filename);
562                else
[19583]563                {
[19891]564                        //check file size
[20932]565                        /*
[19891]566                        off64_t checkpic = getfilesize(node->filename);
[20836]567                        if(checkpic < 200) defpic = 1;
[20932]568                        */
[19891]569
570                        //check file is gif or html
571                        if(defpic == 0)
[19583]572                        {
[19891]573                                char* tmp = NULL;
574                                tmp = readbintomem(node->filename, 3);
[20933]575                                if(ostrncmp("GIF", tmp, 3) == 0) defpic = 1; //gif
576                                if(ostrncmp("<", tmp, 1) == 0) defpic = 1; //html
[19891]577                                free(tmp); tmp = NULL;
[19832]578                        }
[19891]579
580                        if(defpic == 1)
581                        {
582                                m_lock(&status.tithekmutex, 20);
583                                unlink(node->filename);
584                                symlink("/var/usr/local/share/titan/plugins/tithek/default.jpg", node->filename);
585                                m_unlock(&status.tithekmutex, 20);
586                        }
[19887]587                }
[19891]588
589end:
590                free(node->host); node->host = NULL;
591                free(node->page); node->page = NULL;
592                free(node->filename); node->filename = NULL;
593                free(node->auth); node->auth = NULL;
594        }
595
596        free(node); node = NULL;
597
598        tithekdownloadcount--;
599        tithekdownloadrun = 1;
600}
601
[18027]602char* tithekdownload(char* link, char* localname, char* pw, int pic, int flag)
603{
[36122]604        int ret = 1, port = 80, timeout = 10000, ssl = 0;
[18027]605        char* ip = NULL, *pos = NULL, *path = NULL;
606        char* tmpstr = NULL, *localfile = NULL;
607
608        if(link == NULL) return NULL;
[36122]609        if(ostrncmp("http://", link, 7) && ostrncmp("https://", link, 8)) return NULL;
[18027]610
[36122]611        if(!ostrncmp("https://", link, 8))
612                ssl = 1;
613        else
[18027]614        {
[36122]615                ip = string_replace("http://", "", (char*)link, 0);
[39009]616
[36122]617                // tithek security
618                ip = string_replace_all("imageshack.us/md/up/grd/", "atemio.dyndns.tv/", ip, 1);
[39009]619
[36122]620                ip = string_replace_all("kinox.to", "kinox.me", ip, 1);
621                //ip = string_replace_all("movie4k.to", "movie4k.me", ip, 1);
[39009]622
[36122]623                if(ip != NULL)
624                        pos = strchr(ip, '/');
625                if(pos != NULL)
626                {
627                        pos[0] = '\0';
628                        path = pos + 1;
629                }
[39009]630
[36122]631                if(ostrstr(ip, ":") != NULL)
632                {
633                        ip = oregex("http://(.*):.*", link);
634                        port = atoi(oregex("http://.*:(.*)/.*", link));
635                }
[18027]636        }
637
638        tmpstr = ostrcat(path, NULL, 0, 0);
639
640        if(flag == 0)
641        {
642                localfile = ostrcat(TITHEKPATH, "/", 0, 0);
643                if(localname == NULL)
644                        localfile = ostrcat(localfile, basename(tmpstr), 1, 0);
645                else
646                        localfile = ostrcat(localfile, localname, 1, 0);
647        }
648        else
649        {
[19797]650                localfile = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0);
[18027]651                if(localname == NULL)
652                        localfile = ostrcat(localfile, basename(tmpstr), 1, 0);
653                else
654                        localfile = ostrcat(localfile, localname, 1, 0);
655        }
[36122]656        free(tmpstr); tmpstr = NULL;
[18027]657
[19951]658/*
[19713]659        debug(99, "---------------------------------------");
660        debug(99, "link: %s", link);
661        debug(99, "localname: %s", localname);
662        debug(99, "---------------------------------------");
663        debug(99, "ip: %s", ip);
664        debug(99, "port: %d", port);
665        debug(99, "path: %s", path);
666        debug(99, "localfile: %s", localfile);
[36122]667        debug(99, "pw: %s", pw);
[19713]668        debug(99, "---------------------------------------");
[19951]669*/
[18027]670        if(flag == 0)
671        {
[19609]672                if(localfile != NULL && !file_exist(localfile))
[18027]673                {
674                        if(pic == 1)
[19554]675                        {
[36122]676                                if(ssl == 1)
677                                        gethttps(link, localfile, NULL, NULL, NULL, NULL, 0);
678                                else if(tithekdownloadcount >= 24) //start max 24 threads
[19884]679                                        gethttp(ip, path, port, localfile, pw, timeout, NULL, 0);
[19570]680                                else
[19554]681                                {
[19570]682                                        //dnode is freed in thread
683                                        struct download* dnode = calloc(1, sizeof(struct download));
684                                        if(dnode != NULL)
685                                        {
686                                                dnode->host = ostrcat(ip, NULL, 0, 0);
687                                                dnode->page = ostrcat(path, NULL, 0, 0);
[19713]688                                                dnode->port = port;
[19570]689                                                dnode->filename = ostrcat(localfile, NULL, 0, 0);
690                                                dnode->auth = ostrcat(pw, NULL, 0, 0);
691                                                dnode->connfd = -1;
692                                                dnode->ret = -1;
[19884]693                                                dnode->timeout = timeout;
[19570]694                                                addtimer(&tithekdownloadthread, START, 100, 1, (void*)dnode, NULL, NULL);
695                                        }
[19554]696                                }
697                        }
[18027]698                        else
[36938]699                        {
700                                if(ssl == 1)
701                                        gethttps(link, localfile, NULL, NULL, NULL, NULL, 0);
702                                else
[39009]703                                        gethttp(ip, path, port, localfile, pw, timeout, NULL, 0);
[36938]704                        }
[18027]705                }
706        }
707        else
708        {
[39009]709
[19609]710                if(localfile != NULL && file_exist(localfile))
[18027]711                        ret = textbox(_("Message"), _("File exist, overwrite?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0);
712
[19609]713                if(localfile != NULL && ret == 1)
[19884]714                        screendownload("Download", ip, path, port, localfile, pw, timeout, 0);
[18027]715        }
716
717        free(ip); ip = NULL;
718        free(tmpstr); tmpstr = NULL;
719
720        return localfile;
721}
722
[20271]723int createtithekplay(char* titheklink, struct skin* grid, struct skin* listbox, struct skin* countlabel, int flag)
[18027]724{
725        int gridbr = 0, posx = 0, count = 0, sumcount = 0, count1 = 0, pagecount = 0, skip = 0;
[18399]726        int localfile = 0;
[18027]727        struct skin* tmp = NULL;
728        char* tithekfile = NULL;
729        char* tmpstr = NULL;
730
[19713]731        if(!ostrncmp("http://", titheklink, 7))
[18027]732                tithekfile = tithekdownload(titheklink, NULL, HTTPAUTH, 0, 0);
733        else
[18399]734        {
[18027]735                tithekfile = ostrcat(titheklink, NULL, 0, 0);
[18399]736                localfile = 1;
737        }
[18027]738
[36122]739//      amazon_init(titheklink, tithekfile);
[36211]740//init locale parser
[39020]741        localparser_init(titheklink, tithekfile, flag);
[36122]742
[18027]743        delmarkedscreennodes(grid, 1);
744        freetithek();
745//      if(readtithek(tithekfile) != 0) return 1;
746        int linecount = readtithek(tithekfile);
[18401]747//      if(linecount == 0) return 1;
[39009]748
[18027]749        struct tithek* titheknode = tithek;
750
[20269]751        int height = 500;
752        int width = 590;
753        int picheight = 480;
754        int picwidth = 570;
755        int zcount = 2;
756        int fontsize = 25;
757        int pcount = 2;
[20365]758
759        if(getconfigint("tithek_cover", NULL) == 0 || getconfigint("tithek_view", NULL) == 0)
[20247]760        {
761                if(linecount > 2)
762                {
763                        height = 280;
764                        width = 390;
765                        picheight = 230;
766                        picwidth = 370;
767                        zcount = 3;
768                        fontsize = 20;
769                        pcount = 6;
770                }
[39009]771
[20247]772                if(linecount > 8)
773                {
774                        height = 180;
775                        width = 295;
776                        picheight = 130;
777                        picwidth = 270;
778                        zcount = 4;
779                        fontsize = 18;
780                        pcount = 12;
781                }
782
783                if(linecount > 19)
784                {
785                        height = 140;
786                        width = 235;
787                        picheight = 90;
788                        picwidth = 210;
789                        zcount = 5;
790                        fontsize = 16;
791                        pcount = 20;
792                }
[39009]793
[20247]794                if(linecount > 25)
795                {
796                        height = 111;
797                        width = 196;
798                        picheight = 60;
799                        picwidth = 150;
800                        zcount = 6;
801                        fontsize = 14;
[20269]802                        pcount = 30;
[20247]803                }
804        }
[39009]805
[36122]806        if((getconfigint("tithek_cover", NULL) == 1 && flag == 0) || (getconfigint("tithek_view", NULL) == 1 && flag != 0))
[18027]807        {
[20247]808                height = 500;
809                width = 590;
810                picheight = 480;
811                picwidth = 570;
812                zcount = 2;
813                fontsize = 25;
814                pcount = 2;
815        }
[20271]816
[36122]817        if((getconfigint("tithek_cover", NULL) == 2 && flag == 0) || (getconfigint("tithek_view", NULL) == 2 && flag != 0))
[20247]818        {
819                height = 280;
820                width = 390;
821                picheight = 230;
822                picwidth = 370;
823                zcount = 3;
824                fontsize = 20;
825                pcount = 6;
826        }
[20271]827
[36122]828        if((getconfigint("tithek_cover", NULL) == 3 && flag == 0) || (getconfigint("tithek_view", NULL) == 3 && flag != 0))
[20247]829        {
[18027]830                height = 180;
831                width = 295;
832                picheight = 130;
833                picwidth = 270;
834                zcount = 4;
835                fontsize = 18;
836                pcount = 12;
837        }
[20271]838
[36122]839        if((getconfigint("tithek_cover", NULL) == 4 && flag == 0) || (getconfigint("tithek_view", NULL) == 4 && flag != 0))
[20247]840        {
841                height = 140;
842                width = 235;
843                picheight = 90;
844                picwidth = 210;
845                zcount = 5;
846                fontsize = 16;
847                pcount = 20;
848        }
[20271]849
[36122]850        if((getconfigint("tithek_cover", NULL) == 5 && flag == 0) || (getconfigint("tithek_view", NULL) == 5 && flag != 0))
[20247]851        {
852                height = 111;
853                width = 196;
854                picheight = 60;
855                picwidth = 150;
856                zcount = 6;
857                fontsize = 14;
[20269]858                pcount = 30;
[20247]859        }
[18027]860
[36122]861        if((getconfigint("tithek_cover", NULL) == 6 && flag == 0) || (getconfigint("tithek_view", NULL) == 6 && flag != 0))
[27312]862        {
863                height = 50;
864                width = 1160;
865                picheight = 48;
866                picwidth = 1100;
867                zcount = 1;
868                fontsize = 25;
869                pcount = 1;
[38439]870                height += status.fontsizeadjust;
[27312]871        }
872
[38330]873        fontsize += status.fontsizeadjust;
[38439]874        height += status.fontsizeadjust;
[38330]875
[20247]876        if(getconfigint("tithek_pic_ratio", NULL) == 1)
877        {
878                picwidth = 2;
879                picheight = 2;
880        }
[27312]881
[18027]882        while(titheknode != NULL)
883        {
884                tmp = addlistbox(grid, listbox, tmp, 1);
885                if(tmp != NULL)
886                {
887                        skip = 0;
888                        sumcount++;
889                        count++;
890                        count1++;
891                        if(gridbr == 0)
892                                tmp->type = GRIDBR;
893                        gridbr = 1;
894                        tmp->wrap = YES;
895
896                        tmp->picheight = picheight;
897                        tmp->picwidth = picwidth;
[39009]898
[18027]899                        tmp->fontsize = fontsize;
900                        tmp->height = height;
901                        tmp->width = width;
902                        tmp->prozwidth = 0;
903                        //tmp->bgcol = 0xffffff;
904                        tmp->bgspace = 1;
905                        tmp->vspace = 10;
906                        tmp->hspace = 10;
907                        tmp->posx = posx;
908                        //tmp->fontcol = 0x0000ff;
909                        tmp->halign = CENTER;
910                        tmp->valign = TEXTBOTTOM;
911                        changetext(tmp, titheknode->title);
912                        tmp->handle = (char*)titheknode;
913                        posx += tmp->width;
914                        if(count >= zcount)
915                        {
916                                count = 0;
917                                posx = 0;
918                                gridbr = 0;
919                        }
[39009]920
[18027]921                        if(count1 >= pcount)
922                        {
923                                count1 = 0;
924                                pagecount++;
925                                skip = 1;
926                        }
927                }
928                titheknode = titheknode->next;
929        }
930
931        if(skip == 0)
932                pagecount++;
933
934        tmpstr = oitoa(sumcount);
935
936        char* tmpstr1 = ostrcat(_("found"), NULL, 0, 0);
937        tmpstr1 = ostrcat(tmpstr1, " ", 1, 0);
938        tmpstr1 = ostrcat(tmpstr1, tmpstr, 1, 0);
939        free(tmpstr); tmpstr = NULL;
940        tmpstr1 = ostrcat(tmpstr1, " ", 1, 0);
941        tmpstr1 = ostrcat(tmpstr1, _("Results"), 1, 0);
942        changetext(countlabel, tmpstr1);
943        free(tmpstr1); tmpstr1 = NULL;
[18351]944
[18399]945        if(localfile == 0)
[18351]946                unlink(tithekfile);
[39009]947
[18027]948        free(tithekfile); tithekfile = NULL;
949        return pagecount;
950}
951
952void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
953{
954        int count = 0, i = 0;
955        char* tmpstr = NULL, *tmpstr1 = NULL, *input = NULL;
956        struct splitstr* ret = NULL;
957
958        input = ostrcat(input, title, 1, 0);
959        input = ostrcat(input, "#", 1, 0);
960        input = ostrcat(input, link, 1, 0);
961        input = ostrcat(input, "#", 1, 0);
962        input = ostrcat(input, pic, 1, 0);
963        input = ostrcat(input, "#", 1, 0);
964        input = ostrcat(input, localname, 1, 0);
965        input = ostrcat(input, "#", 1, 0);
966        input = ostrcat(input, menutitle, 1, 0);
967        input = ostrcat(input, "#", 1, 0);
[19836]968        input = ostrcat(input, oitoa(flag), 1, 1);
[39009]969
[18027]970        tmpstr = readfiletomem(getconfig("tithek_fav", NULL), 0);
[39009]971
[18027]972        ret = strsplit(tmpstr, "\n", &count);
973
974        if(ret != NULL)
975        {
976                for(i = 0; i < count; i++)
977                {
978                        if(ostrcmp((ret[i]).part, input) != 0)
979                        {
980                                tmpstr1 = ostrcat(tmpstr1, ret[i].part, 1, 0);
981                                tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0);
982                        }
983                        else
984                                printf("remove: %s\n", ret[i].part);
985                }
986        }
987
988        if(tmpstr1 != NULL && strlen(tmpstr1) > 0)
989                tmpstr1[strlen(tmpstr1) - 1] = '\0';
990
[20169]991        if(tmpstr1 == NULL)
992                writesys(getconfig("tithek_fav", NULL), "", 0);
993        else
994                writesys(getconfig("tithek_fav", NULL), tmpstr1, 0);
[18027]995
[33793]996        if(!ostrncmp("/", link, 1))
997        {
998                free(tmpstr1); tmpstr1 = NULL;
999                tmpstr1 = ostrcat("rm -f ", link, 0, 0);
1000                system(tmpstr1);
1001        }
1002
[18027]1003        free(ret); ret = NULL;
1004        free(tmpstr); tmpstr = NULL;
1005        free(tmpstr1); tmpstr1 = NULL;
1006        free(input); input = NULL;
1007}
1008
1009void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
1010{
1011        int count = 0, i = 0;
1012        char* tmpstr = NULL, *tmpstr1 = NULL, *input = NULL;
1013        struct splitstr* ret = NULL;
1014
[33793]1015        char* savefile = NULL;
1016
1017        struct menulist* mlist = NULL, *mbox = NULL;
1018        char* favlist = command("ls -1 /mnt/config/favorite*");
1019        printf("favlist: %s\n", favlist);
1020        ret = strsplit(favlist, "\n", &count);
1021
1022        if(ret != NULL)
1023        {
1024                for(i = 0; i < count; i++)
1025                {
1026                        char* cmd = ostrcat("cat ", getconfig("tithek_fav", NULL), 0, 0);
1027                        cmd = ostrcat(cmd, " | grep '#", 1, 0);
1028                        cmd = ostrcat(cmd, (ret[i]).part, 1, 0);
1029
1030                        cmd = ostrcat(cmd, "#' | cut -d'#' -f1", 1, 0);
1031                        printf("cmd: %s\n", cmd);
1032                        tmpstr = command(cmd);
1033                        if(tmpstr == NULL)
[33920]1034                                tmpstr = ostrcat(_("Favorites"), NULL, 0, 0);
[33793]1035                        addmenulist(&mlist, tmpstr, (ret[i]).part, NULL, 0, 0);
1036                        printf("(ret[i]).part: %s\n", (ret[i]).part);
1037                        printf("tmpstr: %s\n", tmpstr);
1038                        free(tmpstr), tmpstr = NULL;
1039                        free(cmd), cmd = NULL;
1040                }
1041
1042        }
1043        else
[33920]1044                addmenulist(&mlist, "Favorites", getconfig("tithek_fav", NULL), NULL, 0, 0);
[33793]1045
1046        free(ret), ret = NULL;
1047
1048        mbox = menulistbox(mlist, NULL, NULL, NULL, NULL, NULL, 1, 0);
1049        if(mbox != NULL)
1050        {
1051                printf("mbox->name %s\n", mbox->name);
1052                printf("mbox->text %s\n", mbox->text);
1053                savefile = ostrcat(mbox->text, NULL, 0, 0);
1054        }
1055        else
1056                savefile = ostrcat(getconfig("tithek_fav", NULL), NULL, 0, 0);
[39009]1057
[18027]1058        input = ostrcat(input, title, 1, 0);
1059        input = ostrcat(input, "#", 1, 0);
1060        input = ostrcat(input, link, 1, 0);
1061        input = ostrcat(input, "#", 1, 0);
1062        input = ostrcat(input, pic, 1, 0);
1063        input = ostrcat(input, "#", 1, 0);
1064        input = ostrcat(input, localname, 1, 0);
1065        input = ostrcat(input, "#", 1, 0);
1066        input = ostrcat(input, menutitle, 1, 0);
1067        input = ostrcat(input, "#", 1, 0);
[19836]1068        input = ostrcat(input, oitoa(flag), 1, 1);
[20002]1069        // tithek security
1070        input = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", input, 1);
[39009]1071
[18027]1072        tmpstr1 = ostrcat(tmpstr1, input, 1, 0);
1073        tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0);
1074
[33793]1075        tmpstr = readfiletomem(savefile, 0);
1076
[18027]1077        ret = strsplit(tmpstr, "\n", &count);
1078
1079        if(ret != NULL)
1080        {
1081                for(i = 0; i < count; i++)
1082                {
1083                        if(ostrcmp((ret[i]).part, input) != 0)
1084                        {
1085                                tmpstr1 = ostrcat(tmpstr1, ret[i].part, 1, 0);
1086                                tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0);
1087                        }
1088                }
1089        }
1090
1091        if(tmpstr1 != NULL && strlen(tmpstr1) > 0)
1092                tmpstr1[strlen(tmpstr1) - 1] = '\0';
1093
[33793]1094        writesys(savefile, tmpstr1, 0);
[18027]1095
[33793]1096        if(!ostrncmp("/", link, 1))
1097        {
1098                free(tmpstr1); tmpstr1 = NULL;
1099                tmpstr1 = ostrcat("touch ", link, 0, 0);
1100                system(tmpstr1);
1101        }
1102
1103        free(mbox); mbox = NULL;
[18027]1104        free(ret); ret = NULL;
1105        free(tmpstr); tmpstr = NULL;
1106        free(tmpstr1); tmpstr1 = NULL;
1107        free(input); input = NULL;
1108}
1109
[27336]1110void editfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
1111{
1112        int rcret = 0, type = 0;
1113        struct skin* tithekedit = getscreen("tithekedit");
1114        struct skin* listbox = getscreennode(tithekedit, "listbox");
1115        struct skin* skin_title = getscreennode(tithekedit, "title");
1116        struct skin* skin_link = getscreennode(tithekedit, "link");
1117        struct skin* skin_pic = getscreennode(tithekedit, "pic");
1118        struct skin* skin_localname = getscreennode(tithekedit, "localname");
1119        struct skin* skin_menutitle = getscreennode(tithekedit, "menutitle");
1120        struct skin* skin_type = getscreennode(tithekedit, "type");
1121
1122        struct skin* tmp = NULL;
1123        struct skin* load = getscreen("loading");
1124
1125        changeinput(skin_title, title);
1126        changeinput(skin_link, link);
1127        changeinput(skin_pic, pic);
1128        changeinput(skin_localname, localname);
1129        changeinput(skin_menutitle, menutitle);
1130        changeinput(skin_type, oitoa(type));
1131
1132        addscreenrc(tithekedit, listbox);
1133        drawscreen(tithekedit, 0, 0);
1134
1135        tmp = listbox->select;
1136        while(1)
1137        {
1138                addscreenrc(tithekedit, tmp);
1139                rcret = waitrcext(tithekedit, 0, 0, 1000);
1140                delownerrc(tithekedit);
1141                addscreenrc(tithekedit, listbox);
1142                tmp = listbox->select;
1143
1144                if(rcret == getrcconfigint("rcexit", NULL)) break;
1145                if(rcret == getrcconfigint("rcok", NULL))
1146                {
1147                        drawscreen(load, 0, 0);
1148                        addfav(skin_title->ret, skin_link->ret, skin_pic->ret, skin_localname->ret, skin_menutitle->ret, atoi(skin_type->ret));
1149                        clearscreen(load);
1150                        break;
1151                }
1152        }
1153
1154        delownerrc(tithekedit);
1155        clearscreen(tithekedit);
1156}
1157
[20002]1158void cacheplay(char* link, char* filename, int flag)
[19689]1159{
1160        struct skin* load = getscreen("loadingproz");
1161        struct skin* proztext = getscreennode(load, "proztext");
1162
[39009]1163        drawscreen(load, 0, 0);
[19713]1164        int port = 80, count = 0, mcount = 0;
1165        off64_t size = 0, msize = 0;
[19689]1166        char* host = NULL, *pos = NULL, *path = NULL, *file = NULL, *tmpstr = NULL;
1167        host = string_replace("http://", "", (char*)link, 0);
1168
1169        if(host != NULL)
1170                pos = strchr(host, '/');
1171        if(pos != NULL)
1172        {
1173                pos[0] = '\0';
1174                path = pos + 1;
1175        }
1176
[19797]1177        file = ostrcat(getconfig("rec_streampath", NULL), "/.cache.", 0, 0);
1178        file = ostrcat(file, filename, 1, 0);
[19689]1179
1180        if(ostrstr(host, ":") != NULL)
1181        {
1182                host = oregex("http://(.*):.*", link);
1183                port = atoi(oregex("http://.*:(.*)/.*", link));
1184        }
1185
[19713]1186        debug(99, "---------------------------------------");
1187        debug(99, "link: %s", link);
1188        debug(99, "---------------------------------------");
1189        debug(99, "host: %s", host);
1190        debug(99, "port: %d", port);
1191        debug(99, "path: %s", path);
1192        debug(99, "local: %s", file);
1193        debug(99, "---------------------------------------");
[39009]1194
1195
[19689]1196        struct download* dnode = NULL;
1197        dnode = calloc(1, sizeof(struct download));
1198        if(dnode == NULL)
1199        {
1200                err("no mem");
1201                return;
[39009]1202        }
[19689]1203        dnode->host = host;
1204        dnode->page = path;
1205        dnode->port = port;
1206        dnode->filename = file;
1207        dnode->auth = NULL;
1208        dnode->connfd = -1;
1209        dnode->ret = -1;
[20949]1210        dnode->timeout = 30000;
[39009]1211
[19689]1212        addtimer(&gethttpstruct, START, 1000, 1, (void*)dnode, NULL, NULL);
[19713]1213
1214        if(flag == 1)
[19689]1215        {
[19713]1216                mcount = 120;
1217                msize = 10485760;
1218        }
1219        else if(flag == 2)
1220        {
[39009]1221                mcount = 240;
[19713]1222                msize = 20971520;
1223        }
1224        else if(flag == 3)
1225        {
[39009]1226                mcount = 360;
[19713]1227                msize = 31457280;
1228        }
[39009]1229
[19713]1230        while(count < mcount || size >= msize)
1231        {
[19689]1232                sleep(1);
1233                count++;
1234                if(file_exist(file))
1235                        size = getfilesize(file);
1236
1237                int proz = 0;
[19713]1238                int proz1 = size * 100 / msize;
1239                debug(99, "size (%dprozent)", proz1);
[19689]1240
[19713]1241                int proz2 = count * 100 / mcount;
1242                debug(99, "time (%dprozent)", proz2);
[39009]1243
[19689]1244                if(proz1 > proz2)
1245                        proz = proz1;
1246                else
1247                        proz = proz2;
[19713]1248
1249                debug(99, "cacheing...(%lldkb) (%dprozent)", size / 1024, proz);
1250
1251                if(size >= msize)
[19689]1252                        break;
[19713]1253                if(count >= mcount)
[19689]1254                        break;
[39009]1255
[19689]1256                tmpstr = ostrcat(_("please wait..."), " (", 0, 0);
[19838]1257                tmpstr = ostrcat(tmpstr, oitoa(proz), 1, 1);
[19689]1258                tmpstr = ostrcat(tmpstr, "%)", 1, 0);
1259                clearscreen(load);
1260                changetext(proztext, tmpstr);
1261                drawscreen(load, 0, 0);
1262                free(tmpstr), tmpstr = NULL;
1263        }
1264
[20002]1265        screenplay(file, filename, 2, 0);
[19689]1266        sockclose(&dnode->connfd);
1267        free(dnode); dnode = NULL;
1268
1269        tmpstr = ostrcat(tmpstr, _("Remove Cachefile ?"), 1, 0);
1270        tmpstr = ostrcat(tmpstr, "\n\n", 1, 0);
1271        tmpstr = ostrcat(tmpstr, file, 1, 0);
[39009]1272
[19689]1273        if(textbox(_("Message"), tmpstr, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1)
1274        {
1275                unlink(file);
1276        }
1277        free(tmpstr), tmpstr = NULL;
1278        free(file), file = NULL;
1279        free(host), host = NULL;
1280}
[19887]1281
[20861]1282void backgrounddl(char* link, char* filename)
[19887]1283{
[20861]1284        int port = 80, ret = 0;
[19887]1285        char* host = NULL, *pos = NULL, *path = NULL, *file = NULL, *tmpstr = NULL;
1286        host = string_replace("http://", "", (char*)link, 0);
1287
1288        if(host != NULL)
1289                pos = strchr(host, '/');
1290        if(pos != NULL)
1291        {
1292                pos[0] = '\0';
1293                path = pos + 1;
1294        }
1295
[19891]1296        file = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0);
1297        file = ostrcat(file, filename, 1, 0);
[19887]1298
1299        if(ostrstr(host, ":") != NULL)
1300        {
1301                host = oregex("http://(.*):.*", link);
1302                port = atoi(oregex("http://.*:(.*)/.*", link));
1303        }
1304
1305        debug(99, "---------------------------------------");
1306        debug(99, "link: %s", link);
1307        debug(99, "---------------------------------------");
1308        debug(99, "host: %s", host);
1309        debug(99, "port: %d", port);
1310        debug(99, "path: %s", path);
1311        debug(99, "local: %s", file);
1312        debug(99, "---------------------------------------");
[39009]1313
[32113]1314        if(ostrstr(path, "|User-Agent=") != NULL)
1315        {
1316                stringreplacechar(path, '|', '\0');
1317                printf("page changed: %s\n", path);
1318
1319                char* cmd = NULL;
1320                cmd = ostrcat("wget --user-agent=\'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:30.0) Gecko/20100101 Firefox/30.0\' \'http://", host, 0, 0);
1321                cmd = ostrcat(cmd, "/", 1, 0);
1322                cmd = ostrcat(cmd, path, 1, 0);
1323                cmd = ostrcat(cmd, "\' -O \'", 1, 0);
1324                cmd = ostrcat(cmd, file, 1, 0);
1325                cmd = ostrcat(cmd, "\' &", 1, 0);
1326                printf("cmd: %s\n", cmd);
1327                ret = system(cmd);
1328                free(cmd), cmd = NULL;
1329        }
1330        else
1331                ret = startbgdownload(host, path, port, file, NULL, 30000, 1);
1332
[20861]1333        if(ret == 1)
1334                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);
[39009]1335
[19887]1336        free(tmpstr), tmpstr = NULL;
1337        free(file), file = NULL;
1338        free(host), host = NULL;
1339}
[39009]1340
[19713]1341void submenu(struct skin* listbox, struct skin* load, char* title)
[18027]1342{
[19868]1343        int flag = 0;
[39009]1344        char* tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL;
[29981]1345        drawscreen(load, 0, 0);
1346        tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
1347        tmpstr2 = ostrcat(((struct tithek*)listbox->select->handle)->title, NULL, 0, 0);
[36966]1348
[28322]1349        if(((struct tithek*)listbox->select->handle)->flag == 2)
[18226]1350        {
[28322]1351                if(tmpstr != NULL) tmpstr1 = ostrcat(tmpstr, NULL, 0, 0);
[36966]1352        }
[36122]1353        else if(((struct tithek*)listbox->select->handle)->flag == 3)
1354        {
1355                flag = 4;
1356                if(tmpstr != NULL) tmpstr1 = ostrcat(tmpstr, NULL, 0, 0);
1357        }
[28322]1358        else if(((struct tithek*)listbox->select->handle)->flag == 4)
1359        {
[29555]1360                if(tmpstr != NULL) tmpstr1 = youtube_hoster(tmpstr);
[39009]1361        }
[34606]1362        else if(((struct tithek*)listbox->select->handle)->flag == 5)
[28322]1363        {
[34605]1364                if(tmpstr != NULL) tmpstr1 = nowtv(tmpstr);
[28322]1365        }
[34606]1366        else if(((struct tithek*)listbox->select->handle)->flag == 6)
1367        {
1368                if(tmpstr != NULL) tmpstr1 = nowtv(tmpstr);
1369        }
[28322]1370        else if(((struct tithek*)listbox->select->handle)->flag == 12)
1371        {
[29555]1372                if(tmpstr != NULL) tmpstr1 = myvideo_hoster(tmpstr);
[28322]1373        }
1374        else if(((struct tithek*)listbox->select->handle)->flag == 14)
1375        {
1376                if(tmpstr != NULL) tmpstr1 = kinox(tmpstr);
1377        }
[36184]1378        else if(((struct tithek*)listbox->select->handle)->flag == 15)
1379        {
1380                if(tmpstr != NULL) tmpstr1 = giga(tmpstr);
1381        }
[36172]1382        else if(((struct tithek*)listbox->select->handle)->flag == 20)
1383        {
1384                if(tmpstr != NULL) tmpstr1 = nbastream(tmpstr);
1385        }
[28322]1386        else if(((struct tithek*)listbox->select->handle)->flag == 38)
1387        {
1388                if(tmpstr != NULL) tmpstr1 = mlehd(tmpstr);
1389        }
1390        else if(((struct tithek*)listbox->select->handle)->flag == 41)
1391        {
1392                if(tmpstr != NULL) tmpstr1 = movie4k(tmpstr);
1393        }
1394        else if(((struct tithek*)listbox->select->handle)->flag == 42)
1395        {
1396                if(tmpstr != NULL) tmpstr1 = xvideos(tmpstr);
1397        }
1398        else if(((struct tithek*)listbox->select->handle)->flag == 43)
1399        {
1400                if(tmpstr != NULL) tmpstr1 = solarmovie(tmpstr);
1401        }
1402        else if(((struct tithek*)listbox->select->handle)->flag == 45)
1403        {
1404                if(tmpstr != NULL) tmpstr1 = ard(tmpstr);
1405        }
1406        else if(((struct tithek*)listbox->select->handle)->flag == 46)
1407        {
1408                if(tmpstr != NULL) tmpstr1 = zdf(tmpstr);
1409        }
1410        else if(((struct tithek*)listbox->select->handle)->flag == 50)
1411        {
1412                if(tmpstr != NULL) tmpstr1 = beeg(tmpstr);
1413        }
[28839]1414        else if(((struct tithek*)listbox->select->handle)->flag == 64)
1415        {
1416                if(tmpstr != NULL) tmpstr1 = tvtoast(tmpstr);
1417        }
[35286]1418        else if(((struct tithek*)listbox->select->handle)->flag == 75)
1419        {
1420                if(tmpstr != NULL) tmpstr1 = amazon(tmpstr);
1421        }
[36122]1422        else if(((struct tithek*)listbox->select->handle)->flag == 91)
1423        {
[36132]1424                if(tmpstr != NULL) tmpstr1 = streamlive(tmpstr, -1);
[36122]1425        }
[36132]1426        else if(((struct tithek*)listbox->select->handle)->flag == 92)
1427        {
1428                if(tmpstr != NULL) tmpstr1 = cricfree(tmpstr, -1);
1429        }
[36143]1430        else if(((struct tithek*)listbox->select->handle)->flag == 93)
1431        {
1432                if(tmpstr != NULL) tmpstr1 = liveonlinetv(tmpstr, -1);
1433        }
[36158]1434        else if(((struct tithek*)listbox->select->handle)->flag == 94)
1435        {
1436                if(tmpstr != NULL) tmpstr1 = movie2k(tmpstr);
1437        }
[36254]1438        else if(((struct tithek*)listbox->select->handle)->flag == 98)
1439        {
1440                if(tmpstr != NULL) tmpstr1 = nbaondemand(tmpstr);
1441        }
[36966]1442        else if(((struct tithek*)listbox->select->handle)->flag == 111)
1443        {
1444                if(tmpstr != NULL) tmpstr1 = localparser_hoster(tmpstr);
1445        }
[35286]1446
[28322]1447        free(tmpstr); tmpstr = NULL;
[29981]1448        free(tmpstr2); tmpstr2 = NULL;
[18027]1449
[28322]1450        if(ostrstr(title, "Internet Radio") != NULL)
1451                flag = 4;
1452
1453        if(ostrstr(tmpstr1, "&") != NULL)
1454        {
1455                printf("change streamurl from: %s\n", tmpstr1);
1456                tmpstr1 = string_replace_all("&amp;", "&", tmpstr1, 1);
1457                printf("change streamurl to: %s\n", tmpstr1);
1458        }
[39009]1459
[28322]1460        if(tmpstr1 != NULL)
1461        {
[39009]1462                char* filename = ostrcat(title, "_", 0, 0);
[38269]1463
[39009]1464                tmpstr2 = ostrcat(_("Tithek - Mainmenu - Favoriten"), " - ", 0, 0);
[38311]1465                filename = string_replace_all(tmpstr2, "", filename, 1);
1466                free(tmpstr2); tmpstr2 = NULL;
[39009]1467
1468                tmpstr2 = ostrcat(_("Tithek - Mainmenu"), " - ", 0, 0);
[38311]1469                filename = string_replace_all(tmpstr2, "", filename, 1);
1470                free(tmpstr2); tmpstr2 = NULL;
[38269]1471
[38311]1472                filename = string_replace_all("Tips und Tricks - ", "", filename, 1);
1473                filename = string_replace_all("Internet TV - ", "", filename, 1);
1474                filename = string_replace_all("Internet Radio - ", "", filename, 1);
1475                filename = string_replace_all("ARD - ", "", filename, 1);
1476                filename = string_replace_all("ZDF - ", "", filename, 1);
1477                filename = string_replace_all("FilmOn - ", "", filename, 1);
1478                filename = string_replace_all("MyVideo - ", "", filename, 1);
1479                filename = string_replace_all("Netzkino - ", "", filename, 1);
1480                filename = string_replace_all("KinoX - ", "", filename, 1);
1481                filename = string_replace_all("Movie4k - ", "", filename, 1);
1482                filename = string_replace_all("Movie2k - ", "", filename, 1);
1483
[39009]1484                filename = string_replace_all("Beeg ", "", filename, 1);
1485                filename = string_replace_all("Burning Series ", "", filename, 1);
1486                filename = string_replace_all("CricFree ", "", filename, 1);
1487                filename = string_replace_all("Giga ", "", filename, 1);
1488                filename = string_replace_all("KKiste ", "", filename, 1);
1489                filename = string_replace_all("NBA-On-Demand ", "", filename, 1);
1490                filename = string_replace_all("StreamLive ", "", filename, 1);
1491                filename = string_replace_all("TheSolarMovie ", "", filename, 1);
1492                filename = string_replace_all("Youtube ", "", filename, 1);
[38311]1493
[39009]1494                tmpstr2 = ostrcat(_("Category"), " - ", 0, 0);
[38311]1495                filename = string_replace_all(tmpstr2, "", filename, 1);
1496                free(tmpstr2); tmpstr2 = NULL;
1497
[39009]1498                tmpstr2 = ostrcat(_("Search (local)"), " - ", 0, 0);
[38311]1499                filename = string_replace_all(tmpstr2, "", filename, 1);
1500                free(tmpstr2); tmpstr2 = NULL;
1501
[39009]1502                tmpstr2 = ostrcat(_("Search (20)"), " - ", 0, 0);
[38311]1503                filename = string_replace_all(tmpstr2, "", filename, 1);
1504                free(tmpstr2); tmpstr2 = NULL;
1505
[39009]1506                tmpstr2 = ostrcat(_("Search Cast"), " - ", 0, 0);
[38311]1507                filename = string_replace_all(tmpstr2, "", filename, 1);
1508                free(tmpstr2); tmpstr2 = NULL;
1509
[39009]1510                tmpstr2 = ostrcat(_("Search"), " - ", 0, 0);
[38311]1511                filename = string_replace_all(tmpstr2, "", filename, 1);
1512                free(tmpstr2); tmpstr2 = NULL;
1513
1514                tmpstr2 = ostrcat(_("All Sorted"), " - ", 0, 0);
1515                filename = string_replace_all(tmpstr2, "", filename, 1);
1516                free(tmpstr2); tmpstr2 = NULL;
1517
1518                tmpstr2 = ostrcat(_("A-Z"), " - ", 0, 0);
1519                filename = string_replace_all(tmpstr2, "", filename, 1);
1520                free(tmpstr2); tmpstr2 = NULL;
1521
[39018]1522                filename = string_replace_all("(Flash - Shell script) - ", "", filename, 1);
1523                filename = string_replace_all("Genres - ", "", filename, 1);
1524                filename = string_replace_all("All Series - ", "", filename, 1);
1525                filename = string_replace_all("Channels - ", "", filename, 1);
1526                filename = string_replace_all("Kinofilme - ", "", filename, 1);
1527                filename = string_replace_all("Neue Filme - ", "", filename, 1);
1528                filename = string_replace_all("Movies (Year) - ", "", filename, 1);
1529                filename = string_replace_all("Movies (Genre) - ", "", filename, 1);
1530                filename = string_replace_all("Series - ", "", filename, 1);
1531
[28322]1532                filename = ostrcat(filename, ((struct tithek*)listbox->select->handle)->title, 1, 0);
1533                filename = ostrcat(filename, ".mp4", 1, 0);
1534                filename = string_replace_all(" ", ".", filename, 1);
1535                filename = string_replace_all("-", "_", filename, 1);
1536                filename = string_replace_all("._.", "_", filename, 1);
[38270]1537                filename = string_replace_all(".._", "_", filename, 1);
[28322]1538                debug(99, "filename: %s", filename);
[39009]1539
[28322]1540                char* keyconf = NULL;
1541                char* skintitle = _("Choice Playback");
1542                struct menulist* mlist = NULL, *mbox = NULL;
1543
[37327]1544#ifdef MIPSEL
1545                if(checkbox("VUSOLO2") == 0)
1546                        addmenulist(&mlist, "Streaming Playback (default)", _("Streaming Playback (default)"), NULL, 0, 0);
1547#endif
1548
[36605]1549#ifndef MIPSEL
1550                addmenulist(&mlist, "Streaming Playback (default)", _("Streaming Playback (default)"), NULL, 0, 0);
1551#else
[36566]1552                // mipsel work, disable http direct streams without buffer, after 3mins no memory (memleak in player.h ?)
[36605]1553                if(ostrncmp("http://", tmpstr1, 7) && ostrncmp("https://", tmpstr1, 8))
1554                        addmenulist(&mlist, "Streaming Playback (default)", _("Streaming Playback (default)"), NULL, 0, 0);
[36570]1555#endif
[36605]1556                if(!ostrncmp("http://", tmpstr1, 7) || !ostrncmp("https://", tmpstr1, 8))
[18027]1557                {
[31945]1558                        // wakeup hdd for downloading
1559                        wakeup_record_device();
[28322]1560                        if(flag == 4)
1561                        {
[36122]1562//#ifdef EPLAYER3
1563//                              addmenulist(&mlist, "Streaming Playback Caching (1MB)", _("Streaming Playback Caching (1MB)"), NULL, 0, 0);
1564//#else
[36605]1565#ifdef MIPSEL
1566                                // mipsel work for radio
1567                                addmenulist(&mlist, "Streaming Playback (default)", _("Streaming Playback (default)"), NULL, 0, 0);
1568#endif
[36122]1569//#endif
[39009]1570                        }
[36605]1571                        else if(!ostrncmp("http://", tmpstr1, 7) || !ostrncmp("https://", tmpstr1, 8))
[28322]1572                        {
[36605]1573//#ifdef EPLAYER3
[28322]1574                                if(checkbox("UFS910") == 1 && !file_exist("/var/swapdir/swapfile"))
[36605]1575                                        addmenulist(&mlist, "Streaming Playback Caching (5MB)", _("Streaming Playback Caching (5MB)"), NULL, 0, 0);
[28322]1576                                else
1577                                {
[36605]1578                                        addmenulist(&mlist, "Streaming Playback Caching (10MB)", _("Streaming Playback Caching (10MB)"), NULL, 0, 0);
[28322]1579                                }
[36605]1580//#endif
[39416]1581                                if(!ostrncmp("http://", tmpstr1, 7) && (file_exist(getconfig("rec_streampath", NULL)) && (file_exist("/mnt/swapextensions/etc/.codecpack") || file_exist("/var/swap/etc/.codecpack") || file_exist("/var/etc/.codecpack"))))
[28322]1582                                {
[36122]1583/*
[28322]1584#ifndef EPLAYER3
[28663]1585                                        addmenulist(&mlist, "File Caching Playback (10MB / 120s)", _("File Caching Playback (10MB / 120s)"), NULL, 0, 0);
1586                                        addmenulist(&mlist, "File Caching Playback (20MB / 240s)", _("File Caching Playback (20MB / 240s)"), NULL, 0, 0);
1587                                        addmenulist(&mlist, "File Caching Playback (30MB / 360s)", _("File Caching Playback (30MB / 360s)"), NULL, 0, 0);
[28322]1588#endif
[36122]1589*/
[28663]1590                                        addmenulist(&mlist, "Download Full File", _("Download Full File"), NULL, 0, 0);
1591                                        addmenulist(&mlist, "Download Full File (background)", _("Download Full File (background)"), NULL, 0, 0);
[28322]1592                                }
1593                        }
[18027]1594                }
[28322]1595                mbox = menulistbox(mlist, NULL, skintitle, _("Choose your Streaming Playback Modus from the following list"), NULL, NULL, 1, 0);
1596                if(mbox != NULL) keyconf = mbox->name;
1597                debug(99, "tmpstr1: %s filename: %s flag: %d", tmpstr1, filename, flag);
[36605]1598                if(ostrcmp(keyconf, "Streaming Playback (default)") == 0)
[18027]1599                {
[28322]1600                        addconfigtmp("playerbuffersize", "0");
1601                        screenplay(tmpstr1, filename, 2, flag);
1602                        delconfigtmp("playerbuffersize");
[18027]1603                }
[36605]1604                else if(ostrcmp(keyconf, "Streaming Playback Caching (0.5MB)") == 0)
[18027]1605                {
[36605]1606                        addconfigtmp("playerbuffersize", "524288");
[28322]1607                        screenplay(tmpstr1, filename, 2, flag);
1608                        delconfigtmp("playerbuffersize");
[18027]1609                }
[36605]1610                else if(ostrcmp(keyconf, "Streaming Playback Caching (1MB)") == 0)
[18027]1611                {
[28322]1612                        addconfigtmp("playerbuffersize", "1048576");
1613                        screenplay(tmpstr1, filename, 2, flag);
1614                        delconfigtmp("playerbuffersize");
[18027]1615                }
[36605]1616                else if(ostrcmp(keyconf, "Streaming Playback Caching (2MB)") == 0)
[18027]1617                {
[36605]1618                        addconfigtmp("playerbuffersize", "2097152");
[28322]1619                        screenplay(tmpstr1, filename, 2, flag);
1620                        delconfigtmp("playerbuffersize");
[18027]1621                }
[36605]1622                else if(ostrcmp(keyconf, "Streaming Playback Caching (3MB)") == 0)
[25163]1623                {
[36605]1624                        addconfigtmp("playerbuffersize", "3145728");
[28322]1625                        screenplay(tmpstr1, filename, 2, flag);
1626                        delconfigtmp("playerbuffersize");
[25163]1627                }
[36605]1628                else if(ostrcmp(keyconf, "Streaming Playback Caching (4MB)") == 0)
[18027]1629                {
[36605]1630                        addconfigtmp("playerbuffersize", "4194304");
1631                        screenplay(tmpstr1, filename, 2, flag);
1632                        delconfigtmp("playerbuffersize");
1633                }
1634                else if(ostrcmp(keyconf, "Streaming Playback Caching (5MB)") == 0)
1635                {
[28322]1636                        addconfigtmp("playerbuffersize", "5242880");
1637                        screenplay(tmpstr1, filename, 2, flag);
1638                        delconfigtmp("playerbuffersize");
[18027]1639                }
[36605]1640                else if(ostrcmp(keyconf, "Streaming Playback Caching (7.5MB)") == 0)
[18027]1641                {
[36605]1642                        addconfigtmp("playerbuffersize", "7864320");
[28322]1643                        screenplay(tmpstr1, filename, 2, flag);
1644                        delconfigtmp("playerbuffersize");
[18027]1645                }
[36605]1646                else if(ostrcmp(keyconf, "Streaming Playback Caching (10MB)") == 0)
[18027]1647                {
[28322]1648                        addconfigtmp("playerbuffersize", "10485760");
1649                        screenplay(tmpstr1, filename, 2, flag);
1650                        delconfigtmp("playerbuffersize");
[18027]1651                }
[28322]1652                else if(ostrcmp(keyconf, "File Caching Playback (10MB / 120s)") == 0)
[22199]1653                {
[28322]1654                        cacheplay(tmpstr1, filename, 1);
[22199]1655                }
[28322]1656                else if(ostrcmp(keyconf, "File Caching Playback (20MB / 240s)") == 0)
[22241]1657                {
[28322]1658                        cacheplay(tmpstr1, filename, 2);
[22241]1659                }
[28322]1660                else if(ostrcmp(keyconf, "File Caching Playback (30MB / 360s)") == 0)
[22584]1661                {
[28322]1662                        cacheplay(tmpstr1, filename, 3);
[22584]1663                }
[28322]1664                else if(ostrcmp(keyconf, "Download Full File") == 0)
[23699]1665                {
[28322]1666                        char* search = textinput(_("Filename"), filename);
1667                        if(search != NULL)
[39009]1668                        {
[28322]1669                                char* tmpstr2 = tithekdownload(tmpstr1, search, NULL, 0, 1);
1670//                                              drawscreen(grid, 0, 0);
1671                                free(tmpstr2); tmpstr2 = NULL;
[39009]1672
[28322]1673                                if(textbox(_("Message"), _("Start playback"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1)
[19739]1674                                {
[28322]1675                                        tmpstr2 = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0);
1676                                        tmpstr2 = ostrcat(tmpstr2, search, 1, 0);
1677                                        screenplay(tmpstr2, filename, 2, flag);
[19868]1678                                        free(tmpstr2); tmpstr2 = NULL;
[19713]1679                                }
[19689]1680                        }
[28322]1681                        free(search), search = NULL;
[18027]1682                }
[28322]1683                else if(ostrcmp(keyconf, "Download Full File (background)") == 0)
1684                {
1685                        char* search = textinput(_("Filename"), filename);
1686                        if(search != NULL)
1687                                backgrounddl(tmpstr1, search);
1688                        free(search), search = NULL;
1689                }
[39009]1690
[28322]1691                free(filename), filename = NULL;
1692                freemenulist(mlist, 1); mlist = NULL;
[18027]1693        }
[19992]1694        else
[28322]1695                textbox(_("Message"), _("Can't get Streamurl !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0);
[39009]1696
[28322]1697        free(tmpstr1); tmpstr1 = NULL;
[18027]1698}
1699
1700void screentithekplay(char* titheklink, char* title, int first)
1701{
[33794]1702        int savevol = 0;
[23340]1703        if(!file_exist("/mnt/swapextensions/player"))
[39009]1704                mkdir("/mnt/swapextensions/player", 0777);
[19996]1705
[19991]1706        char* disclaimer = NULL;
[23340]1707        disclaimer = ostrcat(disclaimer, "/mnt/swapextensions/player/tithek_disclaimer_accepted", 1, 0);
[39009]1708
[19991]1709        if(!file_exist(disclaimer))
1710        {
1711                char* tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/disclaimer.txt", 80, NULL, HTTPAUTH, 5000, NULL, 0);
1712                if(textbox(_("TitanNit Tithek disclaimer"), _(tmpstr), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1100, 650, 0, 0) == 1)
1713                {
[39009]1714                        writesys(disclaimer, tmpstr, 0);
[19993]1715                        free(tmpstr), tmpstr = NULL;
[19991]1716                }
1717                else
[19993]1718                {
1719                        free(tmpstr), tmpstr = NULL;
1720                        free(disclaimer), disclaimer = NULL;
[19991]1721                        return;
[19993]1722                }
[19991]1723        }
[19993]1724        free(disclaimer), disclaimer = NULL;
[19991]1725
[22674]1726        int rcret = -1, oaktline = 1, oaktpage = -1, ogridcol = 0, pagecount = 0;
[18027]1727
[39009]1728        writesysint("/proc/sys/vm/drop_caches", 3, 0);
[33794]1729
[18027]1730        if(first == 1)
[39009]1731        {
[33794]1732                savevol = getvol();
1733
[19575]1734                mkdir("/tmp/tithek", 777);
1735                if(status.mcaktiv == 0)
1736                {
1737                        rcret = servicestop(status.aktservice, 1, 1);
1738                        if(rcret == 1) return;
1739                }
[18027]1740        }
[18351]1741
[18027]1742        struct skin* grid = getscreen("titheklist");
1743        struct skin* listbox = getscreennode(grid, "listbox");
1744        struct skin* countlabel = getscreennode(grid, "countlabel");
1745        struct skin* countpage = getscreennode(grid, "countpage");
[27336]1746        struct skin* b4 = getscreennode(grid, "b4");
1747        struct skin* b5 = getscreennode(grid, "b5");
[18027]1748        struct skin* load = getscreen("loading");
1749        struct skin* tmp = NULL;
1750        char* tithekpic = NULL;
[27278]1751
[28436]1752        b4->usesavebg = 1;
1753        b5->usesavebg = 1;
[28435]1754        drawscreen(grid, 2, 0);
1755
[33793]1756//      if(ostrcmp(title, _("Tithek - Mainmenu - Favoriten")) == 0)
1757        if(ostrstr(title, _("Tithek - Mainmenu - Favoriten")) != NULL)
[27278]1758        {
[27336]1759                changetext(b4, _("EDIT FAV"));
1760                b5->hidden = NO;
[27286]1761        }
1762        else
1763        {
[27336]1764                changetext(b4, _("ADD FAV"));
1765                b5->hidden = YES;
[27278]1766        }
[27336]1767
[22215]1768        drawscreen(load, 0, 0);
[39009]1769
[18027]1770        if(titheklink == NULL) return;
[39009]1771
[18027]1772        listbox->aktpage = -1;
1773        listbox->aktline = 1;
1774        listbox->gridcol = 0;
1775        listbox->select = NULL;
1776
[22674]1777        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, first);
[18027]1778        if(pagecount == 0) return;
1779
[18399]1780        changetitle(grid, _(title));
[18027]1781        drawscreen(grid, 0, 0);
1782        addscreenrc(grid, listbox);
[39009]1783
[18027]1784        while(1)
1785        {
1786                changetitle(grid, _(title));
[22881]1787                changetext(countpage, NULL);
[18027]1788                if(listbox->select != NULL && listbox->select->handle != NULL)
1789                {
1790                        tmp = listbox->select;
1791                        while(tmp != NULL)
1792                        {
1793
1794                                if(tmp->pagecount != listbox->aktpage) break;
1795
1796                                char* tmpstr = ostrcat(_("Page"), NULL, 0, 0);
1797                                tmpstr = ostrcat(tmpstr, " ( ", 1, 0);
[19838]1798                                tmpstr = ostrcat(tmpstr, oitoa(tmp->pagecount), 1, 1);
[18027]1799                                tmpstr = ostrcat(tmpstr, " / ", 1, 0);
[19838]1800                                tmpstr = ostrcat(tmpstr, oitoa(pagecount), 1, 1);
[22673]1801                                tmpstr = ostrcat(tmpstr, " )", 1, 0);
[18027]1802                                changetext(countpage, tmpstr);
1803                                free(tmpstr); tmpstr = NULL;
[27336]1804
[27312]1805                                if(tmp->handle != NULL && getconfigint("tithek_view", NULL) != 6 && getconfigint("tithek_cover", NULL) != 6)
[18027]1806                                {
1807                                        tithekpic = tithekdownload(((struct tithek*)tmp->handle)->pic, ((struct tithek*)tmp->handle)->localname, "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0=", 1, 0);
1808
[19554]1809                                        /* not working with thread download
[18027]1810                                        off64_t checkpic = getfilesize(tithekpic);
[39009]1811
[18027]1812                                        if(checkpic < 1000)
1813                                        {
1814                                                free(tithekpic); tithekpic = NULL;
1815                                                tithekpic = ostrcat("/var/usr/local/share/titan/plugins/tithek/default.jpg", NULL, 0, 0);
1816                                        }
[19554]1817                                        */
[39009]1818
[18027]1819                                        changepic(tmp, tithekpic);
1820                                        free(tithekpic); tithekpic = NULL;
1821                                }
1822                                tmp = tmp->prev;
1823                        }
1824                        tmp = listbox->select;
[19609]1825                        if(tmp != NULL) tmp = tmp->next;
[18027]1826                        while(tmp != NULL)
1827                        {
1828                                if(tmp->pagecount != listbox->aktpage) break;
[27312]1829                                if(tmp->handle != NULL && getconfigint("tithek_view", NULL) != 6 && getconfigint("tithek_cover", NULL) != 6)
[18027]1830                                {
1831                                        tithekpic = tithekdownload(((struct tithek*)tmp->handle)->pic, ((struct tithek*)tmp->handle)->localname, "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0=", 1, 0);
1832
[19554]1833                                        /* not working with thread download
[18027]1834                                        off64_t checkpic = getfilesize(tithekpic);
1835
1836                                        if(checkpic < 1000)
1837                                        {
1838                                                free(tithekpic); tithekpic = NULL;
1839                                                tithekpic = ostrcat("/var/usr/local/share/titan/plugins/tithek/default.jpg", NULL, 0, 0);
1840                                        }
[19554]1841                                        */
[18027]1842
1843                                        changepic(tmp, tithekpic);
1844                                        free(tithekpic); tithekpic = NULL;
1845                                }
1846                                tmp = tmp->next;
1847                        }
1848                }
[39009]1849
[18027]1850                int count = getfilecount(TITHEKPATH);
1851                if(count > 500)
1852                        delallfiles(TITHEKPATH, ".jpg");
1853
[28435]1854waitrcstart:
[19609]1855                drawscreen(grid, 0, 0);
[28435]1856
[19609]1857                rcret = waitrc(grid, 2000, 2);
[19570]1858
1859                if(rcret == RCTIMEOUT)
1860                {
1861                        if(tithekdownloadrun == 1)
1862                        {
1863                                tithekdownloadrun = 0;
1864                                drawscreen(grid, 0, 0);
1865                        }
1866                        goto waitrcstart;
1867                }
1868
[19572]1869                if(rcret == getrcconfigint("rcblue", NULL))
1870                {
1871                        tithekexit = 1;
1872                        break;
1873                }
1874
[18027]1875                if(rcret == getrcconfigint("rcexit", NULL)) break;
1876                if(rcret == getrcconfigint("rcmenu", NULL))
1877                {
1878                        screentithek_settings();
[20271]1879
[22674]1880                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, first);
[20247]1881                        if(pagecount == 0 || tithekexit == 1) break;
1882
[22881]1883                        listbox->aktpage = -1;
1884                        listbox->aktline = 1;
1885                        listbox->gridcol = 1;
[20247]1886                        addscreenrc(grid, listbox);
[28435]1887//                      drawscreen(grid, 0, 0);
[18027]1888                }
[27294]1889
[33793]1890//              if(ostrcmp(title, _("Tithek - Mainmenu - Favoriten")) == 0)
1891                if(ostrstr(title, _("Tithek - Mainmenu - Favoriten")) != NULL)
[27294]1892                {
[28435]1893//                      changetext(b4, _("EDIT FAV"));
[27336]1894                        b5->hidden = NO;
[27294]1895                }
1896                else
1897                {
[28435]1898//                      changetext(b4, _("ADD FAV"));
[27336]1899                        b5->hidden = YES;
[27294]1900                }
1901
[18027]1902                if(rcret == getrcconfigint("rcred", NULL))
1903                {
1904                        if(listbox->select != NULL && listbox->select->handle != NULL)
1905                        {
[19859]1906
1907                                char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->title, NULL, 0, 0);
[19868]1908                                debug(99, "tmpstr: %s", tmpstr);
[19859]1909                                tmpstr = string_replace("-1 (de)", "", tmpstr, 1);
1910                                tmpstr = string_replace("-1 (en)", "", tmpstr, 1);
1911                                tmpstr = string_replace("-1 (\?\?)", "", tmpstr, 1);
1912                                tmpstr = string_replace("-2 (de)", "", tmpstr, 1);
1913                                tmpstr = string_replace("-2 (en)", "", tmpstr, 1);
1914                                tmpstr = string_replace("-2 (\?\?)", "", tmpstr, 1);
1915                                tmpstr = string_replace("-3 (de)", "", tmpstr, 1);
1916                                tmpstr = string_replace("-3 (en)", "", tmpstr, 1);
1917                                tmpstr = string_replace("-3 (\?\?)", "", tmpstr, 1);
1918                                tmpstr = string_replace(" (de)", "", tmpstr, 1);
1919                                tmpstr = string_replace(" (en)", "", tmpstr, 1);
1920                                tmpstr = string_replace(" (\?\?)", "", tmpstr, 1);
[19990]1921                                tmpstr = string_replace_all("_", " ", tmpstr, 1);
1922                                tmpstr = string_replace_all("-", " ", tmpstr, 1);
[39009]1923                                tmpstr = string_replace_all(".", " ", tmpstr, 1);
[19868]1924                                debug(99, "tmpstr: %s", tmpstr);
[19859]1925
[20102]1926                                int check = playrcred(tmpstr, NULL, 1, 0, 99);
[33793]1927                                if(check == 0 || check == 1000)
[20102]1928                                {
[33920]1929                                        char* search = textinputhist(_("Create sub folder"), " ", "searchhist");
[33793]1930                                        if(search != NULL)
1931                                        {
1932                                                strstrip(search);
1933                                                char* tmpstr = ostrcat(search, NULL, 0, 0);
1934                                                tmpstr = string_replace_all(" ", "_", tmpstr, 1);
1935                                                tmpstr = string_replace_all(".", "_", tmpstr, 1);
1936                                                tmpstr = string_replace_all("-", "_", tmpstr, 1);
1937                                                tmpstr = string_replace_all("._.", "_", tmpstr, 1);
1938                                                tmpstr = string_replace_all("__", "_", tmpstr, 1);
1939                                                string_tolower(tmpstr);
1940                                                strstrip(tmpstr);
1941                                                char* tmpstr1 = NULL;
1942                                                tmpstr1 = ostrcat(getconfig("tithek_fav", NULL), "_", 0, 0);
1943                                                tmpstr1 = ostrcat(tmpstr1, tmpstr, 1, 0);
[33920]1944                                                if(textbox(_("Message"), _("Add this sub folder as Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0) == 1)
[33793]1945                                                        addfav(search, tmpstr1, "http://imageshack.us/md/up/grd/mediathek/menu/default.jpg", tmpstr, title, check);
1946                                                free(tmpstr), tmpstr = NULL;
1947                                                free(tmpstr1), tmpstr1 = NULL;
1948                                        }
1949                                        free(search), search = NULL;
1950
1951                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
1952                                        if(pagecount == 0) return;
1953                                }
1954                                else if(check == 2)
1955                                {
[20836]1956                                        if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search", tmpstr, 0) == 0)
[30018]1957                                                if(screenlistbox(grid, listbox, countlabel, "KinoX - Search", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[20102]1958                                }
[20483]1959                                else if(check == 3)
1960                                {
1961                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "SolarMovies - Movie - Search", tmpstr, 0) == 0)
[30018]1962                                                if(screenlistbox(grid, listbox, countlabel, "SolarMovies - Movie - Search", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[20483]1963                                }
1964                                else if(check == 4)
1965                                {
1966                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "SolarMovies - Tv - Search", tmpstr, 1) == 0)
[30018]1967                                                if(screenlistbox(grid, listbox, countlabel, "SolarMovies - Tv - Search", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[20483]1968                                }
1969                                else if(check == 5)
1970                                {
[20484]1971                                        if(youtube_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Youtube - Search", tmpstr) == 0)
[30018]1972                                                if(screenlistbox(grid, listbox, countlabel, "Youtube - Search", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[20483]1973                                }
[25164]1974                                else if(check == 6)
1975                                {
1976                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "MyVideo - Search", tmpstr, 0) == 0)
[30018]1977                                                if(screenlistbox(grid, listbox, countlabel, "MyVideo - Search", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]1978                                }
[22316]1979                                else if(check == 7)
1980                                {
1981                                        if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search", tmpstr, 0) == 0)
[30018]1982                                                if(screenlistbox(grid, listbox, countlabel, "Movie4k - Search", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[22316]1983                                }
[25164]1984                                else if(check == 8)
1985                                {
1986                                        if(kinox_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search (local)", tmpstr, 0) == 0)
[30018]1987                                                if(screenlistbox(grid, listbox, countlabel, "KinoX - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]1988                                }
1989                                else if(check == 9)
1990                                {
1991                                        if(solarmovie_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Solarmovies - Search (local)", tmpstr, 0) == 0)
[30018]1992                                                if(screenlistbox(grid, listbox, countlabel, "Solarmovies - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]1993                                }
1994                                else if(check == 10)
1995                                {
1996                                        if(youtube_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Youtube - Search (local)", tmpstr, 0) == 0)
[30018]1997                                                if(screenlistbox(grid, listbox, countlabel, "Youtube - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]1998                                }
1999                                else if(check == 11)
2000                                {
2001                                        if(myvideo_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "MyVideo - Search (local)", tmpstr, 0) == 0)
[30018]2002                                                if(screenlistbox(grid, listbox, countlabel, "MyVideo - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]2003                                }
2004                                else if(check == 12)
2005                                {
2006                                        if(movie4k_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Movie4k - Search (local)", tmpstr, 0) == 0)
[30018]2007                                                if(screenlistbox(grid, listbox, countlabel, "Movie4k - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]2008                                }
2009                                else if(check == 13)
2010                                {
2011                                        if(internetradio_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Internetradio - Search (local)", tmpstr, 0) == 0)
[30018]2012                                                if(screenlistbox(grid, listbox, countlabel, "Internetradio - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]2013                                }
2014                                else if(check == 14)
2015                                {
2016                                        if(internettv_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Internettv - Search (local)", tmpstr, 0) == 0)
[30018]2017                                                if(screenlistbox(grid, listbox, countlabel, "Internettv - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]2018                                }
2019                                else if(check == 15)
2020                                {
2021                                        if(ard_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "ARD - Search (local)", tmpstr, 0) == 0)
[30018]2022                                                if(screenlistbox(grid, listbox, countlabel, "ARD - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]2023                                }
2024                                else if(check == 16)
2025                                {
2026                                        if(zdf_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "ZDF - Search (local)", tmpstr, 0) == 0)
[30018]2027                                                if(screenlistbox(grid, listbox, countlabel, "ZDF - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]2028                                }
2029                                else if(check == 17)
2030                                {
[25767]2031                                        if(tectime_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "TecTime - Search (local)", tmpstr, 0) == 0)
[30018]2032                                                if(screenlistbox(grid, listbox, countlabel, "TecTime - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]2033                                }
2034                                else if(check == 18)
2035                                {
2036                                        if(giga_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Giga - Search (local)", tmpstr, 0) == 0)
[30018]2037                                                if(screenlistbox(grid, listbox, countlabel, "Giga - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]2038                                }
2039                                else if(check == 19)
2040                                {
2041                                        if(beeg_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Beeg - Search (local)", tmpstr, 0) == 0)
[30018]2042                                                if(screenlistbox(grid, listbox, countlabel, "Beeg - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]2043                                }
2044                                else if(check == 20)
2045                                {
[34615]2046                                        if(nowtv_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Rtl2Now - Search (local)", tmpstr, 0) == 0)
2047                                                if(screenlistbox(grid, listbox, countlabel, "NowTv - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]2048                                }
2049                                else if(check == 21)
2050                                {
[34615]2051                                        if(all_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Rtl-Now - Search (local)", tmpstr, 0) == 0)
2052                                                if(screenlistbox(grid, listbox, countlabel, "All - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]2053                                }
2054                                else if(check == 24)
2055                                {
2056                                        if(xvideos_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Xvideos - Search (local)", tmpstr, 0) == 0)
[30018]2057                                                if(screenlistbox(grid, listbox, countlabel, "Xvideos - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25164]2058                                }
[25165]2059                                else if(check == 25)
2060                                {
2061                                        if(mlehd_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Mle-HD - Search (local)", tmpstr, 0) == 0)
[30018]2062                                                if(screenlistbox(grid, listbox, countlabel, "Mle-HD - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25165]2063                                }
2064                                else if(check == 26)
2065                                {
2066                                        if(netzkino_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Netzkino - Search (local)", tmpstr, 0) == 0)
[30018]2067                                                if(screenlistbox(grid, listbox, countlabel, "Netzkino - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25165]2068                                }
[28661]2069                                else if(check == 27)
2070                                {
2071                                        if(filmon_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "FilmOn - Search (local)", tmpstr, 0) == 0)
[30018]2072                                                if(screenlistbox(grid, listbox, countlabel, "FilmOn - Search (local)", titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[28661]2073                                }
[25164]2074/*
2075why ?
[20483]2076                                else if((((struct tithek*)listbox->select->handle)->flag == 13))
2077                                {
[23758]2078                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "MyVideo - Search", tmpstr, 0) == 0)
[30018]2079                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[20483]2080                                }
[25164]2081*/
[19868]2082                                free(tmpstr), tmpstr = NULL;
[18027]2083                        }
[33793]2084                        else
2085                        {
2086                                int check = playrcred(NULL, NULL, 1, 0, 199);
2087                                if(check == 0 || check == 1000)
2088                                {
[33920]2089                                        char* search = textinputhist(_("Create sub folder"), " ", "searchhist");
[33793]2090                                        if(search != NULL)
2091                                        {
2092                                                strstrip(search);
2093                                                char* tmpstr = ostrcat(search, NULL, 0, 0);
2094                                                tmpstr = string_replace_all(" ", "_", tmpstr, 1);
2095                                                tmpstr = string_replace_all(".", "_", tmpstr, 1);
2096                                                tmpstr = string_replace_all("-", "_", tmpstr, 1);
2097                                                tmpstr = string_replace_all("._.", "_", tmpstr, 1);
2098                                                tmpstr = string_replace_all("__", "_", tmpstr, 1);
2099                                                string_tolower(tmpstr);
2100                                                strstrip(tmpstr);
2101                                                char* tmpstr1 = NULL;
2102                                                tmpstr1 = ostrcat(getconfig("tithek_fav", NULL), "_", 0, 0);
2103                                                tmpstr1 = ostrcat(tmpstr1, tmpstr, 1, 0);
[33920]2104                                                if(textbox(_("Message"), _("Add this sub folder as Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0) == 1)
[33793]2105                                                        addfav(search, tmpstr1, "http://imageshack.us/md/up/grd/mediathek/menu/default.jpg", tmpstr, title, check);
2106                                                free(tmpstr), tmpstr = NULL;
2107                                                free(tmpstr1), tmpstr1 = NULL;
2108                                        }
2109                                        free(search), search = NULL;
[39009]2110
[33793]2111                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2112                                        if(pagecount == 0) return;
2113                                }
2114                        }
[18027]2115                }
2116                else if(rcret == getrcconfigint("rcok", NULL))
2117                {
2118                        if(listbox->select != NULL && listbox->select->handle != NULL)
2119                        {
2120                                clearscreen(grid);
2121
[36966]2122                                if(((struct tithek*)listbox->select->handle)->flag == 2 || ((struct tithek*)listbox->select->handle)->flag == 3 || ((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 == 12 || ((struct tithek*)listbox->select->handle)->flag == 14 || ((struct tithek*)listbox->select->handle)->flag == 15 || ((struct tithek*)listbox->select->handle)->flag == 20 || ((struct tithek*)listbox->select->handle)->flag == 38 || ((struct tithek*)listbox->select->handle)->flag == 42 || ((struct tithek*)listbox->select->handle)->flag == 45 || ((struct tithek*)listbox->select->handle)->flag == 46 || ((struct tithek*)listbox->select->handle)->flag == 64 || ((struct tithek*)listbox->select->handle)->flag == 50 || ((struct tithek*)listbox->select->handle)->flag == 41 || ((struct tithek*)listbox->select->handle)->flag == 43 || ((struct tithek*)listbox->select->handle)->flag == 75 || ((struct tithek*)listbox->select->handle)->flag == 91 || ((struct tithek*)listbox->select->handle)->flag == 92 || ((struct tithek*)listbox->select->handle)->flag == 93 || ((struct tithek*)listbox->select->handle)->flag == 94 || ((struct tithek*)listbox->select->handle)->flag == 98 || ((struct tithek*)listbox->select->handle)->flag == 111)
[18027]2123                                {
[19713]2124                                        submenu(listbox, load, title);
[28435]2125//                                      drawscreen(grid, 0, 0);
[18027]2126                                }
2127                                else if((((struct tithek*)listbox->select->handle)->flag == 9) || (((struct tithek*)listbox->select->handle)->flag == 10) || (((struct tithek*)listbox->select->handle)->flag == 11))
2128                                {
[20484]2129                                        if(youtube_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL) == 0)
[30018]2130                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[18027]2131                                }
[23758]2132                                else if(((struct tithek*)listbox->select->handle)->flag == 13)
[18027]2133                                {
[23758]2134                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2135                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[18027]2136                                }
[25155]2137                                else if(((struct tithek*)listbox->select->handle)->flag == 24)
2138                                {
2139                                        if(internetradio_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2140                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25155]2141                                }
[25158]2142                                else if(((struct tithek*)listbox->select->handle)->flag == 25)
2143                                {
2144                                        if(kinox_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2145                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25158]2146                                }
2147                                else if(((struct tithek*)listbox->select->handle)->flag == 26)
2148                                {
2149                                        if(movie4k_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2150                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25158]2151                                }
2152                                else if(((struct tithek*)listbox->select->handle)->flag == 27)
2153                                {
2154                                        if(solarmovie_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2155                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25158]2156                                }
2157                                else if(((struct tithek*)listbox->select->handle)->flag == 47)
2158                                {
2159                                        if(internettv_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2160                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25158]2161                                }
2162                                else if(((struct tithek*)listbox->select->handle)->flag == 48)
2163                                {
2164                                        if(youtube_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2165                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25158]2166                                }
2167                                else if(((struct tithek*)listbox->select->handle)->flag == 49)
2168                                {
2169                                        if(myvideo_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2170                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25158]2171                                }
2172                                else if(((struct tithek*)listbox->select->handle)->flag == 51)
2173                                {
2174                                        if(ard_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2175                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25158]2176                                }
2177                                else if(((struct tithek*)listbox->select->handle)->flag == 52)
2178                                {
2179                                        if(zdf_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2180                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25158]2181                                }
2182                                else if(((struct tithek*)listbox->select->handle)->flag == 53)
2183                                {
[25767]2184                                        if(tectime_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2185                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25158]2186                                }
2187                                else if(((struct tithek*)listbox->select->handle)->flag == 54)
2188                                {
2189                                        if(giga_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2190                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25158]2191                                }
2192                                else if(((struct tithek*)listbox->select->handle)->flag == 55)
2193                                {
2194                                        if(beeg_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2195                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25158]2196                                }
[34615]2197                                else if(((struct tithek*)listbox->select->handle)->flag == 100)
[25158]2198                                {
[34615]2199                                        if(all_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2200                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25158]2201                                }
[25163]2202                                else if(((struct tithek*)listbox->select->handle)->flag == 60)
2203                                {
2204                                        if(xvideos_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2205                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25163]2206                                }
[25165]2207                                else if(((struct tithek*)listbox->select->handle)->flag == 61)
2208                                {
2209                                        if(mlehd_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2210                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25165]2211                                }
2212                                else if(((struct tithek*)listbox->select->handle)->flag == 62)
2213                                {
2214                                        if(netzkino_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2215                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[25165]2216                                }
[28659]2217                                else if(((struct tithek*)listbox->select->handle)->flag == 63)
2218                                {
2219                                        if(filmon_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2220                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[28659]2221                                }
[28839]2222                                else if(((struct tithek*)listbox->select->handle)->flag == 65)
2223                                {
2224                                        if(tvtoast_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2225                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[28839]2226                                }
[23758]2227                                else if(((struct tithek*)listbox->select->handle)->flag == 44)
2228                                {
2229                                        if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
[30018]2230                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[23758]2231                                }
[18060]2232                                else if((((struct tithek*)listbox->select->handle)->flag == 21))
2233                                {
[20836]2234                                        if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2235                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[18060]2236                                }
[22215]2237                                else if((((struct tithek*)listbox->select->handle)->flag == 33))
2238                                {
2239                                        if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2240                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2241                                }
[20483]2242                                else if(((struct tithek*)listbox->select->handle)->flag == 29)
2243                                {
2244                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
[30018]2245                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[20483]2246                                }
2247                                else if(((struct tithek*)listbox->select->handle)->flag == 30)
2248                                {
2249                                        if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
[30018]2250                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[20483]2251                                }
[20836]2252                                else if((((struct tithek*)listbox->select->handle)->flag == 31))
2253                                {
2254                                        if(kinox_search_cast(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL) == 0)
[30018]2255                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[20836]2256                                }
2257                                else if((((struct tithek*)listbox->select->handle)->flag == 32))
2258                                {
2259                                        if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
[30018]2260                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[20836]2261                                }
[22150]2262                                else if((((struct tithek*)listbox->select->handle)->flag == 33))
2263                                {
2264                                        if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
[30018]2265                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 3) == 0) break;
[22150]2266                                }
[22175]2267                                else if((((struct tithek*)listbox->select->handle)->flag == 34) || (((struct tithek*)listbox->select->handle)->flag == 35))
[22150]2268                                {
2269                                        if(movie4k_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
[30018]2270                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[22150]2271                                }
[18060]2272                                else if((((struct tithek*)listbox->select->handle)->flag == 22))
2273                                {
[18399]2274                                        if(kinox_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
[30018]2275                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 3) == 0) break;
[20021]2276                                }
2277                                else if((((struct tithek*)listbox->select->handle)->flag == 28))
2278                                {
2279                                        if(solarmovie_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
[30018]2280                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 3) == 0) break;
[20021]2281                                }
[18060]2282                                else if((((struct tithek*)listbox->select->handle)->flag == 23))
2283                                {
[18399]2284                                        if(kinox_hoster_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
[30018]2285                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[18060]2286                                }
[22211]2287                                else if((((struct tithek*)listbox->select->handle)->flag == 36) || (((struct tithek*)listbox->select->handle)->flag == 37))
2288                                {
[22212]2289                                        if(movie4k_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
[30018]2290                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[22211]2291                                }
[22212]2292                                else if((((struct tithek*)listbox->select->handle)->flag == 39))
2293                                {
2294                                        if(movie4k_series_listed(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
[30018]2295                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[22212]2296                                }
[22215]2297                                else if((((struct tithek*)listbox->select->handle)->flag == 40))
2298                                {
2299                                        if(movie4k_hoster_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
[30018]2300                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
[22215]2301                                }
[35286]2302                                else if(((struct tithek*)listbox->select->handle)->flag == 76)
2303                                {
2304                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2305                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2306                                }
[36122]2307                                else if(((struct tithek*)listbox->select->handle)->flag == 77)
2308                                {
2309                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0)
2310                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2311                                }
2312                                else if(((struct tithek*)listbox->select->handle)->flag == 78)
2313                                {
2314                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 2) == 0)
2315                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2316                                }
2317                                else if(((struct tithek*)listbox->select->handle)->flag == 79)
2318                                {
2319                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 3) == 0)
2320                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2321                                }
2322                                else if(((struct tithek*)listbox->select->handle)->flag == 80)
2323                                {
2324                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 4) == 0)
2325                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2326                                }
2327                                else if(((struct tithek*)listbox->select->handle)->flag == 81)
2328                                {
2329                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 5) == 0)
2330                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2331                                }
2332                                else if(((struct tithek*)listbox->select->handle)->flag == 82)
2333                                {
2334                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 6) == 0)
2335                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2336                                }
2337                                else if(((struct tithek*)listbox->select->handle)->flag == 83)
2338                                {
2339                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 7) == 0)
2340                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2341                                }
2342                                else if(((struct tithek*)listbox->select->handle)->flag == 84)
2343                                {
2344                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 8) == 0)
2345                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2346                                }
2347                                else if(((struct tithek*)listbox->select->handle)->flag == 85)
2348                                {
2349                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 9) == 0)
2350                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2351                                }
2352                                else if(((struct tithek*)listbox->select->handle)->flag == 86)
2353                                {
2354                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 10) == 0)
2355                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2356                                }
2357                                else if(((struct tithek*)listbox->select->handle)->flag == 87)
2358                                {
2359                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 11) == 0)
2360                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2361                                }
2362                                else if(((struct tithek*)listbox->select->handle)->flag == 88)
2363                                {
2364                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 12) == 0)
2365                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2366                                }
2367                                else if(((struct tithek*)listbox->select->handle)->flag == 89)
2368                                {
2369                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 13) == 0)
2370                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2371                                }
2372                                else if(((struct tithek*)listbox->select->handle)->flag == 90)
2373                                {
2374                                        if(amazon_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 14) == 0)
2375                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2376                                }
[36158]2377                                else if((((struct tithek*)listbox->select->handle)->flag == 95) || (((struct tithek*)listbox->select->handle)->flag == 96))
2378                                {
2379                                        if(movie2k_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2380                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2381                                }
[36162]2382                                else if(((struct tithek*)listbox->select->handle)->flag == 97)
2383                                {
2384                                        if(movie2k_search_local(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2385                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2386                                }
[18068]2387                                else if((((struct tithek*)listbox->select->handle)->flag == 66))
2388                                {
[23722]2389                                        textbox(_("Message"), _("The hoster is not yet supported !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0);
[18068]2390                                        continue;
[39009]2391                                }
[36966]2392                                else if((((struct tithek*)listbox->select->handle)->flag == 112))
2393                                {
2394//                                      if(localparser_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0)
2395//                                              if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2396                                        if(localparser_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0)
2397                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 0) == 0) break;
2398                                }
[20271]2399                                else if((((struct tithek*)listbox->select->handle)->flag == 3))
2400                                {
2401                                        int pincheck = 0;
2402                                        if(((struct tithek*)listbox->select->handle)->flag == 1000)
2403                                                pincheck = screenpincheck(0, NULL);
2404                                        if(pincheck == 0)
[30018]2405                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 3, 0) == 0) break;
[20271]2406                                }
[18027]2407                                else
2408                                {
2409                                        int pincheck = 0;
2410                                        if(((struct tithek*)listbox->select->handle)->flag == 1000)
2411                                                pincheck = screenpincheck(0, NULL);
2412                                        if(pincheck == 0)
[30018]2413                                                if(screenlistbox(grid, listbox, countlabel, title, titheklink, &pagecount, &tithekexit, &oaktpage, &oaktline, &ogridcol, 0, 3) == 0) break;
[18027]2414                                }
[28644]2415// new osd musst disable this
2416                                drawscreen(grid, 0, 0);
[39009]2417                        }
[18027]2418                }
[33793]2419//              else if(rcret == getrcconfigint("rcyellow", NULL) && ostrcmp(title, _("Tithek - Mainmenu - Favoriten")) == 0)
2420                else if(rcret == getrcconfigint("rcyellow", NULL) && ostrstr(title, _("Tithek - Mainmenu - Favoriten")) != NULL)
[18027]2421                {
[22247]2422                        if(listbox->select != NULL && listbox->select->handle != NULL)
[18027]2423                        {
[33793]2424                                if(textbox(_("Message"), _("Remove this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 5, 0) == 1)
[22247]2425                                {
[39009]2426                                        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]2427                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
[22247]2428                                        if(pagecount == 0) return;
[39009]2429
[28435]2430//                                      drawscreen(grid, 0, 0);
[22247]2431                                }
[18027]2432                        }
2433                }
[33793]2434//              else if(rcret == getrcconfigint("rcgreen", NULL) && ostrcmp(title, _("Tithek - Mainmenu - Favoriten")) != 0)
2435//              else if(rcret == getrcconfigint("rcgreen", NULL) && (ostrcmp(title, _("Tithek - Mainmenu - Favoriten")) == 0 || !ostrncmp("/", ((struct tithek*)listbox->select->handle)->link, 1)))
2436                else if(rcret == getrcconfigint("rcgreen", NULL) && ostrstr(title, _("Tithek - Mainmenu - Favoriten")) == NULL)
[18027]2437                {
[22247]2438                        if(listbox->select != NULL && listbox->select->handle != NULL)
[18027]2439                        {
[33793]2440                                if(textbox(_("Message"), _("Add this link as Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 5, 0) == 1)
[22247]2441                                {
[39009]2442                                        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);
[22247]2443                                }
[18027]2444                        }
2445                }
[33793]2446//              else if(rcret == getrcconfigint("rcgreen", NULL) && ostrcmp(title, _("Tithek - Mainmenu - Favoriten")) == 0)
2447//              else if(rcret == getrcconfigint("rcgreen", NULL) && (ostrcmp(title, _("Tithek - Mainmenu - Favoriten")) == 0 || !ostrncmp("/", ((struct tithek*)listbox->select->handle)->link, 1)))
2448                else if(rcret == getrcconfigint("rcgreen", NULL) && ostrstr(title, _("Tithek - Mainmenu - Favoriten")) != NULL)
[27336]2449                {
2450                        if(listbox->select != NULL && listbox->select->handle != NULL)
2451                        {
[33793]2452                                if(textbox(_("Message"), _("Edit this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 5, 0) == 1)
[27336]2453                                {
[39009]2454                                        editfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag);
[27336]2455                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
2456                                        if(pagecount == 0) return;
[39009]2457
[28435]2458//                                      drawscreen(grid, 0, 0);
[27336]2459                                }
2460                        }
2461                }
[27310]2462
[33793]2463//              if(ostrcmp(title, _("Tithek - Mainmenu - Favoriten")) == 0)
2464                if(ostrstr(title, _("Tithek - Mainmenu - Favoriten")) != NULL)
[27310]2465                {
[27336]2466                        changetext(b4, _("EDIT FAV"));
2467                        b5->hidden = NO;
[27310]2468                }
2469                else
2470                {
[27336]2471                        changetext(b4, _("ADD FAV"));
2472                        b5->hidden = YES;
[27310]2473                }
[39009]2474
[28644]2475// new osd musst disable this
2476                drawscreen(grid, 0, 0);
[39009]2477
[18027]2478        }
2479
[36133]2480//      amazon_deinit();
[36122]2481
[18027]2482        delmarkedscreennodes(grid, 1);
2483        delownerrc(grid);
2484        clearscreen(grid);
2485
[39034]2486        if(first == 1)
2487        {
[33794]2488                setvol(savevol);
2489
[19836]2490                freetithek();
[24513]2491                delallfiles("/tmp/tithek", NULL);
[39043]2492                system("rm -rf /tmp/localhoster");
2493                system("rm -rf /tmp/localparser");
2494                system("rm -rf /tmp/localcache");
2495                system("rm -rf /tmp/parser");
[39033]2496
[19575]2497                if(status.mcaktiv == 0)
2498                        servicecheckret(servicestart(status.lastservice->channel, NULL, NULL, 0), 0);
[39034]2499        }
[18027]2500}
2501
2502#endif
Note: See TracBrowser for help on using the repository browser.