Add content, Follow remote libraries


#1

Hi,

Uploading files works, i see them in my library.
Now i am trying to follow external libraries, but that give me errors like:

Could not fetch remote library, A server error occured

Serverside, they look like this:

2019-03-15 16:27:06,410 ERROR    Internal Server Error: /api/v1/federation/libraries/fetch/
Traceback (most recent call last):
  File "/srv/funkwhale/virtualenv/lib64/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/srv/funkwhale/virtualenv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/srv/funkwhale/virtualenv/lib64/python3.6/site-packages/django/core/handlers/base.py", line 124, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib64/python3.6/contextlib.py", line 52, in inner
    return func(*args, **kwds)
  File "/srv/funkwhale/virtualenv/lib64/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/srv/funkwhale/virtualenv/lib64/python3.6/site-packages/rest_framework/viewsets.py", line 116, in view
    return self.dispatch(request, *args, **kwargs)
  File "/srv/funkwhale/virtualenv/lib64/python3.6/site-packages/rest_framework/views.py", line 495, in dispatch
    response = self.handle_exception(exc)
  File "/srv/funkwhale/virtualenv/lib64/python3.6/site-packages/rest_framework/views.py", line 455, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/srv/funkwhale/virtualenv/lib64/python3.6/site-packages/rest_framework/views.py", line 492, in dispatch
    response = handler(request, *args, **kwargs)
  File "./funkwhale_api/federation/api_views.py", line 135, in fetch
    serializer_class=serializers.LibrarySerializer,
  File "./funkwhale_api/federation/utils.py", line 94, in retrieve_ap_object
    data = response.json()
  File "/srv/funkwhale/virtualenv/lib64/python3.6/site-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

What is the URL format to give there? I tried for example:

https://funkwhale.eliotberriot.com/

Thanks,
Alexander.


#2

To follow libraries, you need libraries urls, which are different from instance urls, because one have multiple users, and each user can have multiple libraries.

You can try with https://open.audio/library libraries, since this instance host creative commons stuff.

Simply browse the library, and scroll down on artist/album/track pages. You’ll find a “Libraries” section in which you can copy the urls:

image

Example of a library url: https://funkwhale.mastodon.host/federation/music/libraries/87552826-3c68-4c35-b361-d7a3eb8d860a


#3

Thanks ( again). That example worked.

Getting up to speed now :wink:


closed #4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.