This commit is contained in:
parent
a11ceecfd3
commit
dc6a910fb1
1 changed files with 3 additions and 2 deletions
|
@ -851,12 +851,13 @@ while True:
|
||||||
try:
|
try:
|
||||||
for i in command:
|
for i in command:
|
||||||
parse = urlparse(i)
|
parse = urlparse(i)
|
||||||
|
unparsed = i
|
||||||
while True:
|
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)
|
||||||
gemsocket.connect((parse.hostname, 1965))
|
gemsocket.connect((parse.hostname, 1965))
|
||||||
gemsocket.send(bytes(i + "\r\n", "UTF-8"))
|
gemsocket.send(bytes(unparsed + "\r\n", "UTF-8"))
|
||||||
received = ""
|
received = ""
|
||||||
while True:
|
while True:
|
||||||
gemresponse = gemsocket.recv(2048)
|
gemresponse = gemsocket.recv(2048)
|
||||||
|
@ -872,8 +873,8 @@ while True:
|
||||||
if firstline:
|
if firstline:
|
||||||
if i.split(" ")[0][0] == "3":
|
if i.split(" ")[0][0] == "3":
|
||||||
redirected = True
|
redirected = True
|
||||||
print("redirect -> " + str([i.split(" ")[1]]))
|
|
||||||
parsed = urlparse(i.split(" ")[1])
|
parsed = urlparse(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
|
||||||
|
|
Loading…
Add table
Reference in a new issue