diff options
| author | Mistivia <i@mistivia.com> | 2025-11-07 15:38:06 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-11-07 15:38:06 +0800 |
| commit | 779d76f20c983f4cda0c8912edb8cf7b156b9f09 (patch) | |
| tree | 2d0251664b600af7fd4a0db6c22f0ed8ee4194aa /ircbot | |
| parent | e488e983626475438b6f4802fae4defe77a3e397 (diff) | |
html unescape
Diffstat (limited to 'ircbot')
| -rw-r--r-- | ircbot/main.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ircbot/main.py b/ircbot/main.py index b65b428..096dec8 100644 --- a/ircbot/main.py +++ b/ircbot/main.py @@ -9,6 +9,7 @@ import urllib.parse import hashlib import re import requests +import html connect_time = time.time() @@ -290,7 +291,7 @@ def url_titles(text): if match: title_content = match.group(1).strip() if title_content: - results.append(title_content) + results.append(html.unescape(title_content)) except Exception as e: print(e) return results @@ -526,7 +527,7 @@ class IRCBot: self.handle_command(nick, reply_target, cmd, args) except IndexError: pass - if not is_cmd: + if not is_cmd and reply_target not in config['nolinks']: titles = url_titles(message) if len(titles) > 0: for t in titles: |
