Changeset 40893


Ignore:
Timestamp:
09/02/17 21:42:56 (7 years ago)
Author:
obi
Message:

tithek show streamed files green, show fav files blue and show python not ready status red in hoster list and fiy kino mirroe 1 only files

Location:
titan/plugins/tithek
Files:
4 edited

Legend:

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

    r40864 r40893  
    359359                                                mirrormax = atoi(mirrormaxtmp);
    360360
     361                                        debug(99, "### START ####################################################");
     362
    361363                                        for(j = 1; j < mirrormax + 1; j++)
    362364                                        {
     
    366368
    367369                                                hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0);
    368                                                 hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1);
    369                                                 hlink = ostrcat(hlink, "Mirror=", 0, 0);
    370 
    371                                                 hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0);
    372                                                 pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0);
    373 
    374                                                 pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1);
     370
     371                                                if (hlink == NULL)
     372                                                {
     373                                                        hlink = string_resub("rel=\"", "\">", ret1[i].part, 0);
     374                                                        hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1);
     375                                                        hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0);
     376                                                        pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0);
     377                                                        pathnew = ostrcat(pathnewtmp, NULL, 0, 0);
     378                                                }
     379                                                else
     380                                                {
     381                                                        hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1);
     382                                                        hlink = ostrcat(hlink, "Mirror=", 0, 0);
     383                                                        hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0);
     384                                                        pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0);
     385                                                        pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1);
     386                                                }
    375387                                                debug(99, "(%d/%d) (%d/%d)hnr: %s hlink: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,hname ,pathnewtmp);
    376388                                                free(pathnewtmp), pathnewtmp= NULL;
     
    491503
    492504                                                debug(99, "-------------------------------");
    493                                                 if(ostrcmp(url, url2) != 0)
    494                                                 {
    495                                                         debug(99, "(%d/%d) (%d/%d) %s (Part1) url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra);
    496                                                 }
    497                                                 else
    498                                                 {
     505//                                              if(ostrcmp(url, url2) != 0)
     506//                                              {
     507//                                                      debug(99, "(%d/%d) (%d/%d) %s (Part1) url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra);
     508//                                              }
     509//                                              else
     510//                                              {
    499511                                                        debug(99, "(%d/%d) (%d/%d) %s url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra);
    500                                                 }
     512//                                              }
     513                                                debug(99, "-------------------------------");
    501514
    502515                                                incount += 1;
     
    664677                                                free(extra), extra = NULL;
    665678                                        }
     679                                        debug(99, "### END #####################################################");
    666680                                }
    667681                        }
     
    792806                                        free(mirrormaxtmp), mirrormaxtmp= NULL;
    793807
     808                                        debug(99, "### START ####################################################");
     809
    794810                                        for(j = 1; j < mirrormax + 1; j++)
    795811                                        {
     
    798814                                                hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0);
    799815
     816//                                              hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0);
     817//                                              hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1);
     818//                                              hlink = ostrcat(hlink, "Mirror=", 0, 0);
     819
     820//////////
    800821                                                hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0);
    801                                                 hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1);
    802                                                 hlink = ostrcat(hlink, "Mirror=", 0, 0);
    803 
     822
     823                                                if (hlink == NULL)
     824                                                {
     825                                                        hlink = string_resub("rel=\"", "\">", ret1[i].part, 0);
     826                                                        hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1);
     827                                                        hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0);
     828                                                        pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0);
     829                                                        pathnew = ostrcat(pathnewtmp, NULL, 0, 0);
     830                                                }
     831                                                else
     832                                                {
     833                                                        hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1);
     834                                                        hlink = ostrcat(hlink, "Mirror=", 0, 0);
     835                                                        hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0);
     836                                                        pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0);
     837                                                        pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1);
     838                                                }
     839                                                debug(99, "(%d/%d) (%d/%d)hnr: %s hlink: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,hname ,pathnewtmp);
     840                                                free(pathnewtmp), pathnewtmp= NULL;
     841//////////
    804842                                                hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0);
    805843                                                pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0);
     
    826864                                                hlink = string_replace("http://kinox.me/Stream/", "", hlink, 1);
    827865                                                                               
    828                                                 debug(99, "pathnew: %s", pathnew);
     866//                                              debug(99, "pathnew: %s", pathnew);
    829867                                                tmpstr1 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0);
    830                                                 debug(99, "tmpstr1 1: %s", tmpstr1);
     868//                                              debug(99, "tmpstr1 1: %s", tmpstr1);
    831869
    832870                                                tmpstr1 = string_replace_all("\\", "", tmpstr1, 1);
    833                                                 debug(99, "tmpstr1 2: %s", tmpstr1);
     871//                                              debug(99, "tmpstr1 2: %s", tmpstr1);
    834872
    835873                                                if(ostrstr(tmpstr1, "<iframe src=") != NULL)
    836874                                                {
    837875                                                        url = string_resub("<iframe src=\"", "\"", tmpstr1, 0);
    838                                                         debug(99, "iframe1.1 url: %s", url);
     876//                                                      debug(99, "iframe1.1 url: %s", url);
    839877                                                }
    840878                                                else if(ostrstr(tmpstr1, "/iframe>") != NULL)
     
    842880                                                        free(pathnew), pathnew = NULL;
    843881                                                        pathnew = ostrcat("kinox.me/aGET/Mirror/", hlink, 0, 0);
    844                                                         debug(99, "iframe2.1 pathnew: %s", pathnew);
     882//                                                      debug(99, "iframe2.1 pathnew: %s", pathnew);
    845883                                                        free(tmpstr1), tmpstr1 = NULL;
    846884                                                        tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1);
    847                                                         debug(99, "iframe2.2 tmpstr1: %s", tmpstr1);
     885//                                                      debug(99, "iframe2.2 tmpstr1: %s", tmpstr1);
    848886                                                        tmpstr1 = string_replace_all("\\", "", tmpstr1, 1);
    849                                                         debug(99, "iframe2.3 tmpstr1: %s", tmpstr1);
     887//                                                      debug(99, "iframe2.3 tmpstr1: %s", tmpstr1);
    850888
    851889                                                        if(ostrstr(tmpstr1, "<iframe src=") != NULL)
    852890                                                        {
    853891                                                                url = string_resub("<iframe src=\"", "\"", tmpstr1, 0);
    854                                                                 debug(99, "iframe2.4 url: %s", url);
     892//                                                              debug(99, "iframe2.4 url: %s", url);
    855893                                                        }
    856894                                                }
     
    858896                                                {
    859897                                                        tmpstr1 = string_resub("<a href=\"", "\"", tmpstr1, 0);
    860                                                         debug(99, "tmpstr1 3: %s", tmpstr1);
     898//                                                      debug(99, "tmpstr1 3: %s", tmpstr1);
    861899                                                        url = ostrcat(tmpstr1, NULL, 0, 0);
    862900                                                }
     
    866904                                                debug(99, "-------------------------------");
    867905                                                debug(99, "(%d/%d) (%d/%d) %s url: %s extra: %s", i, max, j, mirrormax, hname, url, extra);
     906                                                debug(99, "-------------------------------");
    868907                                                       
    869908                                                incount += 1;
     
    911950                                                free(extra), extra = NULL;
    912951                                        }
     952                                        debug(99, "### END #####################################################");
    913953                                }
    914954                        }
  • titan/plugins/tithek/tithek.h

    r40856 r40893  
    944944                        tmp->posx = posx;
    945945
    946                         printf("flag=%d\n", titheknode->flag);
    947                         printf("title=%s\n", titheknode->title);
    948                         printf("menutitle=%s\n", titheknode->menutitle);
    949                         printf("skin title=%s\n", title);
    950                         printf("titheklink=%s\n", titheklink);
    951 
     946                        debug(99, "--- START ----------------------------------------------------");
    952947                        if(title != NULL)
    953948                                tmpstr1 = ostrcat(title, " - ", 0, 0);
     
    955950                                tmpstr1 = ostrcat(titheknode->menutitle, " - ", 0, 0);
    956951
    957                         tmpstr2 = ostrcat(tmpstr1, titheknode->title, 0, 0);
    958 
    959                         printf("tmpstr2=%s\n", tmpstr2);
     952                        tmpstr1 = ostrcat(tmpstr1, titheknode->title, 1, 0);
     953
     954//                      tmpstr2 = createfilename(tmpstr1, titheknode->menutitle);
     955                        tmpstr2 = createfilename(tmpstr1, NULL, 0);
     956                        int new = 0;
     957                        if(file_exist(tmpstr2))
     958                        {
     959                                new = 1;
     960                                debug(99, "found oldfile %s", tmpstr2);
     961                        }
     962                        free(tmpstr2), tmpstr2 = NULL;
     963
     964                        tmpstr2 = createfilename(tmpstr1, NULL, 1);
     965                        int fav = 0;
     966                        if(file_exist(tmpstr2))
     967                        {
     968                                fav = 1;
     969                                debug(99, "found oldfav %s", tmpstr2);
     970                        }
     971                        free(tmpstr2), tmpstr2 = NULL;
     972
    960973                        free(tmpstr1), tmpstr1 = NULL;
    961                         free(tmpstr2), tmpstr2 = NULL;
    962 
    963                         char* title2 = ostrcat(titheknode->title, NULL, 0, 0);
    964                         char* filename = createfilename(tmpstr2, title2);
    965 //                      char* filename = createfilename(tmpstr2, titheknode->title);
    966                         free(title2), title2 = NULL;
    967                         debug(99, "filename: %s", filename);
    968                         free(filename), filename = NULL;
    969 
    970 
    971                         if(python == 0 && titheknode->flag == 14)
    972                                 tmp->fontcol = 0xff0000;
     974                       
     975                        debug(99, "--- END -----------------------------------------------------");
     976
     977                        if(fav == 1)
     978//                              tmp->fontcol = 0x0091c9; //get favcol=0091c9
     979                                tmp->fontcol = convertcol("favcol");
     980                        else if(new == 1)
     981                                tmp->fontcol = convertcol("green");
     982                        else if(python == 0 && titheknode->flag == 14)
     983                                tmp->fontcol = convertcol("red");
    973984                        else if(python == 1 && titheknode->flag == 14)
    974                                 tmp->fontcol = 0xffffff;
    975                                 //tmp->fontcol = 0x00ff00;
     985                                tmp->fontcol = convertcol("white");
    976986                        else
    977                                 tmp->fontcol = 0xffffff;
    978                         //tmp->fontcol = 0x0000ff;
     987                                tmp->fontcol = convertcol("white");
    979988
    980989                        tmp->halign = CENTER;
     
    10211030}
    10221031
     1032//void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, char* fullmenutitle, int flag)
    10231033void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
    10241034{
     1035
     1036debug(99, "removefav title: %s", title);
     1037debug(99, "removefav menutitle: %s", menutitle);
     1038
    10251039        int count = 0, i = 0;
    1026         char* tmpstr = NULL, *tmpstr1 = NULL, *input = NULL;
     1040        char* tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *input = NULL;
    10271041        struct splitstr* ret = NULL;
    10281042
     
    10531067                        }
    10541068                        else
     1069                        {
    10551070                                printf("remove: %s\n", ret[i].part);
     1071
     1072//                              tmpstr2 = createfilename(fullmenutitle, title, 1);
     1073                                tmpstr2 = createfilename(menutitle, title, 1);
     1074
     1075                                debug(99, "tmpstr2: %s", tmpstr2);
     1076
     1077                                if(file_exist(tmpstr2))
     1078                                {
     1079                                        unlink(tmpstr2);
     1080                                        debug(99, "remove favorite color entry %s", tmpstr2);
     1081                                }
     1082                                free(tmpstr2), tmpstr2 = NULL;
     1083                        }
    10561084                }
    10571085        }
     
    10781106}
    10791107
     1108//void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, char* fullmenutitle, int flag)
    10801109void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
    10811110{
     
    11261155        else
    11271156                savefile = ostrcat(getconfig("tithek_fav", NULL), NULL, 0, 0);
     1157
     1158//      char* title2 = ostrcat(((struct tithek*)listbox->select->handle)->title, NULL, 0, 0);
     1159//      char* filename = createfilename(title, title2);
     1160//              char* filename = createfilename(title, ((struct tithek*)listbox->select->handle)->title);
     1161
     1162
     1163//      debug(99, "fullmenutitle: %s", fullmenutitle);
     1164        debug(99, "menutitle: %s", menutitle);
     1165        debug(99, "title: %s", title);
     1166
     1167
     1168        tmpstr = createfilename(menutitle, title, 1);
     1169//      tmpstr = createfilename(fullmenutitle, title, 1);
     1170
     1171        debug(99, "tmpstr: %s", tmpstr);
     1172
     1173        if(!file_exist(tmpstr))
     1174        {
     1175                writesys(tmpstr, "1", 0);
     1176                debug(99, "add favorite color entry %s", tmpstr);
     1177        }
     1178        free(tmpstr), tmpstr = NULL;
    11281179
    11291180        input = ostrcat(input, title, 1, 0);
     
    11791230}
    11801231
     1232//void editfav(char* title, char* link, char* pic, char* localname, char* menutitle, char* fullmenutitle, int flag)
    11811233void editfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag)
    11821234{
     
    12171269                {
    12181270                        drawscreen(load, 0, 0);
     1271//                      addfav(skin_title->ret, skin_link->ret, skin_pic->ret, skin_localname->ret, skin_menutitle->ret, fullmenutitle, atoi(skin_type->ret));
    12191272                        addfav(skin_title->ret, skin_link->ret, skin_pic->ret, skin_localname->ret, skin_menutitle->ret, atoi(skin_type->ret));
    12201273                        clearscreen(load);
     
    16091662        {
    16101663                char* title2 = ostrcat(((struct tithek*)listbox->select->handle)->title, NULL, 0, 0);
    1611                 char* filename = createfilename(title, title2);
     1664                char* filename = createfilename(title, title2, 0);
    16121665//              char* filename = createfilename(title, ((struct tithek*)listbox->select->handle)->title);
    16131666                free(title2), title2 = NULL;
    16141667                debug(99, "filename: %s", filename);
     1668
     1669                if(!file_exist(filename))
     1670                {
     1671                        writesys(filename, "1", 0);
     1672                        debug(99, "create newfile %s", filename);
     1673                }
    16151674
    16161675                char* keyconf = NULL;
     
    25232582                                {
    25242583                                        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);
     2584//                                      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, title, ((struct tithek*)listbox->select->handle)->flag);
     2585
    25252586                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, title, 0);
    25262587                                        if(pagecount == 0) return;
     
    25382599                                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)
    25392600                                {
    2540                                         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);
     2601//                                      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, title, ((struct tithek*)listbox->select->handle)->flag);
     2602                                        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, title, ((struct tithek*)listbox->select->handle)->flag);
    25412603                                }
    25422604                        }
     
    25502612                                if(textbox(_("Message"), _("Edit this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 5, 0) == 1)
    25512613                                {
     2614//                                      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, title, ((struct tithek*)listbox->select->handle)->flag);
    25522615                                        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);
    25532616                                        pagecount = createtithekplay(titheklink, grid, listbox, countlabel, title, 0);
  • titan/plugins/tithek/tithek_global.h

    r40881 r40893  
    571571}
    572572
    573 //char* createfilename(char* title, struct skin* listbox)
    574 char* createfilename(char* title, char* title2)
     573//char* crea(char* title, struct skin* listbox)
     574char* createfilename1(char* title, char* title2)
    575575{
    576576        char* filename = NULL;
     
    658658        return filename;
    659659}
     660/*
     661                        printf("flag=%d\n", titheknode->flag);
     662                        printf("title=%s\n", titheknode->title);
     663                        printf("menutitle=%s\n", titheknode->menutitle);
     664                        printf("skin title=%s\n", title);
     665                        printf("titheklink=%s\n", titheklink);
     666
     667                        if(title != NULL)
     668                                tmpstr1 = ostrcat(title, " - ", 0, 0);
     669                        else
     670                                tmpstr1 = ostrcat(titheknode->menutitle, " - ", 0, 0);
     671
     672                        tmpstr1 = ostrcat(tmpstr1, titheknode->title, 1, 0);
     673//                      tmpstr1 = ostrcat(tmpstr1, ".mp4", 1, 0);
     674
     675                        tmpstr1 = string_replace_all(" - ", "_", tmpstr1, 1);
     676
     677                        tmpstr1 = string_replace_all(") (", ")_(", tmpstr1, 1);
     678                        tmpstr1 = string_replace_all(" ", "-", tmpstr1, 1);
     679                        printf("tmpstr1=%s\n", tmpstr1);
     680
     681                        tmpstr2 = ostrcat("/mnt/swapextensions/player/", tmpstr1, 0, 0);
     682                        free(tmpstr1), tmpstr1 = NULL;
     683*/
     684
     685//char* createfilename(char* title, struct skin* listbox)
     686char* createfilename(char* title, char* title2, int flag)
     687{
     688        debug(99, "title: %s title2: %s", title, title2);
     689        char* filename = NULL;
     690        char* tmpstr = NULL;
     691
     692        if(title2 != NULL)
     693        {
     694                tmpstr = ostrcat(title, " - ", 0, 0);
     695                tmpstr = ostrcat(tmpstr, title2, 1, 0);
     696        }
     697        else
     698                tmpstr = ostrcat(title, NULL, 0, 0);
     699
     700        tmpstr = string_replace_all(" - ", "_", tmpstr, 1);
     701//      filename = string_replace_all(") (", ")_(", filename, 1);
     702        tmpstr = string_replace_all(" ", "-", tmpstr, 1);
     703        tmpstr = string_replace_all("(", "", tmpstr, 1);
     704        tmpstr = string_replace_all(")", "", tmpstr, 1);
     705        tmpstr = string_replace_all("/", "-", tmpstr, 1);
     706
     707        if(flag == 0)
     708                filename = ostrcat("/mnt/swapextensions/player/", tmpstr, 0, 0);
     709        if(flag == 1)
     710                filename = ostrcat("/mnt/swapextensions/player/FAV_", tmpstr, 0, 0);
     711
     712        free(tmpstr), tmpstr = NULL;
     713        debug(99, "filename: %s", filename);
     714
     715        return filename;
     716}
     717
     718
    660719
    661720int all_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag)
  • titan/plugins/tithek/tithek_header.h

    r40856 r40893  
    33
    44//char* createfilename(char* title, struct skin* listbox);
    5 char* createfilename(char* title, char* title2);
     5char* createfilename(char* title, char* title2, int flag);
    66char* jsunpack(char* input);
    77char* gethttps(char* url, char* localfile, char* data, char* user, char* pass, char* referer, int flag);
Note: See TracChangeset for help on using the changeset viewer.