mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 08:59:17 +02:00
See #170: fetching remote objects
This commit is contained in:
parent
65097f6297
commit
c2eeee5eb1
30 changed files with 1173 additions and 169 deletions
|
@ -9,9 +9,7 @@ def get_library_data(library_url, actor):
|
|||
auth = signing.get_auth(actor.private_key, actor.private_key_id)
|
||||
try:
|
||||
response = session.get_session().get(
|
||||
library_url,
|
||||
auth=auth,
|
||||
headers={"Content-Type": "application/activity+json"},
|
||||
library_url, auth=auth, headers={"Accept": "application/activity+json"},
|
||||
)
|
||||
except requests.ConnectionError:
|
||||
return {"errors": ["This library is not reachable"]}
|
||||
|
@ -32,7 +30,7 @@ def get_library_data(library_url, actor):
|
|||
def get_library_page(library, page_url, actor):
|
||||
auth = signing.get_auth(actor.private_key, actor.private_key_id)
|
||||
response = session.get_session().get(
|
||||
page_url, auth=auth, headers={"Content-Type": "application/activity+json"},
|
||||
page_url, auth=auth, headers={"Accept": "application/activity+json"},
|
||||
)
|
||||
serializer = serializers.CollectionPageSerializer(
|
||||
data=response.json(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue