Changeset 24297


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

[tithek] add filenuke not allowed msg and fix solarmovie

Location:
titan/plugins/tithek
Files:
2 edited

Legend:

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

    r24272 r24297  
    1919        debug(99, "test host only: %s", get_ip(host));
    2020        debug(99, "tmpfile: %s", tmpfile);
    21         tmpstr = gethttp(tmphost, tmpfile, 80, NULL, NULL, 10000, NULL, 0);
     21
     22        send = ostrcat(send, "GET ", 1, 0);
     23        send = ostrcat(send, tmpfile, 1, 0);
     24        send = ostrcat(send, " HTTP/1.1\r\nAccept-Encoding: identity\r\n", 1, 0);
     25        send = ostrcat(send, "Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4\r\n", 1, 0);
     26        send = ostrcat(send, "Host: ", 1, 0);
     27        send = ostrcat(send, tmphost, 1, 0);
     28        send = ostrcat(send, "\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3\r\n", 1, 0);
     29        send = ostrcat(send, "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n", 1, 0);
     30        send = ostrcat(send, "Connection: close\r\nCookie: xxx2=ok;\r\n\r\n", 1, 0);
     31        debug(99, "send: %s", send);
     32
     33        tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1);
     34        free(send), send = NULL;
     35
    2236        debug(99, "write file");
    2337        sleep(2);
     
    2842                error = string_resub("<td align=\"center\" valign=\"middle\">", "</td>", tmpstr, 0);
    2943                string_deltags(error);
    30                 error = string_replace("Terms", "\nTerms", error, 1);
     44                stringreplacechar(error, '|', '\0');
     45                error = strstrip(error);
     46                if(error == NULL || strlen(error) == 0)
     47                        error = ostrcat(_("The page is temporarily unavailable"), error, 0, 1);
     48                textbox(_("Message"), error, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0);
     49                goto end;
     50        }
     51
     52        if(ostrstr(tmpstr, "<title>Direct IP access not allowed") != NULL)
     53        {
     54                error = string_resub("<title>", "</title>", tmpstr, 0);
     55                string_deltags(error);
     56                stringreplacechar(error, '|', '\0');
    3157                error = strstrip(error);
    3258                if(error == NULL || strlen(error) == 0)
     
    91117// http://filenuke.com/3gop8ac00z3v;3gop8ac00z3v;FileNuke.com
    92118        post = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 0);
     119
    93120        debug(99, "post: %s", post);
    94121// new end
  • titan/plugins/tithek/solarmovie.h

    r24251 r24297  
    77char* solarmovie(char* link)
    88{
    9         debug(99, "link: %s", link);
    10         char* tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *path = NULL, *url = NULL, *streamurl = NULL, *id = NULL, *hname = NULL, *cmd = NULL;
     9        debug(99, "link11111111111: %s", link);
     10        char* tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *path = NULL, *url = NULL, *streamurl = NULL, *id = NULL, *hname = NULL;
     11//      char* cmd = NULL;
    1112
    1213        if(link == NULL) return NULL;
     
    2930                hname = ostrcat(ret1[2].part, NULL, 0, 0);
    3031                debug(99, "hname: %s", hname);
    31 
    32 //              tmpstr = gethttp("www.solarmovie.so", path, 80, NULL, NULL, 5000, NULL, 0);
    3332
    3433                char* send = ostrcat("GET /link/play/", NULL, 0, 0);
     
    3736                debug(99, "send: %s", send);
    3837                unlink("/tmp/tithek/get1");
    39                 gethttpreal("www.solarmovie.so", path, 80, "/tmp/tithek/get1", NULL, NULL, 0, send, NULL, 5000, 0);
     38                tmpstr = gethttpreal("www.solarmovie.so", path, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 0);
     39                debug(99, "tmpstr: %s", tmpstr);
    4040                free(send); send = NULL;
    4141
    42                 if(file_exist("/tmp/tithek/get1"))
     42                if(tmpstr != NULL)
    4343                {
    44                         tmpstr1 = command("cat /tmp/tithek/get1");
    45                         string_strip_whitechars(tmpstr1);
    46 
    47                         if(ostrstr(tmpstr1, "<!DOCTYPE") == NULL)
    48                         {
    49                                 cmd = ostrcat(cmd, "cat /tmp/tithek/get1 | zcat", 1, 0);
    50                                 debug(99, "cmd: %s", cmd);
    51                                 free(tmpstr1), tmpstr1 = NULL;
    52                                 tmpstr1 = command(cmd);
    53                                
    54                                 writesys("/tmp/tithek/get_zcat1", tmpstr1, 0);
    55                                 free(cmd), cmd = NULL;
     44                        string_strip_whitechars(tmpstr);
     45                        if(ostrstr(tmpstr, "<div class=\"thirdPartyEmbContainer\">") != NULL)
     46                        {
     47                                tmpstr1 = string_resub("<div class=\"thirdPartyEmbContainer\">", "</div>", tmpstr, 0);
     48                                stringreplacechar(tmpstr1, '\n', ' ');
     49                                url = string_resub("<center><iframe src=\"", "\"", tmpstr1, 0);
     50                                if(url == NULL || ostrncmp("http://", url, 7) == 1)
     51                                        url = oregex(".*src=\"(http://.*)&width.*", tmpstr1);
    5652                        }
    5753                        else
    5854                        {
    59                                 system("cp -a /tmp/tithek/get1 /tmp/tithek/get_zcat1");
    60                         }
    61 
    62                         if(ostrstr(tmpstr1, "<div class=\"thirdPartyEmbContainer\">") != NULL)
    63                         {
    64                                 tmpstr1 = string_resub("<div class=\"thirdPartyEmbContainer\">", "</div>", tmpstr1, 1);
    65                                 url = string_resub("<center><iframe src=\"", "\"", tmpstr1, 0);
    66                                 if(url == NULL || ostrncmp("http://", url, 7) == 0)
    67                                         url = oregex(".*src=\"(http://.*)&width.*", tmpstr1);
    68                         }
    69                         else
    70                         {
    71                                 url = oregex(".*<iframe name=\"service_frame\" class=\"service_frame\" src=\"(http://.*)\".*", tmpstr1);
     55                                url = oregex(".*<iframe name=\"service_frame\" class=\"service_frame\" src=\"(http://.*)\".*", tmpstr);
    7256                                url = oregex("(http://.*)\".*", url);
    7357                                url = string_replace_all("embed", "file", url, 1);
     
    260244        }
    261245
    262         gethttp(ip, path, 80, "/tmp/tithek/get", NULL, 10000, NULL, 0);
    263        
    264         if(!file_exist("/tmp/tithek/get"))
     246        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
     247       
     248        if(tmpstr == NULL)
    265249        {
    266250                textbox(_("Message"), _("This file doesn't exist, or has been removed") , _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 200, 0, 0);
    267251                goto end;
    268252        }
    269         if(debuglevel == 99) system("cp -a /tmp/tithek/get /tmp/solarmovie1_tmpstr_get");
    270 
    271         tmpstr = command("cat /tmp/tithek/get");
     253//      if(debuglevel == 99) system("cp -a /tmp/tithek/get /tmp/solarmovie1_tmpstr_get");
     254
     255//      tmpstr = command("cat /tmp/tithek/get");
    272256        if(ostrstr(tmpstr, "<!DOCTYPE") == NULL)
    273257        {
     
    280264                free(cmd), cmd = NULL;
    281265        }
    282         else
    283                 system("cp -a /tmp/tithek/get /tmp/tithek/get_zcat");
    284 
    285         titheklog(debuglevel, "/tmp/solarmovie2_tmpstr_zcat", NULL, tmpstr);
     266//      else
     267//              system("cp -a /tmp/tithek/get /tmp/tithek/get_zcat");
     268
     269//      titheklog(debuglevel, "/tmp/solarmovie2_tmpstr_zcat", NULL, tmpstr);
    286270
    287271        drawscreen(load, 0, 0);
     
    294278        {
    295279                series = 0;
    296                 if(file_exist("/tmp/tithek/get_zcat"))
     280                if(tmpstr != NULL)
    297281                {
    298                         free(tmpstr), tmpstr = NULL;
    299                         tmpstr = command("cat /tmp/tithek/get_zcat");
     282//                      free(tmpstr), tmpstr = NULL;
     283//                      tmpstr = command("cat /tmp/tithek/get_zcat");
    300284                        char* tmpcat = string_resub("<tbody>", "</tbody>", tmpstr, 0);
    301285       
     
    384368        {
    385369                series = 1;
    386                 if(file_exist("/tmp/tithek/get_zcat"))
     370                if(tmpstr != NULL)
    387371                {
     372writesys("/tmp/tithek/get_zcat", tmpstr, 0);
     373
    388374                        free(tmpstr), tmpstr = NULL;
    389375                        tmpstr = command("cat /tmp/tithek/get_zcat | grep episode- | grep -v Episode | grep -v 'linkCount typicalGrey'");
Note: See TracChangeset for help on using the changeset viewer.