Changeset 40864


Ignore:
Timestamp:
08/29/17 00:25:33 (6 years ago)
Author:
obi
Message:

tithek cleanup

File:
1 edited

Legend:

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

    r40861 r40864  
    349349                                for(i = 0; i < max; i++)
    350350                                {
    351 
    352 //                                      printf("ret1[i].part: %s\n",ret1[i].part);
    353 
    354351                                        char *mirrormaxtmp = NULL;
    355352                                        char *pathnewtmp = NULL;
     353                                        int mirrormax = 1;
     354                                        int j = 0;
     355
    356356                                        mirrormaxtmp = oregex("<b>Mirror</b>: .*/(.*)<br/>.*", ret1[i].part);
    357                                         printf("mirrormaxtmp: %s\n",mirrormaxtmp);
    358 
    359                                         int mirrormax = atoi(mirrormaxtmp);
    360                                         printf("mirrormax: %d\n",mirrormax);
    361 
    362 int j = 0;
    363 for(j = 1; j < mirrormax + 1; j++)
    364 {
    365 
    366                                         hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0);
    367 
    368                                         hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0);
    369                                         hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1);
    370                                         hlink = ostrcat(hlink, "Mirror=", 0, 0);
    371 
    372 
    373 
    374                                         hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0);
    375                                         pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0);
    376 
    377 //                                      printf("hnr: %s\n",hnr);
    378 //                                      printf("hlink: %s\n",hlink);
    379 //                                      printf("hname: %s\n",hname);
    380 
    381 /*
    382                                         hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0);
    383                                         hlink = string_resub("rel=\"", "\">", ret1[i].part, 0);
    384                                         hlink = string_replace_all("amp;", "", hlink, 1);
    385        
    386                                         hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0);
    387                                         pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0);
    388 */
    389 
     357
     358                                        if(mirrormaxtmp != NULL)
     359                                                mirrormax = atoi(mirrormaxtmp);
     360
     361                                        for(j = 1; j < mirrormax + 1; j++)
     362                                        {
     363                                                debug(99, "(%d/%d) (%d/%d) ret1[i].part: %s",i ,max ,j ,mirrormax, ret1[i].part);
     364
     365                                                hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0);
     366
     367                                                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);
    390373
    391374                                                pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1);
     375                                                debug(99, "(%d/%d) (%d/%d)hnr: %s hlink: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,hname ,pathnewtmp);
    392376                                                free(pathnewtmp), pathnewtmp= NULL;
    393 
    394 //                                              printf("pathnew: %s\n",pathnew);
    395377
    396378                                                pichname = ostrcat(hname, NULL, 0, 0);
     
    401383
    402384                                                titheklog(debuglevel, "/tmp/kinox4_pathnew1", hname, NULL, NULL, pathnew);
    403                                        
     385
    404386                                                tmpstr1 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0);
    405387                                                if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL)
     
    511493                                                if(ostrcmp(url, url2) != 0)
    512494                                                {
    513                                                         debug(99, "(%d/%d) %s (Part1) url: %s extra: %s",i ,max , hname, url, extra);
     495                                                        debug(99, "(%d/%d) (%d/%d) %s (Part1) url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra);
    514496                                                }
    515497                                                else
    516498                                                {
    517                                                         debug(99, "(%d/%d) %s url: %s extra: %s",i ,max , hname, url, extra);
     499                                                        debug(99, "(%d/%d) (%d/%d) %s url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra);
    518500                                                }
    519501
     
    534516
    535517                                                line = ostrcat(line, " (Mirror ", 1, 0);                                       
    536                                                 line = ostrcat(line, oitoa(j), 1, 0);
     518                                                line = ostrcat(line, oitoa(j), 1, 1);
    537519                                                line = ostrcat(line, "/", 1, 0);                                       
    538                                                 line = ostrcat(line, oitoa(mirrormax), 1, 0);
     520                                                line = ostrcat(line, oitoa(mirrormax), 1, 1);
    539521                                                line = ostrcat(line, ")", 1, 0);                                       
    540522
     
    798780                                for(i = 0; i < max; i++)
    799781                                {
    800 //
    801 //                                      printf("ret1[i].part: %s\n",ret1[i].part);
    802 
    803782                                        char *mirrormaxtmp = NULL;
    804783                                        char *pathnewtmp = NULL;
    805784                                        char *season = NULL;
    806                                         mirrormaxtmp = oregex("<b>Mirror</b>: .*/(.*)<br/>.*", ret1[i].part);
     785                                        int mirrormax = 1;
     786                                        int j = 0;
     787
    807788                                        mirrormaxtmp = oregex("<b>Mirror</b>: .*/(.*)<br.*", ret1[i].part);
    808 //
    809 //                                      printf("mirrormaxtmp: %s\n",mirrormaxtmp);
    810 
    811                                         int mirrormax = atoi(mirrormaxtmp);
    812 //                                      printf("mirrormax: %d\n",mirrormax);
    813 
    814 //rel="Game_of_Thrones-Das_Lied_von_Eis_und_Feuer&amp;Hoster=68&amp;Mirror=1&amp;Season=7&amp;Episode=6">
    815 
    816 
    817                                         int j = 0;
     789                                       
     790                                        if(mirrormaxtmp != NULL)
     791                                                mirrormax = atoi(mirrormaxtmp);
     792                                        free(mirrormaxtmp), mirrormaxtmp= NULL;
     793
    818794                                        for(j = 1; j < mirrormax + 1; j++)
    819795                                        {
     796                                                debug(99, "(%d/%d) (%d/%d) ret1[i].part: %s",i ,max ,j ,mirrormax, ret1[i].part);
    820797
    821798                                                hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0);
     
    825802                                                hlink = ostrcat(hlink, "Mirror=", 0, 0);
    826803
    827 
    828804                                                hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0);
    829805                                                pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0);
     
    832808                                                season = string_replace_all("amp;", "", season, 1);
    833809
    834 
    835 //                                              printf("hnr: %s\n",hnr);
    836 //                                              printf("hlink: %s\n",hlink);
    837 //                                              printf("hname: %s\n",hname);
    838 //                                              printf("pathnewtmp: %s\n",pathnewtmp);
    839 //                                              printf("season: %s\n",season);
    840 
    841 
    842                                                         pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1);
    843                                                         pathnew = ostrcat(pathnew, "&Season=", 1, 0);
    844                                                         pathnew = ostrcat(pathnew, season, 1, 0);
    845                                                         free(pathnewtmp), pathnewtmp= NULL;
    846 //printf("11111111pathnew: %s\n",pathnew);
    847 
    848         /*
    849                                                 hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0);
    850                                                 hlink = string_resub("rel=\"", "\">", ret1[i].part, 0);
    851                                                 hlink = string_replace_all("amp;", "", hlink, 1);
    852                                                 hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0);
    853         */
     810                                                pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1);
     811                                                pathnew = ostrcat(pathnew, "&Season=", 1, 0);
     812                                                pathnew = ostrcat(pathnew, season, 1, 0);
     813
     814                                                debug(99, "(%d/%d) (%d/%d) hnr: %s hlink: %s season: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,season ,hname ,pathnewtmp);
     815 
     816                                                free(season), season= NULL;
     817                                                free(pathnewtmp), pathnewtmp= NULL;
     818
    854819                                                pichname = ostrcat(hname, NULL, 0, 0);
    855820                                                string_tolower(pichname);
     
    861826                                                hlink = string_replace("http://kinox.me/Stream/", "", hlink, 1);
    862827                                                                               
    863         //                                      pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0);
    864         //                                      debug(99, "pathnew: %s", pathnew);
     828                                                debug(99, "pathnew: %s", pathnew);
    865829                                                tmpstr1 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0);
    866         //                                      pathnew = ostrcat("kinox.me/aGET/Mirror/", hlink, 0, 0);
    867 
    868 
    869 //                                              printf("ret1[i].part: %s\n",ret1[i].part);
    870 
    871 
    872                                                 debug(99, "pathnew: %s", pathnew);
    873 //                                              tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1);
    874 //                                              debug(99, "tmpstr1 1: %s", tmpstr1);
    875 
     830                                                debug(99, "tmpstr1 1: %s", tmpstr1);
    876831
    877832                                                tmpstr1 = string_replace_all("\\", "", tmpstr1, 1);
     
    910865
    911866                                                debug(99, "-------------------------------");
    912                                                 debug(99, "(%d/%d) %s url: %s extra: %s",i ,max , hname, url, extra);
     867                                                debug(99, "(%d/%d) (%d/%d) %s url: %s extra: %s", i, max, j, mirrormax, hname, url, extra);
    913868                                                       
    914869                                                incount += 1;
     
    927882
    928883                                                line = ostrcat(line, " (Mirror ", 1, 0);                                       
    929                                                 line = ostrcat(line, oitoa(j), 1, 0);
     884                                                line = ostrcat(line, oitoa(j), 1, 1);
    930885                                                line = ostrcat(line, "/", 1, 0);                                       
    931                                                 line = ostrcat(line, oitoa(mirrormax), 1, 0);
     886                                                line = ostrcat(line, oitoa(mirrormax), 1, 1);
    932887                                                line = ostrcat(line, ")", 1, 0);
    933888
Note: See TracChangeset for help on using the changeset viewer.