script in php works
i'm newbie in php so the script can be improved
you need run this script in rtmpdump folder or indicate the path of rtmpdump in line 15
this script may be shorter if the id channel doesn't change but in doubt
Code:
<?php
$php1=file_get_contents('http://typertv.com.pl/emded/polsat.php');
$cidb= strpos($php1, '"text/javascript"> id="'); $cide=strpos($php1, '"; ew='); $cidf = $cide - $cidb ; $precid= substr($php1, $cidb , $cidf);
$cid=str_replace('"text/javascript"> id="',"",$precid);
$whb= strpos($php1, 'ew="'); $whe=strpos($php1, '"; eh='); $whf = $whe - $whb ; $prewh= substr($php1, $whb , $whf);
$wh=str_replace('ew="',"",$prewh);
$htb= strpos($php1, 'eh="'); $hte=strpos($php1, '";</script><script'); $htf = $hte - $htb ; $preht= substr($php1, $htb , $htf);
$ht=str_replace('eh="',"",$preht);
$php2=file_get_contents("http://castalba.tv/embed.php?cid=$cid&wh=$wh&ht=$ht&r=typertv.com.pl");
$playpathb = strpos($php2, "'file': '"); $playpathe = $playpathb +102; $playpathf = $playpathe - $playpathb;
$preplaypath = substr($php2, $playpathb , $playpathf); $playpath = str_replace("'file': '","",$preplaypath);
$rtmpb = strpos($php2, "streamer': '"); $rtmpe = strpos($php2, "live',"); $rtmpf=$rtmpe - $rtmpb; $prertmp=substr($php2, $rtmpb , $rtmpf);
$rtmp=str_replace("streamer': '","",$prertmp); $rtmp= $rtmp ."live";
echo "Starting vlc with rtmpdump...\n\n";
echo shell_exec("rtmpdump -r \"$rtmp\" -a \"live\" -p \"http://castalba.tv/embed.php?cid=$cid&wh=$wh&ht=$ht&r=typertv.com.pl\" --live -y \"$playpath\" - | \"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\" - &");
echo "Done.\n";
?>