xiph / Icecast-Server

Icecast streaming media server (Mirror) - Please report bugs at https://gitlab.xiph.org/xiph/icecast-server/issues
https://icecast.org
GNU General Public License v2.0
476 stars 131 forks source link

Invalid status-json output (SyntaxError: JSON.parse) #74

Open tyctor opened 1 month ago

tyctor commented 1 month ago

Hi

If stream source is sending dash in StreamTitle, like this:

ffprobe http://myradio.cz:8000/test
Input #0, mp3, from 'http://myradio.cz:8000/test':
  Metadata:
    icy-br          : 128
    icy-name        : Radio Test
    icy-pub         : 1
    StreamTitle     :  - 
  Duration: N/A, start: 0.000000, bitrate: 128 kb/s
  Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s

json output on status-json page is not valid JSON (missing quotes around that dash)

{
"audio_info":"channels=2;samplerate=44100;bitrate=128",
"channels":2,
"genre":"various",
"listener_peak":3,
"listeners":0,
"listenurl":"http://myradio.cz:8000/test",
"samplerate":44100,
"server_description":"Test broadcast from MyRadio",
"server_name":"Radio Test",
"server_type":"audio/mpeg",
"stream_start":"Fri, 04 Oct 2024 08:49:25 +0000",
"stream_start_iso8601":"2024-10-04T08:49:25+0000",
"title": - ,
"dummy":null
}