1 | #ifndef TVTOAST_H |
---|
2 | #define TVTOAST_H |
---|
3 | |
---|
4 | char* streamlive(char* link, int incount) |
---|
5 | { |
---|
6 | debug(99, "streamlive(%d) link=%s", incount, link); |
---|
7 | |
---|
8 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
9 | char* streamurl = NULL, *tmpstr = NULL, *tmpstr1 = NULL; |
---|
10 | char* streamer = NULL; |
---|
11 | char* playpath = NULL; |
---|
12 | char* swfurl = NULL; |
---|
13 | char* app = NULL; |
---|
14 | char* token = NULL; |
---|
15 | char* tmpurl = NULL; |
---|
16 | char* host = NULL; |
---|
17 | char* path = NULL; |
---|
18 | |
---|
19 | tmpstr = gethttps(link, NULL, NULL, NULL, NULL, NULL, 1); |
---|
20 | free(host), host = NULL; |
---|
21 | free(path), path = NULL; |
---|
22 | host = string_resub("http://", "/", link, 0); |
---|
23 | path = string_replace_all(host, "", link, 0); |
---|
24 | path = string_replace_all("http://", "", path, 1); |
---|
25 | path = string_replace_all(" ", "%20", path, 1); |
---|
26 | titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast4_tmpstr", oitoa(incount), host, path, tmpstr); |
---|
27 | |
---|
28 | tmpurl = string_resub("src='", "'", tmpstr, 0); |
---|
29 | free(tmpstr), tmpstr = NULL; |
---|
30 | |
---|
31 | tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1); |
---|
32 | free(host), host = NULL; |
---|
33 | free(path), path = NULL; |
---|
34 | host = string_resub("http://", "/", tmpurl, 0); |
---|
35 | path = string_replace_all(host, "", tmpurl, 0); |
---|
36 | path = string_replace_all("http://", "", path, 1); |
---|
37 | path = string_replace_all(" ", "%20", path, 1); |
---|
38 | titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast5_tmpstr", oitoa(incount), host, path, tmpstr); |
---|
39 | |
---|
40 | streamer = string_resub("streamer: \"", "\"", tmpstr, 0); |
---|
41 | streamer = string_replace_all("\\", "", streamer, 1); |
---|
42 | debug(99, "tvtoast5_tmpstr%d streamer=%s", incount, streamer) |
---|
43 | |
---|
44 | playpath = string_resub("file: \"", "\"", tmpstr, 0); |
---|
45 | playpath = string_replace_all(".flv", "", playpath, 1); |
---|
46 | debug(99, "tvtoast5_tmpstr%d playpath=%s", incount, playpath) |
---|
47 | |
---|
48 | swfurl = string_resub("type: 'flash', src: '", "'", tmpstr, 0); |
---|
49 | swfurl = string_replace_all("//", "http://", swfurl, 1); |
---|
50 | debug(99, "tvtoast5_tmpstr%d swfurl=%s", incount, swfurl) |
---|
51 | |
---|
52 | app = ostrcat(streamer, NULL, 0, 0); |
---|
53 | tmpstr1 = string_resub("rtmp://", "/", app, 0); |
---|
54 | app = string_replace(tmpstr1, "", app, 0); |
---|
55 | free(tmpstr1), tmpstr1 = NULL; |
---|
56 | app = string_replace_all("rtmp:///", "", app, 1); |
---|
57 | debug(99, "tvtoast5_tmpstr%d app5=%s", incount, app) |
---|
58 | |
---|
59 | tmpurl = string_resub("getJSON(\"", "\"", tmpstr, 0); |
---|
60 | tmpurl = string_replace_all("//", "http://", tmpurl, 1); |
---|
61 | free(tmpstr), tmpstr = NULL; |
---|
62 | |
---|
63 | tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1); |
---|
64 | free(host), host = NULL; |
---|
65 | free(path), path = NULL; |
---|
66 | host = string_resub("http://", "/", tmpurl, 0); |
---|
67 | path = string_replace_all(host, "", tmpurl, 0); |
---|
68 | path = string_replace_all("http://", "", path, 1); |
---|
69 | path = string_replace_all(" ", "%20", path, 1); |
---|
70 | titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast6_tmpstr", oitoa(incount), host, path, tmpstr); |
---|
71 | |
---|
72 | token = string_resub("{\"token\":\"", "\"", tmpstr, 0); |
---|
73 | |
---|
74 | streamurl = ostrcat(streamer, " app=", 0, 0); |
---|
75 | streamurl = ostrcat(streamurl, app, 1, 0); |
---|
76 | streamurl = ostrcat(streamurl, " playpath=", 1, 0); |
---|
77 | streamurl = ostrcat(streamurl, playpath, 1, 0); |
---|
78 | streamurl = ostrcat(streamurl, " swfUrl=", 1, 0); |
---|
79 | streamurl = ostrcat(streamurl, swfurl, 1, 0); |
---|
80 | streamurl = ostrcat(streamurl, " live=1", 1, 0); |
---|
81 | streamurl = ostrcat(streamurl, " timeout=15", 1, 0); |
---|
82 | streamurl = ostrcat(streamurl, " token=", 1, 0); |
---|
83 | streamurl = ostrcat(streamurl, token, 1, 0); |
---|
84 | streamurl = ostrcat(streamurl, " pageUrl=", 1, 0); |
---|
85 | streamurl = ostrcat(streamurl, tmpurl, 1, 0); |
---|
86 | |
---|
87 | /* |
---|
88 | rtmp://163.172.8.19:1935/edge/_definst_/?xs=_we_Mzcxamx1aXJsamNzamVufDE0NDY5MDkxODF8OTUuOTEuNi4yNXw1NjNjYzM3ZGIxNTU1fGQzOTYwODlmYjQyOGViYjRhZGQ0YjU3NDgwODY1Zjk2Nzk5ZTE4OWU. app=edge/_definst_/?xs=_we_Mzcxamx1aXJsamNzamVufDE0NDY5MDkxODF8OTUuOTEuNi4yNXw1NjNjYzM3ZGIxNTU1fGQzOTYwODlmYjQyOGViYjRhZGQ0YjU3NDgwODY1Zjk2Nzk5ZTE4OWU. playpath=371jluirljcsjen swfUrl=http://www.streamlive.to/ads/embed/player_ilive_embed.swf live=1 timeout=15 token=Qb582083d22804a892ce37092f7f3d2d pageUrl=http://www.streamlive.to/server.php?id=1446822781 |
---|
89 | */ |
---|
90 | |
---|
91 | free(streamer), streamer = NULL; |
---|
92 | free(app), app = NULL; |
---|
93 | free(playpath), playpath = NULL; |
---|
94 | free(swfurl), swfurl = NULL; |
---|
95 | free(token), token = NULL; |
---|
96 | free(host), host = NULL; |
---|
97 | free(path), path = NULL; |
---|
98 | |
---|
99 | debug(99, "streamurl %s", streamurl); |
---|
100 | return streamurl; |
---|
101 | } |
---|
102 | |
---|
103 | char* zerocast(char* link, int incount) |
---|
104 | { |
---|
105 | debug(99, "zerocast(%d) link=%s ", incount, link); |
---|
106 | char* streamurl = NULL; |
---|
107 | char* host = NULL; |
---|
108 | |
---|
109 | host = string_resub("http://", "/", link, 0); |
---|
110 | free(host), host = NULL; |
---|
111 | |
---|
112 | debug(99, "streamurl %s", streamurl); |
---|
113 | return streamurl; |
---|
114 | } |
---|
115 | |
---|
116 | char* usachannels(char* link, int incount) |
---|
117 | { |
---|
118 | debug(99, "usachannels(%d) link=%s", incount, link); |
---|
119 | char* streamurl = NULL; |
---|
120 | char* host = NULL; |
---|
121 | |
---|
122 | host = string_resub("http://", "/", link, 0); |
---|
123 | free(host), host = NULL; |
---|
124 | |
---|
125 | debug(99, "streamurl %s", streamurl); |
---|
126 | return streamurl; |
---|
127 | } |
---|
128 | |
---|
129 | char* cricfree(char* link, int incount) |
---|
130 | { |
---|
131 | debug(99, "cricfree(%d) link=%s", incount, link); |
---|
132 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
133 | |
---|
134 | char* url = NULL; |
---|
135 | char* token = NULL; |
---|
136 | char* streamurl = NULL; |
---|
137 | char* tmpstr = NULL; |
---|
138 | char* fid = NULL; |
---|
139 | char* width = NULL; |
---|
140 | char* height = NULL; |
---|
141 | char* pageurl = NULL; |
---|
142 | char* swfurl = NULL; |
---|
143 | char* host = NULL; |
---|
144 | char* path = NULL; |
---|
145 | |
---|
146 | tmpstr = gethttps(link, NULL, NULL, NULL, NULL, NULL, 1); |
---|
147 | host = string_resub("http://", "/", link, 0); |
---|
148 | path = string_replace_all(host, "", link, 0); |
---|
149 | path = string_replace_all("http://", "", path, 1); |
---|
150 | path = string_replace_all(" ", "%20", path, 1); |
---|
151 | titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast4_tmpstr", oitoa(incount), host, path, tmpstr); |
---|
152 | |
---|
153 | //<script type='text/javascript'>id='espnuk'; width='620'; height='490';</script><script type='text/javascript' src='http://theactionlive.com/livegamecr.js'></script> |
---|
154 | //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>'); |
---|
155 | |
---|
156 | fid = string_resub("id='", "'", tmpstr, 0); |
---|
157 | width = string_resub("v_width=", ";", tmpstr, 0); |
---|
158 | height = string_resub("v_height=", ";", tmpstr, 0); |
---|
159 | url = string_resub("src='", "'", tmpstr, 0); |
---|
160 | |
---|
161 | if(width == NULL) |
---|
162 | width = string_resub("width='", "'", tmpstr, 0); |
---|
163 | if(height == NULL) |
---|
164 | height = string_resub("height='", "'", tmpstr, 0); |
---|
165 | |
---|
166 | if(width == NULL) |
---|
167 | width = string_resub("var width = '", "'", tmpstr, 0); |
---|
168 | if(height == NULL) |
---|
169 | height = string_resub("var height = '", "'", tmpstr, 0); |
---|
170 | |
---|
171 | debug(99, "fid=%s width=%s height=%s", fid, width, height); |
---|
172 | |
---|
173 | tmpstr = gethttps(url, NULL, NULL, NULL, NULL, link, 1); |
---|
174 | free(host), host = NULL; |
---|
175 | free(path), path = NULL; |
---|
176 | host = string_resub("http://", "/", url, 0); |
---|
177 | path = string_replace_all(host, "", url, 0); |
---|
178 | path = string_replace_all("http://", "", path, 1); |
---|
179 | path = string_replace_all(" ", "%20", path, 1); |
---|
180 | titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast5_tmpstr", oitoa(incount), host, path, tmpstr); |
---|
181 | |
---|
182 | pageurl = string_resub("src=\"", "\"", tmpstr, 0); |
---|
183 | pageurl = string_replace_all(" ", "", pageurl, 1); |
---|
184 | pageurl = string_replace_all("+v_", "+", pageurl, 1); |
---|
185 | pageurl = string_replace("'+fid+'", "'+id+'", pageurl, 1); |
---|
186 | pageurl = string_replace("'+id+'", fid, pageurl, 1); |
---|
187 | pageurl = string_replace("'+width+'", width, pageurl, 1); |
---|
188 | pageurl = string_replace("'+height+'", height, pageurl, 1); |
---|
189 | pageurl = string_replace("'+stretching+'", "", pageurl, 1); |
---|
190 | |
---|
191 | tmpstr = gethttps(pageurl, NULL, NULL, NULL, NULL, link, 1); |
---|
192 | free(host), host = NULL; |
---|
193 | free(path), path = NULL; |
---|
194 | host = string_resub("http://", "/", pageurl, 0); |
---|
195 | path = string_replace_all(host, "", pageurl, 0); |
---|
196 | path = string_replace_all("http://", "", path, 1); |
---|
197 | path = string_replace_all(" ", "%20", path, 1); |
---|
198 | titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast6_tmpstr", oitoa(incount), host, path, tmpstr); |
---|
199 | |
---|
200 | url = string_resub("file: \"", "\"", tmpstr, 0); |
---|
201 | |
---|
202 | if(url == NULL) |
---|
203 | { |
---|
204 | // biggestplayer.me |
---|
205 | // url: http://biggestplayer.me/playercr.js, file=tithek_global.h, func=gethttps, line=124 |
---|
206 | |
---|
207 | fid = string_resub("id='", "'", tmpstr, 0); |
---|
208 | url = string_resub("src='", "'", tmpstr, 0); |
---|
209 | |
---|
210 | debug(99, "fid=%s url=%s", fid, url); |
---|
211 | |
---|
212 | url = string_replace_all(" ", "", url, 1); |
---|
213 | url = string_replace_all("+v_", "+", url, 1); |
---|
214 | url = string_replace_all("'+", "+", url, 1); |
---|
215 | url = string_replace_all("+'", "+", url, 1); |
---|
216 | url = string_replace("+fid+", "+id+", url, 1); |
---|
217 | url = string_replace("+id+", fid, url, 1); |
---|
218 | url = string_replace("+width+", width, url, 1); |
---|
219 | url = string_replace("+height+", height, url, 1); |
---|
220 | url = string_replace("+stretching+", "", url, 1); |
---|
221 | |
---|
222 | tmpstr = gethttps(url, NULL, NULL, NULL, NULL, link, 1); |
---|
223 | free(host), host = NULL; |
---|
224 | free(path), path = NULL; |
---|
225 | host = string_resub("http://", "/", url, 0); |
---|
226 | path = string_replace_all(host, "", url, 0); |
---|
227 | path = string_replace_all("http://", "", path, 1); |
---|
228 | path = string_replace_all(" ", "%20", path, 1); |
---|
229 | titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast7_tmpstr", oitoa(incount), host, path, tmpstr); |
---|
230 | |
---|
231 | // url: http://biggestplayer.me/streamcrnoscrape.php?id=+id+&width=&height=, |
---|
232 | |
---|
233 | url = string_resub("src=\"", "\"", tmpstr, 0); |
---|
234 | url = string_replace_all(" ", "", url, 1); |
---|
235 | url = string_replace_all("+v_", "+", url, 1); |
---|
236 | url = string_replace_all("'+", "+", url, 1); |
---|
237 | url = string_replace_all("+'", "+", url, 1); |
---|
238 | url = string_replace("+fid+", "+id+", url, 1); |
---|
239 | url = string_replace("+id+", fid, url, 1); |
---|
240 | url = string_replace("+width+", width, url, 1); |
---|
241 | url = string_replace("+height+", height, url, 1); |
---|
242 | url = string_replace("+stretching+", "", url, 1); |
---|
243 | |
---|
244 | tmpstr = gethttps(url, NULL, NULL, NULL, NULL, pageurl, 1); |
---|
245 | free(host), host = NULL; |
---|
246 | free(path), path = NULL; |
---|
247 | host = string_resub("http://", "/", url, 0); |
---|
248 | path = string_replace_all(host, "", url, 0); |
---|
249 | path = string_replace_all("http://", "", path, 1); |
---|
250 | path = string_replace_all(" ", "%20", path, 1); |
---|
251 | titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast8_tmpstr", oitoa(incount), host, path, tmpstr); |
---|
252 | streamurl = string_resub("file: \"", "\"", tmpstr, 0); |
---|
253 | /* |
---|
254 | http://178.18.31.52:8081/liverepeater/224731/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9MTEvNi8yMDE1IDM6MDc6MDIgUE0maGFzaF92YWx1ZT1TUUJsM3JoVWNLKzIwVytTdVdRVThRPT0mdmFsaWRtaW51dGVzPTQ= |
---|
255 | */ |
---|
256 | } |
---|
257 | else |
---|
258 | { |
---|
259 | |
---|
260 | token = string_resub("securetoken: \"", "\"", tmpstr, 0); |
---|
261 | debug(99, "token: %s", token); |
---|
262 | |
---|
263 | streamurl = ostrcat(streamurl, url, 1, 0); |
---|
264 | streamurl = ostrcat(streamurl, " swfUrl=http://p.jwpcdn.com/6/11/jwplayer.flash.swf", 1, 0); |
---|
265 | // streamurl = ostrcat(streamurl, swfurl, 1, 0); |
---|
266 | streamurl = ostrcat(streamurl, " live=1", 1, 0); |
---|
267 | streamurl = ostrcat(streamurl, " token=", 1, 0); |
---|
268 | streamurl = ostrcat(streamurl, token, 1, 0); |
---|
269 | streamurl = ostrcat(streamurl, " timeout=15", 1, 0); |
---|
270 | streamurl = ostrcat(streamurl, " swfVfy=1", 1, 0); |
---|
271 | streamurl = ostrcat(streamurl, " pageUrl=", 1, 0); |
---|
272 | streamurl = ostrcat(streamurl, pageurl, 1, 0); |
---|
273 | /* |
---|
274 | 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 |
---|
275 | 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 |
---|
276 | 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 |
---|
277 | */ |
---|
278 | } |
---|
279 | |
---|
280 | free(host), host = NULL; |
---|
281 | free(path), path = NULL; |
---|
282 | free(url), url = NULL; |
---|
283 | free(token), token = NULL; |
---|
284 | free(tmpstr), tmpstr = NULL; |
---|
285 | free(fid), fid = NULL; |
---|
286 | free(width), width = NULL; |
---|
287 | free(height), height = NULL; |
---|
288 | free(pageurl), pageurl = NULL; |
---|
289 | free(swfurl), swfurl = NULL; |
---|
290 | |
---|
291 | debug(99, "streamurl %s", streamurl); |
---|
292 | return streamurl; |
---|
293 | } |
---|
294 | |
---|
295 | char* tvtoast(char* link) |
---|
296 | { |
---|
297 | debug(99, "link %s", link); |
---|
298 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
299 | char* streamurl = NULL, *tmpstr = NULL, *tmpstr1 = NULL; |
---|
300 | char* title = NULL, *pic = NULL; |
---|
301 | char* typemsg = NULL; |
---|
302 | char* host = NULL; |
---|
303 | char* path = NULL; |
---|
304 | char* url = NULL; |
---|
305 | |
---|
306 | system("rm -rf /var/usr/local/share/titan/plugins/tithek/tvtoast*"); |
---|
307 | |
---|
308 | host = string_resub("http://", "/", link, 0); |
---|
309 | path = string_replace_all(host, "", link, 0); |
---|
310 | path = string_replace_all("http://", "", path, 1); |
---|
311 | path = string_replace_all(" ", "%20", path, 1); |
---|
312 | tmpstr = gethttps(link, NULL, NULL, NULL, NULL, NULL, 1); |
---|
313 | titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast1_tmpstr", "1", host, path, tmpstr); |
---|
314 | |
---|
315 | tmpstr1 = string_resub("<ul class=\"player-top-links\">", "<div class=\"float-clear\"></div>", tmpstr, 0); |
---|
316 | titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast2_tmpstr_tmpstr1_resub", "1", host, path, tmpstr1); |
---|
317 | free(host), host = NULL; |
---|
318 | free(path), path = NULL; |
---|
319 | |
---|
320 | free(tmpstr), tmpstr = NULL; |
---|
321 | printf("tmpstr1: %s\n",tmpstr1); |
---|
322 | |
---|
323 | int count = 0, i = 0, incount = 0; |
---|
324 | struct splitstr* ret1 = NULL; |
---|
325 | struct menulist* mlist = NULL, *mbox = NULL; |
---|
326 | ret1 = strsplit(tmpstr1, "\n", &count); |
---|
327 | for(i = 0; i < count; i++) |
---|
328 | { |
---|
329 | if(ret1[i].part != NULL && strlen(ret1[i].part) > 1) |
---|
330 | { |
---|
331 | if(ostrstr(ret1[i].part, "http://tvtoast.com/") != NULL) |
---|
332 | { |
---|
333 | incount++; |
---|
334 | printf("####################### start (%d) ############################\n", incount); |
---|
335 | |
---|
336 | url = string_resub("<a href=\"", "\"", ret1[i].part, 0); |
---|
337 | url = string_replace_all(" ", "%20", url, 1); |
---|
338 | tmpstr = gethttps(url, NULL, NULL, NULL, NULL, NULL, 1); |
---|
339 | host = string_resub("http://", "/", url, 0); |
---|
340 | path = string_replace_all(host, "", url, 0); |
---|
341 | path = string_replace_all("http://", "", path, 1); |
---|
342 | path = string_replace_all(" ", "%20", path, 1); |
---|
343 | titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast3_tmpstr", oitoa(incount), host, path, tmpstr); |
---|
344 | free(url), url = NULL; |
---|
345 | url = string_resub("src=\"", "\"", tmpstr, 0); |
---|
346 | typemsg = string_resub("http://", "/", url, 0); |
---|
347 | |
---|
348 | if(ostrstr(url, "www.streamlive.to") != NULL) |
---|
349 | streamurl = streamlive(url, incount); |
---|
350 | |
---|
351 | if(ostrstr(url, "zerocast.tv") != NULL) |
---|
352 | streamurl = zerocast(url, incount); |
---|
353 | |
---|
354 | if(ostrstr(url, "usachannels.tv") != NULL) |
---|
355 | streamurl = usachannels(url, incount); |
---|
356 | |
---|
357 | if(ostrstr(url, "cricfree.sx") != NULL) |
---|
358 | streamurl = cricfree(url, incount); |
---|
359 | |
---|
360 | debug(99, "streamurl%d streamurl: %s", incount, streamurl); |
---|
361 | |
---|
362 | //////////////////// |
---|
363 | if(ostrstr(streamurl, "rtmp") != NULL) |
---|
364 | title = ostrcat("Rtmpe Stream (", NULL, 0, 0); |
---|
365 | else |
---|
366 | title = ostrcat("Http Stream (", NULL, 0, 0); |
---|
367 | |
---|
368 | title = ostrcat(title, oitoa(incount), 1, 1); |
---|
369 | title = ostrcat(title, ")", 1, 0); |
---|
370 | if(typemsg != NULL) |
---|
371 | { |
---|
372 | title = ostrcat(title, " (", 1, 0); |
---|
373 | title = ostrcat(title, typemsg, 1, 0); |
---|
374 | title = ostrcat(title, ")", 1, 0); |
---|
375 | } |
---|
376 | pic = ostrcat("flv.png", NULL, 0, 0); |
---|
377 | |
---|
378 | if(streamurl != NULL) |
---|
379 | { |
---|
380 | debug(199, "(%d) title: %s streamurl: %s\n", i, title, streamurl); |
---|
381 | addmenulist(&mlist, title, streamurl, pic, 0, 0); |
---|
382 | } |
---|
383 | |
---|
384 | free(title), title = NULL; |
---|
385 | free(pic), pic = NULL; |
---|
386 | free(streamurl), streamurl = NULL; |
---|
387 | free(typemsg), typemsg = NULL; |
---|
388 | free(url), url = NULL; |
---|
389 | free(host), host = NULL; |
---|
390 | free(path), path = NULL; |
---|
391 | printf("####################### stop (%d) ############################\n", incount); |
---|
392 | } |
---|
393 | } |
---|
394 | } |
---|
395 | free(ret1), ret1 = NULL; |
---|
396 | |
---|
397 | if(mlist != NULL) |
---|
398 | { |
---|
399 | mbox = menulistbox(mlist, NULL, _("Stream Menu"), _("Choose your Streaming Format from the following list"), NULL, NULL, 1, 0); |
---|
400 | if(mbox != NULL) |
---|
401 | { |
---|
402 | free(streamurl), streamurl = NULL; |
---|
403 | |
---|
404 | debug(99, "mbox->name %s", mbox->name); |
---|
405 | debug(99, "mbox->text %s", mbox->text); |
---|
406 | streamurl = ostrcat(mbox->text, NULL, 0, 0); |
---|
407 | |
---|
408 | } |
---|
409 | } |
---|
410 | free(tmpstr); tmpstr = NULL; |
---|
411 | free(host), host = NULL; |
---|
412 | free(path), path = NULL; |
---|
413 | free(url), url = NULL; |
---|
414 | |
---|
415 | titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast_tmpstr10_streamurl", NULL, NULL, NULL, tmpstr); |
---|
416 | |
---|
417 | debug(99, "streamurl: %s", streamurl); |
---|
418 | return streamurl; |
---|
419 | } |
---|
420 | |
---|
421 | int tvtoast_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag) |
---|
422 | { |
---|
423 | char* tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *menu = NULL, *search = NULL; |
---|
424 | int ret = 1, count = 0, i = 0; |
---|
425 | |
---|
426 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
427 | return ret; |
---|
428 | |
---|
429 | if(searchstr == NULL) |
---|
430 | search = textinputhist(_("Search"), " ", "searchhist"); |
---|
431 | else |
---|
432 | search = textinputhist(_("Search"), searchstr, "searchhist"); |
---|
433 | |
---|
434 | if(search != NULL) |
---|
435 | { |
---|
436 | drawscreen(load, 0, 0); |
---|
437 | |
---|
438 | strstrip(search); |
---|
439 | string_tolower(search); |
---|
440 | |
---|
441 | tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/tvtoast/streams/tvtoast.all-sorted.list", 80, NULL, HTTPAUTH, 5000, NULL, 0); |
---|
442 | |
---|
443 | struct splitstr* ret1 = NULL; |
---|
444 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
445 | |
---|
446 | if(ret1 != NULL) |
---|
447 | { |
---|
448 | int max = count; |
---|
449 | for(i = 0; i < max; i++) |
---|
450 | { |
---|
451 | |
---|
452 | tmpstr1 = ostrcat(ret1[i].part, NULL, 0, 0); |
---|
453 | tmpstr1 = stringreplacecharonce(tmpstr1, '#', '\0'); |
---|
454 | string_tolower(tmpstr1); |
---|
455 | |
---|
456 | if(ostrstr(tmpstr1, search) != NULL) |
---|
457 | { |
---|
458 | printf("found: %s\n", ret1[i].part); |
---|
459 | int rcret = waitrc(NULL, 10, 0); |
---|
460 | if(rcret == getrcconfigint("rcexit", NULL)) break; |
---|
461 | |
---|
462 | line = ostrcat(line, ret1[i].part, 1, 0); |
---|
463 | line = ostrcat(line, "\n", 0, 0); |
---|
464 | } |
---|
465 | free(tmpstr1), tmpstr1 = NULL; |
---|
466 | } |
---|
467 | free(ret1), ret1 = NULL; |
---|
468 | |
---|
469 | if(line != NULL) |
---|
470 | { |
---|
471 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
472 | menu = ostrcat("/tmp/tithek/tvtoast.search.list", NULL, 0, 0); |
---|
473 | writesys(menu, line, 0); |
---|
474 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
475 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
476 | ret = 0; |
---|
477 | } |
---|
478 | } |
---|
479 | free(tmpstr), tmpstr = NULL; |
---|
480 | } |
---|
481 | free(search), search = NULL; |
---|
482 | return ret; |
---|
483 | } |
---|
484 | |
---|
485 | #endif |
---|