/spotify-buddylist

Python version of valeriangalliat's spotify-buddylist Node library.

Primary LanguagePythonMIT LicenseMIT

spotify-buddylist

project version info supported python version dependency name

A minimal Python version of the spotify-buddylist Node library by valeriangalliat.

Ported Features

  • 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.

Quickstart

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)

sp_dc Cookie Instructions

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.