# NOISY-DEBUG: print(f"DEBUG: Found {len(json['data'])} record(s).")
for record in json["data"]:
# NOISY-DEBUG: print(f"DEBUG: record()={len(record)}")
- if "follower" in record and "host" in record["follower"]:
- # NOISY-DEBUG: print(f"DEBUG: Found host={record['follower']['host']}, adding ...")
- peers.append(record["follower"]["host"])
+ if mode in record and "host" in record[mode]:
+ # NOISY-DEBUG: print(f"DEBUG: Found host={record[mode]['host']}, adding ...")
+ peers.append(record[mode]["host"])
else:
- print(f"WARNING: record from '{domain}' has no 'follower' or 'host' record: {record}")
+ print(f"WARNING: record from '{domain}' has no '{mode}' or 'host' record: {record}")
if len(json["data"]) < 100:
# NOISY-DEBUG: print("DEBUG: Reached end of JSON response:", domain)
# Continue with next row
start = start + 100
- except BaseException as e:
- print("WARNING: Exception during fetching JSON:", domain, e)
+ except BaseException as e:
+ print("WARNING: Exception during fetching JSON:", domain, e)
update_last_nodeinfo(domain)