Changeset 24237


Ignore:
Timestamp:
10/12/13 15:38:35 (10 years ago)
Author:
nit
Message:

optimize

Location:
titan/plugins/tithek
Files:
9 edited

Legend:

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

    r24234 r24237  
    4949        free(ip), ip = NULL;
    5050
    51   titheklog(debuglevel, "/tmp/ard2_streamurl", NULL, streamurl);
     51        titheklog(debuglevel, "/tmp/ard2_streamurl", NULL, streamurl);
    5252
    5353// segfault munmap_chunk(): invalid pointer
  • titan/plugins/tithek/beeg.h

    r24235 r24237  
    2929        free(ip), ip = NULL;
    3030
    31   titheklog(debuglevel, "/tmp/beeg2_streamurl", NULL, streamurl);
     31        titheklog(debuglevel, "/tmp/beeg2_streamurl", NULL, streamurl);
    3232
    3333// segfault munmap_chunk(): invalid pointer
  • titan/plugins/tithek/filenuke.h

    r24235 r24237  
    199199        free(charlist), charlist = NULL;
    200200
    201   titheklog(debuglevel, "/tmp/filenuke7_tmpstr_last", NULL, tmpstr);
     201        titheklog(debuglevel, "/tmp/filenuke7_tmpstr_last", NULL, tmpstr);
    202202
    203203        streamlink = oregex(".*file.*(http:.*video.flv).*image.*", tmpstr);
  • titan/plugins/tithek/flashx.h

    r24236 r24237  
    3535        tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1);
    3636
    37   titheklog(debuglevel, "/tmp/flashx1_tmpstr_get1", NULL, tmpstr);
     37        titheklog(debuglevel, "/tmp/flashx1_tmpstr_get1", NULL, tmpstr);
    3838
    3939        free(tmpstr); tmpstr = NULL;
     
    5151        tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1);
    5252
    53   titheklog(debuglevel, "/tmp/flashx2_tmpstr_get2", NULL, tmpstr);
     53        titheklog(debuglevel, "/tmp/flashx2_tmpstr_get2", NULL, tmpstr);
    5454
    5555        free(tmpstr); tmpstr = NULL;
     
    7171        }
    7272
    73   if(debuglevel == 99) system("cp -a /tmp/tithek/x9 /tmp/flashx3_tmpstr_get3");
     73        if(debuglevel == 99) system("cp -a /tmp/tithek/x9 /tmp/flashx3_tmpstr_get3");
    7474
    7575        free(send); send = NULL;
    7676        tmpstr = command("cat /tmp/tithek/x9 | sed '1,1d' | zcat");
    7777
    78   titheklog(debuglevel, "/tmp/flashx4_tmpstr_get3_zcat", NULL, tmpstr);
     78        titheklog(debuglevel, "/tmp/flashx4_tmpstr_get3_zcat", NULL, tmpstr);
    7979
    8080        streamlink = string_resub("<file>", "</file>", tmpstr, 0);
  • titan/plugins/tithek/kinox.h

    r22339 r24237  
    5454{
    5555        int ret = 1;
     56        int debuglevel = getconfigint("debuglevel", NULL);
    5657
    5758        if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL)
     
    9596                tmpstr = string_resub("<div id=\"beep\" class=\"beep\"></div>", "</table>", tmpstr, 0);
    9697
    97                 if(getconfigint("debuglevel", NULL) == 99)
    98                         writesys("/tmp/kinox1_tmpstr", tmpstr, 0);
    99 
    100 
     98                titheklog(debuglevel, "/tmp/kinox1_tmpstr", NULL, tmpstr);
     99               
    101100                int count = 0;
    102101                int incount = 0;
     
    198197{
    199198        debug(99, "link: %s", link);
     199        int debuglevel = getconfigint("debuglevel", NULL);
    200200        int ret = 1, series = 0;
    201201        char* ip = NULL, *pos = NULL, *path = NULL, *tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *tmpstr3 = NULL, *tmpstr4 = NULL, *tmpstr5 = NULL, *line = NULL, *url = NULL, *url2 = NULL, *url3 = NULL, *url4 = NULL, *pathnew = NULL;
     
    215215
    216216        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    217         if(getconfigint("debuglevel", NULL) == 99)
    218                 writesys("/tmp/kinox2_tmpstr", tmpstr, 0);
     217        titheklog(debuglevel, "/tmp/kinox2_tmpstr", NULL, tmpstr);
    219218       
    220219        if(tmpstr != NULL)
     
    291290                {
    292291                        tmpstr = string_resub("<ul id=\"HosterList\" class=\"Sortable\">", "</ul>", tmpstr, 0);
    293                         if(getconfigint("debuglevel", NULL) == 99)
    294                                 writesys("/tmp/kinox3_tmpstr", tmpstr, 0);
     292                        titheklog(debuglevel, "/tmp/kinox3_tmpstr", NULL, tmpstr);
    295293       
    296294                        int count = 0;
     
    316314                                        pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0);
    317315
    318                                         char* logfile = ostrcat("/tmp/kinox4_pathnew1", hname, 0, 0);
    319                                         if(getconfigint("debuglevel", NULL) == 99)
    320                                                 writesys(logfile, pathnew, 0);
    321                                         free(logfile), logfile= NULL;
     316                                        titheklog(debuglevel, "/tmp/kinox4_pathnew1", hname, pathnew);
    322317                                       
    323318                                        tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0);
    324319                                        free(pathnew), pathnew = NULL;
    325320
    326                                         logfile = ostrcat("/tmp/kinox5_tmpstr1", hname, 0, 0);
    327                                         if(getconfigint("debuglevel", NULL) == 99)
    328                                                 writesys(logfile, tmpstr1, 0);
    329                                         free(logfile), logfile= NULL;
     321                                        titheklog(debuglevel, "/tmp/kinox5_tmpstr1", hname, tmpstr1);
    330322
    331323                                        tmpstr1 = string_replace_all("\\", "", tmpstr1, 1);
     
    338330                                        pathnew = ostrcat(pathnew, "&Part=2", 1, 0);
    339331
    340                                         logfile = ostrcat("/tmp/kinox6_pathnew2", hname, 0, 0);
    341                                         if(getconfigint("debuglevel", NULL) == 99)
    342                                                 writesys(logfile, pathnew, 0);
    343                                         free(logfile), logfile= NULL;
     332                                        titheklog(debuglevel, "/tmp/kinox6_pathnew2", hname, pathnew);
    344333                                       
    345334                                        tmpstr3 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0);
    346335                                        free(pathnew), pathnew = NULL;
    347336
    348                                         logfile = ostrcat("/tmp/kinox7_tmpstr3", hname, 0, 0);
    349                                         if(getconfigint("debuglevel", NULL) == 99)
    350                                                 writesys(logfile, tmpstr3, 0);
    351                                         free(logfile), logfile= NULL;
     337                                        titheklog(debuglevel, "/tmp/kinox7_tmpstr3", hname, tmpstr3);
    352338
    353339                                        tmpstr3 = string_replace_all("\\", "", tmpstr3, 1);
     
    360346                                        pathnew = ostrcat(pathnew, "&Part=3", 1, 0);
    361347
    362                                         logfile = ostrcat("/tmp/kinox6_pathnew3", hname, 0, 0);
    363                                         if(getconfigint("debuglevel", NULL) == 99)
    364                                                 writesys(logfile, pathnew, 0);
    365                                         free(logfile), logfile= NULL;
     348                                        titheklog(debuglevel, "/tmp/kinox6_pathnew3", hname, pathnew);
    366349                                       
    367350                                        tmpstr4 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0);
    368351                                        free(pathnew), pathnew = NULL;
    369352
    370                                         logfile = ostrcat("/tmp/kinox7_tmpstr4", hname, 0, 0);
    371                                         if(getconfigint("debuglevel", NULL) == 99)
    372                                                 writesys(logfile, tmpstr4, 0);
    373                                         free(logfile), logfile= NULL;
     353                                        titheklog(debuglevel, "/tmp/kinox7_tmpstr4", hname, tmpstr4);
    374354
    375355                                        tmpstr4 = string_replace_all("\\", "", tmpstr4, 1);
     
    382362                                        pathnew = ostrcat(pathnew, "&Part=4", 1, 0);
    383363
    384                                         logfile = ostrcat("/tmp/kinox6_pathnew4", hname, 0, 0);
    385                                         if(getconfigint("debuglevel", NULL) == 99)
    386                                                 writesys(logfile, pathnew, 0);
    387                                         free(logfile), logfile= NULL;
     364                                        titheklog(debuglevel, "/tmp/kinox6_pathnew4", hname, pathnew);
    388365                                       
    389366                                        tmpstr5 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0);
    390367                                        free(pathnew), pathnew = NULL;
    391368
    392                                         logfile = ostrcat("/tmp/kinox7_tmpstr5", hname, 0, 0);
    393                                         if(getconfigint("debuglevel", NULL) == 99)
    394                                                 writesys(logfile, tmpstr5, 0);
    395                                         free(logfile), logfile= NULL;
     369                                        titheklog(debuglevel, "/tmp/kinox7_tmpstr5", hname, tmpstr5);
    396370
    397371                                        tmpstr5 = string_replace_all("\\", "", tmpstr5, 1);
     
    818792                writesys(tmpstr, line, 0);
    819793
    820                 if(getconfigint("debuglevel", NULL) == 99)
    821                         writesys("/tmp/kinox8_line", line, 0);
     794                titheklog(debuglevel, "/tmp/kinox8_line", NULL, line);
    822795                                       
    823796                struct tithek* tnode = (struct tithek*)listbox->select->handle;
     
    832805{
    833806        debug(99, "link: %s", link);
     807        int debuglevel = getconfigint("debuglevel", NULL);
    834808        int ret = 1;
    835809        char* ip = NULL, *pathnew = NULL, *seriesid = NULL, *searchname = NULL, *url = NULL, *session = NULL, *episode = NULL, *pos = NULL, *path = NULL, *tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *line = NULL;               
     
    10351009                writesys(tmpstr, line, 0);
    10361010
    1037                 if(getconfigint("debuglevel", NULL) == 99)
    1038                         writesys("/tmp/kinox9_line", line, 0);
     1011                titheklog(debuglevel, "/tmp/kinox9_line", NULL, line);
    10391012
    10401013                struct tithek* tnode = (struct tithek*)listbox->select->handle;
  • titan/plugins/tithek/mlehd.h

    r22199 r24237  
    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, *tmppath = NULL;
    89       
     
    3738        free(tmppath), tmppath = NULL;
    3839
    39         if(getconfigint("debuglevel", NULL) == 99)
    40                 writesys("/tmp/mlehd2_streamurl", streamurl, 0);
     40  titheklog(debuglevel, "/tmp/mlehd2_streamurl", NULL, streamurl);
    4141
    4242// segfault munmap_chunk(): invalid pointer
  • titan/plugins/tithek/movie4k.h

    r23699 r24237  
    254254{
    255255        debug(99, "link: %s", link);
     256        int debuglevel = getconfigint("debuglevel", NULL);
    256257        int ret = 1;
    257258        char* ip = NULL, *pos = NULL, *path = NULL, *tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *url = NULL, *url2 = NULL, *url3 = NULL, *url4 = NULL, *pathnew = NULL, *hname = NULL, *id = NULL, *logfile = NULL, *tmphname = NULL, *hnamein = NULL, *nolinks = NULL;
     
    271272
    272273        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    273         if(getconfigint("debuglevel", NULL) == 99)
    274                 writesys("/tmp/movie4k2_tmpstr", tmpstr, 0);
     274        titheklog(debuglevel, "/tmp/movie4k2_tmpstr", NULL, tmpstr);
    275275
    276276        if(tmpstr != NULL)
     
    331331                                                logfile = ostrcat("/tmp/movie4k4_pathnew1", id, 0, 0);
    332332                                                logfile = ostrcat(logfile, "_", 1, 0);
    333                                                 logfile = ostrcat(logfile, tmphname, 1, 0);
    334 
    335                                                 if(getconfigint("debuglevel", NULL) == 99)
    336                                                         writesys(logfile, pathnew, 0);
     333                                                titheklog(debuglevel, logfile, tmphname, pathnew);
    337334                                                free(logfile), logfile= NULL;
     335                                               
    338336                                                url = ostrcat(pathnew, NULL, 0, 0);
    339337                                        }
     
    667665{
    668666        debug(99, "link: %s", link);
     667        int debuglevel = getconfigint("debuglevel", NULL);
    669668        int ret = 1, series = 0;
    670669        char* ip = NULL, *pos = NULL, *id = NULL, *tpath = NULL, *path = NULL, *tmpstr = NULL, *line = NULL, *episode = NULL;
     
    704703        tmpstr = gethttp(ip, tpath, 80, NULL, NULL, 10000, NULL, 0);
    705704        free(tpath), tpath = NULL;
    706         if(getconfigint("debuglevel", NULL) == 99)
    707                 writesys("/tmp/movie4k2_tmpstr", tmpstr, 0);
     705        titheklog(debuglevel, "/tmp/movie4k2_tmpstr", NULL, tmpstr);
    708706
    709707        if(tmpstr != NULL)
     
    799797                writesys(tmpstr, line, 0);
    800798
    801                 if(getconfigint("debuglevel", NULL) == 99)
    802                         writesys("/tmp/movie4k8_line", line, 0);
     799                titheklog(debuglevel, "/tmp/movie4k8_line", NULL, line);
    803800                                       
    804801                struct tithek* tnode = (struct tithek*)listbox->select->handle;
     
    812809{
    813810        debug(99, "link: %s", link);
     811        int debuglevel = getconfigint("debuglevel", NULL);
    814812        int ret = 1;
    815813        char* ip = NULL, *pos = NULL, *tpath = NULL, *path = NULL, *tmpstr = NULL, *line = NULL;
     
    836834        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    837835        free(tpath), tpath = NULL;
    838         if(getconfigint("debuglevel", NULL) == 99)
    839                 writesys("/tmp/movie4k2_tmpstr", tmpstr, 0);
     836        titheklog(debuglevel, "/tmp/movie4k2_tmpstr", NULL, tmpstr);
    840837
    841838        if(tmpstr != NULL)
     
    912909                writesys(tmpstr, line, 0);
    913910
    914                 if(getconfigint("debuglevel", NULL) == 99)
    915                         writesys("/tmp/movie4k8_line", line, 0);
     911                titheklog(debuglevel, "/tmp/movie4k8_line", NULL, line);
    916912                                       
    917913                struct tithek* tnode = (struct tithek*)listbox->select->handle;
     
    925921{
    926922        debug(99, "link: %s", link);
     923        int debuglevel = getconfigint("debuglevel", NULL);
    927924        int ret = 1;
    928925        char* ip = NULL, *pos = NULL, *tpath = NULL, *path = NULL, *tmpstr = NULL, *line = NULL;
     
    950947        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    951948        free(tpath), tpath = NULL;
    952         if(getconfigint("debuglevel", NULL) == 99)
    953                 writesys("/tmp/movie4k2_tmpstr", tmpstr, 0);
     949        titheklog(debuglevel, "/tmp/movie4k2_tmpstr", NULL, tmpstr);
    954950
    955951        if(tmpstr != NULL)
     
    10351031                writesys(tmpstr, line, 0);
    10361032
    1037                 if(getconfigint("debuglevel", NULL) == 99)
    1038                         writesys("/tmp/movie4k8_line", line, 0);
     1033                titheklog(debuglevel, "/tmp/movie4k8_line", NULL, line);
    10391034                                       
    10401035                struct tithek* tnode = (struct tithek*)listbox->select->handle;
  • titan/plugins/tithek/myvideo.h

    r23760 r24237  
    77{
    88        debug(99, "link(%d): %s", flag, input);
     9        int debuglevel = getconfigint("debuglevel", NULL);
    910        char* ip = NULL, *pos = NULL, *path = NULL, *pageUrl = NULL, *playpath = NULL, *video_id = NULL, *source = NULL, *streamurl = NULL, *tmpstr_uni = NULL, *b64 = NULL, *key = NULL, *newurl = NULL, *link = NULL, *tmpstr = NULL, *tmppath = NULL, *error = NULL;
    1011
     
    4344        unlink("/tmp/myvideo_tmpstr_error");
    4445
    45         if(getconfigint("debuglevel", NULL) == 99)
    46                 writesys("/tmp/myvideo_tmpstr_error", tmpstr, 0);
     46        titheklog(debuglevel, "/tmp/myvideo_tmpstr_error", NULL, tmpstr);
    4747                               
    4848        if(ostrstr(error, "<div class='error sBold' id='error_screen_body'>") == NULL)
     
    6262        debug(99, "link: http://%s/%s", ip, path);
    6363
    64         if(getconfigint("debuglevel", NULL) == 99)
    65                 writesys("/tmp/myvideo_tmpstr", tmpstr, 0);
     64        titheklog(debuglevel, "/tmp/myvideo_tmpstr", NULL, tmpstr);
    6665
    6766/*
     
    119118                        htmldecode(tmpstr_uni, tmpstr_uni);
    120119
    121                         if(getconfigint("debuglevel", NULL) == 99)
    122                                 writesys("/tmp/myvideo_tmpstr_uni", tmpstr_uni, 0);
     120                        titheklog(debuglevel, "/tmp/myvideo_tmpstr_uni", NULL, tmpstr_uni);
    123121
    124122                        if(ostrstr(tmpstr_uni, "connectionurl='rtmp"))
  • titan/plugins/tithek/nowvideo.h

    r20021 r24237  
    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;
     
    3233        tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1);
    3334
    34         if(getconfigint("debuglevel", NULL) == 99)
    35                 writesys("/tmp/nowvideo1", tmpstr, 0);
     35        titheklog(debuglevel, "/tmp/nowvideo1", NULL, tmpstr);
    3636
    3737        if(ostrstr(tmpstr, "The file is being transfered to our other servers. This may take few minutes.") != NULL)
     
    5959        tmpstr = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1);
    6060
    61         if(getconfigint("debuglevel", NULL) == 99)
    62                 writesys("/tmp/nowvideo2", tmpstr, 0);
     61        titheklog(debuglevel, "/tmp/nowvideo2", NULL, tmpstr);
    6362
    6463        sleep(1);
Note: See TracChangeset for help on using the changeset viewer.