Fixed bug on escape string

This commit is contained in:
dbroqua 2019-12-29 21:31:23 +01:00
parent 3c086dc51a
commit 2812176393

View file

@ -65,8 +65,9 @@ if (!process.env.STREAM_TYPE || process.env.STREAM_TYPE === 'radio') {
// Listener on new song // Listener on new song
stream.on('metadata', function (data) { stream.on('metadata', function (data) {
let song = data.replace(/[^A-Za-z 0-9 .,?""!@#$%^&*()-_=+;:<>/\\|}{[\]`~]*/g, '') console.log('RAW DATA:', data)
song = song.substring(12, song.length - 1) // let song = data.replace(/[^A-Za-z 0-9 .,?""!@#$%^&*()-_=+;:<>/\\|}{[\]`~]*/g, '')
const song = data.substring(13, data.length - 1).replace('\';', '')
// Extract artist = title from song // Extract artist = title from song
const splitted = song.split(' - ') const splitted = song.split(' - ')