source: titan/plugins/tithek/xvideos.h @ 22584

Last change on this file since 22584 was 22584, checked in by obi, 11 years ago

[tithek] add xvideos

File size: 1.1 KB
Line 
1#ifndef XVIDEOS_H
2#define XVIDEOS_H
3
4char* xvideos(char* link)
5{
6        debug(99, "link %s", link);
7        char* ip = NULL, *pos = NULL, *path = NULL, *streamurl = NULL, *tmpstr = NULL;
8       
9        ip = string_replace("http://", "", (char*)link, 0);
10
11        if(ip != NULL)
12                pos = strchr(ip, '/');
13        if(pos != NULL)
14        {
15                pos[0] = '\0';
16                path = pos + 1;
17        }
18
19        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
20       
21        writesys("/var/usr/local/share/titan/plugins/tithek/xvideos1_tmpstr", tmpstr, 0);
22       
23        htmldecode(tmpstr, tmpstr);
24        writesys("/var/usr/local/share/titan/plugins/tithek/xvideos2_tmpstr", tmpstr, 0);
25
26       
27        if(getconfigint("debuglevel", NULL) == 99)
28                writesys("/tmp/xvideos1_tmpstr", tmpstr, 0);
29
30        if(tmpstr != NULL)
31        {
32                streamurl = string_resub("flv_url=","&",tmpstr,0);
33        }
34
35        free(tmpstr); tmpstr = NULL;
36        free(ip), ip = NULL;
37
38        if(getconfigint("debuglevel", NULL) == 99)
39                writesys("/tmp/xvideos2_streamurl", streamurl, 0);
40
41// segfault munmap_chunk(): invalid pointer
42//      free(pos), pos = NULL;
43//      free(path), path = NULL;
44
45        debug(99, "streamurl: %s", streamurl); 
46        return streamurl;
47}
48
49#endif
Note: See TracBrowser for help on using the repository browser.