SpiffyTitles: urlRegularExpression -> urlRegexp

This commit is contained in:
oddluck 2020-07-22 19:02:40 +00:00
parent 17dfc21209
commit 9345cc6335
3 changed files with 3 additions and 6 deletions

View File

@ -306,7 +306,7 @@ titles will be shown in all channels. Default value: `""`
`badLinkText` - The text to return when unable to retrieve a title from a URL. Default value: `Error retrieving title. Check the log for more details.`
`urlRegularExpression` - A regular expression override used to match URLs. You shouldn't need to change this.
`urlRegexp` - A regular expression override used to match URLs. You shouldn't need to change this.
`ignoreActionLinks` (Boolean) - By default SpiffyTitles will ignore links that appear in an action, like /me.

View File

@ -68,7 +68,7 @@ conf.registerGlobalValue(
# URL regex
conf.registerChannelValue(
SpiffyTitles,
"urlRegularExpression",
"urlRegexp",
registry.String(
r"", _("""If set, this regular expression will be used to match URLs"""),
),

View File

@ -559,10 +559,7 @@ class SpiffyTitles(callbacks.Plugin):
"""
Find the first string that looks like a URL from the message
"""
try:
url_re = self.registryValue("urlRegularExpression", channel)
except:
url_re = self.registryValue("urlRegularExpression")
url_re = self.registryValue("urlRegexp", channel)
if not url_re:
url_re = utils.web._httpUrlRe
matches = re.findall(url_re, input)