Giter VIP home page Giter VIP logo

Comments (16)

yomguy avatar yomguy commented on July 18, 2024

It is very difficult to detect whether a char is ISO or UTF out of the box. So there are indeed some issues with ISO chars... But we will try to fix that, maybe using chardet : https://pypi.python.org/pypi/chardet

from deefuzzer.

bw4518 avatar bw4518 commented on July 18, 2024

Good to hear, hopefully soon enough :)

By the way, I have a side question, both "artist" and "title" are shown in a "Title" column of media player .. is there a way to use proper field/column? Or is it an Icecast issue?

from deefuzzer.

yomguy avatar yomguy commented on July 18, 2024

Yes Icecast has a unique field for song info :-/

from deefuzzer.

yomguy avatar yomguy commented on July 18, 2024

Managing char coding is hard an painful, so I need some more tests / hacks on this on various languages.

from deefuzzer.

achbed avatar achbed commented on July 18, 2024

Icecast metadata can have more than just title, but the output in the status XSLT files in the default install does not send them out. You can modify the files to do that. The extra metadata does get communicated on the stream I believe.

from deefuzzer.

ChoiZ avatar ChoiZ commented on July 18, 2024

With clementine I have artist and song title in 2 fields because clementine split " - " in metadata info. You can do it on your player (I think it's less difficult to edit player instead of icecast).

from deefuzzer.

achbed avatar achbed commented on July 18, 2024

In most cases, it would be easier to edit your player. I've written a new status-json2.xsl file for my install of Icecast2 that exports key stream information as a JSON object. It either uses artist and/or song fields, or auto-splits the title field automatically.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output indent="no" omit-xml-declaration="yes" method="text" encoding="UTF-8" media-type="application/json"/><xsl:template match="/icestats">{<xsl:for-each select="source"><xsl:if test="position()>1">,</xsl:if>"<xsl:value-of select="translate(@mount,'/','')" />":{"play":{"M3U":"<xsl:value-of select="@mount" />.m3u","XSPF":"<xsl:value-of select="@mount" />.xspf"},"name":"<xsl:value-of select="server_name" />","description":"<xsl:value-of select="server_description" />","type":"<xsl:value-of select="server_type" />","bitrate":"<xsl:value-of select="bitrate" />","listeners":{"current":"<xsl:value-of select="listeners" />","peak":"<xsl:value-of select="listener_peak" />","max":"<xsl:value-of select="max_listeners" />"},"nowplaying":{"artist":"<xsl:choose><xsl:when test="artist"><xsl:value-of select="artist" /></xsl:when><xsl:otherwise><xsl:value-of select='substring-before(title," - ")' /></xsl:otherwise></xsl:choose>","title":"<xsl:choose><xsl:when test="artist"><xsl:value-of select="title" /></xsl:when><xsl:otherwise><xsl:value-of select='substring-after(title," - ")' /></xsl:otherwise></xsl:choose>"}}</xsl:for-each>}</xsl:template></xsl:stylesheet>

It's a bit of a run-on sentence to make sure there's no unexpected newlines (which break certain JSON interpreters). Here it is broken out (if you copy from below, make sure to remove any newlines and extra spaces before using in production):

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output indent="no" omit-xml-declaration="yes" method="text" encoding="UTF-8" media-type="application/json"/>
<xsl:template match="/icestats">
{
  <xsl:for-each select="source">
  <xsl:if test="position()>1">,</xsl:if>
  "<xsl:value-of select="translate(@mount,'/','')" />":{
    "play":{
      "M3U":"<xsl:value-of select="@mount" />.m3u",
      "XSPF":"<xsl:value-of select="@mount" />.xspf"
    },
    "name":"<xsl:value-of select="server_name" />",
    "description":"<xsl:value-of select="server_description" />",
    "type":"<xsl:value-of select="server_type" />",
    "bitrate":"<xsl:value-of select="bitrate" />",
    "listeners":{
      "current":"<xsl:value-of select="listeners" />",
      "peak":"<xsl:value-of select="listener_peak" />",
      "max":"<xsl:value-of select="max_listeners" />"
    },
    "nowplaying":{
      "artist":"<xsl:choose>
         <xsl:when test="artist"><xsl:value-of select="artist" /></xsl:when>
         <xsl:otherwise><xsl:value-of select='substring-before(title," - ")' /></xsl:otherwise>
      </xsl:choose>",
      "title":"<xsl:choose>
         <xsl:when test="artist"><xsl:value-of select="title" /></xsl:when>
         <xsl:otherwise><xsl:value-of select='substring-after(title," - ")' /></xsl:otherwise>
      </xsl:choose>"
    }
  }
</xsl:for-each>
}
</xsl:template>
</xsl:stylesheet>

from deefuzzer.

yomguy avatar yomguy commented on July 18, 2024

Great! This should be the default setup in icecast :)

from deefuzzer.

ChoiZ avatar ChoiZ commented on July 18, 2024

Out of context (maybe your xsl can be a gist).

We can create "gist" for sharing code (ie: for config in /examples folder).
We can show all revision with gist instead of "comments".

Creating "gist" allow to have:

  • yaml config 0.6.6 (revision 1)
  • yaml config 0.7 (revision 2)

What do you think about that?

from deefuzzer.

yomguy avatar yomguy commented on July 18, 2024

Good point @ChoiZ
As explain in #20, icecast mountpoints should be configured with UTF8 to allow special chars.

from deefuzzer.

achbed avatar achbed commented on July 18, 2024

I've added this code to the wiki.

from deefuzzer.

yomguy avatar yomguy commented on July 18, 2024

Good to have started the wiki. As I wanted to simplify the README, I've put you doc about station folders also in the wiki. Tell me if you are OK with that.

from deefuzzer.

ChoiZ avatar ChoiZ commented on July 18, 2024

I'll check that. For @achbed icecast's config we must add icecast minimum version. (status-json2.xsl is implemented since 1 year in my memory).

from deefuzzer.

ChoiZ avatar ChoiZ commented on July 18, 2024

For station folder doc, I think we have to create a "real" configuration and define:

  • stationfolder.folder : /home/deefuzzer
  • a real shortname MyStation
  • a name MyStation (what diference between name and shortname? limited char on shortname?).
  • a gender pop, rock…
  • a media.dir mp3 (if I understand this path is concat(stationfolder.folder + media.dir)? so equal to /home/deefuzzer/mp3?)

from deefuzzer.

yomguy avatar yomguy commented on July 18, 2024

Yes @ChoiZ you are welcome to add any more examples to the doc / wiki ;)

from deefuzzer.

ChoiZ avatar ChoiZ commented on July 18, 2024

Ok so I need an answer for "media.dir".

from deefuzzer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.