Author Topic: Get Cast Stats but from a different port  (Read 116 times)

Chris Oakley

  • Posts: 98
Get Cast Stats but from a different port
« on: 28 Dec '18 - 17:38 »
I need to get the stats from a different port when casting but I can't see anything anywhere that can point me in the right direction.

Basically I can use the BASS_Encode_CastGetStats to get the stats from a currently connected cast, but this cast is connected to a port like 60000 and then relayed to a listening port of 8000.

Now, this means that the stats have to be taken from 8000, but of course BASS_Encode_CastGetStats is only pulling them from the cast it has created to 60000, and the stats are not fed by that.

Anyone any ideas?

Chris Oakley

  • Posts: 98
Re: Get Cast Stats but from a different port
« Reply #1 on: 30 Dec '18 - 22:42 »
Okay, so I did this by basically extending my get statistic routine to allow the user to choose a different stream and I just collect the information from the admin.cgi or status-json.xsl depending on the service.

All good.

Ian @ un4seen

  • Administrator
  • Posts: 21447
Re: Get Cast Stats but from a different port
« Reply #2 on: 1 Jan '19 - 14:34 »
BASS_Encode_CastGetStats basically just sends an HTTP request to the Shoutcast/Icecast server and returns the reply. You can do that yourself by other means (eg. using WinInet or WinHttp) if it needs customizing. The request can look like this for a Shoutcast server:

Code: [Select]
GET /admin.cgi?pass=<yourpassword>&mode=viewxml HTTP/1.0
User-Agent: <youruseragent> (Mozilla Compatible)

If a different username (not "admin") is needed, you can add an "Authorization" header for that.