diff options
Diffstat (limited to 'modules/title.py')
| -rw-r--r-- | modules/title.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/modules/title.py b/modules/title.py index df05546e..eba18566 100644 --- a/modules/title.py +++ b/modules/title.py @@ -27,7 +27,7 @@ class Module(ModuleManager.BaseModule): for title_word in RE_WORDSPLIT.split(title): if len(title_word) > 1 or title_word.isalpha(): title_word = title_word.lower() - title_words.append(title_word.strip("'\"<>()")) + title_words.append(title_word.strip("'\"<>(),:")) if title_words: present = 0 @@ -45,13 +45,9 @@ class Module(ModuleManager.BaseModule): if not urllib.parse.urlparse(url).scheme: url = "http://%s" % url - hostname = urllib.parse.urlparse(url).hostname - if not utils.http.host_permitted(hostname): - self.log.warn("Attempted to get forbidden host: %s", [url]) - return -1, None - + request = utils.http.Request(url, check_hostname=True) try: - page = utils.http.request(url) + page = utils.http.request(request) except Exception as e: self.log.error("failed to get URL title for %s: %s", [url, str(e)]) return -1, None @@ -71,7 +67,7 @@ class Module(ModuleManager.BaseModule): return -2, title if channel.get_setting("title-shorten", False): - short_url = self.exports.get_one("shorturl")(server, url, + short_url = self.exports.get("shorturl")(server, url, context=channel) return page.code, "%s - %s" % (title, short_url) return page.code, title |
