Respect timeout when downloading RSS feeds

This commit is contained in:
Kovid Goyal 2020-12-23 12:09:58 +05:30
parent c614710354
commit f8a3a780a8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1680,7 +1680,7 @@ class BasicNewsRecipe(Recipe):
url = purl._replace(netloc=hostname).geturl() url = purl._replace(netloc=hostname).geturl()
if purl.username and purl.password: if purl.username and purl.password:
br.add_password(url, purl.username, purl.password) br.add_password(url, purl.username, purl.password)
with closing(br.open_novisit(url)) as f: with closing(br.open_novisit(url, timeout=self.timeout)) as f:
raw = f.read() raw = f.read()
parsed_feeds.append(feed_from_xml( parsed_feeds.append(feed_from_xml(
raw, title=title, log=self.log, raw, title=title, log=self.log,