Fixed typo
This commit is contained in:
parent
e5691b7e97
commit
c66dc92033
@ -62,20 +62,20 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
print('loading Tor descriptors... (this could take a while)')
|
print('loading Tor descriptors... (this could take a while)')
|
||||||
tor_data = get_descriptors()
|
tor_data = get_descriptors()
|
||||||
|
|
||||||
with open('tor.json', 'w') as fd:
|
with open('tor.json', 'w') as fd:
|
||||||
json.dump(tor_data['relay'], fd)
|
json.dump(tor_data['relay'], fd)
|
||||||
with open('tor.exit.json', 'w') as fd:
|
with open('tor.exit.json', 'w') as fd:
|
||||||
json.dump(tor_data['exit'], fd)
|
json.dump(tor_data['exit'], fd)
|
||||||
|
|
||||||
print('Relays: {0:,}'.foramt(len(tor_data['relay'])))
|
print('Relays: {0:,}'.format(len(tor_data['relay'])))
|
||||||
print('Exits : {0:,}'.format(len(tor_data['exit'])))
|
print('Exits : {0:,}'.format(len(tor_data['exit'])))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import ipinfo
|
import ipinfo
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError('missing optional library \'ipinfo\' (https://pypi.org/project/ipinfo/) for map visualization')
|
raise ImportError('missing optional library \'ipinfo\' (https://pypi.org/project/ipinfo/) for map visualization')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
handler = ipinfo.getHandler('changeme') # put your ipinfo.io API key here
|
handler = ipinfo.getHandler('changeme') # put your ipinfo.io API key here
|
||||||
print('Relay Map: ' + handler.getMap([ip['address'] for ip in tor_data['relay']]))
|
print('Relay Map: ' + handler.getMap([ip['address'] for ip in tor_data['relay']]))
|
||||||
@ -83,4 +83,4 @@ if __name__ == '__main__':
|
|||||||
except ipinfo.errors.AuthorizationError:
|
except ipinfo.errors.AuthorizationError:
|
||||||
print('error: invalid ipinfo.io API key (https://ipinfo.io/signup)')
|
print('error: invalid ipinfo.io API key (https://ipinfo.io/signup)')
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print(f'error generating ipinfo map ({ex})')
|
print(f'error generating ipinfo map ({ex})')
|
||||||
|
Loading…
Reference in New Issue
Block a user