Skip to content

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

@tyctor

Description

@tyctor

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions