Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add tracks to playlist #70

Open
jaedb opened this issue Dec 3, 2022 · 0 comments
Open

Cannot add tracks to playlist #70

jaedb opened this issue Dec 3, 2022 · 0 comments

Comments

@jaedb
Copy link

jaedb commented Dec 3, 2022

I can create a Playlist successfully 🎉 however when attempting to add tracks, it appears to work, but the server logs suggest otherwise. Refetching said playlist confirms that the tracks were not actually added to the remote asset.

These requests are send to the Mopidy JSON-RPC API (ie POST http://mopidy-server:6680/mopidy/rpc).

Playlist create request

{
	"method": "core.playlists.create",
	"params": {
		"name": "My rad playlist"
	},
	"jsonrpc": "2.0",
	"id": 1
}

Add tracks request

{
	"method": "core.playlists.save",
	"params": {
		"playlist": {
			"__model__": "Playlist",
			"uri": "XXX (RESULT FROM PREVIOUS REQUEST HERE)",
			"name": "My rad playlist",
			"tracks": [
				{
					"__model__": "Track",
					"uri": "ytmusic:track:dEp_vC1La_s"
				}
			]
		}
	},
	"jsonrpc": "2.0",
	"id": 1
}

Server log

ERROR    2022-12-03 09:31:00,201 [7:YTMusicBackend-3] mopidy_ytmusic
  YTMusic failed adding items to playlist
Traceback (most recent call last):
  File "/var/lib/mopidy/.local/lib/python3.7/site-packages/mopidy_ytmusic/playlist.py", line 115, in save
    self.backend.api.add_playlist_items(bId, list(add))
  File "/var/lib/mopidy/.local/lib/python3.7/site-packages/ytmusicapi/mixins/playlists.py", line 280, in add_playlist_items
    response = self._send_request(endpoint, body)
  File "/var/lib/mopidy/.local/lib/python3.7/site-packages/ytmusicapi/ytmusic.py", line 144, in _send_request
    raise Exception(message + error)
Exception: Server returned HTTP 400: Bad Request.
Request contains an invalid argument.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant