More internet exotica: domains with appended handles

main
Bob Mottram 2025-12-14 16:52:23 +00:00
parent b804db588c
commit ebfe4317aa
3 changed files with 8 additions and 0 deletions

View File

@ -4143,6 +4143,8 @@ def send_to_followers(server, session, session_onion, session_i2p,
# randomize the order of sending to instances
randomized_instances: list[str] = []
for follower_domain, follower_handles in grouped.items():
if '<' in follower_domain:
follower_domain = follower_domain.split('<')[0]
randomized_instances.append([follower_domain, follower_handles])
random.shuffle(randomized_instances)

View File

@ -103,6 +103,8 @@ def site_is_active(url: str, timeout: int,
"""
if '<>' in url:
url = url.replace('<>', '')
if '<' in url:
url = url.split('<')[0]
if not url.startswith('http') and \
not url.startswith('ipfs') and \
not url.startswith('ipns'):

View File

@ -1512,6 +1512,10 @@ def get_domain_from_actor(actor: str) -> (str, int):
domain = domain.replace(prefix, '')
if '/' in actor:
domain = domain.split('/')[0]
if '<' in domain:
# handle domain with handle appended
# https://domain<user@domain>
domain = domain.split('<')[0]
if ':' in domain:
port = get_port_from_domain(domain)
domain = remove_domain_port(domain)