spotify-profile-monitor 2.8__tar.gz → 3.0__tar.gz
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.
- {spotify_profile_monitor-2.8 → spotify_profile_monitor-3.0}/PKG-INFO +53 -38
- {spotify_profile_monitor-2.8 → spotify_profile_monitor-3.0}/README.md +52 -37
- {spotify_profile_monitor-2.8 → spotify_profile_monitor-3.0}/pyproject.toml +1 -1
- {spotify_profile_monitor-2.8 → spotify_profile_monitor-3.0}/spotify_profile_monitor.egg-info/PKG-INFO +53 -38
- {spotify_profile_monitor-2.8 → spotify_profile_monitor-3.0}/spotify_profile_monitor.py +875 -74
- {spotify_profile_monitor-2.8 → spotify_profile_monitor-3.0}/LICENSE +0 -0
- {spotify_profile_monitor-2.8 → spotify_profile_monitor-3.0}/setup.cfg +0 -0
- {spotify_profile_monitor-2.8 → spotify_profile_monitor-3.0}/spotify_profile_monitor.egg-info/SOURCES.txt +0 -0
- {spotify_profile_monitor-2.8 → spotify_profile_monitor-3.0}/spotify_profile_monitor.egg-info/dependency_links.txt +0 -0
- {spotify_profile_monitor-2.8 → spotify_profile_monitor-3.0}/spotify_profile_monitor.egg-info/entry_points.txt +0 -0
- {spotify_profile_monitor-2.8 → spotify_profile_monitor-3.0}/spotify_profile_monitor.egg-info/requires.txt +0 -0
- {spotify_profile_monitor-2.8 → spotify_profile_monitor-3.0}/spotify_profile_monitor.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spotify_profile_monitor
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0
|
|
4
4
|
Summary: Tool implementing real-time tracking of Spotify users activities and profile changes including playlists
|
|
5
5
|
Author-email: Michal Szymanski <misiektoja-pypi@rm-rf.ninja>
|
|
6
6
|
License-Expression: GPL-3.0-or-later
|
|
@@ -38,24 +38,25 @@ OSINT tool for real-time monitoring of **Spotify users' activities and profile c
|
|
|
38
38
|
<a id="features"></a>
|
|
39
39
|
## Features
|
|
40
40
|
|
|
41
|
-
- Real-time tracking of Spotify user activities and profile changes:
|
|
42
|
-
- addition/removal of followings and followers
|
|
43
|
-
- addition/removal of playlists
|
|
44
|
-
- addition/removal of tracks in playlists (including collaborator info for newly added tracks)
|
|
45
|
-
- playlists name and description changes
|
|
46
|
-
- number of likes for playlists
|
|
47
|
-
- number of collaborators for playlists
|
|
48
|
-
- profile picture changes
|
|
49
|
-
- username changes
|
|
50
|
-
- Email notifications for various events (as listed above)
|
|
51
|
-
- Attaching changed profile pictures directly to email notifications
|
|
52
|
-
- Displaying the profile picture right in your terminal (if you have `imgcat` installed)
|
|
53
|
-
- Additional functionalities on top of the monitoring mode allowing to display detailed info about the user
|
|
54
|
-
- Ability to display and export the list of tracks for a specific playlist (including Liked Songs for the user who owns the Spotify access token)
|
|
55
|
-
- Saving all profile changes (including playlists) with timestamps to the CSV file
|
|
56
|
-
- Clickable Spotify
|
|
57
|
-
- Support for four different methods to get a Spotify access token (`sp_dc cookie`, `desktop client`, `OAuth app`, `OAuth user`)
|
|
58
|
-
- Possibility to control the running copy of the script via signals
|
|
41
|
+
- **Real-time tracking** of Spotify user activities and profile changes:
|
|
42
|
+
- addition/removal of **followings and followers**
|
|
43
|
+
- addition/removal of **playlists**
|
|
44
|
+
- addition/removal of **tracks in playlists** (including collaborator info for newly added tracks)
|
|
45
|
+
- **playlists name and description** changes
|
|
46
|
+
- **number of likes** for playlists
|
|
47
|
+
- **number of collaborators** for playlists
|
|
48
|
+
- **profile picture** changes
|
|
49
|
+
- **username** changes
|
|
50
|
+
- **Email notifications** for various events (as listed above)
|
|
51
|
+
- **Attaching changed profile pictures** directly to email notifications
|
|
52
|
+
- **Displaying the profile picture** right in your terminal (if you have `imgcat` installed)
|
|
53
|
+
- Additional functionalities on top of the monitoring mode allowing to display **detailed info about the user**, **list of followers & followings**, **recently played artists** and possibility to **search for users** in Spotify catalog with specific names
|
|
54
|
+
- Ability to **display and export** the list of tracks for a specific playlist (including **Liked Songs** for the user who owns the Spotify access token)
|
|
55
|
+
- **Saving all profile changes** (including playlists) with timestamps to the **CSV file**
|
|
56
|
+
- **Clickable** **Spotify**, **Apple Music**, **YouTube Music**, **Amazon Music**, **Deezer**, **Tidal**, **Genius Lyrics**, **AZLyrics**, **Tekstowo.pl**, **Musixmatch** and **Lyrics.com** search URLs printed in the console and included in email notifications (configurable per service)
|
|
57
|
+
- Support for **four different methods to get a Spotify access token** (`sp_dc cookie`, `desktop client`, `OAuth app`, `OAuth user`)
|
|
58
|
+
- Possibility to **control the running copy** of the script via signals
|
|
59
|
+
- **Functional, procedural Python** (minimal OOP)
|
|
59
60
|
|
|
60
61
|
<p align="center">
|
|
61
62
|
<img src="https://raw.githubusercontent.com/misiektoja/spotify_profile_monitor/refs/heads/main/assets/spotify_profile_monitor.png" alt="spotify_profile_monitor_screenshot" width="100%"/>
|
|
@@ -68,6 +69,7 @@ OSINT tool for real-time monitoring of **Spotify users' activities and profile c
|
|
|
68
69
|
2. [Installation](#installation)
|
|
69
70
|
* [Install from PyPI](#install-from-pypi)
|
|
70
71
|
* [Manual Installation](#manual-installation)
|
|
72
|
+
* [Upgrading](#upgrading)
|
|
71
73
|
3. [Quick Start](#quick-start)
|
|
72
74
|
4. [Configuration](#configuration)
|
|
73
75
|
* [Configuration File](#configuration-file)
|
|
@@ -140,6 +142,17 @@ Alternatively, from the downloaded *[requirements.txt](https://raw.githubusercon
|
|
|
140
142
|
pip install -r requirements.txt
|
|
141
143
|
```
|
|
142
144
|
|
|
145
|
+
<a id="upgrading"></a>
|
|
146
|
+
### Upgrading
|
|
147
|
+
|
|
148
|
+
To upgrade to the latest version when installed from PyPI:
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
pip install spotify_profile_monitor -U
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
If you installed manually, download the newest *[spotify_profile_monitor.py](https://raw.githubusercontent.com/misiektoja/spotify_profile_monitor/refs/heads/main/spotify_profile_monitor.py)* file to replace your existing installation.
|
|
155
|
+
|
|
143
156
|
<a id="quick-start"></a>
|
|
144
157
|
## Quick Start
|
|
145
158
|
|
|
@@ -179,22 +192,24 @@ spotify_profile_monitor --generate-config > spotify_profile_monitor.conf
|
|
|
179
192
|
|
|
180
193
|
Edit the `spotify_profile_monitor.conf` file and change any desired configuration options (detailed comments are provided for each).
|
|
181
194
|
|
|
195
|
+
**New in v2.9:** The configuration file includes options to enable/disable music service URLs (Apple Music, YouTube Music, Amazon Music, Deezer, Tidal) and lyrics service URLs (Genius, AZLyrics, Tekstowo.pl, Musixmatch, Lyrics.com) in console and email outputs.
|
|
196
|
+
|
|
182
197
|
<a id="spotify-access-token-source"></a>
|
|
183
198
|
### Spotify access token source
|
|
184
199
|
|
|
185
200
|
The tool supports four methods for obtaining a Spotify access token.
|
|
186
201
|
|
|
187
|
-
It can be configured via the `TOKEN_SOURCE` configuration option or the `--token-source` flag.
|
|
202
|
+
It can be configured via the `TOKEN_SOURCE` configuration option or the `--token-source` flag.
|
|
188
203
|
|
|
189
|
-
**Recommended: `cookie`**
|
|
204
|
+
**Recommended: `cookie`**
|
|
190
205
|
|
|
191
206
|
Uses the `sp_dc` cookie to retrieve a token from the Spotify web endpoint. This method is easy to set up and supports all features except fetching the list of liked tracks for the account that owns the access token (due to recent Spotify token's scope restrictions).
|
|
192
207
|
|
|
193
|
-
**Alternative: `client`**
|
|
208
|
+
**Alternative: `client`**
|
|
194
209
|
|
|
195
210
|
Uses captured credentials from the Spotify desktop client and a Protobuf-based login flow. It's more complex to set up, but supports all features. This method is intended for advanced users who want a long-lasting token with the broadest possible access.
|
|
196
211
|
|
|
197
|
-
**Safe fallback: `oauth_app`**
|
|
212
|
+
**Safe fallback: `oauth_app`**
|
|
198
213
|
|
|
199
214
|
Relies on the official Spotify Web API (Client Credentials OAuth flow). This method is easy to set up and safe to use, but has several limitations. The following features are **not** supported:
|
|
200
215
|
- viewing the list of followers/followings
|
|
@@ -208,7 +223,7 @@ Relies on the official Spotify Web API (Client Credentials OAuth flow). This met
|
|
|
208
223
|
|
|
209
224
|
Dedicated to tracking the authenticated user's own account via the official Spotify Web API (Authorization Code OAuth flow). I personally use this mode to monitor changes to my own account - such as new or lost followers/followings, likes on my playlists or when a collaborator adds a new song. You can also use this mode to track other users.
|
|
210
225
|
|
|
211
|
-
This method is easy to set up and safe to use, but has several limitations.
|
|
226
|
+
This method is easy to set up and safe to use, but has several limitations.
|
|
212
227
|
|
|
213
228
|
The following features are **not** supported when monitoring **your own account**:
|
|
214
229
|
- viewing the list of followers
|
|
@@ -294,7 +309,7 @@ The same applies to `--token-source client` flag - you can persist it via `TOKEN
|
|
|
294
309
|
|
|
295
310
|
The tool will automatically refresh both the access token and client token using the intercepted refresh token.
|
|
296
311
|
|
|
297
|
-
If your refresh token expires, the tool will notify you via the console and email. In that case, you'll need to re-export the login request body.
|
|
312
|
+
If your refresh token expires, the tool will notify you via the console and email. In that case, you'll need to re-export the login request body.
|
|
298
313
|
|
|
299
314
|
If you re-export the login request body to the same file name, you can send a `SIGHUP` signal to reload the file with the new refresh token without restarting the tool. More info in [Signal Controls (macOS/Linux/Unix)](#signal-controls-macoslinuxunix).
|
|
300
315
|
|
|
@@ -394,7 +409,7 @@ Alternatively you can use the built-in functionality to search for usernames (`-
|
|
|
394
409
|
spotify_profile_monitor -s "user name"
|
|
395
410
|
```
|
|
396
411
|
|
|
397
|
-
It will list all users with such names with their user URI ID.
|
|
412
|
+
It will list all users with such names with their user URI ID.
|
|
398
413
|
|
|
399
414
|
Before using this feature make sure you followed the instructions [here](#spotify-sha256-optional).
|
|
400
415
|
|
|
@@ -409,7 +424,7 @@ This step is optional and only required if you want to use the feature that sear
|
|
|
409
424
|
|
|
410
425
|
- Look for requests with the `searchUsers` or `searchDesktop` operation name
|
|
411
426
|
|
|
412
|
-
- Display the details of one of these requests and copy the **sha256Hash** parameter value (string marked as `XXXXXXXXXX` below)
|
|
427
|
+
- Display the details of one of these requests and copy the **sha256Hash** parameter value (string marked as `XXXXXXXXXX` below)
|
|
413
428
|
|
|
414
429
|
Example request:
|
|
415
430
|
`https://api-partner.spotify.com/pathfinder/v1/query?operationName=searchUsers&variables={"searchTerm":"spotify_user_uri_id","offset":0,"limit":5,"numberOfTopResults":5,"includeAudiobooks":false}&extensions={"persistedQuery":{"version":1,"sha256Hash":"XXXXXXXXXX"}}`
|
|
@@ -439,7 +454,7 @@ python3 -c "import pytz; print('\n'.join(pytz.all_timezones))"
|
|
|
439
454
|
<a id="smtp-settings"></a>
|
|
440
455
|
### SMTP Settings
|
|
441
456
|
|
|
442
|
-
If you want to use email notifications functionality, configure SMTP settings in the `spotify_profile_monitor.conf` file.
|
|
457
|
+
If you want to use email notifications functionality, configure SMTP settings in the `spotify_profile_monitor.conf` file.
|
|
443
458
|
|
|
444
459
|
Verify your SMTP settings by using `--send-test-email` flag (the tool will try to send a test email notification):
|
|
445
460
|
|
|
@@ -480,7 +495,7 @@ SP_SHA256="your_spotify_client_sha256"
|
|
|
480
495
|
SMTP_PASSWORD="your_smtp_password"
|
|
481
496
|
```
|
|
482
497
|
|
|
483
|
-
By default the tool will auto-search for dotenv file named `.env` in current directory and then upward from it.
|
|
498
|
+
By default the tool will auto-search for dotenv file named `.env` in current directory and then upward from it.
|
|
484
499
|
|
|
485
500
|
You can specify a custom file with `DOTENV_FILE` or `--env-file` flag:
|
|
486
501
|
|
|
@@ -515,9 +530,9 @@ spotify_profile_monitor <spotify_user_uri_id> -u "your_sp_dc_cookie_value"
|
|
|
515
530
|
```
|
|
516
531
|
|
|
517
532
|
By default, the tool looks for a configuration file named `spotify_profile_monitor.conf` in:
|
|
518
|
-
- current directory
|
|
533
|
+
- current directory
|
|
519
534
|
- home directory (`~`)
|
|
520
|
-
- script directory
|
|
535
|
+
- script directory
|
|
521
536
|
|
|
522
537
|
If you generated a configuration file as described in [Configuration](#configuration), but saved it under a different name or in a different directory, you can specify its location using the `--config-file` flag:
|
|
523
538
|
|
|
@@ -536,7 +551,7 @@ spotify_profile_monitor <spotify_user_uri_id> -k
|
|
|
536
551
|
|
|
537
552
|
It is helpful in the case of playlists created by another user added to another user profile.
|
|
538
553
|
|
|
539
|
-
Some users don't list all their public playlists on their profile, but if you know a playlist's URI, you can still monitor it.
|
|
554
|
+
Some users don't list all their public playlists on their profile, but if you know a playlist's URI, you can still monitor it.
|
|
540
555
|
|
|
541
556
|
To do so, add entries to the `ADD_PLAYLISTS_TO_MONITOR` configuration option. Example:
|
|
542
557
|
|
|
@@ -570,7 +585,7 @@ You can monitor multiple Spotify users by running multiple copies of the script.
|
|
|
570
585
|
The tool automatically saves its output to `spotify_profile_monitor_<user_uri_id/file_suffix>.log` file. The log file name can be changed via `SP_LOGFILE` configuration option and its suffix via `FILE_SUFFIX` / `-y` flag. Logging can be disabled completely via `DISABLE_LOGGING` / `-d` flag.
|
|
571
586
|
|
|
572
587
|
The tool also saves the list of followings, followers and playlists to these files:
|
|
573
|
-
- `spotify_profile_<user_uri_id/file_suffix>_followings.json`
|
|
588
|
+
- `spotify_profile_<user_uri_id/file_suffix>_followings.json`
|
|
574
589
|
- `spotify_profile_<user_uri_id/file_suffix>_followers.json`
|
|
575
590
|
- `spotify_profile_<user_uri_id/file_suffix>_playlists.json`
|
|
576
591
|
|
|
@@ -690,7 +705,7 @@ Make sure you defined your SMTP settings earlier (see [SMTP settings](#smtp-sett
|
|
|
690
705
|
Example email:
|
|
691
706
|
|
|
692
707
|
<p align="center">
|
|
693
|
-
<img src="https://raw.githubusercontent.com/misiektoja/spotify_profile_monitor/refs/heads/main/assets/spotify_profile_monitor_email_notifications.png" alt="spotify_profile_monitor_email_notifications" width="
|
|
708
|
+
<img src="https://raw.githubusercontent.com/misiektoja/spotify_profile_monitor/refs/heads/main/assets/spotify_profile_monitor_email_notifications.png" alt="spotify_profile_monitor_email_notifications" width="90%"/>
|
|
694
709
|
</p>
|
|
695
710
|
|
|
696
711
|
<a id="csv-export"></a>
|
|
@@ -732,7 +747,7 @@ If a change is detected, the old picture is moved to `spotify_profile_<user_uri_
|
|
|
732
747
|
|
|
733
748
|
If you have `imgcat` installed, you can enable inline display of profile pictures and playlist artwork directly in your terminal.
|
|
734
749
|
|
|
735
|
-
To do this, set the path to your `imgcat` binary in the `IMGCAT_PATH` configuration option.
|
|
750
|
+
To do this, set the path to your `imgcat` binary in the `IMGCAT_PATH` configuration option.
|
|
736
751
|
|
|
737
752
|
If you specify only the binary name, it will be auto-searched in your PATH.
|
|
738
753
|
|
|
@@ -832,7 +847,7 @@ To help with troubleshooting and development, two debug utilities are available
|
|
|
832
847
|
<a id="access-token-retrieval-via-sp_dc-cookie-and-totp"></a>
|
|
833
848
|
### Access Token Retrieval via sp_dc Cookie and TOTP
|
|
834
849
|
|
|
835
|
-
The [spotify_monitor_totp_test](https://github.com/misiektoja/spotify_monitor/blob/dev/debug/spotify_monitor_totp_test.py) tool retrieves a Spotify access token using a Web Player `sp_dc` cookie and TOTP parameters.
|
|
850
|
+
The [spotify_monitor_totp_test](https://github.com/misiektoja/spotify_monitor/blob/dev/debug/spotify_monitor_totp_test.py) tool retrieves a Spotify access token using a Web Player `sp_dc` cookie and TOTP parameters.
|
|
836
851
|
|
|
837
852
|
Download from [here](https://github.com/misiektoja/spotify_monitor/blob/dev/debug/spotify_monitor_totp_test.py) or:
|
|
838
853
|
|
|
@@ -863,7 +878,7 @@ You should get a valid Spotify access token, example output:
|
|
|
863
878
|
<a id="secret-key-extraction-from-spotify-web-player-bundles"></a>
|
|
864
879
|
### Secret Key Extraction from Spotify Web Player Bundles
|
|
865
880
|
|
|
866
|
-
The [spotify_monitor_secret_grabber](https://github.com/misiektoja/spotify_monitor/blob/dev/debug/spotify_monitor_secret_grabber.py) tool automatically extracts secret keys used for TOTP generation in Spotify Web Player JavaScript bundles.
|
|
881
|
+
The [spotify_monitor_secret_grabber](https://github.com/misiektoja/spotify_monitor/blob/dev/debug/spotify_monitor_secret_grabber.py) tool automatically extracts secret keys used for TOTP generation in Spotify Web Player JavaScript bundles.
|
|
867
882
|
|
|
868
883
|
> 💡 **Quick tip:** The easiest and recommended way to run this tool is via Docker. Jump directly to the [Docker usage section below](#-secret-key-extraction-via-docker-recommended-easiest-way).
|
|
869
884
|
|
|
@@ -983,7 +998,7 @@ See [RELEASE_NOTES.md](https://github.com/misiektoja/spotify_profile_monitor/blo
|
|
|
983
998
|
<a id="maintainers"></a>
|
|
984
999
|
## Maintainers
|
|
985
1000
|
|
|
986
|
-
[](https://github.com/misiektoja)
|
|
1001
|
+
[](https://github.com/misiektoja)
|
|
987
1002
|
[](https://github.com/tomballgithub)
|
|
988
1003
|
|
|
989
1004
|
<a id="license"></a>
|
|
@@ -9,24 +9,25 @@ OSINT tool for real-time monitoring of **Spotify users' activities and profile c
|
|
|
9
9
|
<a id="features"></a>
|
|
10
10
|
## Features
|
|
11
11
|
|
|
12
|
-
- Real-time tracking of Spotify user activities and profile changes:
|
|
13
|
-
- addition/removal of followings and followers
|
|
14
|
-
- addition/removal of playlists
|
|
15
|
-
- addition/removal of tracks in playlists (including collaborator info for newly added tracks)
|
|
16
|
-
- playlists name and description changes
|
|
17
|
-
- number of likes for playlists
|
|
18
|
-
- number of collaborators for playlists
|
|
19
|
-
- profile picture changes
|
|
20
|
-
- username changes
|
|
21
|
-
- Email notifications for various events (as listed above)
|
|
22
|
-
- Attaching changed profile pictures directly to email notifications
|
|
23
|
-
- Displaying the profile picture right in your terminal (if you have `imgcat` installed)
|
|
24
|
-
- Additional functionalities on top of the monitoring mode allowing to display detailed info about the user
|
|
25
|
-
- Ability to display and export the list of tracks for a specific playlist (including Liked Songs for the user who owns the Spotify access token)
|
|
26
|
-
- Saving all profile changes (including playlists) with timestamps to the CSV file
|
|
27
|
-
- Clickable Spotify
|
|
28
|
-
- Support for four different methods to get a Spotify access token (`sp_dc cookie`, `desktop client`, `OAuth app`, `OAuth user`)
|
|
29
|
-
- Possibility to control the running copy of the script via signals
|
|
12
|
+
- **Real-time tracking** of Spotify user activities and profile changes:
|
|
13
|
+
- addition/removal of **followings and followers**
|
|
14
|
+
- addition/removal of **playlists**
|
|
15
|
+
- addition/removal of **tracks in playlists** (including collaborator info for newly added tracks)
|
|
16
|
+
- **playlists name and description** changes
|
|
17
|
+
- **number of likes** for playlists
|
|
18
|
+
- **number of collaborators** for playlists
|
|
19
|
+
- **profile picture** changes
|
|
20
|
+
- **username** changes
|
|
21
|
+
- **Email notifications** for various events (as listed above)
|
|
22
|
+
- **Attaching changed profile pictures** directly to email notifications
|
|
23
|
+
- **Displaying the profile picture** right in your terminal (if you have `imgcat` installed)
|
|
24
|
+
- Additional functionalities on top of the monitoring mode allowing to display **detailed info about the user**, **list of followers & followings**, **recently played artists** and possibility to **search for users** in Spotify catalog with specific names
|
|
25
|
+
- Ability to **display and export** the list of tracks for a specific playlist (including **Liked Songs** for the user who owns the Spotify access token)
|
|
26
|
+
- **Saving all profile changes** (including playlists) with timestamps to the **CSV file**
|
|
27
|
+
- **Clickable** **Spotify**, **Apple Music**, **YouTube Music**, **Amazon Music**, **Deezer**, **Tidal**, **Genius Lyrics**, **AZLyrics**, **Tekstowo.pl**, **Musixmatch** and **Lyrics.com** search URLs printed in the console and included in email notifications (configurable per service)
|
|
28
|
+
- Support for **four different methods to get a Spotify access token** (`sp_dc cookie`, `desktop client`, `OAuth app`, `OAuth user`)
|
|
29
|
+
- Possibility to **control the running copy** of the script via signals
|
|
30
|
+
- **Functional, procedural Python** (minimal OOP)
|
|
30
31
|
|
|
31
32
|
<p align="center">
|
|
32
33
|
<img src="https://raw.githubusercontent.com/misiektoja/spotify_profile_monitor/refs/heads/main/assets/spotify_profile_monitor.png" alt="spotify_profile_monitor_screenshot" width="100%"/>
|
|
@@ -39,6 +40,7 @@ OSINT tool for real-time monitoring of **Spotify users' activities and profile c
|
|
|
39
40
|
2. [Installation](#installation)
|
|
40
41
|
* [Install from PyPI](#install-from-pypi)
|
|
41
42
|
* [Manual Installation](#manual-installation)
|
|
43
|
+
* [Upgrading](#upgrading)
|
|
42
44
|
3. [Quick Start](#quick-start)
|
|
43
45
|
4. [Configuration](#configuration)
|
|
44
46
|
* [Configuration File](#configuration-file)
|
|
@@ -111,6 +113,17 @@ Alternatively, from the downloaded *[requirements.txt](https://raw.githubusercon
|
|
|
111
113
|
pip install -r requirements.txt
|
|
112
114
|
```
|
|
113
115
|
|
|
116
|
+
<a id="upgrading"></a>
|
|
117
|
+
### Upgrading
|
|
118
|
+
|
|
119
|
+
To upgrade to the latest version when installed from PyPI:
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
pip install spotify_profile_monitor -U
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
If you installed manually, download the newest *[spotify_profile_monitor.py](https://raw.githubusercontent.com/misiektoja/spotify_profile_monitor/refs/heads/main/spotify_profile_monitor.py)* file to replace your existing installation.
|
|
126
|
+
|
|
114
127
|
<a id="quick-start"></a>
|
|
115
128
|
## Quick Start
|
|
116
129
|
|
|
@@ -150,22 +163,24 @@ spotify_profile_monitor --generate-config > spotify_profile_monitor.conf
|
|
|
150
163
|
|
|
151
164
|
Edit the `spotify_profile_monitor.conf` file and change any desired configuration options (detailed comments are provided for each).
|
|
152
165
|
|
|
166
|
+
**New in v2.9:** The configuration file includes options to enable/disable music service URLs (Apple Music, YouTube Music, Amazon Music, Deezer, Tidal) and lyrics service URLs (Genius, AZLyrics, Tekstowo.pl, Musixmatch, Lyrics.com) in console and email outputs.
|
|
167
|
+
|
|
153
168
|
<a id="spotify-access-token-source"></a>
|
|
154
169
|
### Spotify access token source
|
|
155
170
|
|
|
156
171
|
The tool supports four methods for obtaining a Spotify access token.
|
|
157
172
|
|
|
158
|
-
It can be configured via the `TOKEN_SOURCE` configuration option or the `--token-source` flag.
|
|
173
|
+
It can be configured via the `TOKEN_SOURCE` configuration option or the `--token-source` flag.
|
|
159
174
|
|
|
160
|
-
**Recommended: `cookie`**
|
|
175
|
+
**Recommended: `cookie`**
|
|
161
176
|
|
|
162
177
|
Uses the `sp_dc` cookie to retrieve a token from the Spotify web endpoint. This method is easy to set up and supports all features except fetching the list of liked tracks for the account that owns the access token (due to recent Spotify token's scope restrictions).
|
|
163
178
|
|
|
164
|
-
**Alternative: `client`**
|
|
179
|
+
**Alternative: `client`**
|
|
165
180
|
|
|
166
181
|
Uses captured credentials from the Spotify desktop client and a Protobuf-based login flow. It's more complex to set up, but supports all features. This method is intended for advanced users who want a long-lasting token with the broadest possible access.
|
|
167
182
|
|
|
168
|
-
**Safe fallback: `oauth_app`**
|
|
183
|
+
**Safe fallback: `oauth_app`**
|
|
169
184
|
|
|
170
185
|
Relies on the official Spotify Web API (Client Credentials OAuth flow). This method is easy to set up and safe to use, but has several limitations. The following features are **not** supported:
|
|
171
186
|
- viewing the list of followers/followings
|
|
@@ -179,7 +194,7 @@ Relies on the official Spotify Web API (Client Credentials OAuth flow). This met
|
|
|
179
194
|
|
|
180
195
|
Dedicated to tracking the authenticated user's own account via the official Spotify Web API (Authorization Code OAuth flow). I personally use this mode to monitor changes to my own account - such as new or lost followers/followings, likes on my playlists or when a collaborator adds a new song. You can also use this mode to track other users.
|
|
181
196
|
|
|
182
|
-
This method is easy to set up and safe to use, but has several limitations.
|
|
197
|
+
This method is easy to set up and safe to use, but has several limitations.
|
|
183
198
|
|
|
184
199
|
The following features are **not** supported when monitoring **your own account**:
|
|
185
200
|
- viewing the list of followers
|
|
@@ -265,7 +280,7 @@ The same applies to `--token-source client` flag - you can persist it via `TOKEN
|
|
|
265
280
|
|
|
266
281
|
The tool will automatically refresh both the access token and client token using the intercepted refresh token.
|
|
267
282
|
|
|
268
|
-
If your refresh token expires, the tool will notify you via the console and email. In that case, you'll need to re-export the login request body.
|
|
283
|
+
If your refresh token expires, the tool will notify you via the console and email. In that case, you'll need to re-export the login request body.
|
|
269
284
|
|
|
270
285
|
If you re-export the login request body to the same file name, you can send a `SIGHUP` signal to reload the file with the new refresh token without restarting the tool. More info in [Signal Controls (macOS/Linux/Unix)](#signal-controls-macoslinuxunix).
|
|
271
286
|
|
|
@@ -365,7 +380,7 @@ Alternatively you can use the built-in functionality to search for usernames (`-
|
|
|
365
380
|
spotify_profile_monitor -s "user name"
|
|
366
381
|
```
|
|
367
382
|
|
|
368
|
-
It will list all users with such names with their user URI ID.
|
|
383
|
+
It will list all users with such names with their user URI ID.
|
|
369
384
|
|
|
370
385
|
Before using this feature make sure you followed the instructions [here](#spotify-sha256-optional).
|
|
371
386
|
|
|
@@ -380,7 +395,7 @@ This step is optional and only required if you want to use the feature that sear
|
|
|
380
395
|
|
|
381
396
|
- Look for requests with the `searchUsers` or `searchDesktop` operation name
|
|
382
397
|
|
|
383
|
-
- Display the details of one of these requests and copy the **sha256Hash** parameter value (string marked as `XXXXXXXXXX` below)
|
|
398
|
+
- Display the details of one of these requests and copy the **sha256Hash** parameter value (string marked as `XXXXXXXXXX` below)
|
|
384
399
|
|
|
385
400
|
Example request:
|
|
386
401
|
`https://api-partner.spotify.com/pathfinder/v1/query?operationName=searchUsers&variables={"searchTerm":"spotify_user_uri_id","offset":0,"limit":5,"numberOfTopResults":5,"includeAudiobooks":false}&extensions={"persistedQuery":{"version":1,"sha256Hash":"XXXXXXXXXX"}}`
|
|
@@ -410,7 +425,7 @@ python3 -c "import pytz; print('\n'.join(pytz.all_timezones))"
|
|
|
410
425
|
<a id="smtp-settings"></a>
|
|
411
426
|
### SMTP Settings
|
|
412
427
|
|
|
413
|
-
If you want to use email notifications functionality, configure SMTP settings in the `spotify_profile_monitor.conf` file.
|
|
428
|
+
If you want to use email notifications functionality, configure SMTP settings in the `spotify_profile_monitor.conf` file.
|
|
414
429
|
|
|
415
430
|
Verify your SMTP settings by using `--send-test-email` flag (the tool will try to send a test email notification):
|
|
416
431
|
|
|
@@ -451,7 +466,7 @@ SP_SHA256="your_spotify_client_sha256"
|
|
|
451
466
|
SMTP_PASSWORD="your_smtp_password"
|
|
452
467
|
```
|
|
453
468
|
|
|
454
|
-
By default the tool will auto-search for dotenv file named `.env` in current directory and then upward from it.
|
|
469
|
+
By default the tool will auto-search for dotenv file named `.env` in current directory and then upward from it.
|
|
455
470
|
|
|
456
471
|
You can specify a custom file with `DOTENV_FILE` or `--env-file` flag:
|
|
457
472
|
|
|
@@ -486,9 +501,9 @@ spotify_profile_monitor <spotify_user_uri_id> -u "your_sp_dc_cookie_value"
|
|
|
486
501
|
```
|
|
487
502
|
|
|
488
503
|
By default, the tool looks for a configuration file named `spotify_profile_monitor.conf` in:
|
|
489
|
-
- current directory
|
|
504
|
+
- current directory
|
|
490
505
|
- home directory (`~`)
|
|
491
|
-
- script directory
|
|
506
|
+
- script directory
|
|
492
507
|
|
|
493
508
|
If you generated a configuration file as described in [Configuration](#configuration), but saved it under a different name or in a different directory, you can specify its location using the `--config-file` flag:
|
|
494
509
|
|
|
@@ -507,7 +522,7 @@ spotify_profile_monitor <spotify_user_uri_id> -k
|
|
|
507
522
|
|
|
508
523
|
It is helpful in the case of playlists created by another user added to another user profile.
|
|
509
524
|
|
|
510
|
-
Some users don't list all their public playlists on their profile, but if you know a playlist's URI, you can still monitor it.
|
|
525
|
+
Some users don't list all their public playlists on their profile, but if you know a playlist's URI, you can still monitor it.
|
|
511
526
|
|
|
512
527
|
To do so, add entries to the `ADD_PLAYLISTS_TO_MONITOR` configuration option. Example:
|
|
513
528
|
|
|
@@ -541,7 +556,7 @@ You can monitor multiple Spotify users by running multiple copies of the script.
|
|
|
541
556
|
The tool automatically saves its output to `spotify_profile_monitor_<user_uri_id/file_suffix>.log` file. The log file name can be changed via `SP_LOGFILE` configuration option and its suffix via `FILE_SUFFIX` / `-y` flag. Logging can be disabled completely via `DISABLE_LOGGING` / `-d` flag.
|
|
542
557
|
|
|
543
558
|
The tool also saves the list of followings, followers and playlists to these files:
|
|
544
|
-
- `spotify_profile_<user_uri_id/file_suffix>_followings.json`
|
|
559
|
+
- `spotify_profile_<user_uri_id/file_suffix>_followings.json`
|
|
545
560
|
- `spotify_profile_<user_uri_id/file_suffix>_followers.json`
|
|
546
561
|
- `spotify_profile_<user_uri_id/file_suffix>_playlists.json`
|
|
547
562
|
|
|
@@ -661,7 +676,7 @@ Make sure you defined your SMTP settings earlier (see [SMTP settings](#smtp-sett
|
|
|
661
676
|
Example email:
|
|
662
677
|
|
|
663
678
|
<p align="center">
|
|
664
|
-
<img src="https://raw.githubusercontent.com/misiektoja/spotify_profile_monitor/refs/heads/main/assets/spotify_profile_monitor_email_notifications.png" alt="spotify_profile_monitor_email_notifications" width="
|
|
679
|
+
<img src="https://raw.githubusercontent.com/misiektoja/spotify_profile_monitor/refs/heads/main/assets/spotify_profile_monitor_email_notifications.png" alt="spotify_profile_monitor_email_notifications" width="90%"/>
|
|
665
680
|
</p>
|
|
666
681
|
|
|
667
682
|
<a id="csv-export"></a>
|
|
@@ -703,7 +718,7 @@ If a change is detected, the old picture is moved to `spotify_profile_<user_uri_
|
|
|
703
718
|
|
|
704
719
|
If you have `imgcat` installed, you can enable inline display of profile pictures and playlist artwork directly in your terminal.
|
|
705
720
|
|
|
706
|
-
To do this, set the path to your `imgcat` binary in the `IMGCAT_PATH` configuration option.
|
|
721
|
+
To do this, set the path to your `imgcat` binary in the `IMGCAT_PATH` configuration option.
|
|
707
722
|
|
|
708
723
|
If you specify only the binary name, it will be auto-searched in your PATH.
|
|
709
724
|
|
|
@@ -803,7 +818,7 @@ To help with troubleshooting and development, two debug utilities are available
|
|
|
803
818
|
<a id="access-token-retrieval-via-sp_dc-cookie-and-totp"></a>
|
|
804
819
|
### Access Token Retrieval via sp_dc Cookie and TOTP
|
|
805
820
|
|
|
806
|
-
The [spotify_monitor_totp_test](https://github.com/misiektoja/spotify_monitor/blob/dev/debug/spotify_monitor_totp_test.py) tool retrieves a Spotify access token using a Web Player `sp_dc` cookie and TOTP parameters.
|
|
821
|
+
The [spotify_monitor_totp_test](https://github.com/misiektoja/spotify_monitor/blob/dev/debug/spotify_monitor_totp_test.py) tool retrieves a Spotify access token using a Web Player `sp_dc` cookie and TOTP parameters.
|
|
807
822
|
|
|
808
823
|
Download from [here](https://github.com/misiektoja/spotify_monitor/blob/dev/debug/spotify_monitor_totp_test.py) or:
|
|
809
824
|
|
|
@@ -834,7 +849,7 @@ You should get a valid Spotify access token, example output:
|
|
|
834
849
|
<a id="secret-key-extraction-from-spotify-web-player-bundles"></a>
|
|
835
850
|
### Secret Key Extraction from Spotify Web Player Bundles
|
|
836
851
|
|
|
837
|
-
The [spotify_monitor_secret_grabber](https://github.com/misiektoja/spotify_monitor/blob/dev/debug/spotify_monitor_secret_grabber.py) tool automatically extracts secret keys used for TOTP generation in Spotify Web Player JavaScript bundles.
|
|
852
|
+
The [spotify_monitor_secret_grabber](https://github.com/misiektoja/spotify_monitor/blob/dev/debug/spotify_monitor_secret_grabber.py) tool automatically extracts secret keys used for TOTP generation in Spotify Web Player JavaScript bundles.
|
|
838
853
|
|
|
839
854
|
> 💡 **Quick tip:** The easiest and recommended way to run this tool is via Docker. Jump directly to the [Docker usage section below](#-secret-key-extraction-via-docker-recommended-easiest-way).
|
|
840
855
|
|
|
@@ -954,7 +969,7 @@ See [RELEASE_NOTES.md](https://github.com/misiektoja/spotify_profile_monitor/blo
|
|
|
954
969
|
<a id="maintainers"></a>
|
|
955
970
|
## Maintainers
|
|
956
971
|
|
|
957
|
-
[](https://github.com/misiektoja)
|
|
972
|
+
[](https://github.com/misiektoja)
|
|
958
973
|
[](https://github.com/tomballgithub)
|
|
959
974
|
|
|
960
975
|
<a id="license"></a>
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "spotify_profile_monitor"
|
|
7
|
-
version = "
|
|
7
|
+
version = "3.0"
|
|
8
8
|
description = "Tool implementing real-time tracking of Spotify users activities and profile changes including playlists"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "GPL-3.0-or-later"
|