kumistatus/skstools/__init__.py

13 lines
344 B
Python
Raw Normal View History

2017-06-22 15:16:13 +00:00
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