Changeset 40191 for titan/plugins


Ignore:
Timestamp:
02/28/17 01:40:07 (7 years ago)
Author:
obi
Message:

opti code

Location:
titan/plugins/tithek
Files:
2 edited

Legend:

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

    r40187 r40191  
    557557                if(ostrcmp(node->filename, "/media/hdd/.tithek/python.tar") == 0 || ostrcmp(node->filename, "/var/swap/.tithek/python.tar") == 0 || ostrcmp(node->filename, "/mnt/.tithek/python.tar") == 0)
    558558                {
    559                         printf("[tithek] sleep: 10\n");
    560                         sleep(10);
    561                         printf("[tithek] start Download: %s\n", node->filename);
     559                        printf("[tithek] sleep: 20\n");
     560                        sleep(20);
     561                        printf("[tithek] Download start: %s\n", node->filename);
    562562                }
    563563
    564564                gethttpreal(node->host, node->page, node->port, node->filename, node->auth, NULL, 0, NULL, NULL, node->timeout, 0);
     565                printf("[tithek] Download done: %s\n", node->filename);
    565566
    566567                char* cmd = NULL;
    567568                if(ostrcmp(node->filename, "/media/hdd/.tithek/python.tar") == 0)
    568569                {
    569                         cmd = ostrcat("tar -xvf /media/hdd/.tithek/python.tar -C /media/hdd/.tithek/", NULL, 0, 0);
     570                        cmd = ostrcat("tar -xf /media/hdd/.tithek/python.tar -C /media/hdd/.tithek/", NULL, 0, 0);
    570571                        symlink("/media/hdd/.tithek/lib", "/tmp/localhoster/lib");
    571572                }
    572573                else if(ostrcmp(node->filename, "/var/swap/.tithek/python.tar") == 0)
    573574                {
    574                         cmd = ostrcat("tar -xvf /var/swap/.tithek/python.tar -C /var/swap/.tithek/", NULL, 0, 0);
     575                        cmd = ostrcat("tar -xf /var/swap/.tithek/python.tar -C /var/swap/.tithek/", NULL, 0, 0);
    575576                        symlink("/var/swap/.tithek/lib", "/tmp/localhoster/lib");
    576577                }
    577578                else if(ostrcmp(node->filename, "/mnt/.tithek/python.tar") == 0)
    578579                {
    579                         cmd = ostrcat("tar -xvf /mnt/.tithek/python.tar -C /mnt/.tithek/", NULL, 0, 0);
     580                        cmd = ostrcat("tar -xf /mnt/.tithek/python.tar -C /mnt/.tithek/", NULL, 0, 0);
    580581                        symlink("/mnt/.tithek/lib", "/tmp/localhoster/lib");
    581582                }
    582583                else if(ostrcmp(node->filename, "/tmp/python.tar") == 0)
    583                         cmd = ostrcat("tar -xvf /tmp/python.tar -C /tmp/localhoster/", NULL, 0, 0);
     584                {
     585                        cmd = ostrcat("tar -xf /tmp/python.tar -C /tmp/localhoster/", NULL, 0, 0);
     586                        printf("[tithek] remove: %s\n", node->filename);
     587                        unlink(node->filename);
     588                }
    584589
    585590                if(cmd != NULL)
     
    588593                        system(cmd);
    589594                        free(cmd), cmd = NULL;
    590                         printf("[tithek] remove: %s\n", node->filename);
    591                         unlink(node->filename);
    592595                }
    593596                if(tithekrun == 0)
  • titan/plugins/tithek/tithek_global.h

    r40180 r40191  
    811811                        gethttp("atemio.dyndns.tv", "/mediathek/parser_free.tar", 80, "/tmp/parser.tar", HTTPAUTH, 5000, NULL, 0);
    812812       
    813                         cmd = ostrcat("tar -xvf /tmp/parser.tar -C ", path, 0, 0);
     813                        cmd = ostrcat("tar -xf /tmp/parser.tar -C ", path, 0, 0);
    814814                        system(cmd);
    815815                        free(cmd), cmd = NULL;
     
    819819                        {
    820820                                gethttp("atemio.dyndns.tv", "/mediathek/parser_secret.tar", 80, "/tmp/parser.tar", HTTPAUTH, 5000, NULL, 0);
    821                                 cmd = ostrcat("tar -xvf /tmp/parser.tar -C ", path, 0, 0);
     821                                cmd = ostrcat("tar -xf /tmp/parser.tar -C ", path, 0, 0);
    822822                                system(cmd);
    823823                                free(cmd), cmd = NULL;
     
    826826       
    827827                        gethttp("atemio.dyndns.tv", "/mediathek/hoster.tar", 80, "/tmp/hoster.tar", HTTPAUTH, 5000, NULL, 0);
    828                         cmd = ostrcat("tar -xvf /tmp/hoster.tar -C ", "/tmp/localhoster", 0, 0);
     828                        cmd = ostrcat("tar -xf /tmp/hoster.tar -C ", "/tmp/localhoster", 0, 0);
    829829                        system(cmd);
    830830                        free(cmd), cmd = NULL;
     
    839839                                dnode->port = 80;
    840840                                dnode->filename = ostrcat("/tmp/python.tar", NULL, 0, 0);
    841                                        
     841
     842                                printf("[tithek] getfreespace start\n");
     843       
    842844                                if(getfreespace("/mnt") / 1024 > 102400) //100mb
    843845                                {
     
    866868                                        dnode->page = ostrcat("/mediathek/python_full.tar", NULL, 0, 0);                                                       
    867869                                }
     870                                printf("[tithek] getfreespace end\n");
    868871
    869872                                dnode->auth = ostrcat(HTTPAUTH, NULL, 0, 0);
     
    910913                                        cmd = ostrcat(cmd, " init", 1, 0);
    911914                                        line = command(cmd);
     915                                        line = string_newline(line);
    912916                                        debug(99, "add main menuentry: %s", line);
    913917                                        writesys(titheklocalfile, line, 3);
Note: See TracChangeset for help on using the changeset viewer.