c = conn.cursor()
if domain != None:
wildchar = "*." + ".".join(domain.split(".")[-domain.count("."):])
- c.execute("select blocker, block_level, reason from blocks where blocked = ? or blocked = ? or blocked = ? or blocked = ?", (domain, "*."+domain, wildchar, get_hash(domain)))
+ c.execute("select blocker, block_level, reason from blocks where blocked = ? or blocked = ? or blocked = ? or blocked = ?", (domain, "*." + domain, wildchar, get_hash(domain)))
else:
c.execute("select * from blocks where reason like ? and reason != ''", ("%"+reason+"%",))
blocks = c.fetchall()
if header_text in blocks:
blocks[header_text].append(
{
- "domain": line.find("span").text.lower(),
+ "domain": line.find("span").text,
"hash": line.find("span")["title"][9:],
"reason": line.find_all("td")[1].text.strip(),
}
json = get_mastodon_blocks(blocker)
for block_level, blocks in json.items():
for instance in blocks:
+ blocked == blocked.lower()
blocked, blocked_hash, reason = instance.values()
if blocked.count("*") <= 1:
c.execute(