Commit fe2b229f authored by Lysander Trischler's avatar Lysander Trischler

Quick fix (read: hack) for unknown entities in XML

The bestofyoutube.com RSS feed contains illegal é HTML entities so the
Python XML parser reported "xml.parsers.expat.ExpatError: undefined entity".
This ugly hack fixes this incident. However, a more appropriate solution must
be implemented in a later point of time to really get rid of these kind of
nasty errors!
parent 7904471f
......@@ -66,7 +66,7 @@ if rss_url.startswith(("http://", "https://")):
else:
rss_stream = open(rss_url, "rb")
tree = xml.dom.minidom.parse(rss_stream)
tree = xml.dom.minidom.parseString(rss_stream.read().replace("é", "é"))
rss_stream.close()
channel = tree.getElementsByTagName("rss")[0].getElementsByTagName("channel")[0]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment