This commit is contained in:
parent
e39f9c3f94
commit
a45796883e
1 changed files with 39 additions and 33 deletions
10
sweebot.py
10
sweebot.py
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue