]> git.parisson.com Git - deefuzzer.git/commitdiff
finally fix some bad utf-8 encodings and update infos
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 16 Apr 2009 14:24:46 +0000 (14:24 +0000)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 16 Apr 2009 14:24:46 +0000 (14:24 +0000)
INSTALL
README
deefuzz.py
tools/PyRSS2Gen.py

diff --git a/INSTALL b/INSTALL
index 929c18c6249999ac956f28772922fec0d818eda0..ff1e078f66c16247814eb142b85988a0b3619d21 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (c) 2007-2007 Guillaume Pellerin <pellerin@parisson.com>
+# Copyright (c) 2007-2009 Guillaume Pellerin <pellerin@parisson.com>
 # All rights reserved.
 #
 # This software is licensed as described in the file COPYING, which
@@ -9,8 +9,9 @@
 #
 # Author: Guillaume Pellerin <pellerin@parisson.com>
 
- depends : python, python-dev, python-xml, python-shout | shout-python, libshout3, libshout3-dev, icecast2
- recommends : python-mutagen
+ depends : python, python-dev, python-xml, python-shout | shout-python, libshout3,
+           libshout3-dev, icecast2 python-mutagen
+           
  provides : shout-python
 
 python-shout is included in DeeFuzz but needs to be compiled and installed.
diff --git a/README b/README
index 3c2fc851d84a5d241a3ad0d08e00ced83c83888b..cb8e0232a8c385d10cb715d0212cd8499908cf1a 100644 (file)
--- a/README
+++ b/README
@@ -7,11 +7,20 @@ deefuzz : an easy and light media streaming tool
 # 1. Introduction
 # ===============
 
-DeeFuzz is a light python program that streams media data from file systems to icecast2
-with the metadata. It supports MP3, OGG, SPEEX and THEORA media.
+DeeFuzz Tools are new light and easy tools to stream audio and video over internet. It is dedicated to people who wants to create playlisted webradios or webTVs with rich media contents. It depends on python, icecast2 server, libshout and some other tools.
+
+Here are the main features of the DeeFuzz Tools:
+
+ * MP3 and OGG (audio & video) streaming over internet
+ * Full metadata encapsulation and management
+ * RSS podcast feeding (current tracks and playlists)
+ * M3U playlist feefing
+ * Multi-theading architecture (multiple stations now authorized)
+ * Optional random (shuffled) playlists
+ * VERY light and optimized streaming process !
 
 It is neccessary to provide a config file which sets all needed parameters
-(see example/myfuzz.xml for example).
+(see example/myfuzz.xml for an example).
 
 
 # 2. Installation
index 4c2365fc5b3e649545cfa850329d15fb19d93801..219a6fe3dd23ab9ab60815e2ee3c7c433c793b7e 100755 (executable)
@@ -237,8 +237,11 @@ class Station(Thread):
         else:
             sub_title = '(playlist)'
 
+        channel_subtitle = self.channel.name + ' ' + sub_title
+
         for media in media_list:
-            media_link = self.channel.url + self.media_url_dir + media.file_name.decode()
+            media_link = self.channel.url + self.media_url_dir + media.file_name
+            media_link = media_link.decode('utf-8')
             media_description = '<table>'
             for key in media.metadata.keys():
                 if media.metadata[key] != '':
@@ -248,17 +251,19 @@ class Station(Thread):
             media_stats = os.stat(media.media)
             media_date = time.localtime(media_stats[8])
             media_date = time.strftime("%a, %d %b %Y %H:%M:%S +0000", media_date)
-
+            date_now = str(datetime.datetime.now())
+            
             title = media.metadata['title']
             artist = media.metadata['artist']
             if not (title or artist):
                 song = str(media.file_name)
             else:
                 song = artist + ' : ' + title
-                
+
+
             if self.rss_enclosure == '1':
                 rss_item_list.append(PyRSS2Gen.RSSItem(
-                    title = song.decode(),
+                    title = song,
                     link = media_link,
                     description = media_description,
                     enclosure = PyRSS2Gen.Enclosure(media_link, str(media.size), 'audio/mpeg'),
@@ -267,20 +272,20 @@ class Station(Thread):
                     )
             else:
                 rss_item_list.append(PyRSS2Gen.RSSItem(
-                    title = song.decode(),
+                    title = song,
                     link = media_link,
                     description = media_description,
                     guid = PyRSS2Gen.Guid(media_link),
                     pubDate = media_date,)
                     )
 
-        rss = PyRSS2Gen.RSS2(title = self.channel.name + ' ' + sub_title,
+        rss = PyRSS2Gen.RSS2(title = channel_subtitle,
                             link = self.channel.url,
                             description = self.channel.description,
-                            lastBuildDate = datetime.datetime.now(),
+                            lastBuildDate = date_now,
                             items = rss_item_list,)
         f = open(rss_file, 'w')
-        rss.write_xml(f)
+        rss.write_xml(f, 'utf-8')
         f.close()
 
     def set_playlist(self):
@@ -387,9 +392,9 @@ class Station(Thread):
                 if not (title or artist):
                     song = str(self.current_media_obj[0].file_name)
                 else:
-                    song = str(artist) + ' : ' + str(title)
+                    song = artist + ' : ' + title.decode('utf-8')
 
-                self.channel.set_metadata({'song': song})
+                self.channel.set_metadata({'song': str(song)})
                 self.update_rss(self.current_media_obj, self.rss_current_file)
                 self.logger.write('DeeFuzzing this file on %s :  id = %s, index = %s, name = %s' \
                     % (self.short_name, self.id, self.index_list[self.id], self.current_media_obj[0].file_name))
index fc1f1cf245f4bcddfa8b22aaf57e8d195f4dbe18..5a1975e7f5a0f4b75ca60a38a5516944a1aa3b9f 100644 (file)
@@ -10,14 +10,14 @@ import datetime
 
 # Could make this the base class; will need to add 'publish'
 class WriteXmlMixin:
-    def write_xml(self, outfile, encoding = "iso-8859-1"):
+    def write_xml(self, outfile, encoding = "utf-8"):
         from xml.sax import saxutils
         handler = saxutils.XMLGenerator(outfile, encoding)
         handler.startDocument()
         self.publish(handler)
         handler.endDocument()
 
-    def to_xml(self, encoding = "iso-8859-1"):
+    def to_xml(self, encoding = "utf-8"):
         try:
             import cStringIO as StringIO
         except ImportError: