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

View File

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