PDA

View Full Version : stream rippers ban scripts?



chq
07-30-2009, 12:53 PM
ez bw
does anyone have or know where i can find a working
stream rippers ban script?

i found one yesterday on the winamp forums but its does not seem
to work

Lloyd
07-30-2009, 01:13 PM
ez bw
does anyone have or know where i can find a working
stream rippers ban script?

i found one yesterday on the winamp forums but its does not seem
to work


<meta http-equiv="refresh" content="90">
<?php
error_reporting (E_ALL ^ E_NOTICE);
// Ban rippers
// Martin Holk Rasmussen, mhr@tiscali.dk
//
// Requires PHP4 or higher. Tested with PHP4.3.2 and SHOUTcast Server Version 1.9.2/Linux
// Use and modify as you like

// Server configuration
$server = 'SERVER IP';
$portnumber = 'SERVER PORT';
$username = 'SERVER USERNAME';
$password = 'SERVER PASSWORD';

// Send e-mail when some one has been banned. Leave blank to disable.
$recipient = '';

// Array of user agents to look for.
// Check is case insensitive and partial, so don't put "winamp" as this will ban all listeners using Winamp
$knownrippers = array ( "BASS", "Streamripper", "FreeAmp", "UnknownPlayer", "Pathfinder", "sr-POSIX", "andycadd1", "AmiNetRadio", "UPLAYER",
"HiDownload", "jake", "JetAudio", "karrel", "TotalRecorder","engelmann media radio listener", "cr",);


?>

<html>
<head><title>Ban Rippers</title></head>
<body>
<?php
// Get xml stats
$fp = @fsockopen ($server, $portnumber, $errno, $errstr, 30);
if (!$fp) {
print "Could not connect to $server port $portnumber: $errstr ($errno)
\n";
}
else {
fputs ($fp, "GET /admin.cgi?mode=viewxml HTTP/1.1\r\nHost: $server:$portnumber\r\nUser-Agent: Mozilla/4.0\r\nAuthorization: Basic ".base64_encode ("$username:$password")."\r\n\r\n");
while (!feof($fp)) {
$xml .= fgets ($fp,128);
}
fclose ($fp);

if (!preg_match ("/<LISTENERS>(.+)<\/LISTENERS>/", $xml, $regs)) {
print "Could not find information. Possible incorrect username or password.";
exit;
}

$blocks = split ("</LISTENER>", $regs[1]);
array_pop ($blocks);
// Loop through each listener
foreach ($blocks as $block) {
preg_match ("/<USERAGENT>(.+)<\/USERAGENT>/", $block, $regs);
$useragent = $regs[1];
preg_match ("/<POINTER>(.+)<\/POINTER>/", $block, $regs);
$pointer = $regs[1];
preg_match ("/<HOSTNAME>(.+)<\/HOSTNAME>/", $block, $regs);
$hostname = $regs[1];

print "Known ripper found: ";

$ripperfound = false;
foreach ($knownrippers as $lookfor) {
if (stristr ($useragent, $lookfor)) {
$ripperfound = $lookfor;
}
}
// Ripper found. Ban listener.
if ($ripperfound) {
print "$ripperfound for pointer $pointer. Banning ";

$fp = @fsockopen ($server, $portnumber, $errno, $errstr, 30);
if (!$fp) {
print "failed
\n";
}
else {
fputs ($fp, "GET /admin.cgi?mode=bandst&bandst=$pointer&banmsk=255 HTTP/1.1\r\nHost: $server:$portnumber\r\nUser-Agent: Mozilla/4.0\r\nAuthorization: Basic ".base64_encode ("$username:$password")."\r\n\r\n");
fclose ($fp);
print "successful!";
if ($recipient) {
mail($recipient, "Listener banned", "$hostname\n$useragent", "From: $recipient");
}
}
}
else {
print "No ($useragent)";
}
print "
\n";
}
}
?>
</body>
</html>

from http://forums.streamsolutions.co.uk/archive/index.php/t-2758.html
I hope it's what your after.

Edit
Server needs to have php4 + enabled

- Lloyd

GKIye
07-30-2009, 03:25 PM
Hello,
There is one since a while "at" BW who's operational, posted by Me
Visit this link :
http://forums.broadcastingworld.net/showthread.php?t=8100&highlight=ban+stream
Scroll untill my reply and download the .rar file
You'll find all details into my reply

PS: if you are in need for anything, please use the "search" tool, this gonna help you in most of the cases :D

chq
07-30-2009, 03:57 PM
Hello,
There is one since a while "at" BW who's operational, posted by Me
Visit this link :
http://forums.broadcastingworld.net/showthread.php?t=8100&highlight=ban+stream
Scroll untill my reply and download the .rar file
You'll find all details into my reply

PS: if you are in need for anything, please use the "search" tool, this gonna help you in most of the cases :D

cheers 4 this but it does not seem to be working!

GKIye
07-30-2009, 04:06 PM
It have to work out
I am using it and it works fine to Me
Be sure to set all your settings into the right way (IP Port etc etc)
and adjust all players you are willing to ban if used
Important is : your server or webspace has to support php

cheers 4 this but it does not seem to be working!