Update server.py
This commit is contained in:
parent
0f0c06ef3c
commit
9b58562316
1 changed files with 4 additions and 1 deletions
|
@ -90,13 +90,16 @@ def relay():
|
||||||
goto = temp.split(" ")[0]
|
goto = temp.split(" ")[0]
|
||||||
prse = urlparse(goto)
|
prse = urlparse(goto)
|
||||||
extra = ""
|
extra = ""
|
||||||
|
print(goto)
|
||||||
if prse.netloc == "" and prse.scheme == "":
|
if prse.netloc == "" and prse.scheme == "":
|
||||||
isdir = url[len(url) - 1] == "/"
|
isdir = url[len(url) - 1] == "/"
|
||||||
if isdir:
|
if isdir:
|
||||||
|
print(url + goto)
|
||||||
tempurl = url + goto
|
tempurl = url + goto
|
||||||
else:
|
else:
|
||||||
tempurl = "/".join(url.split("/")[:-1]) + "/" + goto
|
tempurl = "/".join(url.split("/")[:-1]) + "/" + goto
|
||||||
goto = f"/gem?gemini={tempurl}"
|
goto = f"/gem?gemini={tempurl}"
|
||||||
|
print(goto)
|
||||||
elif prse.scheme != "gemini":
|
elif prse.scheme != "gemini":
|
||||||
extra = "<img height=\"6\" src=\"/external.png\">"
|
extra = "<img height=\"6\" src=\"/external.png\">"
|
||||||
elif prse.hostname != urlparse(fulladdr).hostname:
|
elif prse.hostname != urlparse(fulladdr).hostname:
|
||||||
|
@ -105,7 +108,7 @@ def relay():
|
||||||
comment = goto
|
comment = goto
|
||||||
else:
|
else:
|
||||||
comment = " ".join(temp.split(" ")[1:])
|
comment = " ".join(temp.split(" ")[1:])
|
||||||
code += f"<a href=\"{goto}\">{comment} {extra}</a>\n"
|
code += f"<p><a href=\"{goto}\">{comment} {extra}</a></p>\n"
|
||||||
else:
|
else:
|
||||||
code += f"<p>{i}</p>\n"
|
code += f"<p>{i}</p>\n"
|
||||||
if title == "Something went wrong...":
|
if title == "Something went wrong...":
|
||||||
|
|
Loading…
Add table
Reference in a new issue