1
0
mirror of https://github.com/Mikaela/Limnoria.git synced 2025-04-05 23:37:51 +02:00

Merge pull request from kyrias/title-timeout

Add timeout to `web title` command
This commit is contained in:
Valentin Lorentz 2016-12-08 18:22:02 +01:00 committed by GitHub
commit 76170080b5

@ -147,7 +147,9 @@ class Web(callbacks.PluginRegexp):
def getTitle(self, irc, url, raiseErrors):
size = conf.supybot.protocols.http.peekSize()
(target, text) = utils.web.getUrlTargetAndContent(url, size=size)
timeout = self.registryValue('timeout')
(target, text) = utils.web.getUrlTargetAndContent(url, size=size,
timeout=timeout)
try:
text = text.decode(utils.web.getEncoding(text) or 'utf8',
'replace')