Kod PHP kickera autopilota ShoutCast:
<?php /* Kicker Autopilota, 4stream.pl */ /* KONFIGURACJA */ $haslo = 'hasloAdministratoraShoutcast'; $port = '8000'; /* konta do kickera */ $ile_kont=2; //liczba kont w kickerze $pass[0] = 'haslo1'; //hasło 1 $pass[1] = 'haslo2'; //haslo 2 /* KONIEC KONFIGURACJI */?>
<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8" /><title>Wykop autopilota</title></head><body>
<?phpif($_POST['pass']){$pass = array();function wyswietl_panel(){echo'<form method="post"><input name="pass" type="hidden" value="'.$_POST['pass'].'"><input name="s" type="hidden" value="1"><input type="submit" value="Wyrzuć grającego PAMIĘTAJ ABY KLIKAĆ TEN PRZYCISK JEDYNIE GDY GRA AUTOPILOT!"></form>';}function wyrzuc(){$tekst = file_get_contents('http://www.4stream.pl/public/addons/kick.php?pass='.$haslo.'&port='.$port);echo'Masz 4 sekundy na połączenie się.';}$q = 0;$x = 0;while($q<$ile_kont){if(md5(md5($pass[$q]))==md5(md5($_POST['pass']))){$x = 1; $q = 99999; if($_POST['s']==1) wyrzuc(); else wyswietl_panel();}else{$x = 0; $q = $q+1;}if($q==$ile_kont && $x == 0){echo'złe hasło';}}}else{echo'<form method="post"><input name="pass" type="password"><input type="submit" value="loguj"></form>';}?>
</body></html>
To spróbuj z tym kodem jeszcze:
<?php /* Kicker Autopilota, 4stream.pl */ /* KONFIGURACJA */ $haslo = 'hasloAdministratoraShoutcast'; $port = '8000'; /* konta do kickera */ $ile_kont=2; //liczba kont w kickerze $pass[0] = 'haslo1'; //hasło 1 $pass[1] = 'haslo2'; //haslo 2 /* KONIEC KONFIGURACJI */?>
<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8" /><title>Wykop autopilota</title></head><body>
<?phpif($_POST['pass']){$pass = array();function wyswietl_panel(){echo'<form method="post"><input name="pass" type="hidden" value="'.$_POST['pass'].'"><input name="s" type="hidden" value="1"><input type="submit" value="Wyrzuć grającego PAMIĘTAJ ABY KLIKAĆ TEN PRZYCISK JEDYNIE GDY GRA AUTOPILOT!"></form>';}function wyrzuc(){$tekst = file_get_contents('http://www.4stream.pl/public/addons/kick.php?pass='.$haslo.'&port='.$port);echo'Masz 4 sekundy na połączenie się.';}$q = 0;$x = 0;while($q<$ile_kont){if(md5(md5($pass[$q]))==md5(md5($_POST['pass']))){$x = 1; $q = 99999; if($_POST['s']==1) wyrzuc(); else wyswietl_panel();}else{$x = 0; $q = $q+1;}if($q==$ile_kont && $x == 0){echo'złe hasło';}}}else{echo'<form method="post"><input name="pass" type="password"><input type="submit" value="loguj"></form>';}?>
</body></html>
Witam radiomaniakow!
Znalazlem calkiem przyzwoity skrypt do kopania autopilota. Jego zaleta jest prosta obsluga, mozliwosc obslugi kilku zrodel (deklaracje w tzw. tablicach), do skryptu dopisalem komentarze co moze ulatwic jego obsluge. Po naniesieniu wlasciwych danych, skrypt wyeksportowac za pomoca FTP na serwer, nadajac mu nazwe np. kicksource.php. Powodzenia!
<?php// COPYRIGHT 2006 by aintschie (stationscript@gmx.net)// SET ALL CONFIG VALUES$login_user = "user"; //ustalamy swoj login aby wejsc na strone$login_password = "1234"; //ustalamy haslo aby wejsc na strone$kick_password = "kickit"; //tu ustalamy haslo do kopniecia zrodla ShoutCast (np. pilota)$timeout = 5; //ile sekund trwac bedzie przerwa, aby wlaczyc nadawanie $shoutcast_ip = array("127.0.0.1", "127.0.0.2"); //w tablicy podajemy adresy IP serwerow nadajacych$shoutcast_name = array("Stream #1", "Stream #2"); //w tablicy podajemy swoje nazwy serwerow, mozna wstawic nazwy puste w ''''$shoutcast_port = array("8000", "8001"); // w tablicy podajemy numery portow serwerow j.w.$shoutcast_password = array("pw1", "pw2"); // w tablicy podajemy hasla admina lub hasla do nadawania// ponizej lepiej nic nie zmieniac!if($_SERVER['PHP_AUTH_USER'] != "$login_user" || $_SERVER['PHP_AUTH_PW'] != "$login_password") { header('WWW-Authenticate: Basic realm="SHOUTcast | KICK SOURCE"'); header('HTTP/1.0 401 Unauthorized'); echo '<html><head><title>SHOUTcast - Kick source</title></head><body bgcolor="#C6E2FF" text="black">'; echo '<h1>SHOUTcast - Source manager<hr width="100%" size="1" color="black" noshade></h1>'; echo '<font face="Verdana" size="3" color="red"><b>Authorisation failed</b></font><br>'; echo '<font face="Verdana" size="2"><b>Reload this page and <a href="'.$_SERVER['PHP_SELF'].'" style="color: black;">try login again</a></b></font></body></html>'; exit; } ?>
<html>
<head>
<title>SHOUTcast - Kick source</title>
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<style>
td {
border:1px black solid; }
font { font-family: Verdana; }
</style>
</head>
<body bgcolor="#C6E2FF" text="black">
<h1>SHOUTcast - Source manager
<hr width="100%" size="1" color="black" noshade></h1>
<font size="2">Select stream:</font>
<form method="get" style="margin: 0px;">
<select name="id" style="border: 1px solid black;">
<option value="0">>> Please choose</option>
<?php $id = $_REQUEST['id']; if(!isset($_REQUEST['id']) || $id == '') $id = 0; for($x=0;$x<count($shoutcast_ip);$x++) { if($x == $id) echo " <option value=\"$x\" selected>".$shoutcast_name[$x]." | ".$shoutcast_ip[$x].":".$shoutcast_port[$x]."</option>\n"; else echo " <option value=\"$x\">".$shoutcast_name[$x]." | ".$shoutcast_ip[$x].":".$shoutcast_port[$x]."</option>\n"; } ?>
</select>
<input name="send2" type="submit" value=">> Select!" style="border: 1px solid black;">
</form>
<br>
<?php $kickit = $_POST['password_kick']; if(isset($_POST['send'])) { if($kickit != "$kick_password") { $mess = "Password wrong. Source(s) not kicked"; $col = "red"; echo "<table width=\"400\" cellpadding=\"2\"> <tr> <td width=\"100%\" bgcolor=\"$col\"><font size=\"2\"><b>Notice</b></font></td> </tr> <tr> <td width=\"100%\" bgcolor=\"white\" height=\"60\"><font size=\"2\">$mess</font></td> </tr> </table><br>"; echo "<meta http-equiv=refresh content=4;URL=".$_SERVER['PHP_SELF']."?id=$id>"; } else { if($_POST['kick_all'] == 'true') { $start = 0; $end = count($shoutcast_ip); } else { $start = $id; $end = $start+1; } for($s=$start;$s<$end;$s++) { $fp = @fsockopen($shoutcast_ip[$s], $shoutcast_port[$s], &$errno, &$errstr, $timeout); if ($fp) { $mess = "Source <b>".$shoutcast_ip[$s]."</b> successfully kicked."; $col = "green"; @fputs($fp,"GET /admin.cgi?pass=".$shoutcast_password[$s]."&mode=kicksrc HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); @fclose($fp); } else { $mess = "Connection parameters wrong. Source <b>".$shoutcast_ip[$s]."</b> not kicked."; $col = "red"; } echo "<table width=\"400\" cellpadding=\"2\"> <tr> <td width=\"100%\" bgcolor=\"$col\"><font size=\"2\"><b>Notice</b></font></td> </tr> <tr> <td width=\"100%\" bgcolor=\"white\" height=\"60\"><font size=\"2\">$mess</font></td> </tr> </table><br>"; } // END FOR echo "<meta http-equiv=refresh content=4;URL=".$_SERVER['PHP_SELF']."?id=$id>"; } }?>
<li><font size="2"><b>Service description</b><br>This service is used to kick your SHOUTcast source via webclient</font>
<li><font size="2"><b>Source details</b></font><br>
<?php $fp = @fsockopen($shoutcast_ip[$id], $shoutcast_port[$id], &$errno, &$errstr, $timeout); if($fp) { fputs($fp,"GET /admin.cgi?pass=".$shoutcast_password[$id]." HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); while(!feof($fp)) { $cont .= fgets($fp, 128); } $cont = strip_tags($cont); if(ereg("Server is currently down", $cont)) { echo "<font size=\"2\"><font color=\"red\">Server is down/source is disconnected</font> >> Kickin' source has <b>no</b> effect</font>"; } elseif(ereg("Server is currently up", $cont)) { echo "<font size=\"2\"><font color=\"green\">Server is up/source is connected</font> >> Kickin' source has effect</font>"; } else { echo "<font size=\"2\" color=\"red\">Unknown server/source status</font>"; } } else echo "<font size=\"2\" color=\"red\">Couldn't connect to server. Is server really up?</font>";?>
<li><font size="2"><b>Kick source</b><br>Enter password and click "Kick source now!" to kick source:</font><br>
<form method="post" style="margin: 0px;">
<input type="hidden" name="id" value="<? echo $id; ?>">
<input type="checkbox" name="kick_all" value="true" checked style="border: 1px solid black;"><font size="1">Kick all sources</font><br>
<input type="password" name="password_kick" style="border: 1px solid black;">
<input type="submit" value=">> Kick source now!" name="send" style="border: 1px solid black;">
</form>
<hr width="100%" size="1" color="black" noshade>
<font size="1">© 2006 by <a href="mailto:stationscript@gmx.net" style="color:black;">aintschie</a></font>
</body>
</html>
I jeszcze jeden bardzo prosty skrypt do kopania zrodla ShoutCast.
<?php// Ustawienie serwera //$ip = "78.46.52.186"; // The IP or hostname of your server$port = "18***"; // The shoutcast port that listeners connect on$pass = "*****"; // This should be your ADMIN password, and may not be the same as the one your DJs use to connect// Messages //$success_message = "Pilot zostal wylaczony, mozna nadawac!";$error_message = "Connection refused, check that server is online";// No need to edit below //$fp = @fsockopen($ip, $port, $errno, $errstr, 8); //na ile sekund kopnieto pilotaif (!$fp) { print $error_message; }else { fputs($fp, "GET /admin.cgi?pass=$pass&mode=kicksrc HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n"); fclose($fp); print $success_message; }?>
(http://www.wadu.fantex.pl/kicksource.jpg)
Tak wyglada zrzut z ekranu kicksource o ktorym mowa wyzej po dostosowaniu do moich potrzeb. Jezeli wszystko smiga to po co zmieniac kod?! W polu wyboru Select stream: mozna umiescic kilka zrodel do kopniecia. Ale trzeba pamietac aby po dokonaniu wyboru zatwierdzic przyciskiem >>Select i zdjac ptaszka z Kick all sources, inaczej zostana kopniete wszystkie zrodla jakie zadeklarowano w tablicach (array) i na koniec kliknac w przycisk >>Kick source now! Polecam!