5 changed files with 140 additions and 146 deletions
@ -0,0 +1,27 @@ |
|||
this program is released under the DWTW license |
|||
|
|||
This program is free software; you can redistribute it and/or modify it under the terms of the Do What Thou Wilt License. |
|||
|
|||
Boundless Public License |
|||
DO WHAT THOU WILT |
|||
TO PUBLIC LICENSE |
|||
|
|||
Version 2.55 |
|||
|
|||
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it in full or in part is allowed without any restrictions. |
|||
|
|||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
|||
|
|||
0. Do what thou wilt shall be the whole of the Law. |
|||
|
|||
DWTWL – a license with a single requirement: DO WHAT THOU WILT |
|||
|
|||
The license provides more freedom than any other one (such as GPL or BSD) and does not require saving the license text on copying. |
|||
|
|||
DWTWL – an accomplished and eligible license for free text, code and any other symbols (including the software, documentation and artwork). |
|||
|
|||
The license does not contain a "no warranty" clause. DWTWL can be used in countries that do not legally acknowledge the transition to public domain. |
|||
|
|||
Summary: |
|||
|
|||
An author-creator gives their source code to the world for free, without becoming distracted by worldly thinking regarding how and why the others will use it. |
@ -1,99 +1,68 @@ |
|||
<?php |
|||
|
|||
echo "id:;:"; |
|||
|
|||
// Shoutcast |
|||
function getID($radioip,$radioport,$postfix = "GET /7.html HTTP/1.1\nUser-Agent:Mozilla\n\n") |
|||
{ |
|||
function getIDshout($radioip,$radioport,$postfix = "GET /7.html HTTP/1.1\nUser-Agent:Mozilla\n\n") { |
|||
$open = fsockopen($radioip,$radioport,$errno,$errstr,'.5'); |
|||
if ($open) { |
|||
fputs($open,$postfix); |
|||
stream_set_timeout($open,'1'); |
|||
$read = fread($open,255); |
|||
$exploded = explode(",",$read); |
|||
if($exploded[6] == '' || $exploded[6] == '</body></html>') |
|||
{ $text = 'streaming'; } else { $text = $exploded[6]; } |
|||
$id = str_replace("</body></html>","",$text); |
|||
fputs($open,$postfix); |
|||
stream_set_timeout($open,'1'); |
|||
$read = fread($open,255); |
|||
$exploded = explode(",",$read); |
|||
if ($exploded[6] == '' || $exploded[6] == '</body></html>') { |
|||
$text = 'streaming'; } else { $text = $exploded[6]; |
|||
} |
|||
$id = str_replace("</body></html>","",$text); |
|||
} else { return false; } |
|||
fclose($open); |
|||
return $id; |
|||
} |
|||
|
|||
$radioip = "93.100.61.75"; |
|||
$radioport = "8000"; |
|||
echo getID($radioip,$radioport); |
|||
echo ":;:"; |
|||
$radioip = "67.212.165.106"; |
|||
$radioport = "8144"; |
|||
echo getID($radioip,$radioport); |
|||
echo ":;:"; |
|||
$radioip = "93.100.61.75"; |
|||
$radioport = "8024"; |
|||
echo getID($radioip,$radioport); |
|||
echo ":;:"; |
|||
// // outdated: |
|||
// $radioip = "173.236.30.162"; |
|||
// $radioport = "8022"; |
|||
// echo getID($radioip,$radioport); |
|||
// // outdated: |
|||
// $radioip = "91.237.213.34"; |
|||
// $radioport = "8008"; |
|||
// echo getID($radioip,$radioport).":;:"; |
|||
$radioip = "79.120.39.202"; |
|||
$radioport = "9009"; |
|||
echo getID($radioip,$radioport); |
|||
echo ":;:"; |
|||
|
|||
} |
|||
// Icecast |
|||
// https://stackoverflow.com/a/17109654 |
|||
function getMp3StreamTitle($streamingUrl, $interval, $offset = 0, $headers = true) |
|||
{ |
|||
$needle = 'StreamTitle='; |
|||
$ua = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36'; |
|||
|
|||
$opts = [ |
|||
'http' => [ |
|||
'method' => 'GET', |
|||
'header' => 'Icy-MetaData: 1', |
|||
'user_agent' => $ua |
|||
] |
|||
]; |
|||
|
|||
if (($headers = get_headers($streamingUrl))) |
|||
foreach ($headers as $h) |
|||
if (strpos(strtolower($h), 'icy-metaint') !== false && ($interval = explode(':', $h)[1])) |
|||
break; |
|||
|
|||
$context = stream_context_create($opts); |
|||
|
|||
if ($stream = fopen($streamingUrl, 'r', false, $context)) |
|||
{ |
|||
$buffer = stream_get_contents($stream, $interval, $offset); |
|||
fclose($stream); |
|||
|
|||
if (strpos($buffer, $needle) !== false) |
|||
{ |
|||
$title = explode($needle, $buffer)[1]; |
|||
return substr($title, 1, strpos($title, ';') - 2); |
|||
} |
|||
else |
|||
return getMp3StreamTitle($streamingUrl, $interval, $offset + $interval, false); |
|||
} |
|||
else |
|||
throw new Exception("Unable to open stream [{$streamingUrl}]"); |
|||
} |
|||
|
|||
echo getMp3StreamTitle('http://audio-online.net:8015/live', 19200); |
|||
echo ":;:"; |
|||
|
|||
$radioip = "sonus.fm"; |
|||
$radioport = "8000"; |
|||
$postfix = "GET /7.html?sid=3 HTTP/1.1\nUser-Agent:Mozilla\n\n"; |
|||
echo getID($radioip,$radioport,$postfix); |
|||
echo ":;:"; |
|||
|
|||
echo getMp3StreamTitle('http://pub2.diforfree.org:8000/di_dubtechno_hi', 19200); |
|||
echo ":;:"; |
|||
echo ":;:"; |
|||
function getIDice($streamingUrl, $interval, $offset = 0, $headers = true) { |
|||
$needle = 'StreamTitle='; |
|||
$ua = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36'; |
|||
$opts = [ |
|||
'http' => [ |
|||
'method' => 'GET', |
|||
'header' => 'Icy-MetaData: 1', |
|||
'user_agent' => $ua |
|||
] |
|||
]; |
|||
if (($headers = get_headers($streamingUrl))) |
|||
foreach ($headers as $h) |
|||
if (strpos(strtolower($h), 'icy-metaint') !== false && ($interval = explode(':', $h)[1])) |
|||
break; |
|||
$context = stream_context_create($opts); |
|||
if ($stream = fopen($streamingUrl, 'r', false, $context)) { |
|||
$buffer = stream_get_contents($stream, $interval, $offset); |
|||
fclose($stream); |
|||
if (strpos($buffer, $needle) !== false) { |
|||
$title = explode($needle, $buffer)[1]; |
|||
return substr($title, 1, strpos($title, ';') - 2); |
|||
} else |
|||
return getMp3StreamTitle($streamingUrl, $interval, $offset + $interval, false); |
|||
} else |
|||
throw new Exception("Unable to open stream [{$streamingUrl}]"); |
|||
} |
|||
|
|||
echo "id:;:"; |
|||
echo stristr(getIDshout("93.100.61.75","8000")," * anima.sknt.ru",true); // Anima Amoris [Dub Techno] |
|||
echo ":;:"; |
|||
echo stristr(getIDshout("93.100.61.75","8024")," * anima.sknt.ru",true); // Anima Amoris [DubTech Mix] |
|||
echo ":;:"; |
|||
echo getIDshout("67.212.165.106","8144"); // arctic dub (sursumcorda) |
|||
// // outdated: |
|||
// echo getIDshout("91.237.213.34","8008"); // electronicmusic.fm - Dub |
|||
echo ":;:"; |
|||
echo getIDshout("79.120.39.202","9009"); // Radio Caprice - Dub Techno |
|||
echo ":;:"; |
|||
echo getIDice("http://audio-online.net:8015/live", 19200); // Loca FM Dub Techno |
|||
echo ":;:"; |
|||
echo getIDshout("sonus.fm","8000","GET /7.html?sid=3 HTTP/1.1\nUser-Agent:Mozilla\n\n"); // Chillkyway - outer space |
|||
echo ":;:"; |
|||
echo getIDice("http://pub2.diforfree.org:8000/di_dubtechno_hi", 19200); // Digitally Imported Dub Techno |
|||
echo ":;:"; |
|||
echo getIDshout("173.236.30.162","8022"); // Dub Techno Statio |
|||
echo ":;:"; |
|||
echo getIDice("http://94.130.113.214:8000/dubtechno", 19200); // Schizoid Dub Techno |
|||
echo ":;:"; |
|||
?> |
|||
|
Loading…
Reference in new issue