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:
|
try:
|
||||||
for i in command:
|
for i in command:
|
||||||
parse = urlparse(i)
|
parse = urlparse(i)
|
||||||
|
while True:
|
||||||
if parse.scheme == "gemini":
|
if parse.scheme == "gemini":
|
||||||
gsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
gsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
gemsocket = ssl.wrap_socket(gsocket)
|
gemsocket = ssl.wrap_socket(gsocket)
|
||||||
|
@ -866,9 +867,14 @@ while True:
|
||||||
received = received.replace("\r", "")
|
received = received.replace("\r", "")
|
||||||
firstline = True
|
firstline = True
|
||||||
title = False
|
title = False
|
||||||
|
redirected = False
|
||||||
for i in received.split("\n"):
|
for i in received.split("\n"):
|
||||||
if firstline:
|
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
|
title = True
|
||||||
multiline("(" + nick + f") [{i}]", channel)
|
multiline("(" + nick + f") [{i}]", channel)
|
||||||
break
|
break
|
||||||
|
@ -884,7 +890,7 @@ while True:
|
||||||
title = True
|
title = True
|
||||||
multiline("(" + nick + f") " + i[2:], channel)
|
multiline("(" + nick + f") " + i[2:], channel)
|
||||||
break
|
break
|
||||||
if not title:
|
if not title and not redirected:
|
||||||
multiline("(" + nick + ") [No title found]", channel)
|
multiline("(" + nick + ") [No title found]", channel)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
exc = str(ex)
|
exc = str(ex)
|
||||||
|
|
Loading…
Add table
Reference in a new issue