diff options
| author | 2018-10-19 10:31:45 +0100 | |
|---|---|---|
| committer | 2018-10-19 10:31:45 +0100 | |
| commit | 87fc3cda55362bb3a0e617da5b78e2cbc817062a (patch) | |
| tree | c31af800cac43e82406ba5f42784a7e3a5bcbb3f /modules | |
| parent | Some networks allow you to remove user modes that don't exist e.g. removing +o (diff) | |
| signature | ||
Catch exceptions in modules/title.py
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/title.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/title.py b/modules/title.py index 96a07e57..5a98b527 100644 --- a/modules/title.py +++ b/modules/title.py @@ -20,9 +20,16 @@ class Module(ModuleManager.BaseModule): url = re.search(REGEX_URL, url.message).group(0) if not url: raise utils.EventError("No URL provided/found.") - soup = utils.http.get_url(url, soup=True) + + soup = None + try: + soup = utils.http.get_url(url, soup=True) + except: + pass + if not soup: raise utils.EventError("Failed to get URL.") + title = soup.title if title: title = title.text.replace("\n", " ").replace("\r", "" |
