1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
<?php
/**
* Second part wrapper for yp.shoutcast.com emulation
*
* Rewrites old form:
* /sbin/shoutcast-playlist.pls?rn=2329&file=filename.pls
* to:
* http://yp.shoutcast.com/sbin/tunein-station.pls?id=4256
*
*
* Needs to be installed in /sbin/, and be callable without .php
* extension. Try one of these .htaccess directives:
*
* SetHandler application/x-httpd-php
* (
* or
* Options +MultiViews
* or
* AddHandler php-script .pls
* or
* RewriteRule .pls .pls.php
* or
* AddType application/x-httpd-php .pls
* )
*
*
* The web server should respond to the virtual hosts
* "yp.shoutcast.com" and "old.shoutcast.com".
*
*
*/
#-- redirect
$id = @$_GET["rn"] . @$_GET["id"];
header("Location: http://www.shoutcast.com/sbin/tunein-station.pls?id=$id");
# Note must redirect to //www.shoutcast, not to //yp.shoutcast
# because else wrapper on localhost would get called in a loop.
#-- alternative
if (FALSE)
{
header("Content-Type: audio/x-scpls");
print file_get_contents("http://shoutcast.com/sbin/tunein-station.pls?id=$id");
}
?>
|