A minimal Python version of the spotify-buddylist Node library by valeriangalliat.
getWebAccessToken
->get_web_access_token
(sync)fetch_web_access_token
(async)
getFriendActivity
->get_friend_activity
(sync)fetch_friend_activity
(async)
However, this package uses a more object-oriented approach. These functions return dataclasses instead of raw JSON dictionaries. Data fields can then be extracted from them with familiar dot notation.
import spotify_buddylist as buddylist
SP_DC = "YOUR_SP_DC_COOKIE_VALUE_HERE"
creds = buddylist.get_web_access_token(SP_DC)
activities = buddylist.get_friend_activity(creds.accessToken)
for activity in activities:
print(activity.user.name)
As designed in the original library, you only have to (annually) retrieve the value of the sp_dc
cookie from 'spotify.com' in your browser.