From 233ba44827c2d00f52bee2b8d1a7bfdfec53aec1 Mon Sep 17 00:00:00 2001 From: moyiz Date: Tue, 11 Apr 2017 14:04:12 +0300 Subject: [PATCH] Added support for following an artist or user --- spotipy/client.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spotipy/client.py b/spotipy/client.py index ad0e082..9ee5609 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -678,6 +678,20 @@ class Spotify(object): r = self._put('me/albums?ids=' + ','.join(alist)) return r + def user_follow_artists(self, ids=[]): + ''' Follow one or more artists + Parameters: + - ids - a list of artist IDs + ''' + return self._put('me/following?type=artist&ids=' + ','.join(ids)) + + def user_follow_users(self, ids=[]): + ''' Follow one or more users + Parameters: + - ids - a list of user IDs + ''' + return self._put('me/following?type=user&ids=' + ','.join(ids)) + def featured_playlists(self, locale=None, country=None, timestamp=None, limit=20, offset=0): ''' Get a list of Spotify featured playlists