mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 14:40:51 +01:00
Web: Add early returns on exception when snarfing titles.
Closes GH-1390.
This commit is contained in:
parent
9291fbd4a0
commit
1a1707420b
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user