Try and fix problem with platform not existing

This commit is contained in:
HackerNCoder 2022-01-10 22:38:45 +00:00
parent 67a0d00bfe
commit 62728c3449
No known key found for this signature in database
GPG key ID: 569FFF33FF802E16

View file

@ -19,8 +19,11 @@ for new_relay in relays:
if datetime.datetime.strptime(new_relay["first_seen"], "%Y-%m-%d %H:%M:%S") > (datetime.datetime.utcnow() - datetime.timedelta(hours=1)):
exit = "no"
eol = "no"
if not re.search("0.3.5|0.4.5|0.4.6|0.4.7", new_relay["platform"], re.IGNORECASE):
eol = "yes"
if "platform" in new_relay:
if not re.search("0.3.5|0.4.5|0.4.6|0.4.7", new_relay["platform"], re.IGNORECASE):
eol = "yes"
else:
eol = "N/A"
if new_relay["exit_policy"][0] != "reject *:*":
exit = "yes"
exitStatus += "\"" + new_relay["nickname"] + "\", fingerprint: " + new_relay["fingerprint"] + ", EOL: " + eol + ", effective family: " + str(len(new_relay["effective_family"])-1) + "; https://metrics.torproject.org/rs.html#search/" + new_relay["fingerprint"] + "\n"