3个版本
0.1.2 | 2024年1月14日 |
---|---|
0.1.1 | 2021年10月8日 |
0.1.0 | 2021年4月10日 |
#12 in #server-status
16KB
244 行
Icecast服务器状态
从icecast服务器解码服务器状态。
使用示例
use icecast_stats::fetch;
let url_str = "https://stream.example.com:8000/somestream";
let stats = fetch(url_str).unwrap();
println!("{:#?}", stats);
lib.rs
:
Icecast服务器状态
从icecast服务器解码服务器状态。
使用示例
use icecast_stats::fetch;
let url_str = "https://stream.example.com:8000/somestream";
let stats = fetch(url_str).unwrap();
println!("{:#?}", stats);
完整的icecast状态json文件的示例
{
"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": "https://127.0.0.1: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
}
}
}
依赖项
~4–19MB
~250K SLoC