Next challenge (except for the additonal metadata): Post the song duration
to my reporting script. Since there probably is no ID3V2 that carrying this
value, I tried this here:
def send_meta(m) =
ignore(http.get("http://myserver.com/push.asp?channelid=" ^ url.encode("my
channel") ^ "&duration=" ^ m["file.duration"] ^ ""))
end
radio = on_metadata(send_meta, radio)
Unfortunately, this doesn’t work. The field ‘duration’ is just blank
Any hints?
Thanks!
Alex
*Von:* Samuel Mimram [mailto:smim...@gmail.com]
*Gesendet:* Freitag, 21. Dezember 2012 10:15
*An:* Alexander Dal Farra
*Cc:* Romain Beauxis; savonet-users
*Betreff:* Re: [Savonet-users] liquidsoap metadata to form push
Hi,
On Fri, Dec 21, 2012 at 12:36 AM, Alexander Dal Farra <
alexander.dalfa...@dmd2.net> wrote:
hi Romain
yeah - makes much sense. Since I am not a programmer, I need to ask 2 more
questions (before I dive and try to come up with something) ;-):
- /path/to/script .. could also be a script on a remote server "http://....
"?
Nope, but actually getting a webpage is easily done using the http.get
command. So I would recommend this variant of Romain's solution
def send_meta(m) =
ignore(http.get("
http://domain.com/reporting.php?artist=#{m["artist"]}&title=#{m["title"]}&year=<http://domain.com/reporting.php?artist=madonna&title=borderline&year=1982>
#{m["year"]}"))
end
source = on_metadata(send_meta, source)
- is there any reference in the liquidsoap docs where i can see what
metadata can be used with send_meta(m)?
Here send_meta is a function which will be called each time there is a new
metadata, with m as argument. Here m is a table associating to each
metadata name the contents of the metadata. So m["title"] is the title
m["artist"] is the artist, etc. Those metadata are precisely those listed
in the headers of your mp3 files (so you can see what you will get using an
ID3 tag editor).
Cheers,
Samuel.
bonne soirée
alex
2012/12/20 Romain Beauxis <to...@rastageeks.org>
2012/12/19 Alexander Dal Farra <alexander.dalfa...@dmd2.net>:
> dear list
Hi!
> i am trying to push metadata from the current playing track (all data
> contained in the ID3V2 tags, such as artist, album, track no, isrc, etc.),
> but not to a shoutcast server, but to a form by calling an URL something
> like this directly from liquidsoap:
>
> http://domain.com/reporting.php?artist=madonna&title=borderline&year=1982..
> etc.
>
> i haven't found anything in the docs that handles cases like this, just
> changing metadata towards the shoutcast-server. I am using this for a
> reporting method.
>
> anyone having an idea how to do this?
You need to use on_metatada
(http://liquidsoap.fm/doc-svn/reference.html#on_metadata):
def send_meta(m) =
system("/path/to/script #{m["title"]} #{m["artist"]}")
end
source = on_metadata(send_meta, source)
Makes sense?
Romain
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users