From 663bbfa0c73b5c25fca81561053a6187bdc46409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20E=C3=9Fer?= Date: Wed, 21 Nov 2018 16:41:40 +0000 Subject: [PATCH] circumvent GDPR redirect on Tumblr feeds by faking a different user agent --- python/feedparser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/feedparser.py b/python/feedparser.py index 80d37a07..cd3cb54c 100644 --- a/python/feedparser.py +++ b/python/feedparser.py @@ -3829,6 +3829,10 @@ def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, refer :return: A :class:`FeedParserDict`. ''' + # circumvent GDPR redirect on Tumblr feeds by faking a different user agent + if 'tumblr.com' in url_file_stream_or_string: + agent = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" + if handlers is None: handlers = [] if request_headers is None: -- GitLab