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...master
parent
d3db04332e
commit
1274df4e1d
4
morss.py
4
morss.py
|
@ -208,7 +208,9 @@ class SimpleDownload(urllib2.HTTPCookieProcessor):
|
||||||
urllib2.HTTPCookieProcessor.http_request(self, req)
|
urllib2.HTTPCookieProcessor.http_request(self, req)
|
||||||
req.add_unredirected_header('Accept-Encoding', 'gzip')
|
req.add_unredirected_header('Accept-Encoding', 'gzip')
|
||||||
req.add_unredirected_header('User-Agent', self.useragent)
|
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.cache:
|
||||||
if self.etag:
|
if self.etag:
|
||||||
req.add_unredirected_header('If-None-Match', self.etag)
|
req.add_unredirected_header('If-None-Match', self.etag)
|
||||||
|
|
Loading…
Reference in New Issue