Changeset 25747


Ignore:
Timestamp:
01/26/14 23:24:51 (9 years ago)
Author:
obi
Message:

[tithek] fix put/sock

File:
1 edited

Legend:

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

    r24396 r25747  
    77        int debuglevel = getconfigint("debuglevel", NULL);
    88        char* tmphost = NULL, *tmppath = 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;
     9        char* ip = NULL, *cmd = NULL, *phpsessid = NULL, *serverid = NULL, *usender = NULL, *streamlink = NULL, *streamlink1 = NULL, *tmpstr2 = NULL;
    1010
    1111        unlink("/tmp/putlocker1_tmpstr_get");
     
    171171        }
    172172        free(tmpstr); tmpstr = NULL;
     173       
     174        if(!ostrncmp("/get_file.php", streamlink, 13))
     175        {
     176                cmd = ostrcat(cmd, "wget 'http://", 1, 0);
     177                cmd = ostrcat(cmd, tmphost, 1, 0);
     178                cmd = ostrcat(cmd, "/", 1, 0);
     179                cmd = ostrcat(cmd, streamlink, 1, 0);
     180                cmd = ostrcat(cmd, "' -O /tmp/putlocker.stream", 1, 0);
     181                debug(99, "cmd: %s", cmd);
     182                unlink("/tmp/putlocker.stream");
     183               
     184                system(cmd);
     185               
     186                free(cmd), cmd = NULL;
     187                cmd = ostrcat("cat /tmp/putlocker.stream", NULL, 0, 0);
     188               
     189                tmpstr = command(cmd);
     190                free(cmd), cmd = NULL;
     191        }
     192
     193/*
     194        free(tmpstr); tmpstr = NULL;
    173195
    174196        if(streamlink == NULL) goto end;
    175 
     197       
    176198        //create send string
    177199        send = ostrcat(send, "GET ", 1, 0);
     
    183205        send = ostrcat(send, "PHPSESSID=", 1, 0);
    184206        send = ostrcat(send, phpsessid, 1, 0);
    185         send = ostrcat(send, "\r\nConnection: close\r\nUser-Agent: Python-urllib/2.6\r\n\r\n", 1, 0);
    186        
    187         tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 0);
     207        send = ostrcat(send, "\r\nConnection: close\r\nUser-Agent: Python-urllib/2.7\r\n\r\n", 1, 0);
     208        send = ostrcat(send, hash, 1, 0);
     209        debug(99, "send: %s", send);
     210       
     211        tmpstr = gethttpreal(tmphost, streamlink, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 0);
     212*/
    188213        free(send); send = NULL;
    189214        debug(99, "tmpstr: %s", tmpstr);
Note: See TracChangeset for help on using the changeset viewer.