diff --git a/posts.py b/posts.py index 7eaee3a4e..c42e69ed5 100644 --- a/posts.py +++ b/posts.py @@ -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) diff --git a/siteactive.py b/siteactive.py index fe21daaea..b431e1077 100644 --- a/siteactive.py +++ b/siteactive.py @@ -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'): diff --git a/utils.py b/utils.py index 069869419..ecb88e918 100644 --- a/utils.py +++ b/utils.py @@ -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 + domain = domain.split('<')[0] if ':' in domain: port = get_port_from_domain(domain) domain = remove_domain_port(domain)