Changeset 24310


Ignore:
Timestamp:
10/14/13 18:36:57 (10 years ago)
Author:
obi
Message:

fix

Location:
titan/plugins/tithek
Files:
2 edited

Legend:

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

    r24309 r24310  
    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* hash = NULL;
    13         char* hashstr = NULL;
    14         char* hashlen = NULL;
    15         char* ip = NULL;
    16         char* phpsessid = NULL;
    17         char* serverid = NULL;
    18         char* usender = NULL;
    19         char* streamlink = NULL;
    20         char* streamlink1 = NULL;
    21         char* tmpstr2 = NULL;
     8        char* tmphost = NULL, *tmpfile = NULL, *tmpstr = NULL, *send = NULL, *hash = NULL, *hashstr = NULL, *hashlen = NULL;
     9        char* ip = NULL, *phpsessid = NULL, *serverid = NULL, *usender = NULL, *streamlink = NULL, *streamlink1 = NULL, *tmpstr2 = NULL;
    2210
    23         unlink("/tmp/tithek/get");
    24         unlink("/tmp/tithek/x9");
     11        unlink("/tmp/putlocker1_tmpstr_get");
     12        unlink("/tmp/putlocker2_tmpstr_post");
     13        unlink("/tmp/putlocker3_tmpstr_get");
     14        unlink("/tmp/putlocker4_streamlink");
    2515
    2616        if(host == NULL || file == NULL) return NULL;
     
    4232        tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1);
    4333        free(send); send = NULL;
     34        debug(99, "tmpstr: %s", tmpstr);
     35        titheklog(debuglevel, "/tmp/putlocker1_tmpstr_get", NULL, tmpstr);
     36       
    4437        phpsessid = getxmlentry(tmpstr, "PHPSESSID=");
    4538        debug(99, "phpsessid: %s", phpsessid);
     
    5144        //get hash from tmpstr
    5245        char* pos = ostrstr(tmpstr, "<input type=\"hidden\" value=");
    53         debug(99, "tmpstr: %s", tmpstr);
    5446        hashstr = getxmlentry(pos, "value=");
    5547// free(tmpstr) after getxml or segfault...
     
    7163        send = ostrcat(send, " HTTP/1.1\r\nContent-Length: ", 1, 0);
    7264        send = ostrcat(send, hashlen, 1, 0);
    73         send = ostrcat(send, "\r\nAccept-Encoding: gzip\r\nConnection: close\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1\r\nHost: www.", 1, 0);
    74         send = ostrcat(send, host, 1, 0);
     65        send = ostrcat(send, "\r\nAccept-Encoding: gzip\r\nConnection: close\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1\r\nHost: ", 1, 0);
     66        send = ostrcat(send, tmphost, 1, 0);
    7567        send = ostrcat(send, "\r\nCookie: usender=", 1, 0);
    7668        send = ostrcat(send, usender, 1, 0);
     
    8779        free(send); send = NULL;
    8880        debug(99, "tmpstr: %s", tmpstr);
    89         titheklog(debuglevel, "/tmp/putlocker4_tmpstr_post_zcat", NULL, tmpstr);
     81        titheklog(debuglevel, "/tmp/putlocker2_tmpstr_post", NULL, tmpstr);
    9082       
    9183        if(ostrstr(tmpstr, "warning_message") != NULL)
     
    127119        send = ostrcat(send, "GET ", 1, 0);
    128120        send = ostrcat(send, streamlink, 1, 0);
    129         send = ostrcat(send, " HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: www.", 1, 0);
    130         send = ostrcat(send, host, 1, 0);
     121        send = ostrcat(send, " HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: ", 1, 0);
     122        send = ostrcat(send, tmphost, 1, 0);
    131123        send = ostrcat(send, "\r\nCookie: SERVERID=", 1, 0);
    132124        send = ostrcat(send, serverid, 1, 0);
     
    139131        tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 0);
    140132        free(send); send = NULL;
    141         titheklog(debuglevel, "/tmp/putlocker5_tmpstr_get", NULL, tmpstr);
     133        debug(99, "tmpstr: %s", tmpstr);
     134        titheklog(debuglevel, "/tmp/putlocker3_tmpstr_get", NULL, tmpstr);
    142135
    143136        //get streamlink1
    144137        streamlink1 = getxmlentry(tmpstr, "url=");
    145         titheklog(debuglevel, "/tmp/putlocker5_streamlink", NULL, streamlink1);
     138        titheklog(debuglevel, "/tmp/putlocker4_streamlink", NULL, streamlink1);
    146139
    147140        free(tmpstr); tmpstr = NULL;
  • titan/plugins/tithek/streamcloud.h

    r24251 r24310  
    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* hashline = NULL;
    17         char* hashlen = NULL;
    18         char* referer = NULL;
    19         char* usr_login = NULL;
    20         char* imhuman = NULL;   
    21         char* ip = NULL;
    22         char* cookie = NULL;
    23         char* cmd = NULL;
    24         char* streamlink = NULL;
     8        char* tmphost = NULL, *tmpfile = NULL, *tmpstr = NULL, *send = NULL, *id = NULL, *fname = NULL, *op = NULL, *hash = NULL, *cmd = NULL;
     9        char* hashline = NULL, *hashlen = NULL, *referer = NULL, *usr_login = NULL, *imhuman = NULL, *ip = NULL, *cookie = NULL, *streamlink = NULL;
     10
     11        unlink("/tmp/streamcould1_get");
     12        unlink("/tmp/streamcould2_post");
     13        unlink("/tmp/streamcould3_streamlink");
    2514
    2615        if(host == NULL || file == NULL) return NULL;
    2716
    28         tmphost = ostrcat(tmphost, host, 1, 0);
     17        tmphost = ostrcat(host, NULL, 0, 0);
    2918        tmpfile = ostrcat("/", file, 0, 0);
    30        
     19
    3120        debug(99, "tmphost: %s", tmphost);
    3221        ip = get_ip(tmphost);
     
    3423        debug(99, "tmpfile: %s", tmpfile);
    3524
    36         send = ostrcat(send, "GET /", 1, 0);
    37         send = ostrcat(send, file, 1, 0);
     25        send = ostrcat(send, "GET ", 1, 0);
     26        send = ostrcat(send, tmpfile, 1, 0);
    3827        send = ostrcat(send, " HTTP/1.1\r\nHost: ", 1, 0);
    39         send = ostrcat(send, host, 1, 0);
     28        send = ostrcat(send, tmphost, 1, 0);
    4029        send = ostrcat(send, "\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1\r\nConnection: close\r\nAccept-Encoding: gzip\r\n\r\n", 1, 0);
    4130        debug(99, "send: %s", send);
    4231
    4332        tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1);
    44 
    45         if(getconfigint("debuglevel", NULL) == 99)
    46                 writesys("/tmp/streamcould1_tmpstr", tmpstr, 0);
    47 /*
    48         old code       
    49         cmd = ostrcat(cmd, "echo -e \"", 1, 0);
    50         cmd = ostrcat(cmd, send, 1, 0);
    51         cmd = ostrcat(cmd, "\" | /var/usr/local/share/titan/plugins/tithek/netcat ", 1, 0);
    52         cmd = ostrcat(cmd, host, 1, 0);
    53         cmd = ostrcat(cmd, " 80", 1, 0);
    54         debug(99, "cmd: %s", cmd);
    55         free(tmpstr), tmpstr = NULL;
    56         tmpstr = command(cmd);
    57 */
     33        free(send), send = NULL;
     34        debug(99, "tmpstr: %s", tmpstr);
     35        sleep(20);
     36        titheklog(debuglevel, "/tmp/streamcould1_get", NULL, tmpstr);
     37       
    5838        cookie = string_resub("Set-Cookie: afc=", ";", tmpstr, 0);     
    5939        debug(99, "cookie: %s", cookie);
    60  
    61         sleep(20);
    6240
    6341        //get hash from tmpstr
     
    10785        hashlen = oitoa(strlen(hash));
    10886
    109         //create send string
    110         free(send), send = NULL;
    111 
    112         send = ostrcat(send, "POST /", 1, 0);
    113         send = ostrcat(send, file, 1, 0);
     87        send = ostrcat(send, "POST ", 1, 0);
     88        send = ostrcat(send, tmpfile, 1, 0);
    11489        send = ostrcat(send, " HTTP/1.1\r\nContent-Length: ", 1, 0);
    11590        send = ostrcat(send, hashlen, 1, 0);
    11691        send = ostrcat(send, "\r\nAccept-Encoding: gzip\r\nConnection: close\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1\r\nHost: ", 1, 0);
    117         send = ostrcat(send, host, 1, 0);
     92        send = ostrcat(send, tmphost, 1, 0);
    11893        send = ostrcat(send, "\r\nCookie: afc=", 1, 0);
    11994        send = ostrcat(send, cookie, 1, 0);
     
    12297        debug(99, "send: %s", send);
    12398
    124         free(tmpstr), tmpstr = NULL;
    125         tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 0);
    126         titheklog(debuglevel, "/tmp/streamcould2_tmpstr_post", NULL, tmpstr);
     99        tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1);
     100        free(send), send = NULL;
     101        debug(99, "tmpstr: %s", tmpstr);
     102        titheklog(debuglevel, "/tmp/streamcould2_post", NULL, tmpstr);
    127103
    128104//      streamlink = oregex(".*file: \".*(http:.*video.mp4).*\".*", tmpstr);
    129105        streamlink = string_resub("file: \"", "\"", tmpstr, 0);
    130106        titheklog(debuglevel, "/tmp/streamcould3_streamlink", NULL, streamlink);
    131 
    132         free(tmpstr); tmpstr = NULL;
    133107
    134108end:
Note: See TracChangeset for help on using the changeset viewer.