diff --git a/plugins/RSS/plugin.py b/plugins/RSS/plugin.py index f1a7bbc2a..49442852e 100644 --- a/plugins/RSS/plugin.py +++ b/plugins/RSS/plugin.py @@ -52,6 +52,11 @@ import supybot.callbacks as callbacks from supybot.i18n import PluginInternationalization, internationalizeDocstring _ = PluginInternationalization('RSS') +if minisix.PY2: + from urllib2 import ProxyHandler +else: + from urllib.request import ProxyHandler + def get_feedName(irc, msg, args, state): if ircutils.isChannel(args[0]): state.errorInvalid('feed name', args[0], 'must not be channel names.') @@ -289,9 +294,15 @@ class RSS(callbacks.Plugin): # Feed fetching def update_feed(self, feed): + handlers = [] + if utils.web.proxy(): + handlers.append(ProxyHandler( + {'http': utils.force(utils.web.proxy())})) + handlers.append(ProxyHandler( + {'https': utils.force(utils.web.proxy())})) with feed.lock: d = feedparser.parse(feed.url, etag=feed.etag, - modified=feed.modified) + modified=feed.modified, handlers=handlers) if 'status' not in d or d.status != 304: # Not modified if 'etag' in d: feed.etag = d.etag