From 0b68a45d508d6257063a606aff281df450825bbe Mon Sep 17 00:00:00 2001 From: aj Date: Sat, 10 Aug 2019 17:06:45 +0100 Subject: [PATCH] added create_playlist --- spotframework/net/network.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spotframework/net/network.py b/spotframework/net/network.py index 6e854b7..5b36c6d 100644 --- a/spotframework/net/network.py +++ b/spotframework/net/network.py @@ -67,6 +67,15 @@ class Network: return playlist + def create_playlist(self, username, name='New Playlist', public=True, collaborative=False, description=None): + + json = {"name": name, "public": public, "collaborative": collaborative} + + if description: + json['description'] = description + + req = self._make_post_request('createPlaylist', f'users/{username}/playlists', json=json) + def get_playlists(self, offset=0): logger.info(f"{offset}")