Strip html in RSS description tags fixes problems with certain feeds (Thanks to Leo Gomez)
git-svn-id: svn://svn.berlios.de/gpodder@34 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
parent
80ecc07da6
commit
0c8f02a747
|
@ -1,3 +1,8 @@
|
|||
Sun, 26 Feb 2006 00:11:28 +0100 <thp@perli.net>
|
||||
* Bumped version number and date in bin/gpodder
|
||||
* Updated TODO-List
|
||||
* Strip html inside <description> tags (Reported by Leo Gomez)
|
||||
|
||||
Sat, 04 Feb 2006 19:07:33 +0100 <thp@perli.net>
|
||||
* ** gPodder version 0.5 is here! **
|
||||
+ Added "downloaded episodes" tab
|
||||
|
|
2
README
2
README
|
@ -45,7 +45,7 @@
|
|||
|
||||
Debian/Ubuntu users can install the dependencies with:
|
||||
|
||||
apt-get install python python-glade2 python-gtk2 wget
|
||||
apt-get install python python-glade2 python-gtk2 wget python-xml
|
||||
|
||||
Other users: Please install the above packages somehow ;)
|
||||
If you want to install gPodder from source, you have to
|
||||
|
|
1
TODO
1
TODO
|
@ -30,4 +30,5 @@
|
|||
* maybe save date with downloads
|
||||
* maybe a "all channels view"
|
||||
|
||||
** UTILIZE PYTHON-FEEDPARSER
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
# PLEASE DO NOT CHANGE FORMAT OF __version__ LINE (Makefile reads this)
|
||||
|
||||
__author__ = "Thomas Perl <thp@perli.net>"
|
||||
__version__ = "0.5"
|
||||
__date__ = "2006-02-04"
|
||||
__version__ = "0.6-svn"
|
||||
__date__ = "2006-02-26"
|
||||
__copyright__ = "Copyright (c) 2005-2006 %s. All rights reserved." % __author__
|
||||
__licence__ = "GPL"
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@ import libgpodder
|
|||
from liblocdbwriter import writeLocalDB
|
||||
from liblocdbreader import readLocalDB
|
||||
|
||||
import re
|
||||
|
||||
|
||||
# podcastChannel: holds data for a complete channel
|
||||
class podcastChannel(object):
|
||||
|
@ -35,7 +37,7 @@ class podcastChannel(object):
|
|||
self.url = url
|
||||
self.title = title
|
||||
self.link = link
|
||||
self.description = description
|
||||
self.description = stripHtml( description)
|
||||
self.items = []
|
||||
|
||||
def addItem( self, item):
|
||||
|
@ -111,7 +113,7 @@ class podcastItem(object):
|
|||
self.length = length
|
||||
self.mimetype = mimetype
|
||||
self.guid = guid
|
||||
self.description = description
|
||||
self.description = stripHtml( description)
|
||||
self.link = ""
|
||||
|
||||
def getSize( self):
|
||||
|
@ -169,3 +171,8 @@ def channelsToModel( channels):
|
|||
return new_model
|
||||
|
||||
|
||||
def stripHtml( html):
|
||||
# strips html from a string (fix for <description> tags containing html)
|
||||
rexp = re.compile( "<[^>]*>")
|
||||
return rexp.sub( "", html)
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ from string import strip
|
|||
|
||||
from libpodcasts import podcastChannel
|
||||
from libpodcasts import podcastItem
|
||||
from libpodcasts import stripHtml
|
||||
|
||||
class rssErrorHandler( ErrorHandler):
|
||||
def __init__( self):
|
||||
|
@ -72,7 +73,7 @@ class rssReader( DefaultHandler):
|
|||
if name == "link":
|
||||
self.channel.link = self.current_element_data
|
||||
if name == "description":
|
||||
self.channel.description = self.current_element_data
|
||||
self.channel.description = stripHtml( self.current_element_data)
|
||||
|
||||
if self.current_item != None:
|
||||
if name == "title":
|
||||
|
@ -80,7 +81,7 @@ class rssReader( DefaultHandler):
|
|||
if name == "link":
|
||||
self.current_item.link = self.current_element_data
|
||||
if name == "description":
|
||||
self.current_item.description = self.current_element_data
|
||||
self.current_item.description = stripHtml( self.current_element_data)
|
||||
if name == "guid":
|
||||
self.current_item.guid = self.current_element_data
|
||||
if name == "item":
|
||||
|
|
Loading…
Reference in New Issue