Comments (16)
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.
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.
Yes Icecast has a unique field for song info :-/
from deefuzzer.
Managing char coding is hard an painful, so I need some more tests / hacks on this on various languages.
from deefuzzer.
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.
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.
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.
Great! This should be the default setup in icecast :)
from deefuzzer.
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.
Good point @ChoiZ
As explain in #20, icecast mountpoints should be configured with UTF8 to allow special chars.
from deefuzzer.
I've added this code to the wiki.
from deefuzzer.
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.
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.
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.
Yes @ChoiZ you are welcome to add any more examples to the doc / wiki ;)
from deefuzzer.
Ok so I need an answer for "media.dir".
from deefuzzer.
Related Issues (20)
- Will this application no longer be supported? HOT 1
- simple mp3 streaming server HOT 5
- Add a verbose mode
- Deefuzzer and Radio DJ HOT 3
- TTS - Feature Request HOT 1
- icecastloop_metadata: Error: 'Station' object has no attribute 'song' HOT 2
- Installation on Ubuntu 22 ARM: list of updated dependencies HOT 2
- Error: can't sync to MPEG frame HOT 1
- STREAM-M
- Is there a way to have jingles play between every nth song instead of between every song? HOT 1
- What is the best way to call playlist.py to regenerate a new playlist.m3u? HOT 3
- Could not send the buffer HOT 2
- Display album name HOT 1
- Can DeeFuzzer do this? HOT 1
- What DeeFuzzer can do? HOT 1
- Playlist reload interface
- segmentation fault (core dumped) HOT 2
- pkg_resources.DistributionNotFound: The 'pycurl' distribution was not found and is required by DeeFuzzer HOT 3
- deefuzzer install failer: ERROR: Command errored out with exit status 1: HOT 10
- OSCController object has no attribute HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deefuzzer.