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