Changeset 24255


Ignore:
Timestamp:
10/13/13 02:16:16 (9 years ago)
Author:
obi
Message:

fix

Location:
titan/plugins/tithek
Files:
2 edited

Legend:

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

    r24251 r24255  
    66        debug(99, "in host: %s file: %s", host, file);
    77        int debuglevel = getconfigint("debuglevel", NULL);
    8         char* tmphost = NULL;
    9         char* tmpfile = NULL;
    10         char* tmpstr = NULL;
    11         char* send = NULL;
    12         char* id = NULL;
    13         char* fname = NULL;
    14         char* op = NULL;
    15         char* hash = NULL;
    16         char* hashlen = NULL;   
    17         char* ip = NULL;
    18         char* b36code = NULL;
    19         char* base = NULL;
    20         char* search = NULL;
    21         char* post = NULL;
    22         char* streamlink = NULL;
    23         char* cmd = NULL;
    24 
    25         char* tmpstr2 = NULL;
    26         char* tmpstr3 = NULL;
    27         char* charlist = NULL;
     8        char* tmphost = NULL, *error = NULL, *tmpfile = NULL, *tmpstr = NULL, *send = NULL, *id = NULL, *fname = NULL, *op = NULL, *hash = NULL, *hashlen = NULL, *ip = NULL;
     9        char* b36code = NULL, *base = NULL, *search = NULL, *post = NULL, *streamlink = NULL, *cmd = NULL, *tmpstr2 = NULL, *tmpstr3 = NULL, *charlist = NULL;
    2810
    2911        if(host == NULL || file == NULL) return NULL;
    3012
    31         tmphost = ostrcat(host, NULL, 0, 0);
     13        tmphost = ostrcat("www.", host, 0, 0);
    3214        tmpfile = ostrcat("/", file, 0, 0);
    3315        debug(99, "tmphost: %s", tmphost);
     
    4325        if(ostrstr(tmpstr, "<title>The page is temporarily unavailable</title>") != NULL)
    4426        {
    45                 tmpstr = string_resub("<td align=\"center\" valign=\"middle\">", "</td>", tmpstr, 1);
    46                 string_deltags(tmpstr);
    47                 tmpstr = string_replace("Terms", "\nTerms", tmpstr, 1);
    48                 tmpstr = strstrip(tmpstr);
    49                 if(tmpstr == NULL || strlen(tmpstr) == 0)
    50                         tmpstr = ostrcat(_("The page is temporarily unavailable"), tmpstr, 0, 1);
    51                 textbox(_("Message"), tmpstr, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0);
     27                error = string_resub("<td align=\"center\" valign=\"middle\">", "</td>", tmpstr, 0);
     28                string_deltags(error);
     29                error = string_replace("Terms", "\nTerms", error, 1);
     30                error = strstrip(error);
     31                if(error == NULL || strlen(error) == 0)
     32                        error = ostrcat(_("The page is temporarily unavailable"), error, 0, 1);
     33                textbox(_("Message"), error, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0);
    5234                goto end;
    5335        }
     
    235217end:
    236218
     219        free(error); error = NULL;
    237220        free(tmphost); tmphost = NULL;
    238221        free(tmpfile); tmpfile = NULL;
  • titan/plugins/tithek/flashx.h

    r24254 r24255  
    88        debug(99, "hosterurl: %s", hosterurl);
    99        int debuglevel = getconfigint("debuglevel", NULL);
    10         char* tmphost = NULL;
    11         char* tmppath = NULL;
    12         char* tmpstr = NULL;
    13         char* send = NULL;
    14         char* streamlink = NULL;
    15         char* ip = NULL, *pos = NULL, *path = NULL;
     10        char* tmphost = NULL, *tmppath = NULL, *tmpstr = NULL, *send = NULL, *streamlink = NULL, *ip = NULL, *pos = NULL, *path = NULL, *error = NULL;
    1611
    1712        if(host == NULL || file == NULL) return NULL;
     
    4338        tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1);
    4439        titheklog(debuglevel, "/tmp/flashx_tmpstr_get1", NULL, tmpstr);
    45 //      writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get1", tmpstr, 0);
    46 //printf("\n#######################################################\n");
    47 
     40        writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get1", tmpstr, 0);
     41//printf("\n#######################################################\n");
     42 
     43        if(ostrstr(tmpstr, "<center>Video not found, deleted or abused, sorry!<br") != NULL)
     44        {
     45                error = string_resub("<li> <center>", "<br", tmpstr, 0);
     46                string_deltags(error);
     47                error = strstrip(error);
     48                if(error == NULL || strlen(error) == 0)
     49                        error = ostrcat(_("The page is temporarily unavailable"), NULL, 0, 0);
     50                textbox(_("Message"), error, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0);
     51                goto end;
     52        }
     53       
    4854        char* cookie1 = string_resub("Set-Cookie: pageredir=", ";", tmpstr, 0);
    4955        debug(99, "cookie1: %s", cookie1);
     
    8490
    8591        titheklog(debuglevel, "/tmp/flashx_tmpstr_get2", NULL, tmpstr);
    86 //      writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get2", tmpstr, 0);
     92        writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get2", tmpstr, 0);
    8793//printf("\n#######################################################\n");
    8894
     
    9096        char* hash2tmp = string_resub("<input type=\"hidden\" name=\"id\" value=\"", "\"", tmpstr, 0);
    9197       
     98        if(hash1tmp == NULL || hash2tmp == NULL) goto end;
    9299        char* hash1 = htmlencode(hash1tmp);
    93100        char* hash2 = htmlencode(hash2tmp);
     101        free(hash1tmp); hash1tmp = NULL;
     102        free(hash2tmp); hash2tmp = NULL;
    94103       
    95104        // htmldecod cant / to %2f
     
    101110        hash = ostrcat(hash, hash2, 0, 0);
    102111        char* hashlen = NULL;
     112
     113        if(hash == NULL) goto end;
    103114        hashlen = oitoa(strlen(hash));
    104115        debug(99, "hashlen: %s", hashlen);
     
    122133        send = ostrcat(send, "\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n", 1, 0);     
    123134        send = ostrcat(send, hash, 1, 0);
    124 
     135        free(hash); hash = NULL;
     136        free(hashlen); hashlen = NULL;
     137       
    125138        debug(99, "send: %s", send);
    126139        tmpstr = gethttpreal(tmphost, "/player/show.php", 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1);
    127140
    128141        titheklog(debuglevel, "/tmp/flashx_tmpstr_get3", NULL, tmpstr);
    129 //      writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get3", tmpstr, 0);
     142        writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get3", tmpstr, 0);
    130143//printf("\n#######################################################\n");
    131144//var code ='<object id="nuevoplayer" width="'+ww+'" height="'+hh+'" data="http://play.flashx.tv/nuevo/player/player.swf?config=http://play.flashx.tv/nuevo/player/play.php?str=4MfrzrW4qrPKnM2dw5/Fvcs=" type="application/x-shockwave-flash">';
     
    161174
    162175        titheklog(debuglevel, "/tmp/flashx_tmpstr_get4", NULL, tmpstr);
    163 //      writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get4", tmpstr, 0);
     176        writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get4", tmpstr, 0);
    164177//printf("\n#######################################################\n");
    165178
     
    204217        if(getconfigint("debuglevel", NULL) == 99)
    205218                writesys("/tmp/flashx_tmpstr_get5", tmpstr, 0);
    206 //      writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get5", tmpstr, 0);
     219        writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get5", tmpstr, 0);
    207220//printf("\n#######################################################\n");
    208221
     
    211224                writesys("/tmp/flashx5_streamlink", streamlink, 0);
    212225
    213 //end:
     226end:
     227        free(error); error = NULL;
    214228        free(tmphost); tmphost = NULL;
    215229        free(tmphost); tmphost = NULL;
Note: See TracChangeset for help on using the changeset viewer.