spotify-monitor 2.0rc2__py3-none-any.whl → 2.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of spotify-monitor might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spotify_monitor
3
- Version: 2.0rc2
3
+ Version: 2.1.1
4
4
  Summary: Tool implementing real-time tracking of Spotify friends music activity
5
5
  Author-email: Michal Szymanski <misiektoja-pypi@rm-rf.ninja>
6
6
  License-Expression: GPL-3.0-or-later
@@ -29,6 +29,10 @@ spotify_monitor is a tool for real-time monitoring of Spotify friends' music act
29
29
 
30
30
  NOTE: If you're interested in tracking changes to Spotify users' profiles including their playlists, take a look at another tool I've developed: [spotify_profile_monitor](https://github.com/misiektoja/spotify_profile_monitor).
31
31
 
32
+ > Spotify made multiple changes to the web endpoint on June 10th 2025, which broke the **[sp_dc cookie](#spotify-sp_dc-cookie)** method.
33
+ > 📦 The issue is under investigation to determine if it can be restored.
34
+ > 👉 In the meantime, use **[desktop client](#spotify-desktop-client)** method instead.
35
+
32
36
  <a id="features"></a>
33
37
  ## Features
34
38
 
@@ -56,7 +60,9 @@ NOTE: If you're interested in tracking changes to Spotify users' profiles includ
56
60
  3. [Quick Start](#quick-start)
57
61
  4. [Configuration](#configuration)
58
62
  * [Configuration File](#configuration-file)
59
- * [Spotify sp_dc Cookie](#spotify-sp_dc-cookie)
63
+ * [Spotify access token source](#spotify-access-token-source)
64
+ * [Spotify sp_dc Cookie](#spotify-sp_dc-cookie)
65
+ * [Spotify Desktop Client](#spotify-desktop-client)
60
66
  * [Following the Monitored User](#following-the-monitored-user)
61
67
  * [How to Get a Friend's User URI ID](#how-to-get-a-friends-user-uri-id)
62
68
  * [SMTP Settings](#smtp-settings)
@@ -153,8 +159,23 @@ spotify_monitor --generate-config > spotify_monitor.conf
153
159
 
154
160
  Edit the `spotify_monitor.conf` file and change any desired configuration options (detailed comments are provided for each).
155
161
 
162
+ <a id="spotify-access-token-source"></a>
163
+ #### Spotify access token source
164
+
165
+ The tool supports two methods for obtaining a Spotify access token.
166
+
167
+ It can be configured via the `TOKEN_SOURCE` configuration option or the `--token-source` flag.
168
+
169
+ The **recommended method** is `cookie` which uses the sp_dc cookie to retrieve a token from the Spotify web endpoint.
170
+
171
+ The **alternative method** is `client` which uses captured credentials from the Spotify desktop client and a Protobuf-based login flow. This approach is intended for advanced users who want an indefinitely valid token with the widest scope.
172
+
173
+ If no method is specified, the tool defaults to the `cookie` method.
174
+
156
175
  <a id="spotify-sp_dc-cookie"></a>
157
- ### Spotify sp_dc Cookie
176
+ #### Spotify sp_dc Cookie
177
+
178
+ It is default method used to obtain a Spotify access token.
158
179
 
159
180
  Log in to [https://open.spotify.com/](https://open.spotify.com/) in your web browser.
160
181
 
@@ -170,11 +191,50 @@ Provide the `SP_DC_COOKIE` secret using one of the following methods:
170
191
  Fallback:
171
192
  - Hard-code it in the code or config file
172
193
 
173
- The `sp_dc` cookie is typically valid for up to 2 weeks. You will be informed by the tool once the cookie expires (proper message on the console and in email).
194
+ You will be informed by the tool once the `sp_dc` cookie expires (proper message on the console and in email).
174
195
 
175
196
  If you store the `SP_DC_COOKIE` in a dotenv file you can update its value and send a `SIGHUP` signal to the process to reload the file with the new `sp_dc` cookie without restarting the tool. More info in [Storing Secrets](#storing-secrets) and [Signal Controls (macOS/Linux/Unix)](#signal-controls-macoslinuxunix).
176
197
 
177
- It is recommended to create a new Spotify account for use with the tool since we are not using the official Spotify Web API most of the time (as it does not support fetching friend activity).
198
+ **Important**: It is strongly recommended to use a separate Spotify account with this tool. It does not rely on the official Spotify Web API for core features (like fetching friend activity), as it is not supported by the public API.
199
+
200
+ <a id="spotify-desktop-client"></a>
201
+ #### Spotify Desktop Client
202
+
203
+ To use credentials captured from the Spotify desktop client to obtain an access token, set the `TOKEN_SOURCE` configuration option to `client` or use the `--token-source client` flag.
204
+
205
+ Run an intercepting proxy of your choice (like [Proxyman](https://proxyman.com)).
206
+
207
+ Launch the Spotify desktop client and look for POST requests to `https://login{n}.spotify.com/v3/login`
208
+
209
+ Note: The `login` part is suffixed with one or more digits (e.g. `login5`).
210
+
211
+ If you don't see this request, log out from the client and log back in.
212
+
213
+ Export the login request body (a binary Protobuf payload) to a file.
214
+
215
+ In Proxyman: ***right click the request → Export → Request Body → Save File***.
216
+
217
+ <p align="center">
218
+ <img src="https://raw.githubusercontent.com/misiektoja/spotify_monitor/refs/heads/main/assets/proxyman_export_protobuf.png" alt="proxyman_export_protobuf" width="80%"/>
219
+ </p>
220
+
221
+ Then run the tool with `-w <path-to-login-request-body-file>`:
222
+
223
+ ```sh
224
+ spotify_monitor --token-source client -w <path-to-login-request-body-file> <spotify_user_uri_id>
225
+ ```
226
+
227
+ If successful, the tool will automatically extract the necessary fields and begin monitoring.
228
+
229
+ You can also persist the Protobuf request file path using the `LOGIN_REQUEST_BODY_FILE` configuration option.
230
+
231
+ The tool will automatically refresh both the access token and client token using the intercepted refresh token.
232
+
233
+ Advanced options are available for further customization - refer to the configuration file comments. However, default settings should work for most cases.
234
+
235
+ You will be informed by the tool once the refresh token expires (proper message on the console and in email).
236
+
237
+ **Important**: It is strongly recommended to use a separate Spotify account with this tool. It does not rely on the official Spotify Web API for core features (like fetching friend activity), as it is not supported by the public API.
178
238
 
179
239
  <a id="following-the-monitored-user"></a>
180
240
  ### Following the Monitored User
@@ -259,7 +319,7 @@ To monitor specific user activity, just type [Spotify user URI ID](#how-to-get-a
259
319
  spotify_monitor <spotify_user_uri_id>
260
320
  ```
261
321
 
262
- If you have not set `SP_DC_COOKIE` secret, you can use `-u` flag:
322
+ If you use the default method to obtain a Spotify access token (`cookie`) and have not set `SP_DC_COOKIE` secret, you can use `-u` flag:
263
323
 
264
324
  ```sh
265
325
  spotify_monitor <spotify_user_uri_id> -u "your_sp_dc_cookie_value"
@@ -461,7 +521,7 @@ List of supported signals:
461
521
  | PIPE | Toggle email notifications when user plays song on loop (-x) |
462
522
  | TRAP | Increase the inactivity check timer (by 30 seconds) (-o) |
463
523
  | ABRT | Decrease the inactivity check timer (by 30 seconds) (-o) |
464
- | HUP | Reload secrets from .env file |
524
+ | HUP | Reload secrets from .env file and token source credentials from Protobuf files |
465
525
 
466
526
  Send signals with `kill` or `pkill`, e.g.:
467
527
 
@@ -0,0 +1,7 @@
1
+ spotify_monitor.py,sha256=V0nSqE7yIdq2RIWhtAPsCect_1TB3eZB45mzYNgWIOg,145965
2
+ spotify_monitor-2.1.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
3
+ spotify_monitor-2.1.1.dist-info/METADATA,sha256=Iu59nenF5pT-jr4inNhdbbiuMiOLTp_72f3FW1NVIjk,21834
4
+ spotify_monitor-2.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
+ spotify_monitor-2.1.1.dist-info/entry_points.txt,sha256=8HzePfUcCSXrYaXOwLbNNYO8GJcnhgCSl4wcDNECht8,57
6
+ spotify_monitor-2.1.1.dist-info/top_level.txt,sha256=EP6IPD4vHT12rLM5b_jo2i3nrfOuwk3ehhr2gWdQx9Y,16
7
+ spotify_monitor-2.1.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5