Changeset 38198


Ignore:
Timestamp:
Aug 17, 2016, 2:02:07 AM (4 years ago)
Author:
obi
Message:

fix the video

File:
1 edited

Legend:

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

    r38188 r38198  
    77        int debuglevel = getconfigint("debuglevel", NULL);
    88        char* tmphost = NULL, *tmplink = NULL, *tmppath = NULL, *tmpstr = NULL, *streamlink = NULL, *pos = NULL, *path = NULL, *url = NULL;
     9        char* vhash = NULL, *gfk = NULL, *fname = NULL, *hash = NULL, *post = NULL, *inhu = NULL, *op = NULL, *vt = NULL, *tmpstr1 = NULL;
    910
    1011        if(link == NULL) return NULL;
    1112
    12         unlink("/tmp/thevideo1_get");
     13        unlink("/var/usr/local/share/titan/plugins/tithek/thevideo1_get");
     14        unlink("/var/usr/local/share/titan/plugins/tithek/thevideo2_post");
     15
    1316        unlink("/tmp/thevideo2_streamlink");
    1417/////////////
     
    4245        tmppath = ostrcat(tmppath, ".html", 1, 0);
    4346
     47//      tmppath = ostrcat("/", path, 0, 0);
     48
    4449/*
    4550http://thevideo.me/g5oi83o7260u
     
    5358        url = ostrcat(tmphost, tmppath, 0, 0);
    5459        debug(99, "url: %s", url);
    55         tmpstr = gethttps(url, NULL, NULL, NULL, NULL, NULL, 1);
    56         titheklog(debuglevel, "/tmp/thevideo1_get", NULL, NULL, NULL, tmpstr); 
     60        tmpstr = gethttps(link, NULL, NULL, NULL, NULL, NULL, 1);
     61        titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/thevideo1_get", NULL, NULL, NULL, tmpstr);     
    5762
    5863        if(tmpstr == NULL)
     
    6873        }
    6974
     75        vhash = string_resub("'_vhash', value: '", "'", tmpstr, 0);
     76        gfk = string_resub("'gfk', value: '", "'", tmpstr, 0);
     77        fname = string_resub("name=\"fname\" value=\"", "\"", tmpstr, 0);
     78        hash = string_resub("name=\"hash\" value=\"", "\"", tmpstr, 0);
     79        op = string_resub("name=\"op\" value=\"", "\"", tmpstr, 0);
     80        inhu = string_resub("name=\"inhu\" value=\"", "\"", tmpstr, 0);
     81        free(tmpstr); tmpstr = NULL;
     82
     83        post = ostrcat("_vhash=", vhash, 0, 0);
     84        post = ostrcat(post, "&gfk=", 1, 0);
     85        post = ostrcat(post, gfk, 1, 0);
     86        post = ostrcat(post, "&op=", 1, 0);
     87        post = ostrcat(post, op, 1, 0);
     88        post = ostrcat(post, "&usr_login=&id=", 1, 0);
     89        post = ostrcat(post, path, 1, 0);
     90        post = ostrcat(post, "&fname=", 1, 0);
     91        post = ostrcat(post, fname, 1, 0);
     92        post = ostrcat(post, "&referer=http%3A%2F%2Fthevideo.me%2F", 1, 0);
     93        post = ostrcat(post, path, 1, 0);
     94        post = ostrcat(post, "&hash=", 1, 0);
     95        post = ostrcat(post, hash, 1, 0);
     96        post = ostrcat(post, "&inhu=", 1, 0);
     97        post = ostrcat(post, inhu, 1, 0);
     98        post = ostrcat(post, "&imhuman=", 1, 0);
     99
     100        debug(99, "post: %s", post);
     101
     102        debug(99, "url: %s", url);
     103        tmpstr = gethttps(link, NULL, post, NULL, NULL, link, 1);
     104        titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/thevideo2_post", NULL, NULL, NULL, tmpstr);   
     105
    70106        streamlink = string_resub("'label' : '360p', 'file' : '", "'", tmpstr, 0);
    71107        if(streamlink == NULL)
     
    78114                streamlink = oregex(".*(http://.*v.mp4).*", tmpstr);
    79115
     116        tmpstr1 = string_resub("<div class=\"container main-container\">", "</div>", tmpstr, 0);
     117        debug(99, "tmpstr1: %s", tmpstr1);
     118        free(tmpstr), tmpstr = NULL;
     119
     120        url = string_resub("<script src=\"", "\"></script>", tmpstr1, 0);
     121        free(tmpstr1), tmpstr1 = NULL;
     122
     123/*
     124        <script src="https://thevideo.me/jwjsv/sfqlqb288ft2"></script>
     125        https://thevideo.me/jwjsv/sfqlqb288ft2
     126*/
     127
     128        tmpstr = gethttps(url, NULL, NULL, NULL, NULL, link, 1);
     129        titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/thevideo3_get", NULL, NULL, NULL, tmpstr);     
     130
     131        tmpstr1 = string_resub("[],30,'", "'.split('|')", tmpstr, 0);
     132        int count = 0;
     133        int j;
     134        struct splitstr* ret1 = NULL;
     135        ret1 = strsplit(tmpstr1, "|", &count);
     136
     137        if(ret1 != NULL && count > 0)
     138        {
     139                for(j = 0; j < count; j++)
     140                {
     141                        if(strlen(ret1[j].part) > 50)
     142                                vt = ostrcat(ret1[j].part, NULL, 0, 0);
     143                }
     144        }
     145        free(ret1); ret1 = NULL;
     146
     147/*
     148        https://d4242.thevideo.me:8777/gwjta3agywoammfvg7sfgcmaglluse7vcwc6gn6frivojkuv2dk6h7fk77bpqtu5v6uxlvg6okwz2hdqdykueqnd5hllm5bnwwveiqijxa5b6wzozls26gn3f7ci6pvr44jhdqjt3ndyur5ecocf2pz4mlwtmdzps4xtk7jdce3ezweuna7ww2u4pmujltietcuedpvveh4tc6sjv3oxljsajrq5hz22vtwthssqknhd3v5psrp2rur2gxroejzewfek5dbr/v.mp4?direct=false&ua=1&vt=osv3jha2zaetuu35h7nm4hpodzb7raf5clkelbe2gmgew3qcowp257vjk347pb6fshhj3uku2vggcte3ix4tqwp6gy5twendw4wrkj76ms437ghk76hhb5iimrpmjgt4uee4hdhctjvy72pfx7us3usbvyiwxpizl5mbo2alkrb4g253pznnrqn5ub4a7w36p3lirdnfoxogogs7pnsspgmxi6wqinys7orguna
     149*/
     150
    80151        if(streamlink != NULL)
    81                 streamlink = ostrcat(streamlink, "?direct=false&ua=1&vt=1", 1, 0);
     152        {
     153                streamlink = ostrcat(streamlink, "?direct=false&ua=1&vt=", 1, 0);
     154                if(vt != NULL)
     155                        streamlink = ostrcat(streamlink, vt, 1, 0);
     156                else
     157                        streamlink = ostrcat(streamlink, "1", 1, 0);
     158        }
    82159
    83160        titheklog(debuglevel, "/tmp/thevideo1_streamlink", NULL, NULL, NULL, streamlink);
     
    85162end:
    86163
     164        free(vhash); vhash = NULL;
     165        free(gfk); gfk = NULL;
     166        free(fname); fname = NULL;
     167        free(hash); hash = NULL;
     168        free(post); post = NULL;
     169        free(inhu); inhu = NULL;
     170        free(op); op = NULL;
     171        free(vt); vt = NULL;
    87172        free(url); url = NULL;
    88173        free(tmphost); tmphost = NULL;
     
    90175        free(tmplink); tmplink = NULL;
    91176        free(tmpstr); tmpstr = NULL;
     177        free(tmpstr1); tmpstr1 = NULL;
    92178
    93179        return streamlink;
Note: See TracChangeset for help on using the changeset viewer.