From 9000d43c0f08e6191fcfbf6ddd82b39091bf0dbc Mon Sep 17 00:00:00 2001 From: nex Date: Tue, 3 Jan 2023 14:46:05 +0000 Subject: [PATCH] FIx filter --- cogs/other.py | 9 ++++++--- domains.txt | 3 +-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cogs/other.py b/cogs/other.py index 68f8ca1..b8ae208 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -367,12 +367,15 @@ class OtherCog(commands.Cog): url = urlparse(url) + await ctx.respond(f"Taking screenshot of {url.geturl()}..."[:2000]) + with open("domains.txt") as blacklist: for line in blacklist: - if line.strip() == url.netloc.lower(): - return await ctx.respond("That domain is blacklisted.") + if not line.strip(): + continue + if re.match(line.strip(), url.netloc): + return await ctx.edit(content="That domain is blacklisted.") - await ctx.respond("Taking screenshot...") try: screenshot = await self.screenshot_website( ctx, diff --git a/domains.txt b/domains.txt index a4fc992..11e1dd6 100644 --- a/domains.txt +++ b/domains.txt @@ -1,3 +1,2 @@ 2girls1cup.ca -pornhub.com - +pornhub.com \ No newline at end of file