Signed-off-by: François Boulogne <fboulogne sciunto org>
Signed-off-by: W. Trevor King <wking@tremily.us>
import urllib
import re
+import rss2email
def process(feed, parsed, entry, guid, message):
# decode message
# Remove the redirect and modify the content
try:
- direct_link = urllib.request.urlopen(link).geturl()
+ request = urllib.request.Request(link)
+ request.add_header('User-agent', rss2email.feed._USER_AGENT)
+ direct_link = urllib.request.urlopen(request).geturl()
except:
return message
content = re.sub(re.escape(link), direct_link, content, re.MULTILINE)