else:
logger.info("args.domain='%s' is not known", args.domain)
- logger.debug("status='%d' - EXIT!", status)
+ logger.debug("status=%d - EXIT!", status)
return status
def fetch_pixelfed_api(args: argparse.Namespace) -> int:
logger.debug("Invoking blocks.add_instance(%s, %s, %s, %s)", blocker, block["blocked"], block["reason"], block['block_level'])
blocks.add_instance(blocker, block["blocked"], block["reason"], block['block_level'])
- logger.debug("block_level='%s',config[bot_enabled]=%s", block['block_level'], config.get("bot_enabled"))
+ logger.debug("block_level='%s',config[bot_enabled]='%s'", block['block_level'], config.get("bot_enabled"))
if block['block_level'] == "reject" and config.get("bot_enabled"):
logger.debug("blocker='%s' has blocked '%s' with reason='%s' - Adding to bot notification ...", blocker, block["blocked"], block["reason"])
blockdict.append({
return software
start = software.find("powered by ")
- logger.debug("start[%s]='%d'", type(start), start)
+ logger.debug("start[%s]=%d", type(start), start)
software = software[start + 11:].strip()
logger.debug("software='%s'", software)
return software
end = software.find("hosted on ")
- logger.debug("end[%s]='%d'", type(end), end)
+ logger.debug("end[%s]=%d", type(end), end)
software = software[0:end].strip()
logger.debug("software[%s]='%s'", type(software), software)
# Next, strip until part
end = software.find(until)
- logger.debug("end[%s]='%d'", type(end), end)
+ logger.debug("end[%s]=%d", type(end), end)
if end > 0:
software = software[0:end].strip()
# Continue raising it
raise data["exception"]
elif "error_message" in data:
- logger.debug("Returned error_message during fetching nodeinfo: '%s',status_code='%d'", data['error_message'], data['status_code'])
+ logger.debug("Returned error_message during fetching nodeinfo: '%s',status_code=%d", data['error_message'], data['status_code'])
return fetch_generator_from_path(domain)
elif "status" in data and data["status"] == "error" and "message" in data:
logger.warning("JSON response is an error: '%s'", data["message"])
json_reply["json"] = json_from_response(response)
- logger.debug("response.ok='%s',response.status_code='%d',json_reply[]='%s'", response.ok, response.status_code, type(json_reply))
+ logger.debug("response.ok='%s',response.status_code=%d,json_reply[]='%s'", response.ok, response.status_code, type(json_reply))
if not response.ok or response.status_code >= 400:
- logger.warning("Cannot query JSON API: domain='%s',path='%s',data()=%d,response.status_code='%d',json_reply[]='%s'", domain, path, len(data), response.status_code, type(json_reply))
+ logger.warning("Cannot query JSON API: domain='%s',path='%s',data()=%d,response.status_code=%d,json_reply[]='%s'", domain, path, len(data), response.status_code, type(json_reply))
json_reply["status_code"] = response.status_code
json_reply["error_message"] = response.reason
del json_reply["json"]
logger.debug("response.ok='%s',response.status_code='%s',json_reply[]='%s'", response.ok, response.status_code, type(json_reply))
if not response.ok or response.status_code >= 400:
- logger.warning("Cannot query JSON API: url='%s',response.status_code='%d',json_reply[]='%s'", url, response.status_code, type(json_reply))
+ logger.warning("Cannot query JSON API: url='%s',response.status_code=%d,json_reply[]='%s'", url, response.status_code, type(json_reply))
json_reply["status_code"] = response.status_code
json_reply["error_message"] = response.reason
del json_reply["json"]
json_reply["json"] = json_from_response(response)
- logger.debug("response.ok='%s',response.status_code='%d',json_reply[]='%s'", response.ok, response.status_code, type(json_reply))
+ logger.debug("response.ok='%s',response.status_code=%d,json_reply[]='%s'", response.ok, response.status_code, type(json_reply))
if not response.ok or response.status_code >= 400:
- logger.warning("Cannot query JSON API: domain='%s',path='%s',response.status_code='%d',json_reply[]='%s'", domain, path, response.status_code, type(json_reply))
+ logger.warning("Cannot query JSON API: domain='%s',path='%s',response.status_code=%d,json_reply[]='%s'", domain, path, response.status_code, type(json_reply))
json_reply["status_code"] = response.status_code
json_reply["error_message"] = response.reason
del json_reply["json"]
logger.debug("blocklist()=%d", len(blocklist))
for block in blocklist:
- logger.debug("block[%s]=%s", type(block), block)
+ logger.debug("block[%s]='%s'", type(block), block)
if block["reason"] is None or block["reason"] == '':
message = message + block["blocked"] + " with unspecified reason\n"
else:
logger.debug("data[]='%s'", type(data))
if "error_message" in data:
- logger.debug("Was not able to fetch domain_blocks from domain='%s': status_code='%d',error_message='%s'", domain, data['status_code'], data['error_message'])
+ logger.debug("Was not able to fetch domain_blocks from domain='%s': status_code=%d,error_message='%s'", domain, data['status_code'], data['error_message'])
instances.set_last_error(domain, data)
return blocklist
elif "json" in data and "error" in data["json"]:
# instances page-by-page, since that troonware doesn't support
# sending them all at once
while True:
- logger.debug("Fetching offset='%d' from domain='%s' ...", offset, domain)
+ logger.debug("Fetching offset=%d from domain='%s' ...", offset, domain)
if offset == 0:
fetched = network.post_json_api(domain, "/api/federation/instances", json.dumps({
"sort" : "+pubAt",
logger.debug("Fetched %d row(s) but expected: %d", len(rows), config.get('misskey_limit'))
offset = offset + (config.get("misskey_limit") - len(rows))
else:
- logger.debug("Raising offset by step='%d'", step)
+ logger.debug("Raising offset by step=%d", step)
offset = offset + step
already = 0
# instances page-by-page since it doesn't support sending them all at once
while True:
try:
- logger.debug("Fetching offset='%d' from domain='%s' ...", offset, domain)
+ logger.debug("Fetching offset=%d from domain='%s' ...", offset, domain)
if offset == 0:
- logger.debug("Sending JSON API request to domain='%s',step='%d',offset='%d'", domain, step, offset)
+ logger.debug("Sending JSON API request to domain='%s',step=%d,offset=%d", domain, step, offset)
fetched = network.post_json_api(domain, "/api/federation/instances", json.dumps({
"sort" : "+pubAt",
"host" : None,
"limit" : step
}), headers)
else:
- logger.debug("Sending JSON API request to domain='%s',step='%d',offset='%d'", domain, step, offset)
+ logger.debug("Sending JSON API request to domain='%s',step=%d,offset=%d", domain, step, offset)
fetched = network.post_json_api(domain, "/api/federation/instances", json.dumps({
"sort" : "+pubAt",
"host" : None,
logger.debug("Fetched %d row(s) but expected: %d", len(rows), config.get('misskey_limit'))
offset = offset + (config.get("misskey_limit") - len(rows))
else:
- logger.debug("Raising offset by step='%d'", step)
+ logger.debug("Raising offset by step=%d", step)
offset = offset + step
count = 0
# Fetch blocked (full suspended) instances
try:
if offset == 0:
- logger.debug("Sending JSON API request to domain='%s',step='%d',offset='%d'", domain, step, offset)
+ logger.debug("Sending JSON API request to domain='%s',step=%d,offset=%d", domain, step, offset)
fetched = network.post_json_api(domain, "/api/federation/instances", json.dumps({
"sort" : "+pubAt",
"host" : None,
"limit" : step
}), headers)
else:
- logger.debug("Sending JSON API request to domain='%s',step='%d',offset='%d'", domain, step, offset)
+ logger.debug("Sending JSON API request to domain='%s',step=%d,offset=%d", domain, step, offset)
fetched = network.post_json_api(domain, "/api/federation/instances", json.dumps({
"sort" : "+pubAt",
"host" : None,
logger.debug("Fetched %d row(s) but expected: %d'", len(rows), config.get('misskey_limit'))
offset = offset + (config.get("misskey_limit") - len(rows))
else:
- logger.debug("Raising offset by step='%d'", step)
+ logger.debug("Raising offset by step=%d", step)
offset = offset + step
count = 0
(config.get("connection_timeout"), config.get("read_timeout"))
)
- logger.debug("response.ok='%s',response.status_code='%d',response.text()=%d", response.ok, response.status_code, len(response.text))
+ logger.debug("response.ok='%s',response.status_code=%d,response.text()=%d", response.ok, response.status_code, len(response.text))
if not response.ok or response.text.strip() == "":
logger.warning("path='%s' does not exist on domain='%s' - SKIPPED!", path, domain)
continue