elif mode == "obfuscator":
database.cursor.execute("SELECT software, COUNT(domain) AS cnt FROM instances WHERE has_obfuscation = 1 GROUP BY software ORDER BY cnt DESC LIMIT ?", [amount])
elif mode == "obfuscation":
- database.cursor.execute("SELECT has_obfuscation, COUNT(domain) AS cnt FROM instances WHERE software IN ('pleroma', 'lemmy', 'mastodon', 'friendica') GROUP BY has_obfuscation ORDER BY cnt DESC LIMIT ?", [amount])
+ database.cursor.execute("SELECT has_obfuscation, COUNT(domain) AS cnt FROM instances WHERE software IN ('pleroma', 'lemmy', 'mastodon', 'misskey', 'friendica') GROUP BY has_obfuscation ORDER BY cnt DESC LIMIT ?", [amount])
elif mode == "block_level":
database.cursor.execute("SELECT block_level, COUNT(rowid) AS cnt FROM blocks GROUP BY block_level ORDER BY cnt DESC LIMIT ?", [amount])
else:
if "domain" not in row:
logger.warning("row='%s' does not contain element 'domain' - SKIPPED!", row)
continue
- elif row["domain"] is None:
- logger.debug("row[domain] is None - SKIPPED!")
- continue
- elif row["domain"] == "":
- logger.debug("row[domain] is empty - SKIPPED!")
+ elif row["domain"] is None or row["domain"] == "":
+ logger.debug("row[domain]='%s' is empty - SKIPPED!", row["domain"])
continue
logger.debug("row[domain]='%s' - BEFORE!", row["domain"])
if "domain" not in entry:
logger.warning("entry()=%d does not contain 'domain' - SKIPPED!", len(entry))
continue
- elif entry["domain"] == "":
- logger.debug("entry[domain] is empty - SKIPPED!")
+ elif entry["domain"] is None or entry["domain"] == "":
+ logger.debug("entry[domain]='%s' is empty - SKIPPED!", entry["domain"])
continue
elif not domain_helper.is_wanted(entry["domain"]):
logger.debug("entry[domain]='%s' is not wanted - SKIPPED!", entry["domain"])
block["reason"] = tidyup.reason(block["reason"]) if block["reason"] is not None and block["reason"] != "" else None
logger.debug("blocked='%s',reason='%s' - AFTER!", block["blocked"], block["reason"])
- if block["blocked"] == "":
- logger.warning("blocked is empty, blocker='%s'", blocker)
+ if block["blocked"] is None or block["blocked"] == "":
+ logger.warning("block[blocked]='%s' is empty, blocker='%s'", block["blocked"], blocker)
continue
elif block["blocked"].endswith(".onion"):
logger.debug("blocked='%s' is a TOR .onion domain - SKIPPED", block["blocked"])
origin = row["origin"]
nodeinfo_url = row["nodeinfo_url"]
- logger.debug("Looking up instance by domainm, blocked='%s'", block["blocked"])
- if block["blocked"] == "":
- logger.debug("block[blocked] is empty - SKIPPED!")
+ logger.debug("Looking up instance by domain, blocked='%s'", block["blocked"])
+ if block["blocked"] is None or block["blocked"] == "":
+ logger.debug("block[blocked]='%s' is empty - SKIPPED!", block["blocked"])
continue
logger.debug("block[blocked]='%s' - BEFORE!", block["blocked"])
for item in items:
logger.debug("item[]='%s'", type(item))
domain = item.decode_contents()
+ logger.debug("domain[%s]='%s'", type(domain), domain)
domain = tidyup.domain(domain) if domain not in [None, ""] else None
logger.debug("domain='%s' - AFTER!", domain)
logger.debug("entry[]='%s'", type(entry))
doc = bs4.BeautifulSoup(entry.content.value, "html.parser")
logger.debug("doc[]='%s'", type(doc))
+
for element in doc.findAll("a"):
logger.debug("element[]='%s'", type(element))
for href in element["href"].split(","):
})
logger.debug("Setting obfuscated=%d for row[domain]='%s' ...", obfuscated, row["domain"])
+ instances.set_has_obfuscation(row["domain"], (obfuscated > 0))
instances.set_obfuscated_blocks(row["domain"], obfuscated)
logger.info("domain='%s' has %d obfuscated domain(s)", row["domain"], obfuscated)
fetched = network.get_json_api(
source_domain,
"/api/1.0/instances/list?count=0&sort_by=name",
- headers,
- (config.get("connection_timeout"), config.get("read_timeout"))
+ headers=headers,
+ timeout=(config.get("connection_timeout"), config.get("read_timeout"))
)
logger.debug("fetched[]='%s'", type(fetched))