Changeset 24238


Ignore:
Timestamp:
10/12/13 16:00:09 (10 years ago)
Author:
nit
Message:

[titan] tithek optimize

Location:
titan/plugins/tithek
Files:
7 edited

Legend:

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

    r21018 r24238  
    55{
    66        debug(99, "in host: %s file: %s", host, file);
     7        int debuglevel = getconfigint("debuglevel", NULL);
    78        char* tmphost = NULL;
    89        char* tmpfile = NULL;
     
    5354                goto end;
    5455        }
    55         if(getconfigint("debuglevel", NULL) == 99)
    56                 system("cp -a /tmp/tithek/get /tmp/putlocker1_tmpstr_get");
     56        if(debuglevel == 99) system("cp -a /tmp/tithek/get /tmp/putlocker1_tmpstr_get");
    5757
    5858        char* header = NULL;
     
    8787        free(cmd); cmd = NULL;
    8888        free(lines); lines = NULL;
    89         if(getconfigint("debuglevel", NULL) == 99)
    90                 writesys("/tmp/putlocker2_tmpstr_zcat", tmpstr, 0);
     89        titheklog(debuglevel, "/tmp/putlocker2_tmpstr_zcat", NULL, tmpstr);
    9190
    9291        //get hash from tmpstr
     
    126125        gethttpreal(tmphost, tmpfile, 80, "/tmp/tithek/x9", NULL, NULL, 0, send, NULL, 5000, 0);
    127126        sleep(1);
    128         if(getconfigint("debuglevel", NULL) == 99)
    129                 system("cp -a /tmp/tithek/x9 /tmp/putlocker3_tmpstr_post");
     127        if(debuglevel == 99) system("cp -a /tmp/tithek/x9 /tmp/putlocker3_tmpstr_post");
    130128
    131129        free(send); send = NULL;
    132130        tmpstr = command("cat /tmp/tithek/x9 | sed '1,1d' | zcat");
    133         if(getconfigint("debuglevel", NULL) == 99)
    134                 writesys("/tmp/putlocker4_tmpstr_post_zcat", tmpstr, 0);
     131        titheklog(debuglevel, "/tmp/putlocker4_tmpstr_post_zcat", NULL, tmpstr);
    135132       
    136133        if(ostrstr(tmpstr, "warning_message") != NULL)
     
    185182        free(send); send = NULL;
    186183
    187         if(getconfigint("debuglevel", NULL) == 99)
    188                 writesys("/tmp/putlocker5_tmpstr_get", tmpstr, 0);
     184        titheklog(debuglevel, "/tmp/putlocker5_tmpstr_get", NULL, tmpstr);
    189185
    190186//Streaming version of this file is currently not available. You can download it below.
     
    192188        //get streamlink1
    193189        streamlink1 = getxmlentry(tmpstr, "url=");
    194         if(getconfigint("debuglevel", NULL) == 99)
    195                 writesys("/tmp/putlocker5_streamlink", streamlink1, 0);
     190        titheklog(debuglevel, "/tmp/putlocker5_streamlink", NULL, streamlink1);
    196191
    197192        free(tmpstr); tmpstr = NULL;
  • titan/plugins/tithek/solarmovie.h

    r23760 r24238  
    128128int solarmovie_search(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag)
    129129{
     130        int debuglevel = getconfigint("debuglevel", NULL);
    130131        int ret = 1;
    131132        int incount = 0;
     
    163164       
    164165                tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    165                 if(getconfigint("debuglevel", NULL) == 99)
    166                         writesys("/tmp/solarmovie_tmpstr", tmpstr, 0);
     166                titheklog(debuglevel, "/tmp/solarmovie_tmpstr", NULL, tmpstr);
    167167
    168168                while(ostrstr(tmpstr, "<div class=\"typicalGrey coverGroup\">") != NULL)
     
    172172
    173173                        incount += 1;
    174                         if(getconfigint("debuglevel", NULL) == 99)
     174                        if(debuglevel == 99)
    175175                        {
    176176                                file = ostrcat("/tmp/solarmovie_tmpstr", oitoa(incount), 0, 1);
     
    180180                        tmpstr1 = string_resub("<div class=\"typicalGrey coverGroup\">", "</div>", tmpstr, 0);
    181181
    182                         if(getconfigint("debuglevel", NULL) == 99)
     182                        if(debuglevel == 99)
    183183                        {
    184184                                file1 = ostrcat("/tmp/solarmovie_tmpstr_resub", oitoa(incount), 0, 1);
     
    239239{
    240240        debug(99, "link: %s", link);
     241        int debuglevel = getconfigint("debuglevel", NULL);
    241242        int ret = 1, series = 0;
    242243        char* ip = NULL, *pos = NULL, *path = NULL, *etitle = NULL, *episode = NULL, *session = NULL, *update = NULL, *quality = NULL, *id = NULL, *line = NULL, *hname = NULL, *tmpstr = NULL, *cmd = NULL, *url = NULL, *tmpstr1 = NULL, *tmphost = NULL, *tmphname = NULL;
     
    266267                goto end;
    267268        }
    268         if(getconfigint("debuglevel", NULL) == 99)
    269                 system("cp -a /tmp/tithek/get /tmp/solarmovie1_tmpstr_get");
     269        if(debuglevel == 99) system("cp -a /tmp/tithek/get /tmp/solarmovie1_tmpstr_get");
    270270
    271271        tmpstr = command("cat /tmp/tithek/get");
     
    283283                system("cp -a /tmp/tithek/get /tmp/tithek/get_zcat");
    284284
    285         if(getconfigint("debuglevel", NULL) == 99)
    286                 writesys("/tmp/solarmovie2_tmpstr_zcat", tmpstr, 0);
     285        titheklog(debuglevel, "/tmp/solarmovie2_tmpstr_zcat", NULL, tmpstr);
    287286
    288287        drawscreen(load, 0, 0);
     
    403402                                etitle = oregex(".*>(.*)<.*", ret1[i].part);
    404403                                url = string_resub("\"", "\"", ret1[i].part, 0);
    405 printf("(s%se%s) (%s) = %s\n",session , episode, etitle, url);                         
     404
    406405                                incount += 1;
    407406                                line = ostrcat(line, _("Season"), 1, 0);
     
    456455                writesys(tmpstr, line, 0);
    457456
    458                 if(getconfigint("debuglevel", NULL) == 99)
    459                         writesys("/tmp/solarmovie8_line", line, 0);
     457                titheklog(debuglevel, "/tmp/solarmovie8_line", NULL, line);
    460458                                       
    461459                struct tithek* tnode = (struct tithek*)listbox->select->handle;
  • titan/plugins/tithek/streamcloud.h

    r19879 r24238  
    55{
    66        debug(99, "in host: %s file: %s", host, file);
     7        int debuglevel = getconfigint("debuglevel", NULL);
    78        char* tmphost = NULL;
    89        char* tmpfile = NULL;
     
    105106        debug(99, "hash: %s", hash);
    106107        hashlen = oitoa(strlen(hash));
    107        
     108
    108109        //create send string
    109110        free(send), send = NULL;
     
    123124        free(tmpstr), tmpstr = NULL;
    124125        tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 0);
    125         if(getconfigint("debuglevel", NULL) == 99)
    126                 writesys("/tmp/streamcould2_tmpstr_post", tmpstr, 0);
     126        titheklog(debuglevel, "/tmp/streamcould2_tmpstr_post", NULL, tmpstr);
    127127
    128128//      streamlink = oregex(".*file: \".*(http:.*video.mp4).*\".*", tmpstr);
    129129        streamlink = string_resub("file: \"", "\"", tmpstr, 0);
    130         if(getconfigint("debuglevel", NULL) == 99)
    131                 writesys("/tmp/streamcould3_streamlink", streamlink, 0);
     130        titheklog(debuglevel, "/tmp/streamcould3_streamlink", NULL, streamlink);
    132131
    133132        free(tmpstr); tmpstr = NULL;
  • titan/plugins/tithek/vidstream.h

    r21018 r24238  
    55{
    66        debug(99, "in host: %s file: %s", host, file);
     7        int debuglevel = getconfigint("debuglevel", NULL);
    78        char* tmphost = NULL;
    89        char* tmpfile = NULL;
     
    4243        tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1);
    4344
    44         if(getconfigint("debuglevel", NULL) == 99)
    45                 writesys("/tmp/vidstream1_tmpstr", tmpstr, 0);
     45        titheklog(debuglevel, "/tmp/vidstream1_tmpstr", NULL, tmpstr);
    4646
    4747        sleep(1);
     
    121121        tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1);
    122122       
    123         if(getconfigint("debuglevel", NULL) == 99)
    124                 writesys("/tmp/vidstream2_tmpstr_post", tmpstr, 0);
     123        titheklog(debuglevel, "/tmp/vidstream2_tmpstr_post", NULL, tmpstr);
    125124
    126125        sleep(1);
    127126        streamlink = string_resub("file: \"", "\",", tmpstr, 0);
    128127
    129         if(getconfigint("debuglevel", NULL) == 99)
    130                 writesys("/tmp/vidstream3_streamlink", streamlink, 0);
     128        titheklog(debuglevel, "/tmp/vidstream3_streamlink", NULL, streamlink);
    131129
    132130end:
  • titan/plugins/tithek/xvideos.h

    r22584 r24238  
    55{
    66        debug(99, "link %s", link);
     7        int debuglevel = getconfigint("debuglevel", NULL);
    78        char* ip = NULL, *pos = NULL, *path = NULL, *streamurl = NULL, *tmpstr = NULL;
    89       
     
    2425        writesys("/var/usr/local/share/titan/plugins/tithek/xvideos2_tmpstr", tmpstr, 0);
    2526
    26        
    27         if(getconfigint("debuglevel", NULL) == 99)
    28                 writesys("/tmp/xvideos1_tmpstr", tmpstr, 0);
     27        titheklog(debuglevel, "/tmp/xvideos1_tmpstr", NULL, tmpstr);
    2928
    3029        if(tmpstr != NULL)
     
    3635        free(ip), ip = NULL;
    3736
    38         if(getconfigint("debuglevel", NULL) == 99)
    39                 writesys("/tmp/xvideos2_streamurl", streamurl, 0);
     37        titheklog(debuglevel, "/tmp/xvideos2_streamurl", NULL, streamurl);
    4038
    4139// segfault munmap_chunk(): invalid pointer
  • titan/plugins/tithek/xvidstage.h

    r19880 r24238  
    55{
    66        debug(99, "in host: %s file: %s", host, file);
     7        int debuglevel = getconfigint("debuglevel", NULL);
    78        char* tmphost = NULL;
    89        char* tmpfile = NULL;
     
    6667        }
    6768
    68         if(getconfigint("debuglevel", NULL) == 99)
    69                 system("cp -a /tmp/tithek/get /tmp/xvidstage1_tmpstr_get");
     69        if(debuglevel == 99) system("cp -a /tmp/tithek/get /tmp/xvidstage1_tmpstr_get");
    7070
    7171        tmpstr = command("cat /tmp/tithek/get");
    7272        cookie = string_resub("Set-Cookie: afc=", ";", tmpstr, 0);     
    7373        debug(99, "cookie: %s", cookie);
    74 
    75         if(getconfigint("debuglevel", NULL) == 99)
    76                 writesys("/tmp/xvidstage2_tmpstr", tmpstr, 0);
     74       
     75        titheklog(debuglevel, "/tmp/xvidstage2_tmpstr", NULL, tmpstr);
    7776
    7877        free(tmpstr), tmpstr = NULL;
     
    9998        free(lines); lines = NULL;
    10099
    101         if(getconfigint("debuglevel", NULL) == 99)
    102                 writesys("/tmp/xvidstage3_tmpstr_zcat", tmpstr, 0);
     100        titheklog(debuglevel, "/tmp/xvidstage3_tmpstr_zcat", NULL, tmpstr);
    103101
    104102        sleep(1);
     
    179177        }
    180178
    181         if(getconfigint("debuglevel", NULL) == 99)
    182                 system("cp -a /tmp/tithek/post /tmp/xvidstage4_tmpstr_post");   
     179        if(debuglevel == 99) system("cp -a /tmp/tithek/post /tmp/xvidstage4_tmpstr_post");     
    183180
    184181        cmd = ostrcat(cmd, "cat /tmp/tithek/post | zcat", 1, 0);
    185182        debug(99, "cmd: %s", cmd);
    186183        post = command(cmd);
    187         if(getconfigint("debuglevel", NULL) == 99)
    188                 writesys("/tmp/xvidstage5_tmpstr_post1_zcat", post, 0);
     184        titheklog(debuglevel, "/tmp/xvidstage5_tmpstr_post1_zcat", NULL, post);
    189185        free(cmd); cmd = NULL;
    190186
    191187        free(tmpstr),tmpstr = NULL;
    192188        tmpstr = string_resub(";return p}('", ");'", post, 0);
    193         if(getconfigint("debuglevel", NULL) == 99)
    194                 writesys("/tmp/xvidstage6_tmpstr_post1_zcat_resub", tmpstr, 0);
     189        titheklog(debuglevel, "/tmp/xvidstage6_tmpstr_post1_zcat_resub", NULL, tmpstr);
    195190       
    196191        post = string_replace_all(tmpstr, "", post, 1);
    197192        post = string_replace_all(";return p}(');'", "", post, 1);
    198         if(getconfigint("debuglevel", NULL) == 99)
    199                 writesys("/tmp/xvidstage7_tmpstr_post2", post, 0);
     193        titheklog(debuglevel, "/tmp/xvidstage7_tmpstr_post2", NULL, post);
    200194
    201195        free(tmpstr),tmpstr = NULL;
    202196        free(b36code),b36code = NULL;
    203197        tmpstr = string_resub(";return p}('", ");'", post, 0);
    204         if(getconfigint("debuglevel", NULL) == 99)
    205                 writesys("/tmp/xvidstage8_tmpstr_post2_resub", tmpstr, 0);
     198        titheklog(debuglevel, "/tmp/xvidstage8_tmpstr_post2_resub", NULL, tmpstr);
    206199
    207200        b36code = oregex(".*;',[0-9]{2,2},[0-9]{2,2},'(.*)'.split.*", post);
    208201       
    209         b36code = string_replace_all("||", "| |", b36code, 1);         
    210         if(getconfigint("debuglevel", NULL) == 99)
    211                 writesys("/tmp/xvidstage9_tmpstr_post2_resub_b36code2", b36code, 0);
     202        b36code = string_replace_all("||", "| |", b36code, 1);
     203        titheklog(debuglevel, "/tmp/xvidstage9_tmpstr_post2_resub_b36code2", NULL, b36code);
    212204       
    213205        struct splitstr* ret1 = NULL;
     
    288280        free(charlist), charlist = NULL;
    289281
    290         if(getconfigint("debuglevel", NULL) == 99)
    291                 writesys("/tmp/xvidstage10_tmpstr_last", tmpstr, 0);
     282        titheklog(debuglevel, "/tmp/xvidstage10_tmpstr_last", NULL, tmpstr);
    292283
    293284        streamlink = oregex(".*file.*(http:.*video.flv).*image.*", tmpstr);
     
    319310                streamlink = oregex(".*value=.*(http:.*video.avi).*\".*", tmpstr);                     
    320311
    321         if(getconfigint("debuglevel", NULL) == 99)
    322                 writesys("/tmp/xvidstage11_streamlink", streamlink, 0);
     312        titheklog(debuglevel, "/tmp/xvidstage11_streamlink", NULL, streamlink);
    323313
    324314        free(tmpstr); tmpstr = NULL;
  • titan/plugins/tithek/zdf.h

    r24002 r24238  
    55{
    66        debug(99, "link %s", link);
     7        int debuglevel = getconfigint("debuglevel", NULL);
    78        char* ip = NULL, *pos = NULL, *path = NULL, *streamurl = NULL, *tmpstr = NULL, *tmpstr2 = NULL, *pic = NULL, *title = NULL, *tmpstr3 = NULL, *quali = NULL;
    89       
     
    1819
    1920        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    20         if(getconfigint("debuglevel", NULL) == 99)
    21                 writesys("/tmp/zdf1_tmpstr", tmpstr, 0);
    22 
    23         if(getconfigint("debuglevel", NULL) == 99)
    24                 writesys("/var/usr/local/share/titan/plugins/tithek/zdf1_tmpstr", tmpstr, 0);
    25        
     21        titheklog(debuglevel, "/tmp/zdf1_tmpstr", NULL, tmpstr);
    2622
    2723        if(tmpstr != NULL)
     
    4137                tmpstr2 = string_replace_all("<formitaet basetype", "\n\t<formitaet basetype", tmpstr2, 1);
    4238
    43                 if(getconfigint("debuglevel", NULL) == 99)
    44                         writesys("/var/usr/local/share/titan/plugins/tithek/zdf1_tmpstr2", tmpstr2, 0);
     39                titheklog(debuglevel, "/tmp/zdf1_tmpstr2", NULL, tmpstr");
    4540               
    4641                int count = 0, i = 0;   
     
    113108                free(ret1), ret1 = NULL;
    114109
    115                 if(mlist != NULL){
     110                if(mlist != NULL)
     111                {
    116112                        mbox = menulistbox(mlist, NULL, NULL, NULL, NULL, 1, 0);
    117                         if(mbox != NULL){
    118                             free(streamurl), streamurl = NULL;
    119    
    120                             debug(99, "mbox->name %s", mbox->name);
    121                             debug(99, "mbox->text %s", mbox->text);
    122                             streamurl = ostrcat(mbox->text, NULL, 0, 0);
    123    
     113                        if(mbox != NULL)
     114                        {
     115                                free(streamurl), streamurl = NULL;
     116
     117                                debug(99, "mbox->name %s", mbox->name);
     118                                debug(99, "mbox->text %s", mbox->text);
     119                                streamurl = ostrcat(mbox->text, NULL, 0, 0);
     120
    124121                        }
    125                 }                                                                                                               
     122                }
    126123        }
    127124
     
    129126        free(ip), ip = NULL;
    130127
    131         if(getconfigint("debuglevel", NULL) == 99)
    132                 writesys("/tmp/zdf2_streamurl", streamurl, 0);
     128        titheklog(debuglevel, "/tmp/zdf2_streamurl", NULL, streamurl");
    133129
    134130// segfault munmap_chunk(): invalid pointer
Note: See TracChangeset for help on using the changeset viewer.