commit
f69eaed5a6
1 changed files with 14 additions and 1 deletions
|
@ -557,6 +557,11 @@ def parse_url(url, parsed_urls):
|
||||||
if match is not None:
|
if match is not None:
|
||||||
parsed_urls[url] = match
|
parsed_urls[url] = match
|
||||||
|
|
||||||
|
if url not in parsed_urls:
|
||||||
|
match = parse_mastodon_uri(url)
|
||||||
|
if match is not None:
|
||||||
|
parsed_urls[url] = match
|
||||||
|
|
||||||
if url not in parsed_urls:
|
if url not in parsed_urls:
|
||||||
match = parse_pleroma_url(url)
|
match = parse_pleroma_url(url)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
|
@ -601,6 +606,14 @@ def parse_mastodon_url(url):
|
||||||
return (match.group("server"), match.group("toot_id"))
|
return (match.group("server"), match.group("toot_id"))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def parse_mastodon_uri(uri):
|
||||||
|
"""parse a Mastodon URI and return the server and ID"""
|
||||||
|
match = re.match(
|
||||||
|
r"https://(?P<server>[^/]+)/users/(?P<username>[^/]+)/statuses/(?P<toot_id>[^/]+)", uri
|
||||||
|
)
|
||||||
|
if match is not None:
|
||||||
|
return (match.group("server"), match.group("toot_id"))
|
||||||
|
return None
|
||||||
|
|
||||||
def parse_pleroma_url(url):
|
def parse_pleroma_url(url):
|
||||||
"""parse a Pleroma URL and return the server and ID"""
|
"""parse a Pleroma URL and return the server and ID"""
|
||||||
|
@ -1205,7 +1218,7 @@ def get_server_info(server, seen_hosts):
|
||||||
def set_server_apis(server):
|
def set_server_apis(server):
|
||||||
# support for new server software should be added here
|
# support for new server software should be added here
|
||||||
software_apis = {
|
software_apis = {
|
||||||
'mastodonApiSupport': ['mastodon', 'pleroma', 'akkoma', 'pixelfed', 'hometown'],
|
'mastodonApiSupport': ['mastodon', 'pleroma', 'akkoma', 'pixelfed', 'hometown', 'iceshrimp'],
|
||||||
'misskeyApiSupport': ['misskey', 'calckey', 'firefish', 'foundkey'],
|
'misskeyApiSupport': ['misskey', 'calckey', 'firefish', 'foundkey'],
|
||||||
'lemmyApiSupport': ['lemmy']
|
'lemmyApiSupport': ['lemmy']
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue