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:
James Vega 2005-06-29 19:05:20 +00:00
parent bd31b7f596
commit bc1451e898

View File

@ -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: