Adding a Spotify playlist via mpc

Hi all, and thank everyone who is working at this beautiful application!

My question is: are there news on the possibility to add a playlist via mpc command tool? My mopidy version is 2.2.3, is running under Buster in a Raspberry Pi 3B+, used with Iris.
Unfortunately i’m not as good as a developer but, on this forum, i found an update to a .py file for doing this but I’m unable to locate that file and don’t know if i have to add/modify those 2/3 lines.

Also, is there a possibility to delete “now playing” queue when adding an existing playlist to queue?

Thank you for the attention, if it is repetitive I’ll remove this post.

EDIT: when using “mpc add spotify:user:USERNAME:playlist:4HUG815wcqz8gtddWIHRbJ”, i receive

Blockquote
caused an exception.
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/mopidy/core/library.py”, line 19, in _backend_error_handling
yield
File “/usr/lib/python2.7/dist-packages/mopidy/core/library.py”, line 237, in lookup
result = future.get()
File “/usr/lib/python2.7/dist-packages/pykka/threading.py”, line 52, in get
compat.reraise(*self._data[‘exc_info’])
File “/usr/lib/python2.7/dist-packages/pykka/compat.py”, line 12, in reraise
exec(‘raise tp, value, tb’)
File “/usr/lib/python2.7/dist-packages/pykka/actor.py”, line 201, in _actor_loop
response = self._handle_receive(message)
File “/usr/lib/python2.7/dist-packages/pykka/actor.py”, line 295, in _handle_receive
return callee(*message[‘args’], **message[‘kwargs’])
File “/usr/lib/python2.7/dist-packages/mopidy_spotify/library.py”, line 32, in lookup
return lookup.lookup(self._config, self._backend._session, uri)
File “/usr/lib/python2.7/dist-packages/mopidy_spotify/lookup.py”, line 33, in lookup
return list(_lookup_playlist(config, sp_link))
File “/usr/lib/python2.7/dist-packages/mopidy_spotify/lookup.py”, line 95, in _lookup_playlist
sp_playlist.load(config[‘timeout’])
AttributeError: ‘NoneType’ object has no attribute ‘load’

When using the same command but without the user (only using mopidy spotify plylist uri), i get:

Blockquote
Failed to lookup “spotify:playlist:4HUG815wcqz8gtddWIHRbJ”: Failed to get link from Spotify URI: u’spotify:playlist:4HUG815wcqz8gtddWIHRbJ’

You’re doing everything right but you have hit a long-running bug in Mopidy-Spotify. The good news is that it is fixed in the next major release that’s due within the next couple of weeks.

2 Likes

Thank you for the answer and your work!
I will wait these couple of weeks like waiting for a christmas present.

1 Like

Hi there! I just updated my mopidy and it seems that this feature is not working. Has this feature been introducesd in latest mopidy?

Really thank you!

You need to use a uri in the form spotify:playlist:blahblahblahblah. Spotify no longer support the spotify:user:blah:blahblahblah format.

Thank you! Unfortunately I’m doing this as you wrote but i receive “loading: spotify:playlist:blablabla - mpd error: No such playlist”.

My Mopidy version is Mopidy 2.2.3, is it possible this is not the latest version? If yes, i need to reinstall the whole mopidy or I can try with just “apt-get upgrade mopidy”?

EDIT: when I run “apt-get upgrade Mopidy” it tells me that Mopidy is the most recent version (2.2.3-1). This is done in a Raspbian Buster environment.

I’m also receiving this from apt update:
http://apt.mopidy.com stretch InRelease" changed from “Suite” from “stable” to “oldstable” [translated from Italian, sorry if wrong in some words].

Really thankful for your help.

You said you had upgraded Mopidy so I assumed you now had the latest version, which is 3.0.1 and the latest version of Mopidy-Spotify is 4.0. They are both available if you install from apt.mopidy.com like our documentation describes. It sounds like you have used the mopidy.list file for stretch. Follow the docs to get the one for buster. Then run ‘apt update’ and then upgrade mopidy and Mopidy-spotify.

Also, the playlist ID " blahblahblah" is not a real ID. Once you have upgraded to the actual latest version find a real playlist ID to add. You can get them in the official Spotify client/website. A real example would be spotify:playlist:1enamd7IoA2KtAoMxeiINW.

Hello!

Thank you for your support! I noticed that now also Iris is working. A couple of questions (infos):

  • Do you expect Spotify or Mopidy will change the playlist URI format in next months? I’m working on an automated system through the use of mpc (mpd) add playlist;
  • Have you ever heard of a mpc command (“crossfade”) with a response like “not implemented”?

We (Mopidy) have no plans to change the format. We have no idea what Spotify will do.

We don’t currently have our MPD documentation available the same way we used to but you can see from the previous docs that we do not support that MPD command.

EDIT: I am wrong, the relevent docs are now at https://github.com/mopidy/mopidy-mpd/#limitations

Thank you very much! I’m here with another question about mpc with mopidy: if you think it’s better, I will start a new thread.

So, when using mopidy as a service (enabled or disabled at boot and runned by service start) it seems that the MPD can’t handle the mpc play command and the web client stucks. If i run mopidy manually, everything is good.
I also tried to change any conf file (/etc/mopidy, /home/.config/, etc.) in the mopidy.service but nothing changed. I also changed the MPD host entry with " :: ".

What could the problem be?

Yes, please start a new thread and provide all the information you can (see https://docs.mopidy.com/en/latest/troubleshooting/ for the sort of information that’s useful).

The config file you should be editing when running as a service is clearly explained at https://docs.mopidy.com/en/latest/running/service/.