Onionr/onionr/utils/gettransports.py

17 lines
491 B
Python

import filepaths, time
files = [filepaths.tor_hs_address_file]
def get():
transports = []
for file in files:
try:
with open(file, 'r') as transport_file:
transports.append(transport_file.read().strip())
except FileNotFoundError:
pass
else:
break
else:
time.sleep(1)
return list(transports)