source: titan/plugins/tithek/cricfree.h @ 41465

Last change on this file since 41465 was 38013, checked in by obi, 8 years ago

fix crcfree

File size: 8.3 KB
Line 
1#ifndef CRICFREE_H
2#define CRICFREE_H
3
4char* cricfree(char* link, int incount)
5{
6        debug(99, "cricfree(%d) link=%s", incount, link);
7        int debuglevel = getconfigint("debuglevel", NULL);
8
9        char* url = NULL;
10        char* token = NULL;
11        char* streamurl = NULL;
12        char* tmpstr = NULL;
13        char* fid = NULL;
14        char* width = NULL;
15        char* height = NULL;
16        char* pageurl = NULL;
17        char* swfurl = NULL;
18        char* host = NULL;
19        char* path = NULL;
20/*
21http://cricfree.sx/sky-sports-1-live-stream-5
22http://cricfree.sx/update/tsn1.php,
23*/
24
25        if(ostrstr(link, "/update/") == NULL)
26        {
27                tmpstr = gethttps(link, NULL, NULL, NULL, NULL, NULL, 1);
28                host = string_resub("http://", "/", link, 0);
29                path = string_replace_all(host, "", link, 0);
30                path = string_replace_all("http://", "", path, 1);
31                path = string_replace_all(" ", "%20", path, 1);
32                titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast4_tmpstr", oitoa(incount), host, path, tmpstr);
33//              url = string_resub("src=\"", "\"", tmpstr, 0);
34                url = oregex(".*src=\"(http://cricfree.*)\" id=\"iframe\".*", tmpstr); 
35//<iframe frameborder="0" marginheight="0" allowfullscreen="true" marginwidth="0" height="555" src="http://cricfree.sc/update/bbc2.php" id="iframe" name="iframe_a" scrolling="no" width="620">Your Browser Do not Support Iframe</iframe>
36
37        }
38        else
39        {
40                url = ostrcat(link, NULL, 0, 0);
41        }
42
43        tmpstr = gethttps(url, NULL, NULL, NULL, NULL, NULL, 1);
44        host = string_resub("http://", "/", url, 0);
45        path = string_replace_all(host, "", url, 0);
46        path = string_replace_all("http://", "", path, 1);
47        path = string_replace_all(" ", "%20", path, 1);
48        titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast5_tmpstr", oitoa(incount), host, path, tmpstr);
49        free(url), url = NULL;
50
51//<script type='text/javascript'>id='espnuk'; width='620'; height='490';</script><script type='text/javascript' src='http://theactionlive.com/livegamecr.js'></script>
52//document.write('<iframe width="'+width+'" height="'+height+'" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" allowtransparency="true" src="http://theactionlive.com/livegamecr2.php?id='+id+'&width='+width+'&height='+height+'&stretching='+stretching+'"></iframe>');
53
54        fid = string_resub("id='", "'", tmpstr, 0);
55        width = string_resub("v_width=", ";", tmpstr, 0);
56        height = string_resub("v_height=", ";", tmpstr, 0);
57        url = string_resub("src='", "'", tmpstr, 0);
58
59        if(width == NULL)
60                width = string_resub("width='", "'", tmpstr, 0);
61        if(height == NULL)
62                height = string_resub("height='", "'", tmpstr, 0);
63
64        if(width == NULL)
65                width = string_resub("var width = '", "'", tmpstr, 0);
66        if(height == NULL)
67                height = string_resub("var height = '", "'", tmpstr, 0);
68
69        debug(99, "fid=%s width=%s height=%s", fid, width, height);
70
71        tmpstr = gethttps(url, NULL, NULL, NULL, NULL, link, 1);
72        free(host), host = NULL;
73        free(path), path = NULL;
74        host = string_resub("http://", "/", url, 0);
75        path = string_replace_all(host, "", url, 0);
76        path = string_replace_all("http://", "", path, 1);
77        path = string_replace_all(" ", "%20", path, 1);
78        titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast6_tmpstr", oitoa(incount), host, path, tmpstr);
79
80        pageurl = string_resub("src=\"", "\"", tmpstr, 0);
81        pageurl = string_replace_all(" ", "", pageurl, 1);
82        pageurl = string_replace_all("+v_", "+", pageurl, 1);
83        pageurl = string_replace("'+fid+'", "'+id+'", pageurl, 1);
84        pageurl = string_replace("'+id+'", fid, pageurl, 1);
85        pageurl = string_replace("'+width+'", width, pageurl, 1);
86        pageurl = string_replace("'+height+'", height, pageurl, 1);
87        pageurl = string_replace("'+stretching+'", "", pageurl, 1);
88
89        tmpstr = gethttps(pageurl, NULL, NULL, NULL, NULL, link, 1);
90        free(host), host = NULL;
91        free(path), path = NULL;
92        host = string_resub("http://", "/", pageurl, 0);
93        path = string_replace_all(host, "", pageurl, 0);
94        path = string_replace_all("http://", "", path, 1);
95        path = string_replace_all(" ", "%20", path, 1);
96        titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast7_tmpstr", oitoa(incount), host, path, tmpstr);
97
98        url = string_resub("file: \"", "\"", tmpstr, 0);
99
100        if(url == NULL)
101        {
102//              biggestplayer.me
103//              url: http://biggestplayer.me/playercr.js, file=tithek_global.h, func=gethttps, line=124
104
105                fid = string_resub("id='", "'", tmpstr, 0);
106                url = string_resub("src='", "'", tmpstr, 0);
107
108                debug(99, "fid=%s url=%s", fid, url);
109
110                url = string_replace_all(" ", "", url, 1);
111                url = string_replace_all("+v_", "+", url, 1);
112                url = string_replace_all("'+", "+", url, 1);
113                url = string_replace_all("+'", "+", url, 1);
114                url = string_replace("+fid+", "+id+", url, 1);
115                url = string_replace("+id+", fid, url, 1);
116                url = string_replace("+width+", width, url, 1);
117                url = string_replace("+height+", height, url, 1);
118                url = string_replace("+stretching+", "", url, 1);
119
120                tmpstr = gethttps(url, NULL, NULL, NULL, NULL, link, 1);
121                free(host), host = NULL;
122                free(path), path = NULL;
123                host = string_resub("http://", "/", url, 0);
124                path = string_replace_all(host, "", url, 0);
125                path = string_replace_all("http://", "", path, 1);
126                path = string_replace_all(" ", "%20", path, 1);
127                titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast8_tmpstr", oitoa(incount), host, path, tmpstr);
128                tmpstr = jsunpack(tmpstr);
129                titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast8a_tmpstr_jsunpack", oitoa(incount), host, path, tmpstr);
130
131//              url: http://biggestplayer.me/streamcrnoscrape.php?id=+id+&width=&height=,
132
133                url = string_resub("src=\"", "\"", tmpstr, 0);         
134                url = string_replace_all(" ", "", url, 1);
135                url = string_replace_all("+v_", "+", url, 1);
136                url = string_replace_all("'+", "+", url, 1);
137                url = string_replace_all("+'", "+", url, 1);
138                url = string_replace("+fid+", "+id+", url, 1);
139                url = string_replace("+id+", fid, url, 1);
140                url = string_replace("+width+", width, url, 1);
141                url = string_replace("+height+", height, url, 1);
142                url = string_replace("+stretching+", "", url, 1);
143// work start
144                free(url), url = NULL;
145                url = ostrcat("http://chupala.biggestplayer.me/streamcr.php?id=", fid, 0, 0);
146                url = ostrcat(url, "&width=620&height=460", 1, 0);
147// work end
148
149//              http://chupala.biggestplayer.me/streamcr.php?id=234556&width=620&height=460
150
151                tmpstr = gethttps(url, NULL, NULL, NULL, NULL, pageurl, 1);
152                free(host), host = NULL;
153                free(path), path = NULL;
154                host = string_resub("http://", "/", url, 0);
155                path = string_replace_all(host, "", url, 0);
156                path = string_replace_all("http://", "", path, 1);
157                path = string_replace_all(" ", "%20", path, 1);
158                titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast9_tmpstr", oitoa(incount), host, path, tmpstr);
159                streamurl = string_resub("file: \"", "\"", tmpstr, 0);
160/*
161                http://178.18.31.52:8081/liverepeater/224731/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9MTEvNi8yMDE1IDM6MDc6MDIgUE0maGFzaF92YWx1ZT1TUUJsM3JoVWNLKzIwVytTdVdRVThRPT0mdmFsaWRtaW51dGVzPTQ=
162*/
163        }
164        else
165        {
166
167                token = string_resub("securetoken: \"", "\"", tmpstr, 0);
168                debug(99, "token: %s", token);
169
170                streamurl = ostrcat(streamurl, url, 1, 0);
171                streamurl = ostrcat(streamurl, " swfUrl=http://p.jwpcdn.com/6/11/jwplayer.flash.swf", 1, 0);
172        //      streamurl = ostrcat(streamurl, swfurl, 1, 0);
173                streamurl = ostrcat(streamurl, " live=1", 1, 0);
174                streamurl = ostrcat(streamurl, " token=", 1, 0);
175                streamurl = ostrcat(streamurl, token, 1, 0);
176                streamurl = ostrcat(streamurl, " timeout=15", 1, 0);
177                streamurl = ostrcat(streamurl, " swfVfy=1", 1, 0);
178                streamurl = ostrcat(streamurl, " pageUrl=", 1, 0);
179                streamurl = ostrcat(streamurl, pageurl, 1, 0);
180/*
181                rtmp://31.220.2.148/redirect/espnusa swfUrl=http://p.jwpcdn.com/6/11/jwplayer.flash.swf live=1 token=%Zrey(nKa@#Z timeout=14 swfVfy=1 pageUrl=http://yotv.co/embed.php?live=espnusa&vw=620&vh=490
182                rtmp://31.220.2.148/redirect/espn2 swfUrl=http://p.jwpcdn.com/6/11/jwplayer.flash.swf live=1 token=%Zrey(nKa@#Z timeout=15 swfVfy=1 pageUrl=http://www.yotv.co/embed.php?live=espn2&vw=620&vh=490
183                rtmp://31.220.2.148/redirect/tsnx2 swfUrl=http://p.jwpcdn.com/6/11/jwplayer.flash.swf live=1 token=%Zrey(nKa@#Z timeout=15 swfVfy=1 pageUrl=http://www.yotv.co/embed.php?live=tsnx2&vw=620&vh=490
184*/
185        }
186
187        free(host), host = NULL;
188        free(path), path = NULL;
189        free(url), url = NULL;
190        free(token), token = NULL;
191        free(tmpstr), tmpstr = NULL;
192        free(fid), fid = NULL;
193        free(width), width = NULL;
194        free(height), height = NULL;
195        free(pageurl), pageurl = NULL;
196        free(swfurl), swfurl = NULL;
197       
198        debug(99, "streamurl %s", streamurl);
199        return streamurl;
200}
201
202#endif
Note: See TracBrowser for help on using the repository browser.