Update publically available copies of Zenit and reindexer
This commit is contained in:
parent
eed2fa4ece
commit
4ce9455c02
|
@ -6,3 +6,5 @@ geddit.glv.one
|
|||
geddit.pitr.ca
|
||||
# ignore medusae
|
||||
medusae.space
|
||||
# ignore some german guy's gemlog
|
||||
g.dumke.me
|
||||
|
|
|
@ -100,6 +100,7 @@ def grab_content(url,redirect_num=0):
|
|||
else:
|
||||
ctx = globals()["ctx"]
|
||||
with socket.socket(socket.AF_INET,socket.SOCK_STREAM) as s:
|
||||
s.settimeout(5)
|
||||
ss = ctx.wrap_socket(s,server_hostname=parsed.hostname)
|
||||
try:
|
||||
ss.connect((parsed.hostname,parsed.port or 1965))
|
||||
|
@ -107,6 +108,9 @@ def grab_content(url,redirect_num=0):
|
|||
except ConnectionRefusedError:
|
||||
print("Connection refused!",file=sys.stderr)
|
||||
return b'', 'application/octet-stream'
|
||||
except socket.timeout:
|
||||
print("Timeout!",file=sys.stderr)
|
||||
return b'', 'application/octet-stream'
|
||||
except ssl.CertificateError as e:
|
||||
print(e.args[0],file=sys.stderr)
|
||||
return b'', 'application/octet-stream'
|
||||
|
@ -141,7 +145,7 @@ def grab_content(url,redirect_num=0):
|
|||
# Return the header with a mimetype of text/plain. If this were a real library I might throw an error here, but this is just to make Zenit work.
|
||||
return header.decode("utf-8"), "text/plain"
|
||||
|
||||
CAPSULES_IN_ORBIT = set()
|
||||
CAPSULES_IN_ORBIT = set(["g.dumke.me"]) # temporary change to remove a certain link
|
||||
import copy
|
||||
links = copy.deepcopy(URLS)[1:] # skip main link
|
||||
|
||||
|
|
4
zenit.py
4
zenit.py
|
@ -100,6 +100,7 @@ def grab_content(url,redirect_num=0):
|
|||
else:
|
||||
ctx = globals()["ctx"]
|
||||
with socket.socket(socket.AF_INET,socket.SOCK_STREAM) as s:
|
||||
s.settimeout(5)
|
||||
ss = ctx.wrap_socket(s,server_hostname=parsed.hostname)
|
||||
try:
|
||||
ss.connect((parsed.hostname,parsed.port or 1965))
|
||||
|
@ -107,6 +108,9 @@ def grab_content(url,redirect_num=0):
|
|||
except ConnectionRefusedError:
|
||||
print("Connection refused!")
|
||||
return b'', 'application/octet-stream'
|
||||
except socket.timeout:
|
||||
print("Connection refused!")
|
||||
return b'', 'application/octet-stream'
|
||||
except ssl.CertificateError as e:
|
||||
print(f"Certificate error for domain {parsed.hostname}: {e.args[0]}")
|
||||
return b'', 'application/octet-stream'
|
||||
|
|
Loading…
Reference in New Issue