RadioDJ - Free Radio Automation Software Forum

Zeno Media Shoutcast

Zeno Media Shoutcast
« on: July 15, 2020, 02:21:44 AM »
Hi all !! I bring you a question, I am trying to extract the information of the song that is playing from the Shoutcast server of Zeno Media. Until today I have not been able to complete my objective. I have the xml code, I need your help. Now my question is if the xml code is correct for its operation or if the Zeno Media server/IP is restricted and has a high level of security. or both theories mentioned above are wrong. in the code, replace the url and port of my stream and it still did nothing. and as I said before until today I could not achieve my goal. I await your responses.  :)

I leave the code:
Code: [Select]
<?php
$url 
"http://<MYSHOUTCASTURL>:<PORTNUMBER>/stats";
$ch curl_init();
curl_setopt($chCURLOPT_RETURNTRANSFER1);
curl_setopt($chCURLOPT_URL$url);

$data curl_exec($ch);
curl_close($ch);

$xml simplexml_load_string($data);

$servname $xml->SERVERTITLE;
$song $xml->SONGTITLE;
$status $xml->STREAMSTATUS;

if(
$status == '0'){
$stat '

<div style="padding:8px;background-color:#1c1c1c;border-radius:10px 10px 10px 10px;border:#080808 solid 1px;color:#ffffff;font-family:Comic Sans MS, cursive;">
SORRY! We are not broadcasting at the moment...
<div style="padding:8px;background-color:#000000;border:#080808 solid 1px;margin-top:6px;border-radius:10px 10px 10px 10px;">
Please come back soon
</div><br/>
See you soon ;)
</div>

'
;
}elseif(
$status == '1'){
$stat '

<div style="padding:8px;background-color:#1c1c1c;border-radius:10px 10px 10px 10px;border:#080808 solid 1px;color:#ffffff;font-family:Comic Sans MS, cursive;">
BROADCASTING LIVE with : '
.$servname.'
<div style="padding:8px;background-color:#000000;border:#080808 solid 1px;margin-top:6px;border-radius:10px 10px 10px 10px;">
Now playing: '
.$song.'

'
;
}
echo 
$stat;
?>


Offline EmmaS

  • **
  • 73
  • I don't fail... I find ways that don't work.
    • StewartsWebWorks
Re: Zeno Media Shoutcast
« Reply #1 on: July 15, 2020, 01:38:28 PM »
Code: [Select]
<?php
$url 
"http://<MYSHOUTCASTURL>:<PORTNUMBER>/stats";
$ch curl_init();
curl_setopt($chCURLOPT_RETURNTRANSFER1);
curl_setopt($chCURLOPT_URL$url);

$data curl_exec($ch);
curl_close($ch);

$xml simplexml_load_string($data);

$servname $xml->SERVERTITLE;
$song $xml->SONGTITLE;
$status $xml->STREAMSTATUS;

if(
$status == '0'){
$stat '

<div style="padding:8px;background-color:#1c1c1c;border-radius:10px 10px 10px 10px;border:#080808 solid 1px;color:#ffffff;font-family:Comic Sans MS, cursive;">
SORRY! We are not broadcasting at the moment...
<div style="padding:8px;background-color:#000000;border:#080808 solid 1px;margin-top:6px;border-radius:10px 10px 10px 10px;">
Please come back soon
</div><br/>
See you soon ;)
</div>

'
;
}elseif(
$status == '1'){
$stat '

<div style="padding:8px;background-color:#1c1c1c;border-radius:10px 10px 10px 10px;border:#080808 solid 1px;color:#ffffff;font-family:Comic Sans MS, cursive;">
BROADCASTING LIVE with : '
.$servname.'
<div style="padding:8px;background-color:#000000;border:#080808 solid 1px;margin-top:6px;border-radius:10px 10px 10px 10px;">
Now playing: '
.$song.'

'
;
}
echo 
$stat;
?>



I've put my IP and PORT into this to check and all is working fine so I can only assume it's something to do with ZENO...
This is ShoutcastXML V1.0 found at:
https://www.stewartswebworks.com/scripts.php
XperienceRewind.co.uk - 70s and 80s None Stop
https://www.xperiencerewind.co.uk/

XperienceRadio.co.uk - Club Dance & Trance
https://www.xperienceradio.co.uk/

Offline DJ Garybaldy

  • *****
  • 4270
  • Retired DJ who uses RadioDJ
    • DJ Garybaldy Blog
Re: Zeno Media Shoutcast
« Reply #2 on: July 16, 2020, 11:47:03 AM »
I don't think its possible to extract the now playing information from Zeno as its hard coded with their servers. The songs titles only populate on Zeno when there are listeners connected if you don't have listeners it won't display the now playing info.


You'd be better off running another Shoutcast server and extracting the now playing information from that.
Retired DJ & Proud USER of RadioDJ since 2010

Computers: Windows 10 Pro 16GB & 32GB AMD10/Intel i5 processor

https://djgarybaldy.blogspot.com/

Repair the RadioDJ database: https://djgarybaldy.blogspot.com/2020/09/radiodj-database-maintenance-how-to.html

Re: Zeno Media Shoutcast
« Reply #3 on: July 16, 2020, 12:24:19 PM »
I don't think its possible to extract the now playing information from Zeno as its hard coded with their servers. The songs titles only populate on Zeno when there are listeners connected if you don't have listeners it won't display the now playing info.


You'd be better off running another Shoutcast server and extracting the now playing information from that.

Lol that's how I did things when i used Zeno as main server. But now I'm using Azuracast on my local server which is superior to Zeno media  8)

Re: Zeno Media Shoutcast
« Reply #4 on: July 20, 2020, 11:59:19 PM »
Lol that's how I did things when i used Zeno as main server. But now I'm using Azuracast on my local server which is superior to Zeno media  8)

So I will try to use AzuraCast to extract the shoutcast information of the currently playing song. I was seeing that to use the AzuraCast platform you need to have a virtual machine (VPS). What service / website do you recommend to start?