Ignore:
Timestamp:
01/26/16 04:07:55 (7 years ago)
Author:
obi
Message:

update tithek

File:
1 edited

Legend:

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

    r36938 r36961  
    445445
    446446//      if(cmpfilenameext(filename, ".sh") == 0)
    447         if(ostrstr(filename, ".sh ") != NULL && ostrstr(filename, ".sh init") == NULL)
     447        if(ostrstr(filename, ".sh ") != NULL && ostrstr(filename, ".sh init") == NULL && ostrstr(filename, ".sh video") == NULL)
    448448        {
    449449                printf("[tithek] cmd: %s\n", filename);
     
    454454                debug(10, "file: %s", file);
    455455        }
     456        else if(ostrstr(filename, ".sh video") != NULL)
     457        {
     458                printf("[tithek] video..... cmd: %s\n", filename);
     459                debug(10, "cmd: %s", filename);
     460                file = command(filename);
     461                file = string_newline(file);
     462                printf("[tithek] file: %s\n", file);
     463                debug(10, "file: %s", file);
     464        }
    456465        else
    457466                file = ostrcat(filename, NULL, 0, 0);   
     
    467476        pay = getconfigint("tithek_pay", NULL);
    468477
     478        char* tmpstr = NULL;
     479
    469480        while(fgets(fileline, MINMALLOC, fd) != NULL)
    470481        {
    471482                if(fileline[0] == '\n')
    472483                        continue;
    473                 len = strlen(fileline) - 1;
    474                 if(fileline[len] == '\n')
    475                         fileline[len] = '\0';
    476                 if(fileline[len - 1] == '\r')
    477                         fileline[len - 1] = '\0';
    478 
     484
     485                if(ostrstr(filename, ".sh hoster") != NULL)
     486                {
     487                        printf("[tithek] hoster fileline: %s\n", fileline);
     488                        tmpstr = command(fileline);
     489                        printf("[tithek] hoster tmpstr: %s\n", tmpstr);
     490
     491                        len = strlen(tmpstr) - 1;
     492                        if(tmpstr[len] == '\n')
     493                                tmpstr[len] = '\0';
     494                        if(tmpstr[len - 1] == '\r')
     495                                tmpstr[len - 1] = '\0';
     496                }
     497                else
     498                {
     499                        len = strlen(fileline) - 1;
     500                        if(fileline[len] == '\n')
     501                                fileline[len] = '\0';
     502                        if(fileline[len - 1] == '\r')
     503                                fileline[len - 1] = '\0';
     504                }
    479505                linecount++;
    480506
    481507                if(last == NULL) last = tmplast;
    482                 last = addtithek(fileline, len + 2, linecount, last, pay);
     508                if(ostrstr(filename, ".sh hoster") != NULL)
     509                        last = addtithek(tmpstr, len + 2, linecount, last, pay);
     510                else
     511                        last = addtithek(fileline, len + 2, linecount, last, pay);
    483512                if(last != NULL) tmplast = last;
     513                free(tmpstr), tmpstr = NULL;
    484514        }
    485515
Note: See TracChangeset for help on using the changeset viewer.