mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-24 02:54:05 +01:00
Merge pull request #1276 from kyrias/title-timeout
Add timeout to `web title` command
This commit is contained in:
commit
76170080b5
@ -147,7 +147,9 @@ class Web(callbacks.PluginRegexp):
|
|||||||
|
|
||||||
def getTitle(self, irc, url, raiseErrors):
|
def getTitle(self, irc, url, raiseErrors):
|
||||||
size = conf.supybot.protocols.http.peekSize()
|
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:
|
try:
|
||||||
text = text.decode(utils.web.getEncoding(text) or 'utf8',
|
text = text.decode(utils.web.getEncoding(text) or 'utf8',
|
||||||
'replace')
|
'replace')
|
||||||
|
Loading…
Reference in New Issue
Block a user