Web: Add early returns on exception when snarfing titles.

Closes GH-1390.
This commit is contained in:
Valentin Lorentz 2019-11-22 18:17:44 +01:00
parent 9291fbd4a0
commit 1a1707420b
1 changed files with 2 additions and 0 deletions

View File

@ -158,6 +158,7 @@ class Web(callbacks.PluginRegexp):
Raise=True)
else:
self.log.info('Web plugin TitleSnarfer: URL <%s> raised <%s>', url, str(e))
return
try:
text = text.decode(utils.web.getEncoding(text) or 'utf8',
'replace')
@ -170,6 +171,7 @@ class Web(callbacks.PluginRegexp):
self.log.info('Web plugin TitleSnarfer: URL <%s> Could '
'not guess the page\'s encoding. (Try '
'installing python-charade.)', url)
return
try:
parser = Title()
parser.feed(text)