Tweak the lookup
This commit is contained in:
parent
6cda5402f7
commit
88186e2306
3 changed files with 6 additions and 5 deletions
|
@ -10,9 +10,10 @@ from little_boxes.webfinger import get_actor_url
|
|||
def lookup(url: str) -> ap.BaseActivity:
|
||||
"""Try to find an AP object related to the given URL."""
|
||||
try:
|
||||
actor_url = get_actor_url(url)
|
||||
if actor_url:
|
||||
return ap.fetch_remote_activity(actor_url)
|
||||
if url.startswith('@'):
|
||||
actor_url = get_actor_url(url)
|
||||
if actor_url:
|
||||
return ap.fetch_remote_activity(actor_url)
|
||||
except NotAnActivityError:
|
||||
pass
|
||||
except requests.HTTPError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue