3 releases

0.1.2 Jan 14, 2024
0.1.1 Oct 8, 2021
0.1.0 Apr 10, 2021

#12 in #server-status

MIT license

16KB
244 lines

Icecast Server Status

Decode server status from an icecast server.

Usage example

use icecast_stats::fetch;

let url_str = "https://stream.example.com:8000/somestream";
let stats = fetch(url_str).unwrap();
println!("{:#?}", stats);

lib.rs:

Icecast Server Status

Decode server status from an icecast server.

Usage example

use icecast_stats::fetch;

let url_str = "https://stream.example.com:8000/somestream";
let stats = fetch(url_str).unwrap();
println!("{:#?}", stats);

Example for a full icecast stats json file

{
    "icestats": {
        "admin": "icemaster@localhost",
        "host": "localhost",
        "location": "Earth",
        "server_id": "Icecast 2.4.4",
        "server_start": "Fri, 09 Apr 2021 21:49:50 +0200",
        "server_start_iso8601": "2021-04-09T21:49:50+0200",
        "source": {
            "audio_bitrate": 128000,
            "audio_channels": 1,
            "audio_samplerate": 48000,
            "bitrate": 128,
            "genre": "various",
            "ice-bitrate": 128,
            "listener_peak": 1,
            "listeners": 0,
            "listenurl": "http://localhost:8000/test2",
            "server_description": "Unspecified description",
            "server_name": "Unspecified name",
            "server_type": "application/ogg",
            "stream_start": "Fri, 09 Apr 2021 21:49:52 +0200",
            "stream_start_iso8601": "2021-04-09T21:49:52+0200",
            "subtype": "Vorbis",
            "dummy": null
        }
    }
}

Dependencies

~4–16MB
~218K SLoC