Audio/video stream recording forums (http://stream-recorder.com/forum/index.php)
-   rtmpdump (http://stream-recorder.com/forum/forumdisplay.php?f=54)
-   -  

Rtmp Dump Castaba.tv

(http://stream-recorder.com/forum/showthread.php?t=20094)

biezom 08-05-2015 03:34 PM

Re: Rtmp Dump Castaba.tv


 
you can try
if the name's script is shidurlive.php

Code:

php shidurlive.php shidurliveURL
example
Code:

php shidurlive.php http://shidurlive.com/channel/al-jazeera-english
Code:

<?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

Re: Rtmp Dump Castaba.tv


 
without cUrl

Code:

<?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);
?>



All times are GMT -6. The time now is 01:19 PM.