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:32:31 -08:00
parent e39f9c3f94
commit a45796883e

View file

@ -851,6 +851,7 @@ while True:
try:
for i in command:
parse = urlparse(i)
while True:
if parse.scheme == "gemini":
gsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
gemsocket = ssl.wrap_socket(gsocket)
@ -866,9 +867,14 @@ while True:
received = received.replace("\r", "")
firstline = True
title = False
redirected = False
for i in received.split("\n"):
if firstline:
if i.split(" ")[0][0] != "2":
if i.split(" ")[0][0] == "3":
redirected = True
parsed = urlparse(i.split(" ")[2])
break
elif i.split(" ")[0][0] != "2":
title = True
multiline("(" + nick + f") [{i}]", channel)
break
@ -884,7 +890,7 @@ while True:
title = True
multiline("(" + nick + f") " + i[2:], channel)
break
if not title:
if not title and not redirected:
multiline("(" + nick + ") [No title found]", channel)
except Exception as ex:
exc = str(ex)