Closed FireController1847 closed 6 years ago
Thanks for the report! Fixed in https://github.com/TooTallNate/node-icy/commit/1c7278102d66b2cb52bc6dc0b3f2101c4cfdfee6.
Yay! No problem :)
Hey, so it still seems to be parsing invalid (I'm using the latest github commit), as it marks "StreamTitle" but does not include the rest of the information within the object but the title.
{
StreamTitle: 'Khalid - text="Location" song_spot="M" MediaBaseId="2218753" itunesTrackId="0" amgTrackId="-1" amgArtistId="0" TAID="836574" TPID="45592457" cartcutId="0400112001"'
}
This is the fix that I've been using.
const ta = md.toString().split('"');
let taid = md.toString().split('TPID=');
taid = (taid[1] ? taid[1].split('"') : null);
if (taid) {
taid.shift();
taid = taid[0];
}
let cimg = this.options[key].url.split('/');
cimg = cimg[cimg.length - 1];
if (cimg) {
cimg = cimg.replace(/_icy/g, '');
}
if (md.toString().includes('adw_ad=\'true\'') || taid < 0) {
ta[1] = 'Advertisement';
ta[0] = 'Advertisement';
taid = null;
}
if (taid == 0) {
taid = null;
}
item.metadata = {
'title': ta[1],
'author': ta[0].replace('StreamTitle=\'', '').replace(' - text=', ''),
'avatar': (taid ? 'https://iscale.iheart.com/v3/catalog/track/' + taid + '?ops=fit(250%2C%20250)' : null),
'station': this.options[key].name,
'icon': (cimg ? 'https://iscale.iheart.com/catalog/live/' + cimg + '?ops=fit(75%2C75)' : null),
'debug': md.toString()
};
Hey there. I get what you're saying, but I think this format is a bit too specific to iheart radio, as I have not seen it in other shoutcast style streams before.
Parsing the StreamTitle
string afterwards is up to you in this case.
Damn, okay. I'll just stick with my current setup then :)
Issue *Note: I am using an IHeartRadio stream. When parsing a buffer, if there is another quote in the text, it is not shown. But, instead, when doing buffer.toString(), it returns everything. Not sure if this has to do with Icy in general or IHeartRadio but it seems to be an issue.
Example Not Working:
Working:
The URL https://c3icy.prod.playlists.ihrhls.com/2385_icy