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

This commit is contained in:
Nova Cat 2025-01-16 20:12:52 -08:00
parent bb2871fc77
commit 6a9d92e03d

View file

@ -870,28 +870,31 @@ while True:
title = False title = False
redirected = False redirected = False
for i in received.split("\n"): for i in received.split("\n"):
if firstline: try:
if i.split(" ")[0][0] == "3": if firstline:
redirected = True if i.split(" ")[0][0] == "3":
parsed = urlparse(i.split(" ")[1]) redirected = True
unparsed = i.split(" ")[1] parsed = urlparse(i.split(" ")[1])
break unparsed = i.split(" ")[1]
elif i.split(" ")[0][0] != "2": break
title = True elif i.split(" ")[0][0] != "2":
multiline("(" + nick + f") [{i}]", channel) title = True
break multiline("(" + nick + f") [{i}]", channel)
break
else:
firstline = False
if i.split(" ")[1] != "text/gemini":
typee = i.split(" ")[1]
multiline("(" + nick + f") [Non-Gemtext file: {typee}]", channel)
title = True
break
else: else:
firstline = False if i.split(" ")[0][0] == "#" and not i.split(" ")[0][1] == "#":
if i.split(" ")[1] != "text/gemini": title = True
typee = i.split(" ")[1] multiline("(" + nick + f") " + i[2:], channel)
multiline("(" + nick + f") [Non-Gemtext file: {typee}]", channel) break
title = True except:
break pass
else:
if i.split(" ")[0][0] == "#" and not i.split(" ")[0][1] == "#":
title = True
multiline("(" + nick + f") " + i[2:], channel)
break
if not title and not redirected: if not title and not redirected:
multiline("(" + nick + ") [No title found]", channel) multiline("(" + nick + ") [No title found]", channel)
if not redirected: if not redirected: