From 1274df4e1d5bbb3185f7107dcc2d3f19fc445a46 Mon Sep 17 00:00:00 2001 From: pictuga Date: Sun, 24 Nov 2013 20:43:09 +0100 Subject: [PATCH] Yet another feedburner workaround This one really drove me mad. When the "Referer" is feedburner itself, it just will show html page (with Google Reader Add buttons), instead of the regular feed. Itself adding "?format=xml" at the end of the url also solves it, but users don't know about that... --- morss.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/morss.py b/morss.py index 999c11b..0fafd2d 100644 --- a/morss.py +++ b/morss.py @@ -208,7 +208,9 @@ class SimpleDownload(urllib2.HTTPCookieProcessor): urllib2.HTTPCookieProcessor.http_request(self, req) req.add_unredirected_header('Accept-Encoding', 'gzip') req.add_unredirected_header('User-Agent', self.useragent) - req.add_unredirected_header('Referer', 'http://%s' % req.get_host()) + if req.get_host() != 'feeds.feedburner.com': + req.add_unredirected_header('Referer', 'http://%s' % req.get_host()) + if self.cache: if self.etag: req.add_unredirected_header('If-None-Match', self.etag)