zs

Zeitungsschau rss to email converter
git clone git://r-36.net/zs
Log | Files | Refs | LICENSE

commit 63fe7a682af0938334c13a7132b52b933dafec13
parent ab6251f24a30cfb463c0317871529e66ea56079d
Author: Christoph Lohmann <20h@r-36.net>
Date:   Fri, 28 Apr 2017 19:59:17 +0200

Do not let us fool by the http server encoding.

Diffstat:
zeitungsschau/feed.py | 3+--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/zeitungsschau/feed.py b/zeitungsschau/feed.py @@ -24,7 +24,6 @@ def parseiso(dstr, now): # Invalid time format. Could not be parsed. return now - def removenamespaces(xml): for key in xml.nsmap: nsstr = u'{%s}' % (xml.nsmap[key]) @@ -278,7 +277,7 @@ def fetch(uri): else: fd = requests.get(uri, timeout=20,\ headers={"User-Agent": "Zeitungsschau/1.0"}) - fval = fd.text.encode("utf-8") + fval = fd.content rcode = fd.status_code return (rcode, parse(fval))