YunoHost-Apps / mopidy_ynh

Mopidy package for YunoHost
http://www.mopidy.com
Apache License 2.0
4 stars 8 forks source link

what about Spotify? #34

Open h3ndrik opened 2 years ago

h3ndrik commented 2 years ago

Just a question: I noticed Spotify is missing in the list of extensions. Would it be possible to use that with this YunoHost-App? I've had it working with a manually installed mopidy before. Thanks!

siwinter commented 2 years ago

I do not use spotify and have no credentials. Therefore I could not not test this extension. If anyone could help, I would give it a try.

h3ndrik commented 2 years ago

nice. i'll see if i can spare some time to try installing it.

siwinter commented 2 years ago

The new installation script supporting spotify is now in place. Use it via ssh or in the shell with the command: sudo yunohost app install https://github.com/YunoHost-Apps/mopidy_ynh/tree/spotify

Then edit the configuration file /opt/yunohost/mopidy/mopidy.conf. Set your credentials in chapter [spotify] at the end of the file (username, password, client_id, client_secret) and set enabled = true. Finally, the service must be restarted. systemctl status mopidy

Please also read the description of the extension on this website. There are some limitations mentioned. Please give feedback on whether the extension is helpful even with these limitations and should be included in the standard installation. Thanks very much

h3ndrik commented 2 years ago

hey, first of all the installation failed, because libspotify12 isn't found ( https://paste.yunohost.org/raw/ronanomena ) i went ahead and used the instructions on https://github.com/mopidy/libspotify-deb to add the repository and installed libspotify12 and libspotify-dev manually. that made the installation go through.

now something's wrong with ffi. i'm trying to debug this:

mopidy@server:~$ /opt/yunohost/mopidy/env/bin/mopidy --config /opt/yunohost/mopidy/mopidy.conf
ERROR    [MainThread] mopidy.__main__ Extension spotify failed during setup. This might have left the registry in a bad state.
Traceback (most recent call last):
  File "/opt/yunohost/mopidy/env/lib/python3.7/site-packages/mopidy/__main__.py", line 130, in main
    extension.setup(registry)
  File "/opt/yunohost/mopidy/env/lib/python3.7/site-packages/mopidy_spotify/__init__.py", line 49, in setup
    from mopidy_spotify.backend import SpotifyBackend
  File "/opt/yunohost/mopidy/env/lib/python3.7/site-packages/mopidy_spotify/backend.py", line 8, in <module>
    import spotify     
  File "/opt/yunohost/mopidy/env/lib/python3.7/site-packages/spotify/__init__.py", line 95, in <module>
    from spotify.album import *  # noqa
  File "/opt/yunohost/mopidy/env/lib/python3.7/site-packages/spotify/album.py", line 380, in <module>
    @serialized
SystemError: ffi_prep_closure(): bad user_data (it seems that the version of the libffi library seen at runtime is different from th
e 'ffi.h' file seen at compile-time)
Exception in thread Thread-8:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/opt/yunohost/mopidy/env/lib/python3.7/site-packages/mopidy_ytmusic/repeating_timer.py", line 18, in run
    self._method()
  File "/opt/yunohost/mopidy/env/lib/python3.7/site-packages/mopidy_ytmusic/backend.py", line 99, in _refresh_youtube_player
    self.playback.update_cipher(playerurl=url)
  File "/opt/yunohost/mopidy/env/lib/python3.7/site-packages/mopidy_ytmusic/playback.py", line 25, in update_cipher
    self.PyTubeCipher = Cipher(js=response.text)
  File "/opt/yunohost/mopidy/env/lib/python3.7/site-packages/pytube/cipher.py", line 43, in __init__
    self.throttling_plan = get_throttling_plan(js)
  File "/opt/yunohost/mopidy/env/lib/python3.7/site-packages/pytube/cipher.py", line 387, in get_throttling_plan
    raw_code = get_throttling_function_code(js)
  File "/opt/yunohost/mopidy/env/lib/python3.7/site-packages/pytube/cipher.py", line 293, in get_throttling_function_code
    name = re.escape(get_throttling_function_name(js))
  File "/opt/yunohost/mopidy/env/lib/python3.7/site-packages/pytube/cipher.py", line 279, in get_throttling_function_name
    caller="get_throttling_function_name", pattern="multiple"
pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple

EDIT: this did the trick: (i'm still on yunohost buster)

su -s /bin/bash mopidy
/opt/yunohost/mopidy/env/bin/pip3 install --upgrade cffi==1.12.2