added create_playlist

This commit is contained in:
aj 2019-08-10 17:06:45 +01:00
parent b2d7c2c078
commit 0b68a45d50

View File

@ -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}")