6 This can rip many types of streams simply by downloading them to file.
7 (MP3,OGG,MPEG,AVI,WMA,WMV,etc..)
10 ///CODE///////////////////////////////////////////////////////////
12 $len = 1000; //Block size
13 //$out = "broadcast.mp3";
16 if(!isset($argc)) die('This is php-cli script you idiot!');
17 if($argc < 2) die("Usage: streamrip stream_url [output file] [block_size]\n");
18 if($argc > 1) $in = $argv[1];
19 $out = explode('/', $in); $out = trim($out[sizeof($out)-1]);
20 if($argc > 2) $out = $argv[2];
21 if($argc > 3) $len = $argv[3];
24 while(is_file($out)) {
26 if(!is_file($sout)) $out = $sout;
31 echo("Rippin' da stream $in...\nSaving to $out\nc-C to stop\n\n");
34 $total = @(filesize($in));
35 $in = fopen($in, 'rb');
36 $out = fopen($out, 'wb');
42 while(!feof($in) && !feof($out)) {
48 $mb=floor($b/1000000);
49 if($s!=0) $sp = round($kb/$s, 2);
50 if(is_int($total)) $perc = ceil($b/$total*100);
51 echo("$mb MB = $kb KB == $m:$s Mins == $perc% == $sp kB/s (avg.) \r");
54 $data = fgets($in,$len);
56 $b = $b+
strlen($data);
This page took 0.292012 seconds and 4 git commands to generate.