Changeset 39009


Ignore:
Timestamp:
09/25/16 11:49:02 (7 years ago)
Author:
Stephan
Message:

tithek shorter filename for shell script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/tithek/tithek.h

    r38439 r39009  
    2222//flag 7        - nowtv local serach //rtlnow
    2323//flag 8        - nowtv search //voxnow
    24 //flag 9        - youtube suche 10 
     24//flag 9        - youtube suche 10
    2525//flag 10       - youtube suche 25
    2626//flag 11       - youtube suche 50
     
    4949//flag 34       - movie4k hoster de
    5050//flag 35       - movie4k hoster other
    51 //flag 36       - movie4k series de > open seasons and list episode flag=39 > hoster listed flag=34 
     51//flag 36       - movie4k series de > open seasons and list episode flag=39 > hoster listed flag=34
    5252//flag 37       - movie4k series other > open seasons and list episode flag=39 > hoster listed flag=34
    5353//flag 38       - mlehd
     
    162162        char* pic;
    163163        char* localname;
    164         char* menutitle;       
     164        char* menutitle;
    165165        int flag;
    166166        struct tithek* prev;
     
    233233
    234234        if(flag != NULL) node->flag = atoi(flag);
    235        
     235
    236236        sos = getconfigint("sos", NULL);
    237237        hid = getconfigint("tithek_hid_xxx", NULL);
     
    251251        {
    252252                cmd = ostrcat(cmd, "www.thesolarmovie.me", 1, 0);
    253                
     253
    254254                for(i = 0; i < 3; i++)
    255255                {
     
    266266        {
    267267                cmd = ostrcat(cmd, "www.movie4k.to", 1, 0);
    268                
     268
    269269                for(i = 0; i < 3; i++)
    270270                {
     
    277277
    278278                tithekmovie4k = 0;
    279         }               
     279        }
    280280        else if(tithekmlehd == 1 && node->flag == 9998 && sos == 0)
    281281        {
    282282                cmd = ostrcat(cmd, "www.mle-hd.se", 1, 0);
    283                
     283
    284284                for(i = 0; i < 3; i++)
    285285                {
     
    296296        {
    297297                cmd = ostrcat(cmd, "kinox.me", 1, 0);
    298                
     298
    299299                for(i = 0; i < 3; i++)
    300300                {
     
    317317        free(tmp); tmp = NULL;
    318318        free(cmd), cmd = NULL;
    319                
     319
    320320        return 0;
    321321}
     
    378378        struct tithek* tnode = NULL;
    379379        char* tmpstr = NULL;
    380        
     380
    381381        pay = getconfigint("tithek_pay", NULL);
    382382
     
    386386        localname = stringreplacechar(localname, '#', ' ');
    387387        menutitle = stringreplacechar(menutitle, '#', ' ');
    388        
     388
    389389        tmpstr = ostrcat(tmpstr, title, 1, 0);
    390390        tmpstr = ostrcat(tmpstr, "#", 1, 0);
     
    442442        }
    443443        else
    444                 file = ostrcat(filename, NULL, 0, 0);   
     444                file = ostrcat(filename, NULL, 0, 0);
    445445
    446446        fd = fopen(file, "r");
     
    614614        {
    615615                ip = string_replace("http://", "", (char*)link, 0);
    616        
     616
    617617                // tithek security
    618618                ip = string_replace_all("imageshack.us/md/up/grd/", "atemio.dyndns.tv/", ip, 1);
    619        
     619
    620620                ip = string_replace_all("kinox.to", "kinox.me", ip, 1);
    621621                //ip = string_replace_all("movie4k.to", "movie4k.me", ip, 1);
    622        
     622
    623623                if(ip != NULL)
    624624                        pos = strchr(ip, '/');
     
    628628                        path = pos + 1;
    629629                }
    630        
     630
    631631                if(ostrstr(ip, ":") != NULL)
    632632                {
     
    701701                                        gethttps(link, localfile, NULL, NULL, NULL, NULL, 0);
    702702                                else
    703                                         gethttp(ip, path, port, localfile, pw, timeout, NULL, 0);                       
     703                                        gethttp(ip, path, port, localfile, pw, timeout, NULL, 0);
    704704                        }
    705705                }
     
    707707        else
    708708        {
    709        
     709
    710710                if(localfile != NULL && file_exist(localfile))
    711711                        ret = textbox(_("Message"), _("File exist, overwrite?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0);
     
    746746        int linecount = readtithek(tithekfile);
    747747//      if(linecount == 0) return 1;
    748        
     748
    749749        struct tithek* titheknode = tithek;
    750750
     
    769769                        pcount = 6;
    770770                }
    771          
     771
    772772                if(linecount > 8)
    773773                {
     
    791791                        pcount = 20;
    792792                }
    793        
     793
    794794                if(linecount > 25)
    795795                {
     
    803803                }
    804804        }
    805        
     805
    806806        if((getconfigint("tithek_cover", NULL) == 1 && flag == 0) || (getconfigint("tithek_view", NULL) == 1 && flag != 0))
    807807        {
     
    896896                        tmp->picheight = picheight;
    897897                        tmp->picwidth = picwidth;
    898                                                                
     898
    899899                        tmp->fontsize = fontsize;
    900900                        tmp->height = height;
     
    918918                                gridbr = 0;
    919919                        }
    920                        
     920
    921921                        if(count1 >= pcount)
    922922                        {
     
    945945        if(localfile == 0)
    946946                unlink(tithekfile);
    947        
     947
    948948        free(tithekfile); tithekfile = NULL;
    949949        return pagecount;
     
    967967        input = ostrcat(input, "#", 1, 0);
    968968        input = ostrcat(input, oitoa(flag), 1, 1);
    969        
     969
    970970        tmpstr = readfiletomem(getconfig("tithek_fav", NULL), 0);
    971        
     971
    972972        ret = strsplit(tmpstr, "\n", &count);
    973973
     
    10551055        else
    10561056                savefile = ostrcat(getconfig("tithek_fav", NULL), NULL, 0, 0);
    1057                                
     1057
    10581058        input = ostrcat(input, title, 1, 0);
    10591059        input = ostrcat(input, "#", 1, 0);
     
    10691069        // tithek security
    10701070        input = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", input, 1);
    1071        
     1071
    10721072        tmpstr1 = ostrcat(tmpstr1, input, 1, 0);
    10731073        tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0);
     
    11611161        struct skin* proztext = getscreennode(load, "proztext");
    11621162
    1163         drawscreen(load, 0, 0); 
     1163        drawscreen(load, 0, 0);
    11641164        int port = 80, count = 0, mcount = 0;
    11651165        off64_t size = 0, msize = 0;
     
    11921192        debug(99, "local: %s", file);
    11931193        debug(99, "---------------------------------------");
    1194        
    1195        
     1194
     1195
    11961196        struct download* dnode = NULL;
    11971197        dnode = calloc(1, sizeof(struct download));
     
    12001200                err("no mem");
    12011201                return;
    1202         }               
     1202        }
    12031203        dnode->host = host;
    12041204        dnode->page = path;
     
    12091209        dnode->ret = -1;
    12101210        dnode->timeout = 30000;
    1211        
     1211
    12121212        addtimer(&gethttpstruct, START, 1000, 1, (void*)dnode, NULL, NULL);
    12131213
     
    12191219        else if(flag == 2)
    12201220        {
    1221                 mcount = 240; 
     1221                mcount = 240;
    12221222                msize = 20971520;
    12231223        }
    12241224        else if(flag == 3)
    12251225        {
    1226                 mcount = 360; 
     1226                mcount = 360;
    12271227                msize = 31457280;
    12281228        }
    1229                        
     1229
    12301230        while(count < mcount || size >= msize)
    12311231        {
     
    12411241                int proz2 = count * 100 / mcount;
    12421242                debug(99, "time (%dprozent)", proz2);
    1243                
     1243
    12441244                if(proz1 > proz2)
    12451245                        proz = proz1;
     
    12531253                if(count >= mcount)
    12541254                        break;
    1255                
     1255
    12561256                tmpstr = ostrcat(_("please wait..."), " (", 0, 0);
    12571257                tmpstr = ostrcat(tmpstr, oitoa(proz), 1, 1);
     
    12701270        tmpstr = ostrcat(tmpstr, "\n\n", 1, 0);
    12711271        tmpstr = ostrcat(tmpstr, file, 1, 0);
    1272        
     1272
    12731273        if(textbox(_("Message"), tmpstr, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1)
    12741274        {
     
    13111311        debug(99, "local: %s", file);
    13121312        debug(99, "---------------------------------------");
    1313                
     1313
    13141314        if(ostrstr(path, "|User-Agent=") != NULL)
    13151315        {
     
    13331333        if(ret == 1)
    13341334                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);
    1335                                        
     1335
    13361336        free(tmpstr), tmpstr = NULL;
    13371337        free(file), file = NULL;
    13381338        free(host), host = NULL;
    13391339}
    1340        
     1340
    13411341void submenu(struct skin* listbox, struct skin* load, char* title)
    13421342{
    13431343        int flag = 0;
    1344         char* tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL; 
     1344        char* tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL;
    13451345        drawscreen(load, 0, 0);
    13461346        tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0);
     
    13591359        {
    13601360                if(tmpstr != NULL) tmpstr1 = youtube_hoster(tmpstr);
    1361         }                                               
     1361        }
    13621362        else if(((struct tithek*)listbox->select->handle)->flag == 5)
    13631363        {
     
    14571457                printf("change streamurl to: %s\n", tmpstr1);
    14581458        }
    1459        
     1459
    14601460        if(tmpstr1 != NULL)
    14611461        {
    1462                 char* filename = ostrcat(title, "_", 0, 0);             
    1463 
    1464                 tmpstr2 = ostrcat(_("Tithek - Mainmenu - Favoriten"), " - ", 0, 0);             
     1462                char* filename = ostrcat(title, "_", 0, 0);
     1463
     1464                tmpstr2 = ostrcat(_("Tithek - Mainmenu - Favoriten"), " - ", 0, 0);
    14651465                filename = string_replace_all(tmpstr2, "", filename, 1);
    14661466                free(tmpstr2); tmpstr2 = NULL;
    1467        
    1468                 tmpstr2 = ostrcat(_("Tithek - Mainmenu"), " - ", 0, 0);         
     1467
     1468                tmpstr2 = ostrcat(_("Tithek - Mainmenu"), " - ", 0, 0);
    14691469                filename = string_replace_all(tmpstr2, "", filename, 1);
    14701470                free(tmpstr2); tmpstr2 = NULL;
     
    14821482                filename = string_replace_all("Movie2k - ", "", filename, 1);
    14831483
    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);
    1493 
    1494                 tmpstr2 = ostrcat(_("Category"), " - ", 0, 0);         
     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);
     1493
     1494                tmpstr2 = ostrcat(_("Category"), " - ", 0, 0);
    14951495                filename = string_replace_all(tmpstr2, "", filename, 1);
    14961496                free(tmpstr2); tmpstr2 = NULL;
    14971497
    1498                 tmpstr2 = ostrcat(_("Search (local)"), " - ", 0, 0);           
     1498                tmpstr2 = ostrcat(_("Search (local)"), " - ", 0, 0);
    14991499                filename = string_replace_all(tmpstr2, "", filename, 1);
    15001500                free(tmpstr2); tmpstr2 = NULL;
    15011501
    1502                 tmpstr2 = ostrcat(_("Search (20)"), " - ", 0, 0);               
     1502                tmpstr2 = ostrcat(_("Search (20)"), " - ", 0, 0);
    15031503                filename = string_replace_all(tmpstr2, "", filename, 1);
    15041504                free(tmpstr2); tmpstr2 = NULL;
    15051505
    1506                 tmpstr2 = ostrcat(_("Search Cast"), " - ", 0, 0);               
     1506                tmpstr2 = ostrcat(_("Search Cast"), " - ", 0, 0);
    15071507                filename = string_replace_all(tmpstr2, "", filename, 1);
    15081508                free(tmpstr2); tmpstr2 = NULL;
    15091509
    1510                 tmpstr2 = ostrcat(_("Search"), " - ", 0, 0);           
     1510                tmpstr2 = ostrcat(_("Search"), " - ", 0, 0);
    15111511                filename = string_replace_all(tmpstr2, "", filename, 1);
    15121512                free(tmpstr2); tmpstr2 = NULL;
     
    15271527                filename = string_replace_all(".._", "_", filename, 1);
    15281528                debug(99, "filename: %s", filename);
    1529                        
     1529
    15301530                char* keyconf = NULL;
    15311531                char* skintitle = _("Choice Playback");
     
    15581558#endif
    15591559//#endif
    1560                         }       
     1560                        }
    15611561                        else if(!ostrncmp("http://", tmpstr1, 7) || !ostrncmp("https://", tmpstr1, 8))
    15621562                        {
     
    16561656                        char* search = textinput(_("Filename"), filename);
    16571657                        if(search != NULL)
    1658                         {       
     1658                        {
    16591659                                char* tmpstr2 = tithekdownload(tmpstr1, search, NULL, 0, 1);
    16601660//                                              drawscreen(grid, 0, 0);
    16611661                                free(tmpstr2); tmpstr2 = NULL;
    1662                        
     1662
    16631663                                if(textbox(_("Message"), _("Start playback"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1)
    16641664                                {
     
    16781678                        free(search), search = NULL;
    16791679                }
    1680                  
     1680
    16811681                free(filename), filename = NULL;
    16821682                freemenulist(mlist, 1); mlist = NULL;
     
    16841684        else
    16851685                textbox(_("Message"), _("Can't get Streamurl !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0);
    1686        
     1686
    16871687        free(tmpstr1); tmpstr1 = NULL;
    16881688}
     
    16921692        int savevol = 0;
    16931693        if(!file_exist("/mnt/swapextensions/player"))
    1694                 mkdir("/mnt/swapextensions/player", 0777); 
     1694                mkdir("/mnt/swapextensions/player", 0777);
    16951695
    16961696        char* disclaimer = NULL;
    16971697        disclaimer = ostrcat(disclaimer, "/mnt/swapextensions/player/tithek_disclaimer_accepted", 1, 0);
    1698                                
     1698
    16991699        if(!file_exist(disclaimer))
    17001700        {
     
    17021702                if(textbox(_("TitanNit Tithek disclaimer"), _(tmpstr), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1100, 650, 0, 0) == 1)
    17031703                {
    1704                         writesys(disclaimer, tmpstr, 0);                               
     1704                        writesys(disclaimer, tmpstr, 0);
    17051705                        free(tmpstr), tmpstr = NULL;
    17061706                }
     
    17161716        int rcret = -1, oaktline = 1, oaktpage = -1, ogridcol = 0, pagecount = 0;
    17171717
    1718         writesysint("/proc/sys/vm/drop_caches", 3, 0); 
     1718        writesysint("/proc/sys/vm/drop_caches", 3, 0);
    17191719
    17201720        if(first == 1)
    1721         { 
     1721        {
    17221722                savevol = getvol();
    17231723
     
    17571757
    17581758        drawscreen(load, 0, 0);
    1759        
     1759
    17601760        if(titheklink == NULL) return;
    1761        
     1761
    17621762        listbox->aktpage = -1;
    17631763        listbox->aktline = 1;
     
    17711771        drawscreen(grid, 0, 0);
    17721772        addscreenrc(grid, listbox);
    1773                                
     1773
    17741774        while(1)
    17751775        {
     
    17991799                                        /* not working with thread download
    18001800                                        off64_t checkpic = getfilesize(tithekpic);
    1801                        
     1801
    18021802                                        if(checkpic < 1000)
    18031803                                        {
     
    18061806                                        }
    18071807                                        */
    1808                        
     1808
    18091809                                        changepic(tmp, tithekpic);
    18101810                                        free(tithekpic); tithekpic = NULL;
     
    18371837                        }
    18381838                }
    1839                
     1839
    18401840                int count = getfilecount(TITHEKPATH);
    18411841                if(count > 500)
     
    19111911                                tmpstr = string_replace_all("_", " ", tmpstr, 1);
    19121912                                tmpstr = string_replace_all("-", " ", tmpstr, 1);
    1913                                 tmpstr = string_replace_all(".", " ", tmpstr, 1);                               
     1913                                tmpstr = string_replace_all(".", " ", tmpstr, 1);
    19141914                                debug(99, "tmpstr: %s", tmpstr);
    19151915
     
    20982098                                        }
    20992099                                        free(search), search = NULL;
    2100        
     2100
    21012101                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
    21022102                                        if(pagecount == 0) return;
     
    23792379                                        textbox(_("Message"), _("The hoster is not yet supported !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0);
    23802380                                        continue;
    2381                                 }       
     2381                                }
    23822382                                else if((((struct tithek*)listbox->select->handle)->flag == 112))
    23832383                                {
     
    24052405// new osd musst disable this
    24062406                                drawscreen(grid, 0, 0);
    2407                         }                       
     2407                        }
    24082408                }
    24092409//              else if(rcret == getrcconfigint("rcyellow", NULL) && ostrcmp(title, _("Tithek - Mainmenu - Favoriten")) == 0)
     
    24142414                                if(textbox(_("Message"), _("Remove this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 5, 0) == 1)
    24152415                                {
    2416                                         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);             
     2416                                        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);
    24172417                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
    24182418                                        if(pagecount == 0) return;
    2419                                                
     2419
    24202420//                                      drawscreen(grid, 0, 0);
    24212421                                }
     
    24302430                                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)
    24312431                                {
    2432                                         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);         
     2432                                        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);
    24332433                                }
    24342434                        }
     
    24422442                                if(textbox(_("Message"), _("Edit this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 5, 0) == 1)
    24432443                                {
    2444                                         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);               
     2444                                        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);
    24452445                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0);
    24462446                                        if(pagecount == 0) return;
    2447                                                
     2447
    24482448//                                      drawscreen(grid, 0, 0);
    24492449                                }
     
    24622462                        b5->hidden = YES;
    24632463                }
    2464                
     2464
    24652465// new osd musst disable this
    24662466                drawscreen(grid, 0, 0);
    2467                
     2467
    24682468        }
    24692469
Note: See TracChangeset for help on using the changeset viewer.