Fixed userinfo component of URLs not being filtered out. (Closes #5)
Some checks failed
Build Maubot Plugin Artifact / Build (push) Successful in 2s
Lint Source Code / Lint (push) Failing after 8s

This commit is contained in:
2025-04-05 17:42:36 -04:00
parent c4156f861e
commit 815b246ad8

View File

@@ -505,7 +505,13 @@ class OwncastSentry(Plugin):
# "stream.logal.dev" -> "stream.logal.dev"
# "https://stream.logal.dev" -> "stream.logal.dev"
# "stream.logal.dev/embed/chat/readwrite" -> "stream.logal.dev"
# "https://stream.logal.dev/abcdefghijklmno/123456789" -> "stream.logal.dev
# "https://stream.logal.dev/abcdefghijklmno/123456789" -> "stream.logal.dev"
# "notify@stream.logal.dev" -> "stream.logal.dev"
parsed_url = urlparse(url)
domain = (parsed_url.netloc or parsed_url.path).lower()
if "@" in domain:
return domain.split('@')[-1]
return domain