[Icecast] Best method of grabbing Now Playing metadata with PHP?
Thomas B. Rücker
thomas at ruecker.fi
Sun Sep 15 08:11:12 UTC 2019
On 9/14/19 5:56 PM, Thomas B. Rücker wrote:
> On 9/12/19 9:05 PM, Richard G Elen wrote:
>> Can someone do me the favour of pointing us at a routine, library,
>> script or technique that will grab Now Playing metadata (Title,
>> Artist, Album) remotely (ie from another machine) from an Icecast
>> 2.4.x server reliably for logging purposes, preferably using PHP?
>> Ideally we would grab the metadata when it changes - all the methods
>> we've tried so far require us to poll the server so have not been as
>> accurate as we would like.
> I'd look at the playlist.log, if you can access the logs for your
> Icecast server and configure it.
>> But there seem to be plenty of systems out there - Online Radio Box
>> for example - that manage to get the start time exactly right, so it
>> must be possible.
> You can just ingest the actual stream, but somehow I doubt you actually
> require *that* level of accuracy.
If for some reason you do want to explore such a path, you might want to
look at the STATS stream instead. It will give you a comprehensive flow
of data in real time and if necessary you can use it to trigger requests
for further data from e.g. the JSON endpoint.
> Polling the /status-json.xsl every few seconds and looking for changes
> should work just as well.
>> I'm not a programmer - I deal with music licensing mainly - so I will
>> be passing details you give me on to our developer who is great on
>> databases but not so good on the ins and outs of getting data out of
>> Icecast. Needless to say, I have ploughed through the documentation
>> provided but I evidently need something a bit more basic.
> Maybe you should consider directing them to this mailing list. It might
> be possible to come up with a simpler solution in technical discussion.
More information about the Icecast