From ce2c200c4961ab64d69eb6ac4fdad4103310b314 Mon Sep 17 00:00:00 2001 From: Mint <> Date: Mon, 8 Aug 2022 14:11:01 +0300 Subject: [PATCH] Fucking unicode --- api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api.py b/api.py index cd302ef..d37d22e 100644 --- a/api.py +++ b/api.py @@ -38,8 +38,9 @@ def blocked(domain: str = None, reason: str = None): c = conn.cursor() if domain != None: wildchar = "*." + ".".join(domain.split(".")[-domain.count("."):]) + punycode = domain.encode('idna').decode('utf-8') c.execute("select blocker, block_level, reason from blocks where blocked = ? or blocked = ? or blocked = ? or blocked = ? or blocked = ? or blocked = ?", - (domain, "*." + domain, wildchar, get_hash(domain), domain.encode('idna'), "*." + domain.encode('idna'))) + (domain, "*." + domain, wildchar, get_hash(domain), punycode, "*." + punycode)) else: c.execute("select * from blocks where reason like ? and reason != ''", ("%"+reason+"%",)) blocks = c.fetchall() -- 2.39.5