This commit is contained in:
parent
6a9d92e03d
commit
8268fa0940
1 changed files with 20 additions and 20 deletions
40
sweebot.py
40
sweebot.py
|
@ -870,31 +870,31 @@ while True:
|
||||||
title = False
|
title = False
|
||||||
redirected = False
|
redirected = False
|
||||||
for i in received.split("\n"):
|
for i in received.split("\n"):
|
||||||
try:
|
if firstline:
|
||||||
if firstline:
|
if i.split(" ")[0][0] == "3":
|
||||||
if i.split(" ")[0][0] == "3":
|
redirected = True
|
||||||
redirected = True
|
parsed = urlparse(i.split(" ")[1])
|
||||||
parsed = urlparse(i.split(" ")[1])
|
unparsed = i.split(" ")[1]
|
||||||
unparsed = i.split(" ")[1]
|
break
|
||||||
break
|
elif i.split(" ")[0][0] != "2":
|
||||||
elif i.split(" ")[0][0] != "2":
|
title = True
|
||||||
title = True
|
multiline("(" + nick + f") [{i}]", channel)
|
||||||
multiline("(" + nick + f") [{i}]", channel)
|
break
|
||||||
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(" ")[1] != "text/gemini":
|
||||||
|
typee = i.split(" ")[1]
|
||||||
|
multiline("(" + nick + f") [Non-Gemtext file: {typee}]", channel)
|
||||||
|
title = True
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
try:
|
||||||
if i.split(" ")[0][0] == "#" and not i.split(" ")[0][1] == "#":
|
if i.split(" ")[0][0] == "#" and not i.split(" ")[0][1] == "#":
|
||||||
title = True
|
title = True
|
||||||
multiline("(" + nick + f") " + i[2:], channel)
|
multiline("(" + nick + f") " + i[2:], channel)
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
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:
|
||||||
|
|
Loading…
Add table
Reference in a new issue