kumistatus/skstools/__init__.py
2017-06-22 17:16:13 +02:00

12 lines
344 B
Python

import urllib.request, urllib.error
def getStatus(server):
try:
source = str(urllib.request.urlopen("https://sks-keyservers.net/status/ks-status.php?server=%s" % server).read())
if "No data found for keyserver" in source:
return False
if "Reason" in source:
return False
return True
except urllib.error.URLError:
return None