Add webfinger support for the lookup, fix forwarding
This commit is contained in:
parent
f05eb559f0
commit
4a22ac12a8
4 changed files with 61 additions and 5 deletions
|
@ -3,10 +3,16 @@ import json
|
|||
import little_boxes.activitypub as ap
|
||||
import mf2py
|
||||
import requests
|
||||
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:
|
||||
return ap.fetch_remote_activity(get_actor_url(url))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
backend = ap.get_backend()
|
||||
resp = requests.get(
|
||||
url,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue