diff --git a/modules/framalink.py b/modules/framalink.py index a556563..8b17cd8 100644 --- a/modules/framalink.py +++ b/modules/framalink.py @@ -79,7 +79,7 @@ def parselisten(msg): @hook("all_post") def parseresponse(msg): global LAST_URLS - try: + if hasattr(msg, "text") and msg.text: urls = re.findall("([a-zA-Z0-9+.-]+:(?://)?[^ :]+)", msg.text) for url in urls: o = urlparse(url, "http") @@ -92,8 +92,6 @@ def parseresponse(msg): if recv not in LAST_URLS: LAST_URLS[recv] = list() LAST_URLS[recv].append(url) - except: - pass return msg diff --git a/modules/reddit.py b/modules/reddit.py index 53791ff..4c376d3 100644 --- a/modules/reddit.py +++ b/modules/reddit.py @@ -79,14 +79,12 @@ def parselisten(msg): def parseresponse(msg): global LAST_SUBS - try: + if hasattr(msg, "text") and msg.text: urls = re.findall("www.reddit.com(/\w/\w+/?)", msg.text) for url in urls: for recv in msg.receivers: if recv not in LAST_SUBS: LAST_SUBS[recv] = list() LAST_SUBS[recv].append(url) - except: - pass return msg diff --git a/modules/youtube-title.py b/modules/youtube-title.py index 93240b0..d4061b1 100644 --- a/modules/youtube-title.py +++ b/modules/youtube-title.py @@ -82,7 +82,7 @@ def parselisten(msg): @hook("all_post") def parseresponse(msg): global LAST_URLS - if hasattr(msg, "text"): + if hasattr(msg, "text") and msg.text: urls = re.findall("([a-zA-Z0-9+.-]+:(?://)?[^ :]+)", msg.text) for url in urls: o = urlparse(url)