Detect when multiple domains point to the same console
This commit is contained in:
parent
f720b2e549
commit
e5471f66d3
|
@ -12,6 +12,12 @@ MAIN_PAGE = "gemini://tilde.team/~khuxkm/leo/"
|
||||||
# In case GUS ever goes down, is replaced, or changes URL, this will allow for easy fixing of Zenit.
|
# In case GUS ever goes down, is replaced, or changes URL, this will allow for easy fixing of Zenit.
|
||||||
BACKLINKS = "gemini://geminispace.info/backlinks"
|
BACKLINKS = "gemini://geminispace.info/backlinks"
|
||||||
|
|
||||||
|
# Domains that refer to the same capsule.
|
||||||
|
# For instance, tilde.team has several domains.
|
||||||
|
DUPLICATED_DOMAINS = {
|
||||||
|
"tilde.team": ['fuckup.club', 'nand.sh', 'ttm.sh', 'tild3.org', 'tilde.life', 'tilde.site', 'tildeteam.net', 'tildeteam.org']
|
||||||
|
}
|
||||||
|
|
||||||
# Determine a "capsule".
|
# Determine a "capsule".
|
||||||
# Used to prevent one person from flooding the orbit with pages.
|
# Used to prevent one person from flooding the orbit with pages.
|
||||||
# One page is allowed in the list per "capsule".
|
# One page is allowed in the list per "capsule".
|
||||||
|
@ -22,6 +28,9 @@ def determine_capsule(parsed):
|
||||||
capsule+="/"+parsed.path.split("/")[1][1:]
|
capsule+="/"+parsed.path.split("/")[1][1:]
|
||||||
if parsed.path.startswith("/users/"): # gemini.circumlunar.space uses this format as well
|
if parsed.path.startswith("/users/"): # gemini.circumlunar.space uses this format as well
|
||||||
capsule+="/"+parsed.path.split("/",3)[2]
|
capsule+="/"+parsed.path.split("/",3)[2]
|
||||||
|
for domain in DUPLICATED_DOMAINS:
|
||||||
|
for alt in DUPLICATED_DOMAINS[domain]:
|
||||||
|
capsule.replace(alt,domain)
|
||||||
return capsule
|
return capsule
|
||||||
|
|
||||||
# Required links.
|
# Required links.
|
||||||
|
|
Loading…
Reference in New Issue