From 52b46c4501a4f67e6355ea8d513dab884c95458f Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 20 Apr 2009 00:12:52 +0000 Subject: [PATCH] fix full charset to utf-8 (but need some info on the server for right descriptions) --- README | 10 +++++----- deefuzz.py | 9 ++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README b/README index 4608c19..cea32df 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ # README # ====== -deefuzz : an easy and light media streaming tool +deefuzz : an easy and light media streaming tools # 1. Introduction @@ -13,10 +13,10 @@ Here are the main features of the DeeFuzz Tools: * MP3 and OGG (audio & video) file 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 + * RSS podcast generator (current tracks and playlists) + * M3U playlist generator + * Recursive, random (shuffled) or pre-defined playlists + * Multi-threaded architecture (multiple stations now authorized !) * VERY light and optimized streaming process ! It is neccessary to provide a config file which sets all needed parameters diff --git a/deefuzz.py b/deefuzz.py index c4c6783..3f1bebf 100755 --- a/deefuzz.py +++ b/deefuzz.py @@ -124,6 +124,9 @@ class DeeFuzz(Thread): return xmltodict(conf_xml,'utf-8') def set_m3u_playlist(self): + m3u_dir = os.sep.join(self.m3u.split(os.sep)[:-1]) + if not os.path.exists(m3u_dir): + os.makedirs(m3u_dir) m3u = open(self.m3u, 'w') i = 1 m3u.write('#EXTM3U\n') @@ -302,7 +305,7 @@ class Station(Thread): rss = PyRSS2Gen.RSS2(title = channel_subtitle, link = self.channel.url, - description = self.channel.description, + description = self.channel.description.decode('utf-8'), lastBuildDate = date_now, items = rss_item_list,) f = open(rss_file, 'w') @@ -413,9 +416,9 @@ class Station(Thread): if not (title or artist): song = str(self.current_media_obj[0].file_name) else: - song = artist + ' : ' + title.decode('utf-8') + song = artist + ' : ' + title - self.channel.set_metadata({'song': str(song.encode('utf-8'))}) + self.channel.set_metadata({'song': str(song.encode('utf-8')), 'charset': 'utf8',}) 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)) -- 2.39.5