Changeset 28903
- Timestamp:
- May 7, 2014, 8:25:38 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/tithek/tvtoast.h
r28839 r28903 8 8 char* ip = NULL, *pos = NULL, *path = NULL, *fid = NULL, *streamurl = NULL, *tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *channelid = NULL; 9 9 char* tmppath = NULL, *streamurl1 = NULL, *logfile = NULL, *tmpurl = NULL, *streamport = NULL, *streamip = NULL, *streamid = NULL, *tmphost = NULL, *title = NULL, *pic = NULL; 10 10 char* streamer = NULL; 11 char* playpath = NULL; 12 char* swfUrl = NULL; 13 //char* pageUrl = NULL; 14 char* app = NULL; 15 char* url = NULL; 16 char* Cookie1 = NULL; 17 char* tmpstr4 = NULL; 18 char* tmpstr5 = NULL; 19 char* token = NULL; 20 char* typemsg = NULL; 21 char* referer = NULL; 22 char* send = NULL; 23 char* tmpstr3 = NULL; 24 char* pageurlid = NULL; 25 char* pageurl = NULL; 26 char* cmd = NULL; 27 char* urlid = NULL; 28 char* tokenid = NULL; 29 char* check = NULL; 30 11 31 ip = string_replace("http://", "", (char*)link, 0); 12 32 … … 49 69 if(ostrstr(ret1[i].part, "http://tvtoast.com/") != NULL) 50 70 { 51 // debug(99, "Round (%d) found tvtoast.com link", i);52 71 incount++; 53 72 printf("####################### start (%d) ############################\n", incount); 73 74 referer = string_resub("<a href=\"", "\"", ret1[i].part, 0); 54 75 tmphost = string_resub("http://", "/", ret1[i].part, 0); 55 76 tmppath = string_resub("http://tvtoast.com/", "\"", ret1[i].part, 0); 56 77 tmppath = string_replace_all(" ", "%20", tmppath, 1); 78 printf("tmphost: %s\n",tmphost); 79 printf("tmppath: %s\n",tmppath); 57 80 58 81 tmpstr = gethttp(tmphost, tmppath, 80, NULL, NULL, 10000, NULL, 0); 82 59 83 logfile = ostrcat(logfile, "/var/usr/local/share/titan/plugins/tithek/tvtoast_tmpstr2_", 1, 0); 60 84 logfile = ostrcat(logfile, oitoa(incount), 1, 1); … … 69 93 free(tmpstr2), tmpstr2 = NULL; 70 94 71 72 95 if(ostrstr(tmpstr, "channel.php?a=") != NULL) 73 96 www = 0; … … 75 98 tmpurl = string_resub("src=\"", "\"", tmpstr, 0); 76 99 tmphost = string_resub("http://", "/", tmpurl, 0); 100 typemsg = ostrcat(tmphost, NULL, 0, 0); 101 77 102 tmppath = string_replace_all(tmphost, "", tmpurl, 0); 78 103 tmppath = string_replace_all("http://", "", tmppath, 1); 79 tmpstr = gethttp(tmphost, tmppath, 80, NULL, NULL, 10000, NULL, 0); 104 105 106 107 108 109 send = ostrcat(NULL, "GET ", 0, 0); 110 send = ostrcat(send, tmppath, 1, 0); 111 send = ostrcat(send, " HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: ", 1, 0); 112 send = ostrcat(send, tmphost, 1, 0); 113 send = ostrcat(send, "\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1\r\nConnection: close\r\n", 1, 0); 114 send = ostrcat(send, "Referer: ", 1, 0); 115 send = ostrcat(send, referer, 1, 0); 116 117 //send = ostrcat(send, "\r\nCookie: ", 1, 0); 118 //send = ostrcat(send, Cookie1, 1, 0); 119 send = ostrcat(send, "\r\n\r\n", 1, 0); 120 121 debug(99, "send: %s", send); 122 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 123 free(send), send = NULL; 124 125 // tmpstr = gethttp(tmphost, tmppath, 80, NULL, NULL, 10000, NULL, 0); 126 127 // referer = ostrcat(tmpurl, NULL, 0, 0); 80 128 81 129 logfile = ostrcat(logfile, "/var/usr/local/share/titan/plugins/tithek/tvtoast_tmpstr3b_", 1, 0); … … 86 134 writesys(logfile, tmpstr, 0); 87 135 free(logfile), logfile = NULL; 88 // free(tmppath), tmppath = NULL;89 // free(tmphost), tmphost = NULL;90 136 free(tmpurl), tmpurl = NULL; 91 137 free(tmpstr2), tmpstr2 = NULL; 92 138 139 check = string_resub("file: \"", "\"", tmpstr, 0); 140 if(ostrstr(check, "rtmpe://5.135.128.157:1935") != NULL) 141 { 142 printf("####################################################\n"); 143 printf("streamid: %s\n",streamid); 144 printf("check: %s\n",check); 145 printf("fid: %s\n",fid); 146 printf("####################################################\n"); 147 148 //rtmpdump -r rtmpe://strm.ukcast.tv/redirect -y bhousaa0 --debug 149 //rtmpdump -r rtmpe://5.135.128.157:1935/ula/abc8815 --debug 150 cmd = ostrcat("rtmpdump -r ", NULL, 0, 0); 151 cmd = ostrcat(cmd, check, 1, 0); 152 cmd = ostrcat(cmd, " --debug > /tmp/tithek/rtmp.log 2>&1", 1, 0); 153 system("rm -rf /tmp/tithek/rtmp.log"); 154 155 free(tmpstr), tmpstr = NULL; 156 printf("cmd: %s\n",cmd); 157 system(cmd); 158 free(cmd),cmd = NULL; 159 160 tmpstr = command("cat /tmp/tithek/rtmp.log"); 161 162 streamip = string_resub("redirect, STRING:", ">", tmpstr, 0); 163 strstrip(streamip); 164 165 free(tmpstr), tmpstr = NULL; 166 167 168 //rtmpe://5.135.128.157:1935/ula/abc8815 169 170 fid = basename(check); 171 streamurl = ostrcat(streamip, NULL, 0, 0); 172 streamurl = ostrcat(streamurl, " playpath=", 1, 0); 173 streamurl = ostrcat(streamurl, fid, 1, 0); 174 streamurl = ostrcat(streamurl, " swfUrl=http://www.zingo.tv/jwplayer/player.swf", 1, 0); 175 streamurl = ostrcat(streamurl, " pageUrl=http://zingo.tv/", 1, 0); 176 streamurl = ostrcat(streamurl, " live=true", 1, 0); 177 streamurl = ostrcat(streamurl, " swfVfy=true", 1, 0); 178 streamurl = ostrcat(streamurl, " timeout=15", 1, 0); 179 180 free(urlid), urlid = NULL; 181 free(tokenid), tokenid = NULL; 182 free(pageurlid), pageurlid = NULL; 183 free(url), url = NULL; 184 free(token), token = NULL; 185 free(pageurl), pageurl = NULL; 186 187 } 188 else if(ostrstr(check, "rtmp://") != NULL) 189 streamurl = ostrcat(check, NULL, 0, 0); 190 191 free(check), check = NULL; 192 93 193 if(www == 1) 94 194 { … … 114 214 tmppath = string_replace_all(tmphost, "", tmpurl, 0); 115 215 tmppath = string_replace_all("http://", "", tmppath, 1); 116 tmpstr = gethttp(tmphost, tmppath, 80, NULL, NULL, 10000, NULL, 0); 117 216 217 send = ostrcat(NULL, "GET ", 0, 0); 218 send = ostrcat(send, tmppath, 1, 0); 219 send = ostrcat(send, " HTTP/1.1\r\nHost: ", 1, 0); 220 send = ostrcat(send, tmphost, 1, 0); 221 send = ostrcat(send, "\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1\r\nConnection: close\r\n", 1, 0); 222 send = ostrcat(send, "\r\nAccept-Encoding: gzip\r\n\r\n", 1, 0); 223 224 debug(99, "send: %s", send); 225 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 226 free(send), send = NULL; 227 118 228 logfile = ostrcat(logfile, "/var/usr/local/share/titan/plugins/tithek/tvtoast_tmpstr3c_", 1, 0); 119 229 logfile = ostrcat(logfile, oitoa(incount), 1, 1); … … 123 233 writesys(logfile, tmpstr, 0); 124 234 free(logfile), logfile = NULL; 125 // free(tmppath), tmppath = NULL;126 // free(tmphost), tmphost = NULL;127 235 free(tmpurl), tmpurl = NULL; 128 236 free(tmpstr2), tmpstr2 = NULL; 129 237 130 if(fid != NULL) 238 streamer = string_resub("streamer: \"", "\"", tmpstr, 0); 239 if(streamer != NULL) 240 { 241 streamer = string_replace_all("\\", "", streamer, 1); 242 243 playpath = string_resub("file: \"", "\"", tmpstr, 0); 244 playpath = string_replace_all(".flv", "", playpath, 1); 245 246 swfUrl = string_resub("type: 'flash', src: '", "'", tmpstr, 0); 247 // pageUrl = ostrcat("http://www.ilive.to", NULL, 0, 0); 248 printf("streamer: %s\n", streamer); 249 app = string_resub("/edge/", "\0", streamer, 0); 250 251 app = oregex(".*(/edge/) .*", streamer); 252 253 app = ostrcat(streamer, NULL, 0, 0); 254 url = string_resub("rtmp://", "/", app, 0); 255 app = string_replace(url, "", app, 0); 256 app = string_replace_all("rtmp:///", "", app, 1); 257 } 258 259 260 261 262 263 while(ostrstr(tmpstr, "Set-Cookie:") != NULL) 264 { 265 tmpstr4 = string_resub("Set-Cookie:", ";", tmpstr, 0); 266 267 if(tmpstr4 != NULL) 268 { 269 tmpstr5 = ostrcat("Set-Cookie: ", tmpstr4, 0, 0); 270 tmpstr5 = ostrcat(tmpstr5, ";", 1, 0); 271 tmpstr = string_replace(tmpstr5, "", tmpstr, 1); 272 tmpstr4 = ostrcat(tmpstr4, "; ", 1, 0); 273 Cookie1 = ostrcat(Cookie1, tmpstr4, 1, 0); 274 } 275 free(tmpstr4), tmpstr4 = NULL; 276 free(tmpstr5), tmpstr5 = NULL; 277 } 278 279 if(ostrstr(tmpstr, "getJSON(\"") != NULL) 280 { 281 printf("found getJSON\n"); 282 tmpurl = string_resub("getJSON(\"", "\"", tmpstr, 0); 283 284 printf("tmpurl: %s\n", tmpurl); 285 tmphost = string_resub("http://", "/", tmpurl, 0); 286 tmppath = string_replace_all(tmphost, "", tmpurl, 0); 287 tmppath = string_replace_all("http://", "", tmppath, 1); 288 free(fid), fid = NULL; 289 free(tmpstr), tmpstr = NULL; 290 291 send = ostrcat(NULL, "GET ", 0, 0); 292 send = ostrcat(send, tmppath, 1, 0); 293 send = ostrcat(send, " HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: ", 1, 0); 294 send = ostrcat(send, tmphost, 1, 0); 295 send = ostrcat(send, "\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1\r\nConnection: close\r\n", 1, 0); 296 send = ostrcat(send, "Referer: ", 1, 0); 297 send = ostrcat(send, "http://", 1, 0); 298 send = ostrcat(send, tmphost, 1, 0); 299 300 send = ostrcat(send, "\r\nCookie: ", 1, 0); 301 send = ostrcat(send, Cookie1, 1, 0); 302 send = ostrcat(send, "\r\n\r\n", 1, 0); 303 304 debug(99, "send: %s", send); 305 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 306 free(send), send = NULL; 307 logfile = ostrcat(logfile, "/var/usr/local/share/titan/plugins/tithek/tvtoast_tmpstr3d_", 1, 0); 308 logfile = ostrcat(logfile, oitoa(incount), 1, 1); 309 logfile = ostrcat(logfile, "_", 1, 0); 310 tmpstr2 = string_replace_all("/", ".", tmppath, 0); 311 logfile = ostrcat(logfile, tmpstr2, 1, 0); 312 writesys(logfile, tmpstr, 0); 313 free(logfile), logfile = NULL; 314 free(tmpstr2), tmpstr2 = NULL; 315 316 token = string_resub("{\"token\":\"", "\"", tmpstr, 0); 317 318 streamurl1 = ostrcat(streamer, " app=", 0, 0); 319 streamurl1 = ostrcat(streamurl1, app, 1, 0); 320 streamurl1 = ostrcat(streamurl1, " playpath=", 1, 0); 321 streamurl1 = ostrcat(streamurl1, playpath, 1, 0); 322 streamurl1 = ostrcat(streamurl1, " swfUrl=", 1, 0); 323 streamurl1 = ostrcat(streamurl1, swfUrl, 1, 0); 324 streamurl1 = ostrcat(streamurl1, " live=1", 1, 0); 325 streamurl1 = ostrcat(streamurl1, " timeout=15", 1, 0); 326 streamurl1 = ostrcat(streamurl1, " token=", 1, 0); 327 streamurl1 = ostrcat(streamurl1, token, 1, 0); 328 streamurl1 = ostrcat(streamurl1, " pageUrl=http://", 1, 0); 329 streamurl1 = ostrcat(streamurl1, tmphost, 1, 0); 330 typemsg = ostrcat(tmphost, NULL, 0, 0); 331 } 332 else if(fid != NULL) 131 333 { 132 334 tmpurl = string_resub("src=\"", "'", tmpstr, 0); … … 135 337 tmppath = string_replace_all("http://", "", tmppath, 1); 136 338 tmppath = ostrcat(tmppath, fid, 1, 0); 137 free(fid), fid = NULL; 339 printf("1111fid: %s\n",fid); 340 //free(fid), fid = NULL; 138 341 free(tmpstr), tmpstr = NULL; 139 342 } … … 151 354 free(tmpurl), tmpurl = NULL; 152 355 tmpurl = string_resub("var url = '", "'", tmpstr, 0); 356 357 if(ostrstr(tmpstr, "<h1>This channel can only work in") != NULL) 358 referer = string_resub("<h1>This channel can only work in <a href='", "'", tmpstr, 0); 153 359 154 360 free(tmpstr), tmpstr = NULL; … … 157 363 tmppath = string_replace_all("http://", "", tmppath, 1); 158 364 159 char*send = ostrcat(NULL, "GET ", 0, 0);365 send = ostrcat(NULL, "GET ", 0, 0); 160 366 send = ostrcat(send, tmppath, 1, 0); 161 send = ostrcat(send, " HTTP/1.1\r\n Host: ", 1, 0);367 send = ostrcat(send, " HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: ", 1, 0); 162 368 send = ostrcat(send, tmphost, 1, 0); 163 // send = ostrcat(send, "\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1\r\nConnection: close\r\nAccept-Encoding: gzip\r\n\r\n", 1, 0);164 369 send = ostrcat(send, "\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1\r\nConnection: close\r\n", 1, 0); 165 send = ostrcat(send, "\r\nReferer: ", 1, 0); 166 // send = ostrcat(send, "http://embed.tgo-tv.com/usa/hbo.php?&width=650&height=480", 1, 0); 167 send = ostrcat(send, "http://tgo-tv.com/usa/hbo.php?&width=650&height=480", 1, 0); 168 send = ostrcat(send, "\r\nAccept-Encoding: gzip\r\n\r\n", 1, 0); 169 170 debug(99, "send: %s", send); 171 tmpstr = gethttpreal(tmphost, "/embed.php", 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 172 logfile = ostrcat(logfile, "/var/usr/local/share/titan/plugins/tithek/tvtoast_tmpstrsend_", 1, 0); 370 send = ostrcat(send, "Referer: ", 1, 0); 371 send = ostrcat(send, referer, 1, 0); 372 373 send = ostrcat(send, "\r\nCookie: ", 1, 0); 374 send = ostrcat(send, Cookie1, 1, 0); 375 send = ostrcat(send, "\r\n\r\n", 1, 0); 376 377 free(referer), referer = NULL; 378 379 debug(99, ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"); 380 debug(99, "send1: %s", send); 381 debug(99, ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"); 382 383 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 384 logfile = ostrcat(logfile, "/var/usr/local/share/titan/plugins/tithek/tvtoast_tmpstr3e_", 1, 0); 173 385 logfile = ostrcat(logfile, oitoa(incount), 1, 1); 386 logfile = ostrcat(logfile, "_", 1, 0); 387 tmpstr2 = string_replace_all("/", ".", tmppath, 0); 388 logfile = ostrcat(logfile, tmpstr2, 1, 0); 389 174 390 writesys(logfile, tmpstr, 0); 175 /* 176 free(tmppath), tmppath = NULL; 177 free(tmphost), tmphost = NULL; 178 free(tmpurl), tmpurl = NULL; 179 tmpurl = string_resub("var url = '", "'", tmpstr, 0); 180 free(tmpstr), tmpstr = NULL; 181 printf("tmpurl: %s\n",tmpurl); 182 tmphost = string_resub("http://", "/", tmpurl, 0); 183 tmppath = string_replace_all(tmphost, "", tmpurl, 0); 184 tmppath = string_replace_all("http://", "", tmppath, 1); 185 */ 391 free(logfile), logfile = NULL; 392 free(tmpstr2), tmpstr2 = NULL; 393 186 394 } 187 395 streamurl1 = string_resub("streamer: \"", "\"", tmpurl, 0); … … 192 400 else 193 401 { 194 195 402 printf("found www\n"); 196 403 … … 206 413 } 207 414 415 printf("vor refer\n"); 416 if(ostrstr(tmpstr, "<h1>This channel can only work in") != NULL) 417 { 418 printf("in refer\n"); 419 420 referer = string_resub("<h1>This channel can only work in <a href='", "'", tmpstr, 0); 421 422 } 423 424 free(tmpstr), tmpstr = NULL; 425 free(send), send = NULL; 426 427 send = ostrcat(NULL, "GET ", 0, 0); 428 send = ostrcat(send, tmppath, 1, 0); 429 send = ostrcat(send, " HTTP/1.1\r\nAccept-Encoding: gzip\r\nHost: ", 1, 0); 430 send = ostrcat(send, tmphost, 1, 0); 431 send = ostrcat(send, "\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1\r\nConnection: close\r\n", 1, 0); 432 send = ostrcat(send, "Referer: ", 1, 0); 433 if(referer != NULL) 434 send = ostrcat(send, referer, 1, 0); 435 else 436 send = ostrcat(send, tmphost, 1, 0); 437 send = ostrcat(send, "\r\nCookie: ", 1, 0); 438 send = ostrcat(send, Cookie1, 1, 0); 439 send = ostrcat(send, "\r\n\r\n", 1, 0); 440 441 free(referer), referer = NULL; 442 443 debug(99, ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"); 444 debug(99, "send2: %s", send); 445 debug(99, ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"); 446 447 208 448 debug(199, "connect (%d) %s %s", i, tmphost, tmppath); 209 tmpstr = gethttp(tmphost, tmppath, 80, NULL, NULL, 10000, NULL, 0); 449 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 450 // tmpstr = gethttp(tmphost, tmppath, 80, NULL, NULL, 10000, NULL, 0); 210 451 free(logfile), logfile = NULL; 211 452 logfile = ostrcat(logfile, "/var/usr/local/share/titan/plugins/tithek/tvtoast_tmpstr4_", 1, 0); … … 221 462 free(tmpstr2), tmpstr2 = NULL; 222 463 464 swfUrl = string_resub("<script type=\"text/javascript\" src=\"", "\"", tmpstr, 0); 465 466 check = string_resub("var str = \"", "\"", tmpstr, 0); 467 if(ostrstr(check, "rtmpe://cdn.ukcast.tv/redirect") != NULL) 468 { 469 printf("####################################################\n"); 470 printf("streamid: %s\n",streamid); 471 printf("check: %s\n",check); 472 printf("fid: %s\n",fid); 473 printf("####################################################\n"); 474 475 //rtmpdump -r rtmpe://strm.ukcast.tv/redirect -y bhousaa0 --debug 476 cmd = ostrcat("rtmpdump -r ", NULL, 0, 0); 477 cmd = ostrcat(cmd, "rtmpe://strm.ukcast.tv/redirect -y ", 1, 0); 478 cmd = ostrcat(cmd, fid, 1, 0); 479 cmd = ostrcat(cmd, " --debug > /tmp/tithek/rtmp.log 2>&1", 1, 0); 480 system("rm -rf /tmp/tithek/rtmp.log"); 481 482 free(tmpstr), tmpstr = NULL; 483 printf("cmd: %s\n",cmd); 484 system(cmd); 485 free(cmd),cmd = NULL; 486 487 tmpstr = command("cat /tmp/tithek/rtmp.log"); 488 489 streamip = string_resub("redirect, STRING:", ">", tmpstr, 0); 490 strstrip(streamip); 491 492 free(tmpstr), tmpstr = NULL; 493 494 streamurl = ostrcat(streamip, NULL, 0, 0); 495 streamurl = ostrcat(streamurl, " playpath=", 1, 0); 496 streamurl = ostrcat(streamurl, fid, 1, 0); 497 streamurl = ostrcat(streamurl, " swfUrl=http://ukcast.tv/player/player.swf", 1, 0); 498 streamurl = ostrcat(streamurl, " pageUrl=http://ukcast.tv/", 1, 0); 499 streamurl = ostrcat(streamurl, " live=true", 1, 0); 500 streamurl = ostrcat(streamurl, " swfVfy=true", 1, 0); 501 streamurl = ostrcat(streamurl, " timeout=15", 1, 0); 502 503 free(urlid), urlid = NULL; 504 free(tokenid), tokenid = NULL; 505 free(pageurlid), pageurlid = NULL; 506 free(url), url = NULL; 507 free(token), token = NULL; 508 free(pageurl), pageurl = NULL; 509 510 } 511 512 223 513 if(streamurl1 == NULL) 224 514 streamurl1 = string_resub("file: \"", "\"", tmpstr, 0); … … 229 519 if(streamid != NULL) 230 520 { 521 tmpstr1 = string_resub("<div style=\"visibility:hidden;\">", "</body>", tmpstr, 0); 522 tmpurl = string_resub("type=\"text/javascript\" src=\"", "\"", tmpstr1, 0); 523 524 tmphost = string_resub("http://", "/", tmpurl, 0); 525 tmppath = string_replace_all(tmphost, "", tmpurl, 0); 526 tmppath = string_replace_all("http://", "", tmppath, 1); 527 528 tmpstr = gethttp(tmphost, tmppath, 80, NULL, NULL, 10000, NULL, 0); 529 530 while(ostrstr(tmpstr, "\\") != NULL) 531 { 532 tmpstr1 = string_resub("\"", "\"", tmpstr, 0); 533 tmpstr2 = string_replace_all("\\x", "%", tmpstr1, 0); 534 535 if(tmpstr2 != NULL) 536 { 537 htmldecode(tmpstr2, tmpstr2); 538 539 tmpstr3 = ostrcat("\"", tmpstr1, 0, 0); 540 tmpstr3 = ostrcat(tmpstr3, "\"", 1, 0); 541 542 tmpstr4 = ostrcat("'", tmpstr2, 0, 0); 543 tmpstr4 = ostrcat(tmpstr4, "'", 1, 0); 544 545 tmpstr = string_replace(tmpstr3, tmpstr4, tmpstr, 1); 546 free(tmpstr1), tmpstr1 = NULL; 547 free(tmpstr2), tmpstr2 = NULL; 548 } 549 else 550 break; 551 552 free(tmpstr1), tmpstr1 = NULL; 553 free(tmpstr2), tmpstr2 = NULL; 554 free(tmpstr3), tmpstr3 = NULL; 555 free(tmpstr4), tmpstr4 = NULL; 556 } 557 558 559 free(logfile), logfile = NULL; 560 logfile = ostrcat(logfile, "/var/usr/local/share/titan/plugins/tithek/tvtoast_tmpstr4a_", 1, 0); 561 logfile = ostrcat(logfile, oitoa(incount), 1, 1); 562 logfile = ostrcat(logfile, "_", 1, 0); 563 tmpstr2 = string_replace_all("/", ".", tmppath, 0); 564 logfile = ostrcat(logfile, tmpstr2, 1, 0); 565 writesys(logfile, tmpstr, 0); 566 free(logfile), logfile = NULL; 567 free(tmpstr2), tmpstr2 = NULL; 568 569 urlid = oregex(".*\\[(.*)\\]\\+stream.*", tmpstr); 570 tokenid = oregex(".*securetoken:_0x.*\\[(.*)\\].*", tmpstr); 571 pageurlid = oregex(".*abouttext:_0x.*\\[(.*)\\],width.*", tmpstr); 572 573 tmpstr1 = string_resub("[", "]", tmpstr, 0); 574 int count2 = 0; 575 struct splitstr* ret2 = NULL; 576 ret2 = strsplit(tmpstr1, ",", &count2); 577 578 if(count2 > atoi(urlid)) url = string_resub("'", "'", ret2[atoi(urlid)].part, 0); 579 if(count2 > atoi(tokenid)) token = string_resub("'", "'", ret2[atoi(tokenid)].part, 0); 580 if(count2 > atoi(pageurlid)) pageurl = string_resub("'", "'", ret2[atoi(pageurlid)].part, 0); 581 582 printf("urlid: %s\n",urlid); 583 printf("tokenid: %s\n",tokenid); 584 printf("pageurlid: %s\n",pageurlid); 585 printf("url: %s\n",url); 586 printf("token: %s\n",token); 587 printf("1pageurl: %s\n",pageurl); 588 589 free(ret2), ret2 = NULL; 590 591 //rtmpdump -r rtmpe://strm.ukcast.tv/redirect -y bhousaa0 --debug 592 593 cmd = ostrcat("rtmpdump -r ", NULL, 0, 0); 594 cmd = ostrcat(cmd, url, 1, 0); 595 cmd = ostrcat(cmd, streamid, 1, 0); 596 cmd = ostrcat(cmd, " --debug > /tmp/tithek/rtmp.log 2>&1", 1, 0); 597 system("rm -rf /tmp/tithek/rtmp.log"); 598 231 599 free(tmpstr), tmpstr = NULL; 232 streamip = ostrcat("173.208.201.162", NULL, 0, 0); 233 streamport = ostrcat("1935", NULL, 0, 0); 234 debug(99, "Round (%d) streamip=%s", i, streamip); 235 debug(99, "Round (%d) streamport=%s", i, streamport); 236 debug(199, "Round (%d) streamid=%s", i, streamid); 600 printf("cmd: %s\n",cmd); 601 system(cmd); 602 free(cmd),cmd = NULL; 603 604 tmpstr = command("cat /tmp/tithek/rtmp.log"); 605 606 streamip = string_resub("redirect, STRING:", ">", tmpstr, 0); 607 strstrip(streamip); 608 609 free(tmpstr), tmpstr = NULL; 237 610 238 streamurl = ostrcat("rtmpe://", streamip, 0, 0); 239 streamurl = ostrcat(streamurl, ":", 1, 0); 240 streamurl = ostrcat(streamurl, streamport, 1, 0); 241 streamurl = ostrcat(streamurl, "/goLive playpath=", 1, 0); 611 streamurl = ostrcat(streamip, NULL, 0, 0); 612 streamurl = ostrcat(streamurl, " playpath=", 1, 0); 242 613 streamurl = ostrcat(streamurl, streamid, 1, 0); 243 streamurl = ostrcat(streamurl, " swfUrl=http://b17014255105be61b178-d8c0dbd82389bad2adcb7a22d1883b64.r92.cf5.rackcdn.com/jwplayer.flash.swf live=1 pageUrl=http://envivo.pw/ token=OOG17t.x#K9Vh#|", 1, 0); 614 // streamurl = ostrcat(streamurl, " swfUrl=http://b17014255105be61b178-d8c0dbd82389bad2adcb7a22d1883b64.r92.cf5.rackcdn.com/jwplayer.flash.swf live=1 pageUrl=http://envivo.pw/ token=OOG17t.x#K9Vh#|", 1, 0); 615 616 // streamurl = ostrcat(streamurl, " swfUrl=http://b17014255105be61b178-d8c0dbd82389bad2adcb7a22d1883b64.r92.cf5.rackcdn.com/jwplayer.flash.swf", 1, 0); 617 streamurl = ostrcat(streamurl, " swfUrl=", 1, 0); 618 streamurl = ostrcat(streamurl, swfUrl, 1, 0); 619 streamurl = ostrcat(streamurl, " live=1", 1, 0); 620 // streamurl = ostrcat(streamurl, " pageUrl=http://envivo.pw/", 1, 0); 621 // streamurl = ostrcat(streamurl, pageUrl, 1, 0); 622 streamurl = ostrcat(streamurl, " pageUrl=http://", 1, 0); 623 streamurl = ostrcat(streamurl, pageurl, 1, 0); 624 streamurl = ostrcat(streamurl, "/", 1, 0); 625 // typemsg = ostrcat(pageurl, NULL, 0, 0); 626 627 streamurl = ostrcat(streamurl, " token=", 1, 0); 628 streamurl = ostrcat(streamurl, token, 1, 0); 629 630 free(urlid), urlid = NULL; 631 free(tokenid), tokenid = NULL; 632 free(pageurlid), pageurlid = NULL; 633 free(url), url = NULL; 634 free(token), token = NULL; 635 free(pageurl), pageurl = NULL; 636 244 637 } 245 638 } … … 252 645 title = ostrcat(title, oitoa(incount), 1, 1); 253 646 title = ostrcat(title, ")", 1, 0); 254 647 if(typemsg != NULL) 648 { 649 title = ostrcat(title, " (", 1, 0); 650 title = ostrcat(title, typemsg, 1, 0); 651 title = ostrcat(title, ")", 1, 0); 652 } 255 653 pic = ostrcat("flv.png", NULL, 0, 0); 256 654 … … 268 666 free(pic), pic = NULL; 269 667 free(streamurl), streamurl = NULL; 668 free(typemsg), typemsg = NULL; 669 270 670 www = 1; 271 671 printf("####################### stop (%d) ############################\n", incount);
Note: See TracChangeset
for help on using the changeset viewer.