28 lines
594 B
Python
28 lines
594 B
Python
|
from collections import Counter
|
||
|
import re
|
||
|
|
||
|
prLines = []
|
||
|
|
||
|
# You need a consensus, easiest is to download from collector, e.g: https://collector.torproject.org/recent/relay-descriptors/consensuses/2021-10-29-23-00-00-consensus
|
||
|
file = open("consensus", "r")
|
||
|
|
||
|
while True:
|
||
|
line1 = file.readline()
|
||
|
|
||
|
if not line1: break
|
||
|
|
||
|
if re.search("^v.*Tor 0.4.6.7", line1, re.IGNORECASE):
|
||
|
line2 = file.readline()
|
||
|
prLines.append(line2)
|
||
|
|
||
|
c = Counter(prLines)
|
||
|
|
||
|
for element in c.most_common():
|
||
|
print(element)
|
||
|
|
||
|
#print(c.most_common())
|
||
|
print()
|
||
|
print(c.most_common(1)[0][0])
|
||
|
|
||
|
file.close()
|