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!")
continue
for row in fetched["json"]:
logger.debug("row[]='%s'", type(row))
domain = urlparse(row["url"]).netloc.lower().split(":")[0]
-
logger.debug("domain='%s' - AFTER!", domain)
+
if domain is None and domain == "":
logger.debug("domain='%s' is empty after tidyup.domain() - SKIPPED!", domain)
continue
logger.debug("Appending domain='%s' to peers list for relay='%s' ...", domain, row["domain"])
peers.append(domain)
+ logger.debug("domains()=%d,domain='%s'", len(domains), domain)
if dict_helper.has_key(domains, "domain", domain):
logger.debug("domain='%s' already added", domain)
continue
logger.debug("Appending domain='%s' to peers list for relay='%s' ...", domain, row["domain"])
peers.append(domain)
+ logger.debug("domains()=%d,domain='%s'", len(domains), domain)
if dict_helper.has_key(domains, "domain", domain):
logger.debug("domain='%s' already added", domain)
continue
logger.debug("Appending domain='%s' to peers list for relay='%s' ...", domain, row["domain"])
peers.append(domain)
+ logger.debug("domains()=%d,domain='%s'", len(domains), domain)
if dict_helper.has_key(domains, "domain", domain):
logger.debug("domain='%s' already added", domain)
continue
- logger.debug("Appending domain='%s',origin='%s',software='%s'", domain, row["domain"], row["software"])
+ logger.debug("Appending domain='%s',origin='%s',software='%s' ...", domain, row["domain"], row["software"])
domains.append({
"domain": domain,
"origin": row["domain"],
logger.debug("blocked='%s' - BEFORE!", blocked)
blocked = utils.deobfuscate(blocked, blocker)
+ logger.debug("blocked='%s' - AFTER!", blocked)
- logger.debug("blocked='%s' - DEOBFUSCATED!", blocked)
if instances.has_pending(blocker):
logger.debug("Flushing updates for blocker='%s' ...", blocker)
instances.update(blocker)
"reason" : reason,
})
+ logger.debug("reject_media='%s',reject_reports='%s'", reject_media, reject_reports)
if reject_media:
block(blocker, domain, None, "reject_media")
if reject_reports:
data = network.get_json_api(
domain,
path,
- headers,
- (config.get("connection_timeout"), config.get("read_timeout"))
+ headers=headers,
+ timeout=(config.get("connection_timeout"), config.get("read_timeout"))
)
logger.debug("data[]='%s'", type(data))
response = network.fetch_response(
domain,
path,
- network.web_headers,
- (config.get("connection_timeout"), config.get("read_timeout")),
+ headers=network.web_headers,
+ timeout=(config.get("connection_timeout"), config.get("read_timeout")),
allow_redirects=True
)
data = network.get_json_api(
domain,
"/api/v1/instance/domain_blocks",
- headers,
- (config.get("connection_timeout"), config.get("read_timeout"))
+ headers=headers,
+ timeout=(config.get("connection_timeout"), config.get("read_timeout"))
)
rows = list()
# Invoke other function, avoid trailing ?
logger.debug("components[%s]='%s'", type(components), components)
if components.query != "":
- response = network.fetch_response(components.netloc.split(":")[0], f"{components.path}?{components.query}", headers, timeout)
+ response = network.fetch_response(
+ components.netloc.split(":")[0],
+ f"{components.path}?{components.query}",
+ headers,
+ timeout
+ )
else:
- response = network.fetch_response(components.netloc.split(":")[0], components.path if isinstance(components.path, str) and components.path != '' else '/', headers, timeout)
+ response = network.fetch_response(
+ components.netloc.split(":")[0],
+ components.path if isinstance(components.path, str) and components.path != '' else '/',
+ headers,
+ timeout
+ )
logger.debug("response[]='%s' - EXIT!", type(response))
return response