Update sweebot.py
Some checks are pending
Check syntax / check (push) Waiting to run

This commit is contained in:
Nova Cat 2025-01-12 20:39:09 -08:00
parent a11ceecfd3
commit dc6a910fb1

View file

@ -851,12 +851,13 @@ while True:
try:
for i in command:
parse = urlparse(i)
unparsed = i
while True:
if parse.scheme == "gemini":
gsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
gemsocket = ssl.wrap_socket(gsocket)
gemsocket.connect((parse.hostname, 1965))
gemsocket.send(bytes(i + "\r\n", "UTF-8"))
gemsocket.send(bytes(unparsed + "\r\n", "UTF-8"))
received = ""
while True:
gemresponse = gemsocket.recv(2048)
@ -872,8 +873,8 @@ while True:
if firstline:
if i.split(" ")[0][0] == "3":
redirected = True
print("redirect -> " + str([i.split(" ")[1]]))
parsed = urlparse(i.split(" ")[1])
unparsed = i.split(" ")[1]
break
elif i.split(" ")[0][0] != "2":
title = True