Changeset 36130 for titan/plugins
- Timestamp:
- 11/09/15 15:10:27 (8 years ago)
- Location:
- titan/plugins/tithek
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/tithek/tvtoast.h
r36122 r36130 1 1 #ifndef TVTOAST_H 2 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 char* id = NULL;19 /*20 char* streamurl1 = NULL;21 char* title = NULL;22 char* pic = NULL;23 char* typemsg = NULL;24 25 typemsg = string_resub("http://", "/", link, 0);26 */27 /*28 http://www.streamlive.to/embedplayer_new.php?width=640&height=480&channel=71562&autoplay=true29 http://www.streamlive.to/view/72736/BT_Sport_2-live-stream-channel30 */31 if(ostrstr(link, "http://www.streamlive.to/view/") != NULL)32 {33 id = string_resub("/view/", "/", link, 0);34 tmpurl = ostrcat("http://www.streamlive.to/embedplayer_new.php?width=640&height=480&channel=", id, 0, 0);35 tmpurl = ostrcat(tmpurl, "&autoplay=true", 1, 0);36 }37 else38 tmpurl = ostrcat(link, NULL, 0, 0);39 40 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1);41 host = string_resub("http://", "/", tmpurl, 0);42 path = string_replace_all(host, "", tmpurl, 0);43 path = string_replace_all("http://", "", path, 1);44 path = string_replace_all(" ", "%20", path, 1);45 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast4_tmpstr", oitoa(incount), host, path, tmpstr);46 free(tmpurl), tmpurl = NULL;47 48 if(ostrstr(tmpstr, "rtmp") == NULL)49 {50 tmpurl = string_resub("src='", "'", tmpstr, 0);51 free(tmpstr), tmpstr = NULL;52 53 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1);54 free(host), host = NULL;55 free(path), path = NULL;56 host = string_resub("http://", "/", tmpurl, 0);57 path = string_replace_all(host, "", tmpurl, 0);58 path = string_replace_all("http://", "", path, 1);59 path = string_replace_all(" ", "%20", path, 1);60 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast5_tmpstr", oitoa(incount), host, path, tmpstr);61 }62 /*63 if(ostrstr(tmpstr, "'file': 'http") != NULL)64 {65 streamurl1 = string_resub("'file': 'http", "'", tmpstr, 0);66 streamurl1 = ostrcat("http", streamurl1, 0, 1);67 }68 */69 streamer = string_resub("streamer: \"", "\"", tmpstr, 0);70 streamer = string_replace_all("\\", "", streamer, 1);71 debug(99, "tvtoast5_tmpstr%d streamer=%s", incount, streamer)72 if(streamer != NULL)73 {74 playpath = string_resub("file: \"", "\"", tmpstr, 0);75 playpath = string_replace_all(".flv", "", playpath, 1);76 debug(99, "tvtoast5_tmpstr%d playpath=%s", incount, playpath)77 78 swfurl = string_resub("type: 'flash', src: '", "'", tmpstr, 0);79 swfurl = string_replace_all("//", "http://", swfurl, 1);80 debug(99, "tvtoast5_tmpstr%d swfurl=%s", incount, swfurl)81 82 app = ostrcat(streamer, NULL, 0, 0);83 tmpstr1 = string_resub("rtmp://", "/", app, 0);84 app = string_replace(tmpstr1, "", app, 0);85 free(tmpstr1), tmpstr1 = NULL;86 app = string_replace_all("rtmp:///", "", app, 1);87 debug(99, "tvtoast5_tmpstr%d app5=%s", incount, app)88 89 tmpurl = string_resub("getJSON(\"", "\"", tmpstr, 0);90 tmpurl = string_replace_all("//", "http://", tmpurl, 1);91 free(tmpstr), tmpstr = NULL;92 93 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1);94 free(host), host = NULL;95 free(path), path = NULL;96 host = string_resub("http://", "/", tmpurl, 0);97 path = string_replace_all(host, "", tmpurl, 0);98 path = string_replace_all("http://", "", path, 1);99 path = string_replace_all(" ", "%20", path, 1);100 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast6_tmpstr", oitoa(incount), host, path, tmpstr);101 102 token = string_resub("{\"token\":\"", "\"", tmpstr, 0);103 free(tmpstr), tmpstr = NULL;104 105 streamurl = ostrcat(streamer, " app=", 0, 0);106 streamurl = ostrcat(streamurl, app, 1, 0);107 streamurl = ostrcat(streamurl, " playpath=", 1, 0);108 streamurl = ostrcat(streamurl, playpath, 1, 0);109 streamurl = ostrcat(streamurl, " swfUrl=", 1, 0);110 streamurl = ostrcat(streamurl, swfurl, 1, 0);111 streamurl = ostrcat(streamurl, " live=1", 1, 0);112 streamurl = ostrcat(streamurl, " timeout=15", 1, 0);113 streamurl = ostrcat(streamurl, " token=", 1, 0);114 streamurl = ostrcat(streamurl, token, 1, 0);115 streamurl = ostrcat(streamurl, " pageUrl=", 1, 0);116 streamurl = ostrcat(streamurl, tmpurl, 1, 0);117 118 /*119 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=1446822781120 */121 122 /*123 http://163.172.8.19:1935/edge/_definst_/r3t8xd8ss6pdequ/playlist.m3u8?xs=_we_cjN0OHhkOHNzNnBkZXF1fDE0NDcwNzY3Mjh8OTUuOTEuNi4yNXw1NjNmNTFmODVkZTRmfGNiMDZjMWNhN2UwNTAxYmQzNThkM2I3ZGJjOTVhNmY2YmNlNDg1NGY.124 125 streamurl = ostrcat(streamurl, "\n", 1, 0);126 if(streamurl1 != NULL)127 {128 streamurl = ostrcat(streamurl, streamurl1, 1, 0);129 tmpstr = ostrcat(streamurl, NULL, 0, 0);130 }131 132 if(incount == -1 && streamurl1 != NULL)133 {134 135 incount = 0;136 int count = 0, i = 0;137 struct splitstr* ret1 = NULL;138 struct menulist* mlist = NULL, *mbox = NULL;139 ret1 = strsplit(tmpstr, "\n", &count);140 for(i = 0; i < count; i++)141 {142 incount++;143 144 free(streamurl), streamurl = NULL;145 streamurl = ostrcat(ret1[i].part, NULL, 0, 0);146 147 if(ostrstr(streamurl, "rtmp") != NULL)148 title = ostrcat("Rtmpe Stream (", NULL, 0, 0);149 else150 title = ostrcat("Http Stream (", NULL, 0, 0);151 152 title = ostrcat(title, oitoa(incount), 1, 1);153 title = ostrcat(title, ")", 1, 0);154 if(typemsg != NULL)155 {156 title = ostrcat(title, " (", 1, 0);157 title = ostrcat(title, typemsg, 1, 0);158 title = ostrcat(title, ")", 1, 0);159 }160 pic = ostrcat("flv.png", NULL, 0, 0);161 162 if(streamurl != NULL)163 {164 debug(99, "(%d) title: %s streamurl: %s\n", i, title, streamurl);165 addmenulist(&mlist, title, streamurl, pic, 0, 0);166 }167 168 free(title), title = NULL;169 free(pic), pic = NULL;170 }171 free(ret1), ret1 = NULL;172 if(mlist != NULL)173 {174 mbox = menulistbox(mlist, NULL, _("Stream Menu"), _("Choose your Streaming Format from the following list"), NULL, NULL, 1, 0);175 if(mbox != NULL)176 {177 free(streamurl), streamurl = NULL;178 179 debug(99, "mbox->name %s", mbox->name);180 debug(99, "mbox->text %s", mbox->text);181 streamurl = ostrcat(mbox->text, NULL, 0, 0);182 183 }184 }185 }186 free(streamurl1), streamurl1 = NULL;187 */188 }189 else190 {191 free(streamurl), streamurl = NULL;192 if(ostrstr(tmpstr, "'file': 'http") != NULL)193 streamurl = string_resub("'file': 'http", "'", tmpstr, 0);194 }195 free(streamer), streamer = NULL;196 free(app), app = NULL;197 free(playpath), playpath = NULL;198 free(swfurl), swfurl = NULL;199 free(token), token = NULL;200 free(host), host = NULL;201 free(path), path = NULL;202 free(id), id = NULL;203 204 debug(99, "streamurl %s", streamurl);205 return streamurl;206 }207 3 208 4 char* zerocast(char* link, int incount) … … 228 24 free(host), host = NULL; 229 25 230 debug(99, "streamurl %s", streamurl);231 return streamurl;232 }233 234 char* cricfree(char* link, int incount)235 {236 debug(99, "cricfree(%d) link=%s", incount, link);237 int debuglevel = getconfigint("debuglevel", NULL);238 239 char* url = NULL;240 char* token = NULL;241 char* streamurl = NULL;242 char* tmpstr = NULL;243 char* fid = NULL;244 char* width = NULL;245 char* height = NULL;246 char* pageurl = NULL;247 char* swfurl = NULL;248 char* host = NULL;249 char* path = NULL;250 251 tmpstr = gethttps(link, NULL, NULL, NULL, NULL, NULL, 1);252 host = string_resub("http://", "/", link, 0);253 path = string_replace_all(host, "", link, 0);254 path = string_replace_all("http://", "", path, 1);255 path = string_replace_all(" ", "%20", path, 1);256 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast4_tmpstr", oitoa(incount), host, path, tmpstr);257 258 //<script type='text/javascript'>id='espnuk'; width='620'; height='490';</script><script type='text/javascript' src='http://theactionlive.com/livegamecr.js'></script>259 //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>');260 261 fid = string_resub("id='", "'", tmpstr, 0);262 width = string_resub("v_width=", ";", tmpstr, 0);263 height = string_resub("v_height=", ";", tmpstr, 0);264 url = string_resub("src='", "'", tmpstr, 0);265 266 if(width == NULL)267 width = string_resub("width='", "'", tmpstr, 0);268 if(height == NULL)269 height = string_resub("height='", "'", tmpstr, 0);270 271 if(width == NULL)272 width = string_resub("var width = '", "'", tmpstr, 0);273 if(height == NULL)274 height = string_resub("var height = '", "'", tmpstr, 0);275 276 debug(99, "fid=%s width=%s height=%s", fid, width, height);277 278 tmpstr = gethttps(url, NULL, NULL, NULL, NULL, link, 1);279 free(host), host = NULL;280 free(path), path = NULL;281 host = string_resub("http://", "/", url, 0);282 path = string_replace_all(host, "", url, 0);283 path = string_replace_all("http://", "", path, 1);284 path = string_replace_all(" ", "%20", path, 1);285 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast5_tmpstr", oitoa(incount), host, path, tmpstr);286 287 pageurl = string_resub("src=\"", "\"", tmpstr, 0);288 pageurl = string_replace_all(" ", "", pageurl, 1);289 pageurl = string_replace_all("+v_", "+", pageurl, 1);290 pageurl = string_replace("'+fid+'", "'+id+'", pageurl, 1);291 pageurl = string_replace("'+id+'", fid, pageurl, 1);292 pageurl = string_replace("'+width+'", width, pageurl, 1);293 pageurl = string_replace("'+height+'", height, pageurl, 1);294 pageurl = string_replace("'+stretching+'", "", pageurl, 1);295 296 tmpstr = gethttps(pageurl, NULL, NULL, NULL, NULL, link, 1);297 free(host), host = NULL;298 free(path), path = NULL;299 host = string_resub("http://", "/", pageurl, 0);300 path = string_replace_all(host, "", pageurl, 0);301 path = string_replace_all("http://", "", path, 1);302 path = string_replace_all(" ", "%20", path, 1);303 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast6_tmpstr", oitoa(incount), host, path, tmpstr);304 305 url = string_resub("file: \"", "\"", tmpstr, 0);306 307 if(url == NULL)308 {309 // biggestplayer.me310 // url: http://biggestplayer.me/playercr.js, file=tithek_global.h, func=gethttps, line=124311 312 fid = string_resub("id='", "'", tmpstr, 0);313 url = string_resub("src='", "'", tmpstr, 0);314 315 debug(99, "fid=%s url=%s", fid, url);316 317 url = string_replace_all(" ", "", url, 1);318 url = string_replace_all("+v_", "+", url, 1);319 url = string_replace_all("'+", "+", url, 1);320 url = string_replace_all("+'", "+", url, 1);321 url = string_replace("+fid+", "+id+", url, 1);322 url = string_replace("+id+", fid, url, 1);323 url = string_replace("+width+", width, url, 1);324 url = string_replace("+height+", height, url, 1);325 url = string_replace("+stretching+", "", url, 1);326 327 tmpstr = gethttps(url, NULL, NULL, NULL, NULL, link, 1);328 free(host), host = NULL;329 free(path), path = NULL;330 host = string_resub("http://", "/", url, 0);331 path = string_replace_all(host, "", url, 0);332 path = string_replace_all("http://", "", path, 1);333 path = string_replace_all(" ", "%20", path, 1);334 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast7_tmpstr", oitoa(incount), host, path, tmpstr);335 336 // url: http://biggestplayer.me/streamcrnoscrape.php?id=+id+&width=&height=,337 338 url = string_resub("src=\"", "\"", tmpstr, 0);339 url = string_replace_all(" ", "", url, 1);340 url = string_replace_all("+v_", "+", url, 1);341 url = string_replace_all("'+", "+", url, 1);342 url = string_replace_all("+'", "+", url, 1);343 url = string_replace("+fid+", "+id+", url, 1);344 url = string_replace("+id+", fid, url, 1);345 url = string_replace("+width+", width, url, 1);346 url = string_replace("+height+", height, url, 1);347 url = string_replace("+stretching+", "", url, 1);348 349 tmpstr = gethttps(url, NULL, NULL, NULL, NULL, pageurl, 1);350 free(host), host = NULL;351 free(path), path = NULL;352 host = string_resub("http://", "/", url, 0);353 path = string_replace_all(host, "", url, 0);354 path = string_replace_all("http://", "", path, 1);355 path = string_replace_all(" ", "%20", path, 1);356 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast8_tmpstr", oitoa(incount), host, path, tmpstr);357 streamurl = string_resub("file: \"", "\"", tmpstr, 0);358 /*359 http://178.18.31.52:8081/liverepeater/224731/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9MTEvNi8yMDE1IDM6MDc6MDIgUE0maGFzaF92YWx1ZT1TUUJsM3JoVWNLKzIwVytTdVdRVThRPT0mdmFsaWRtaW51dGVzPTQ=360 */361 }362 else363 {364 365 token = string_resub("securetoken: \"", "\"", tmpstr, 0);366 debug(99, "token: %s", token);367 368 streamurl = ostrcat(streamurl, url, 1, 0);369 streamurl = ostrcat(streamurl, " swfUrl=http://p.jwpcdn.com/6/11/jwplayer.flash.swf", 1, 0);370 // streamurl = ostrcat(streamurl, swfurl, 1, 0);371 streamurl = ostrcat(streamurl, " live=1", 1, 0);372 streamurl = ostrcat(streamurl, " token=", 1, 0);373 streamurl = ostrcat(streamurl, token, 1, 0);374 streamurl = ostrcat(streamurl, " timeout=15", 1, 0);375 streamurl = ostrcat(streamurl, " swfVfy=1", 1, 0);376 streamurl = ostrcat(streamurl, " pageUrl=", 1, 0);377 streamurl = ostrcat(streamurl, pageurl, 1, 0);378 /*379 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=490380 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=490381 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=490382 */383 }384 385 free(host), host = NULL;386 free(path), path = NULL;387 free(url), url = NULL;388 free(token), token = NULL;389 free(tmpstr), tmpstr = NULL;390 free(fid), fid = NULL;391 free(width), width = NULL;392 free(height), height = NULL;393 free(pageurl), pageurl = NULL;394 free(swfurl), swfurl = NULL;395 396 26 debug(99, "streamurl %s", streamurl); 397 27 return streamurl; -
titan/plugins/tithek/youtube.h
r36127 r36130 49 49 */ 50 50 51 tmpstr = gethttps(tmplink, NULL, NULL, NULL, NULL, 1);51 tmpstr = gethttps(tmplink, NULL, NULL, NULL, NULL, NULL, 1); 52 52 writesys("/var/usr/local/share/titan/plugins/tithek/youtube_tmpstr", tmpstr, 0); 53 53 free(tmplink), tmplink = NULL; … … 273 273 274 274 char* tmpstr = NULL; 275 tmpstr = gethttps(url, NULL, NULL, NULL, NULL, 1);275 tmpstr = gethttps(url, NULL, NULL, NULL, NULL, NULL, 1); 276 276 writesys("/var/usr/local/share/titan/plugins/tithek/tmpstr1", tmpstr, 0); 277 277
Note: See TracChangeset
for help on using the changeset viewer.