mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
plugins/Web: Encountering an HTMLParser exception doesn't mean the title hasn't already been snarfed. Don't bail right away.
This commit is contained in:
parent
bd31b7f596
commit
bc1451e898
@ -88,8 +88,8 @@ class Web(callbacks.PluginRegexp):
|
||||
try:
|
||||
parser.feed(text)
|
||||
except HTMLParser.HTMLParseError:
|
||||
self.log.debug('Unable to parse %u', url)
|
||||
return
|
||||
self.log.debug('Encountered a problem parsing %u. Title may '
|
||||
'already be set, though', url)
|
||||
if parser.title is not None:
|
||||
domain = utils.web.getDomain(url)
|
||||
title = utils.web.htmlToText(parser.title.strip())
|
||||
@ -164,9 +164,8 @@ class Web(callbacks.PluginRegexp):
|
||||
try:
|
||||
parser.feed(text)
|
||||
except HTMLParser.HTMLParseError:
|
||||
irc.reply(format('That URL appears to have no HTML title within '
|
||||
'the first %i bytes.', size))
|
||||
return
|
||||
self.log.debug('Encountered a problem parsing %u. Title may '
|
||||
'already be set, though', url)
|
||||
if parser.title is not None:
|
||||
irc.reply(utils.web.htmlToText(parser.title.strip()))
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user