Fixed bug on escape string
This commit is contained in:
parent
3c086dc51a
commit
2812176393
1 changed files with 3 additions and 2 deletions
5
index.js
5
index.js
|
@ -65,8 +65,9 @@ if (!process.env.STREAM_TYPE || process.env.STREAM_TYPE === 'radio') {
|
|||
|
||||
// Listener on new song
|
||||
stream.on('metadata', function (data) {
|
||||
let song = data.replace(/[^A-Za-z 0-9 .,?""!@#$%^&*()-_=+;:<>/\\|}{[\]`~]*/g, '')
|
||||
song = song.substring(12, song.length - 1)
|
||||
console.log('RAW DATA:', data)
|
||||
// let song = data.replace(/[^A-Za-z 0-9 .,?""!@#$%^&*()-_=+;:<>/\\|}{[\]`~]*/g, '')
|
||||
const song = data.substring(13, data.length - 1).replace('\';', '')
|
||||
|
||||
// Extract artist = title from song
|
||||
const splitted = song.split(' - ')
|
||||
|
|
Loading…
Reference in a new issue