newoneeeeeeeeee
08-02-2015, 05:43 PM
Hi all, i am very new with this stuff, and i need your help.
I have this website:
http://castalba.tv
and dumped response of it:
<script type='text/javascript' src='http://castalba.tv/js/jwplayer.js'></script>
<script type="text/javascript">
jwplayer("mediaspace").setup({
'flashplayer': "http://static.castalba.tv/player5.9.swf",
'width': '650',
'height': '400',
'allowfullscreen':'true',
'allowscriptaccess':'always',
'wmode':'opaque',
'controlbar':'over',
'dock':'true',
'dock.position':'left',
'mute':'false',
'stretching':'',
'autostart': 'true',
'provider': 'http://castalba.tv/bae3.swf',
'file': 'http://ndr_fs-lh.akamaihd.net/z/ndrfs_nds@119224/manifest.f4m',
'plugins': 'http://castalba.tv/ova-jw2.swf',
'config': 'http://castalba.tv/ova.php',
'logo.file':'http://i62.tinypic.com/10pwzsk.png',
'logo.hide':'false',
'logo.position':'top-right',
'logo.link':'http://castalba.tv/channel/23651',
'rtmp.tunneling': 'false',
'abouttext':'CastAlba.TV - Stream Live Video',
'aboutlink':'http://castalba.tv',
'skin':'http://static.castalba.tv/bluez.zip'
});
</script>
Please note i have this just as example, i have other link with dynamically rtmp link provided, also this stream is domain protected.
I would figure out how to obtain domain protected response of server but:
- using above example how can i build pageUrl playpath and rest things what are needed to play via VLC and example command if possible.
Can anyone explain me how can i do it manually?
as of its domain protected i need a little generator written in php, to curl its page to obtain that required data.
Please anyone have any thoughts?.
Basically i need to convert from java to type like that
rtmp://dynamic.ip/live playpath=dynamicplaypath swfUrl=http://whateverneeded pageUrl=http://castalba.tv/channel/itschannelid
That is what i thinking it would be but just correct me if im wrong please.
http://ndr_fs-lh.akamaihd.net/z/ndrfs_nds@119224 playpath=manifest.f4m swfUrl=http://static.castalba.tv/player5.9.swf pageUrl=http://castalba.tv/channel/23651
so in java request:
'file' section need to be splitted to two different things:
This is beggining of rtmp link?
'http://ndr_fs-lh.akamaihd.net/z/ndrfs_nds@119224
and this is playpath? without backslash??
/manifest.f4m' -->manifest.f4m
swfUrl would be ---> http://static.castalba.tv/player5.9.swf
but i have tried to play it and wont play why?
I have tried in simpletv player.
Any thoughs? Thanks for any help guys!
biezom
08-03-2015, 12:02 AM
hi
not rtmp protocol but hds (f4m) protocol
http://ndr_fs-lh.akamaihd.net/z/ndrfs_nds@119224/manifest.f4m
for simpletv you need convert to hls (m3u8) protocol
z >>>i
manifest.f4m >>> master.m3u8
so
http://ndr_fs-lh.akamaihd.net/i/ndrfs_nds@119224/master.m3u8
newoneeeeeeeeee
08-03-2015, 01:41 AM
Many thanks a lot, but what if i have rtmp link?
Castalba.tv
<script type="text/javascript">
jwplayer("media38322e3234").setup({
'flashplayer': "http://static.castalba.tv/player5.9.swf",
'file': '203633?313433383538373937335f36383165626264646636 63616661613534616535336539316334373561663962',
'streamer': 'rtmp://184.173.85.119/live',
'plugins': 'http://castalba.tv/ova-jw2.swf',
'config': 'http://castalba.tv/ova.php',
'logo.link':'http://castalba.tv/',
'rtmp.tunneling': 'false',
});
</script>
so variables:
'flashplayer': "http://static.castalba.tv/player5.9.swf",
will be
swfUrl="http://static.castalba.tv/player5.9.swf"
----------
'streamer': 'rtmp://184.173.85.119/live' its beggining of rtmp code
and 'file' is a
playPath = '203633?313433383538373937335f36383165626264646636 63616661613534616535336539316334373561663962'
or
Shidurlive.com - extracted js
<script type="text/javascript">
var so = new SWFObject('http://cdn.shidurlive.com/player.swf','mpl','100%','100%','9');
so.addVariable('plugins','http://shidurlive.com/ova-jws.swf');
so.addVariable('config','http://shidurlive.com/ova.php');
so.addVariable('file', unescape('%31%37%30%39%37%3f%4d%54%51%7a%4f%44%55% 34%4e%6a%67%78%4e%44%73%77%5a%44%59%33%59%54%59%34 %4f%57%45%30%59%32%55%33%4f%44%6b%31%4e%32%5a%68%4 d%7a%45%78%4d%6d%46%68%4d%32%49%31%4e%47%51%31%59% 77%3d%3d'));
============================================
UNESCAPE RESULT IS: 17097?MTQzODU4NjgxNDswZDY3YTY4OWE0Y2U3ODk1N2ZhMzEx MmFhM2I1NGQ1Yw==
===========================================
so.addVariable('streamer', 'rtmp://50.7.28.114/app');
</script>
I just do not know how to put them flash vars together to play a stream.
biezom
08-03-2015, 02:10 AM
i think you can use rtmpdumphelper + rtmpdump
but can you post a url channel like the first example http://castalba.tv/channel/23651
for example for this channel
http://castalba.tv/channel/4182
with rtmpdumphelper + rtmpdump
i find this for simpletv
rtmp://$OPT:rtmp://aljazeeraflashlivefs.fplive.net/aljazeeraflashlive-live app=aljazeeraflashlive-live swfUrl=http://static.castalba.tv/player5.9.swf pageUrl=http://castalba.tv/channel/4182 live=1 playpath=aljazeera_eng_high
other example
http://shidurlive.com/channel/al-jazeera-english
rtmp://$OPT:rtmp://aljazeeraflashlivefs.fplive.net:1935/aljazeeraflashlive-live app=aljazeeraflashlive-live swfUrl=http://cdn.shidurlive.com/player.swf live=1 playpath=aljazeera_eng_high
newoneeeeeeeeee
08-03-2015, 07:41 PM
Thanks a lot.
I thought i would be able to play this stream. But i can get it working...
Can any one have a look for me if anything can be done to play this via rtmpdump + vlc?
Polsat:
http://typertv.com.pl/emded/polsat.php
What i did every time you are trying to get correct url it doesnot work...
rtmp server ip and playpath are changing every time you are trying to access stream 1sec later.
I have written script to get it for me but still i can not play it.
Please have a look at it and post me results or even better how did you managed to get it working.
Hope hear of you soon!
biezom
08-04-2015, 01:15 AM
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
<?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";
?>
newoneeeeeeeeee
08-04-2015, 04:39 AM
Hi biezom,
Have You tried with this stream?
I can not run it on outside server but just trying it on localhost.
I have copied, rtmpdump, and vlc files to my D:/xampp/htdocs/ folder
so rtmpdump and vlc are there too.
Modified this script but it seems to not working at all.. hmm.. it gets path for video but wont run rtmpdump or vlc.
<?php
//phpinfo();
echo "exec is enabled\r\n";
$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...\r\n";
echo "RESULT = D:/xampp/htdocs/rtmpdump.exe -r \"$rtmp\" -a \"live\" -p \"http://castalba.tv/embed.php?cid=$cid&wh=$wh&ht=$ht&r=typertv.com.pl\" --live -y \"$playpath\" - | \"D:/xampp/htdocs/vlc.exe\" - &";
echo shell_exec(\"D:/xampp/htdocs/rtmpdump.exe -r \"$rtmp\" -a \"live\" -p \"http://castalba.tv/embed.php?cid=$cid&wh=$wh&ht=$ht&r=typertv.com.pl\" --live -y \"$playpath\" - | \"D:/xampp/htdocs/vlc.exe\" - &");
echo "Done.\r\n";
?>
I have tried if exec command will work with whoami. And it shows result so i am sure exec() its working, with result line i have checked if whole page has been taken and playpath rtmp file an live has been taken correctly, and i am sure it did, can you try on Your server if it works??
biezom
08-04-2015, 04:57 AM
http://i.imgur.com/qy3kqZW.png
problem with this line not / with windows path but \ and you need double
echo shell_exec(\"D:/xampp/htdocs/rtmpdump.exe -r \"$rtmp\" -a \"live\" -p \"http://castalba.tv/embed.php?cid=$cid&wh=$wh&ht=$ht&r=typertv.com.pl\" --live -y \"$playpath\" - | \"D:/xampp/htdocs/vlc.exe\" - &");
try this
echo shell_exec(\"D:\\xampp\\htdocs\\rtmpdump.exe -r \"$rtmp\" -a \"live\" -p \"http://castalba.tv/embed.php?cid=$cid&wh=$wh&ht=$ht&r=typertv.com.pl\" --live -y \"$playpath\" - | \"D:\\xampp\\htdocs\\vlc.exe\" - &");
newoneeeeeeeeee
08-04-2015, 11:34 AM
hmm that its strange your code did not worked.
But have managed to get it working other way.
$pathvar = 'rtmpdump.exe -r "'.$rtmp.'" -a "live" -p "http://castalba.tv/embed.php?cid='.$cid.'&wh='.$wh.'&ht='.$ht." --live -y "'.$playpath.'" - | "vlc.exe" - &';
echo $pathvar;
echo exec($pathvar);
Many thanks!!!
newoneeeeeeeeee
08-05-2015, 09:15 AM
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
<?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";
?>
Hi again do You have anything simillar scriptwise for:
http://shidurlive.com/ ?
Once again thank You.
biezom
08-05-2015, 03:34 PM
you can try
if the name's script is shidurlive.php
php shidurlive.php shidurliveURL
example
php shidurlive.php http://shidurlive.com/channel/al-jazeera-english
<?php
$embed= str_replace("channel","embed",$argv[1]);
echo "\n";
$opts1 = array(
'http'=>array(
'method'=>"GET",
'header'=>"Referer: $argv[1]"
)
);
$prepageUrl=file_get_contents($embed, false, stream_context_create($opts1));
$pageUrlb= strpos($prepageUrl, 'http'); $pageUrle=strpos($prepageUrl, '"></ifr'); $pageUrlf = $pageUrle - $pageUrlb ;
$pageUrl= substr($prepageUrl, $pageUrlb , $pageUrlf);
echo "$pageUrl\n\n";
$curl = curl_init($pageUrl);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux i686; rv:39.0) Gecko/20100101 Firefox/39.0 Iceweasel/39.0" );
$return = curl_exec($curl);
curl_close($curl);
$rtmpb= strpos($return, "rtmp"); $rtmpe=strpos($return, "so.addParam('allowfullscreen'");
$rtmpf = $rtmpe - $rtmpb ; $prertmp =substr($return, $rtmpb , $rtmpf);
$prertmpb = strpos($prertmp, "rtmp"); $prertmpe=strpos($prertmp, "'"); $prertmpf = $prertmpe - $prertmpb;
$rtmp = substr($prertmp, $prertmpb , $prertmpf);
echo "$rtmp\n\n";
$pathb= strpos($return, "file', unescape('"); $pathe=strpos($return, "rtmp.tunneling','false'");
$pathf = $pathe - $pathb ; $prepath =substr($return, $pathb , $pathf); $prepath = str_replace("file', unescape('","",$prepath);
$prepathb = 0; $prepathe=strpos($prepath, "'"); $prepathf = $prepathe - $prepathb;
$hexurl = substr($prepath, $prepathb , $prepathf); $hex = str_replace("%","",$hexurl);
function Hex2String($hex){
$string='';
for ($i=0; $i < strlen($hex)-1; $i+=2){
$string .= chr(hexdec($hex[$i].$hex[$i+1]));
}
return $string;
}
$playpath=Hex2String($hex); $playpath = str_replace("med","high",$playpath);
echo "$playpath\n\n";
$pathvar = 'rtmpdump.exe -r "'.$rtmp.'" -p "'.$pageUrl.'" --live -y "'.$playpath.'" - | "vlc.exe" - &';
echo "$pathvar\n\n";
echo exec($pathvar);
?>
maybe you need enable cURL extension in PHP
http://php.net/manual/en/curl.installation.php
biezom
08-06-2015, 04:59 AM
without cUrl
<?php
$embed= str_replace("channel","embed",$argv[1]);
echo "\n";
$opts1 = array(
'http'=>array(
'method'=>"GET",
'header'=>"Referer: $argv[1]\r\n" .
"User-Agent: Mozilla/5.0 (X11; Linux i686; rv:39.0) Gecko/20100101 Firefox/39.0 Iceweasel/39.0"
)
);
$prepageUrl=file_get_contents($embed, false, stream_context_create($opts1));
$pageUrlb= strpos($prepageUrl, 'http'); $pageUrle=strpos($prepageUrl, '"></ifr'); $pageUrlf = $pageUrle - $pageUrlb ;
$pageUrl= substr($prepageUrl, $pageUrlb , $pageUrlf);
echo "$pageUrl\n\n";
$return=file_get_contents("$pageUrl", false, stream_context_create($opts1));
$rtmpb= strpos($return, "rtmp"); $rtmpe=strpos($return, "so.addParam('allowfullscreen'");
$rtmpf = $rtmpe - $rtmpb ; $prertmp =substr($return, $rtmpb , $rtmpf);
$prertmpb = strpos($prertmp, "rtmp"); $prertmpe=strpos($prertmp, "'"); $prertmpf = $prertmpe - $prertmpb;
$rtmp = substr($prertmp, $prertmpb , $prertmpf);
echo "$rtmp\n\n";
$pathb= strpos($return, "file', unescape('"); $pathe=strpos($return, "rtmp.tunneling','false'");
$pathf = $pathe - $pathb ; $prepath =substr($return, $pathb , $pathf); $prepath = str_replace("file', unescape('","",$prepath);
$prepathb = 0; $prepathe=strpos($prepath, "'"); $prepathf = $prepathe - $prepathb;
$hexurl = substr($prepath, $prepathb , $prepathf); $hex = str_replace("%","",$hexurl);
function Hex2String($hex){
$string='';
for ($i=0; $i < strlen($hex)-1; $i+=2){
$string .= chr(hexdec($hex[$i].$hex[$i+1]));
}
return $string;
}
$playpath=Hex2String($hex); $playpath = str_replace("med","high",$playpath);
echo "$playpath\n\n";
$pathvar = 'rtmpdump.exe -r "'.$rtmp.'" -p "'.$pageUrl.'" --live -y "'.$playpath.'" - | "vlc.exe" - &';
echo "$pathvar\n\n";
echo exec($pathvar);
?>
vBulletin® , Copyright ©2000-2025, Jelsoft Enterprises Ltd.