Skip to Content
It is currently August 7th, 2020, 10:05 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Meta data live DJ
PostPosted: June 3rd, 2020, 12:54 pm 
Offline
New User
New User

Joined: June 3rd, 2020, 2:02 am
Posts: 16
Hi guys,
First of all, I’m new to this forum so Hi!

I’ve got a question about Sam, our 24/7 system is running with Sam.
Our Live DJs are streaming into Sam true a static relay.
When we are loaded into deck A or B it shows the meta data from the live DJ in the player.
Image

But it seems the encoder in Sam doesn’t sent it to icecast because “current song” stays empty.

Is there a solution for it? Or do I need to create several mountpoints (ie 7djs 7 mountpoints)
(We are using icecast btw.)

I hope you guys understand what I mean lol. I’ve tried to explain it as much as possible in English.

Thanks in advance.


Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 3rd, 2020, 5:39 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8044
Location: Aachen (Germany)
Does Icecast have a 7.html compatible interface?
If so, you can use this 16 year old PAL script to update the titles on the encoder:
viewtopic.php?p=215147#p215147

If not, you can use this as an inspiration and build your own one with the interfaces of Icecast. (or search the forums to see if someone has built a script for Icecast)

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 4th, 2020, 3:56 am 
Offline
New User
New User

Joined: June 3rd, 2020, 2:02 am
Posts: 16
Hi thanks for your fast reply!
I’m gonna try and see if I can make something out of it


Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 13th, 2020, 2:12 pm 
Offline
New User
New User

Joined: June 3rd, 2020, 2:02 am
Posts: 16
Hey there me again!
I’ve got the script running, however it goes back and forth between a certain point.
In picture 2 you can see the point where something goes wrong I guess?

In picture 1 there is the metadata from the url. It’s shown in the script. However it doesn’t go to the encoder/go to icecast

Could you/someone help me out with this?

Thanks!


Attachments:
529E6C40-31AD-4C99-8537-547B16AD45D8.jpeg
529E6C40-31AD-4C99-8537-547B16AD45D8.jpeg [ 74.33 KiB | Viewed 1398 times ]
1C7C1300-DF2C-433F-B01A-59B5F74D9DBA.jpeg
1C7C1300-DF2C-433F-B01A-59B5F74D9DBA.jpeg [ 109.8 KiB | Viewed 1398 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 15th, 2020, 5:07 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8044
Location: Aachen (Germany)
It looks like the 7.html of Icecast does not have the Format expected by the old script.
Can you open the 7.html in a browser (firefox, chrome, etc), then save the file to disk (Here's instructions for how to do so in Chrome: https://www.howtogeek.com/415086/how-to ... in-chrome/, the other browsers have similar functions, in firefox simply right click a blank spot on the page and in the context menu choose save page as file or something similar [My computer is set to German language, so I can't tell you the exact
english names of things])

Open the file in a text editor and copy-paste it's contents here, then we'll maybe have a chance to adjust the PAL script.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 16th, 2020, 7:21 am 
Offline
New User
New User

Joined: June 3rd, 2020, 2:02 am
Posts: 16
Hi there, thanks for the assist!

Icecast doesnt work with 7.html.
They work with status7.xsl

here is the original.
Code:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" media-type="text/html" indent="no" encoding="ISO8859-1"/>
<xsl:template match="/icestats">
<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>
<xsl:value-of select="clients"/>
,1
<xsl:for-each select="source">
,
<xsl:value-of select="listener_peak"/>
,1000,
<xsl:value-of select="listeners"/>
,
<xsl:value-of select="bitrate"/>
<xsl:value-of select="quality"/>
,
<xsl:value-of select="artist"/>
<xsl:value-of select="title"/>
</body></html>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


I've found this one on a website -modified-

Code:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" version="1.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match="/icestats">
<xsl:for-each select="source">
<xsl:if test="position()=1">
<xsl:if test="artist">
<xsl:value-of select="artist"/>
-
</xsl:if>
<xsl:value-of select="title"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


this is the pal script.
Code:
{ PAL Script created on 4/10/2006 1:50:23 PM }
{==================================================}
WriteLn('Lets make this puppy run all the time');
PAL.Loop := True;
{ You will need to edit the next line to point to the URL you are pulling from.}
var html : String = WebToStr('http://mscp3.live-streams.nl:8330/7.xsl');
var head : String = '<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>';
var tail : String = '</body></html>';
WriteLn(html);

Delete(html, Pos(head, html), Length(head));
WriteLn(html);

Delete(html, Pos(tail, html), Length(tail));
WriteLn(html);

var i : Integer = 0;
var j : Integer = 0;
while j < 6 do
begin
i := i + 1;
if (CharAt(html, i) = ',') then
begin
j := j + 1;
end;
end;

Delete(html, 1, i);
WriteLn(html);

var sepa : String = ' - ';
var artist : String = html;
var title : String = html;

Delete(artist, Pos(sepa, artist), Length(artist));
Delete(title, 1, Pos(sepa, title) + Length(sepa) - 1);

WriteLn(artist);
WriteLn(title);

var Song : TSongInfo;
Song := TSongInfo.Create;
Song['artist'] := artist;
Song['title'] := title;
Encoders.SongChange(Song);
Song.Free;
WriteLn('Waiting 10 Seconds so we are not constantly updating.');
PAL.WaitForTime(T['+00:00:10']); //Wait 5 secs


I hope you could help me out with this.
Thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 16th, 2020, 7:45 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8044
Location: Aachen (Germany)
The status7.xsl is just the instructions for generating the 7.html compatible output from the full Icecast XML.
.xsl = XSLT = Extensible Stylesheet Language Transformation = Instructions that are applied to an XML document to create a new document, in this case it's supposed to create a 7.html compatible output AFAIR.

I can't remember how to configure icecast to deploy new stats pages, but the XSL looks like it should generate the body part where shoutcast prints comma separated values just fine.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 16th, 2020, 12:49 pm 
Offline
New User
New User

Joined: June 3rd, 2020, 2:02 am
Posts: 16
the 7.xsl does work tho, if you see the link in the pal script That generates the correct meta data.

Although the pal script keeps bugging. Is there a solution for that?
Or do I need to do something different?


Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 16th, 2020, 1:23 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8044
Location: Aachen (Germany)
Well, obviously it matches only one part correctly (probably the one after the first comma) and has some stuff it didn't expect before the first information bit.
So you'd need to adjust the pattern for head.
AFAIK the XSL of Icecast at least produces valid HTML as opposed to the 7.html in Shoutcast (which has a missing opening <head>)


Is the URL in the PAL script you posted the one from your stream?
I just noticed I could've just looked at that and checked the correct pattern all the time. Sorry, I completely missed that part.

So the icecast version of 7.html looks like this:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
Piratenhits.FM -Live- - Groet of verzoek? kijk op onze website!


And the one expected by the PAL Script:
Code:
<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>Piratenhits.FM -Live- - Groet of verzoek? kijk op onze website!</body></html>



Which means your script should actually look like this instead:
Code:
{ PAL Script created on 4/10/2006 1:50:23 PM }
{==================================================}
WriteLn('Lets make this puppy run all the time');
PAL.Loop := True;
{ You will need to edit the next line to point to the URL you are pulling from.}
var html : String = WebToStr('http://mscp3.live-streams.nl:8330/7.xsl');
var head : String = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">';
WriteLn(html);

Delete(html, Pos(head, html), Length(head));
WriteLn(html);

var i : Integer = 0;
var j : Integer = 0;
while j < 6 do
begin
i := i + 1;
if (CharAt(html, i) = ',') then
begin
j := j + 1;
end;
end;

Delete(html, 1, i);
WriteLn(html);

var sepa : String = ' - ';
var artist : String = html;
var title : String = html;

Delete(artist, Pos(sepa, artist), Length(artist));
Delete(title, 1, Pos(sepa, title) + Length(sepa) - 1);

WriteLn(artist);
WriteLn(title);

var Song : TSongInfo;
Song := TSongInfo.Create;
Song['artist'] := artist;
Song['title'] := title;
Encoders.SongChange(Song);
Song.Free;
WriteLn('Waiting 10 Seconds so we are not constantly updating.');
PAL.WaitForTime(T['+00:00:10']); //Wait 5 secs


If that gives you a surplus line-break before the artist, you can probably adjust this line with either a +1 or +2 (just try which one works, finding out if the file uses newline or carriage-return newline for a line-break would take way longer than just trying both):
Code:
Delete(html, Pos(head, html), Length(head)+1);

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 17th, 2020, 4:08 pm 
Offline
New User
New User

Joined: June 3rd, 2020, 2:02 am
Posts: 16
Hi there!
Thanks for your help so far!


I have tried it, but somehow it won't work.
The script keeps bouncing on this part :
Code:
i := i + 1;
if (CharAt(html, i) = ',') then


the text in the output box is shown correctly. however like i said it keeps bouncing on that piece of code..
What am i doing wrong?


this is the url for the status page
[url]http://mscp3.live-streams.nl:8330/7.xsl
[/url]

Many thanks in advance, i've been breaking my head over this all night haha!


Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 17th, 2020, 5:09 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8044
Location: Aachen (Germany)
Ahh, that's because you're not using the comma as separator character.
You need to put the - instead of the comma.

Also this script is very fine tuned for the original version of the 7.html, not the one you use.

For example the offending block at the beginning where your script hangs will try to find the separator character 5 times and will delete everything up to that.
This is because the original 7.html contains 5 blocks of info separated by commas that are not the artist and title fields of Icecast.
Your version starts with the artist field then <newline/space>-<newline/space> and then the title.

I think for your 7.xsl you need to remove the whole block. This one here should actually contain all the parts you need and has everything commented out that's not needed for your version of the status page:
Code:
{ PAL Script created on 4/10/2006 1:50:23 PM }
{==================================================}
WriteLn('Lets make this puppy run all the time');
PAL.Loop := True;
{ You will need to edit the next line to point to the URL you are pulling from.}
var html : String = WebToStr('http://mscp3.live-streams.nl:8330/7.xsl');
//var head : String = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">';
WriteLn('full HTML:');
WriteLn(html);

{
Delete(html, Pos(head, html), Length(head));
WriteLn('HTML without header');
WriteLn(html);

var i : Integer = 0;
var j : Integer = 0;

PAL.LockExecution;
while j < 6 do
begin
  i := i + 1;
  if (CharAt(html, i) = '-') then
  begin
    j := j + 1;
  end;
end;
PAL.UnlockExecution;

Delete(html, 1, i+1);
WriteLn('HTML before the sixth separator');
WriteLn(html);
}

var sepa : String = ' - ';
var artist : String = html;
var title : String = html;

Delete(artist, Pos(sepa, artist), Length(artist));
WriteStr('artist: ');
WriteLn(artist);
Delete(title, 1, Pos(sepa, title) + Length(sepa) - 1);
WriteStr('title: ');
WriteLn(title);

var Song : TSongInfo;
Song := TSongInfo.Create;
Song['artist'] := artist;
Song['title'] := title;
Encoders.SongChange(Song);
Song.Free;
WriteLn('Waiting 10 Seconds so we are not constantly updating.');
PAL.WaitForTime(T['+00:00:10']); //Wait 5 secs;


I'm not 100% sure as I can't make out what's supposed to be the title and what the artist. You're only streaming a dutch call-to-action, but not an artist/title of any musical track as far as I can tell. Here's the full output of my modified script:
Code:
Lets make this puppy run all the time
full HTML:
Piratenhits.FM -Live- - Groet of verzoek? kijk op onze website! Piratenhits.FM -Live- - Groet of verzoek? kijk op onze website! Radio San-Diego

artist: Piratenhits.FM -Live-
title: Groet of verzoek? kijk op onze website! Piratenhits.FM -Live- - Groet of verzoek? kijk op onze website! Radio San-Diego

Waiting 10 Seconds so we are not constantly updating.


It looks like you got the same info in both the artist and title fields, but since you're using the same separator string in your SAM encoders as you do in the XSL file, it will pick the artist part on the artist field and then use all remaining characters as the title (which in your case is title - artist - title)
If this is right, you should modify your XSL file and only print either artist or title field, but not both and most certainly don't use the <newline/space>-<newline/space> separator sequence in the XSL if you use that in SAM already.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 18th, 2020, 12:25 am 
Offline
New User
New User

Joined: June 3rd, 2020, 2:02 am
Posts: 16
Goodmorning,
I’m going to try it out today!
The reason why it’s doing artist-title-artist is I added an artist on the URL or else it would only show url:Port/mountpoint, so i edited the song info in Sam. If the script fully works I will remove this and then it will show de live DJ meta data.

Thanks, I’ll let you know


Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 18th, 2020, 10:49 am 
Offline
New User
New User

Joined: June 3rd, 2020, 2:02 am
Posts: 16
Ive tested it, and yes it adds the metadata as title and artist. I need a way t figure that out.

But the script keeps adding info to the current song.
Do you know why it keeps doing thIs?


Attachments:
8A5C34F6-FD20-4DF2-B15D-276A61303AC2.jpeg
8A5C34F6-FD20-4DF2-B15D-276A61303AC2.jpeg [ 154.05 KiB | Viewed 1320 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 18th, 2020, 2:12 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8044
Location: Aachen (Germany)
Just use either the artist or the title field :D
Code:
{ PAL Script created on 4/10/2006 1:50:23 PM }
{==================================================}
WriteLn('Lets make this puppy run all the time');
PAL.Loop := True;
{ You will need to edit the next line to point to the URL you are pulling from.}
var html : String = WebToStr('http://mscp3.live-streams.nl:8330/7.xsl');
//var head : String = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">';
WriteLn('full HTML:');
WriteLn(html);

{
Delete(html, Pos(head, html), Length(head));
WriteLn('HTML without header');
WriteLn(html);

var i : Integer = 0;
var j : Integer = 0;

PAL.LockExecution;
while j < 6 do
begin
  i := i + 1;
  if (CharAt(html, i) = '-') then
  begin
    j := j + 1;
  end;
end;
PAL.UnlockExecution;

Delete(html, 1, i+1);
WriteLn('HTML before the sixth separator');
WriteLn(html);
}

var sepa : String = ' - ';
var artist : String = html;
var title : String = html;

Delete(artist, Pos(sepa, artist), Length(artist));
WriteStr('artist: ');
WriteLn(artist);
Delete(title, 1, Pos(sepa, title) + Length(sepa) - 1);
WriteStr('title: ');
WriteLn(title);

var Song : TSongInfo;
Song := TSongInfo.Create;
Song['artist'] := artist;
//Song['title'] := title;
Encoders.SongChange(Song);
Song.Free;
WriteLn('Waiting 10 Seconds so we are not constantly updating.');
PAL.WaitForTime(T['+00:00:10']); //Wait 5 secs;


Quote:
Do you know why it keeps doing thIs?

I guess because it detects your artist - song string as both artist and title, it will obviously add one "thing" each time you call the script.
At first it starts out as artist - title, then you get artist ="artist", title = "title artist - title", and so on.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
 Post subject: Re: Meta data live DJ
PostPosted: June 21st, 2020, 3:48 pm 
Offline
New User
New User

Joined: June 3rd, 2020, 2:02 am
Posts: 16
Good evening,
I think I’ve got it working like it should.
Now the Next issue occurs. The scripts runs, but the metadata update is very slow/late.

Sometimes it’s 2/4mins behind.
Is it something I’ve done wrong? (I’ve copied last version) or is it in this script and can’t be changed?

Thanks


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 87 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group