From d92b4f08f623295028cf59338ca33d2a55c29f7b Mon Sep 17 00:00:00 2001 From: jellysheep Date: Sun, 2 Aug 2015 19:35:01 +0200 Subject: [ZDF] Encode unicode characters when loading XML The XML file from the ZDF website often contains unicode characters, which lead to errors like `'ascii' codec can't decode byte 0xc3 in position 29: ordinal not in range(128)`. This change makes the plugin encode unicode characters to UTF-8 before parsing the XML data. --- module/plugins/hoster/ZDF.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/ZDF.py') diff --git a/module/plugins/hoster/ZDF.py b/module/plugins/hoster/ZDF.py index f66c07a13..549dd718c 100644 --- a/module/plugins/hoster/ZDF.py +++ b/module/plugins/hoster/ZDF.py @@ -42,7 +42,7 @@ class ZDF(Hoster): def process(self, pyfile): - xml = etree.fromstring(self.load(self.XML_API % self.get_id(pyfile.url))) + xml = etree.fromstring(self.load(self.XML_API % self.get_id(pyfile.url)).encode("UTF-8")) status = xml.findtext("./status/statuscode") if status != "ok": -- cgit v1.2.3