Skip to content

Commit 46f74f7

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 99f2019 + e642428 commit 46f74f7

24 files changed

Lines changed: 1255 additions & 543 deletions

README.md

Lines changed: 72 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -19,43 +19,79 @@ Powerful real-time tracker for Spotify friend music activity: monitor listening
1919
<a id="-quick-install-run"></a>
2020
### 🚀 Quick Install & Run
2121

22-
Python from PyPI
22+
#### Python from PyPI
2323

2424
```sh
2525
pip install spotify_monitor
26+
```
27+
28+
Run setup by itself:
29+
30+
```sh
2631
spotify_monitor --setup
2732
```
2833

29-
Docker Compose
34+
#### Docker image - fastest container setup
35+
36+
##### macOS or Windows
37+
38+
Use a macOS shell or Windows PowerShell with a Docker-compatible runtime that provides the `docker` CLI.
39+
40+
```sh
41+
docker run --rm --pull=always -it --init -v "${PWD}:/data:z" misiektoja/spotify-monitor:latest --setup
42+
```
43+
44+
After setup finishes, start monitoring with the files created by the wizard:
45+
46+
```sh
47+
docker run --rm -it --init -v "${PWD}:/data:z" misiektoja/spotify-monitor:latest --config-file /data/spotify_monitor.conf
48+
```
49+
50+
The setup command pulls the current image. Both commands keep configuration, private values and output in the current directory.
51+
52+
In Windows Command Prompt replace `${PWD}` with `%cd%`. Windows hosts must use Linux containers.
53+
54+
##### Linux
55+
56+
`--user "$(id -u):$(id -g)"` runs the container with your numeric user and group IDs. This lets the container write files that your host account can edit.
57+
58+
```sh
59+
docker run --rm --pull=always -it --init --user "$(id -u):$(id -g)" -v "$PWD:/data:z" misiektoja/spotify-monitor:latest --setup
60+
```
61+
62+
After setup finishes, start monitoring:
3063

31-
On Linux, set the container user to your host user before the first setup command. This lets Spotify Monitor create its configuration and private `.env` file in the current directory. Docker Desktop users on macOS or Windows can skip the two `export` commands.
64+
```sh
65+
docker run --rm -it --init --user "$(id -u):$(id -g)" -v "$PWD:/data:z" misiektoja/spotify-monitor:latest --config-file /data/spotify_monitor.conf
66+
```
67+
68+
#### Docker Compose - shorter recurring commands
69+
70+
Download the Compose file:
3271

3372
```sh
3473
curl -fsSLO https://raw.githubusercontent.com/misiektoja/spotify_monitor/refs/heads/main/docker-compose.yml
74+
```
75+
76+
Linux container engine requires to export your numeric user ID and group ID so files created in the current directory belong to you instead of `root`.
77+
78+
```sh
3579
export SPOTIFY_MONITOR_UID="$(id -u)"
3680
export SPOTIFY_MONITOR_GID="$(id -g)"
37-
docker compose run --rm spotify_monitor --setup
38-
docker compose up
3981
```
4082

41-
Docker run
83+
Docker-compatible runtimes on macOS and Windows normally do not need these values.
4284

43-
On macOS or Windows with Docker Desktop:
85+
Run setup by itself:
4486

4587
```sh
46-
docker pull misiektoja/spotify-monitor:latest
47-
docker run --rm -it --init -v "${PWD}:/data:z" misiektoja/spotify-monitor:latest --setup
48-
docker run --rm -it --init -v "${PWD}:/data:z" misiektoja/spotify-monitor:latest --config-file /data/spotify_monitor.conf
88+
docker compose run --rm --pull=always spotify_monitor --setup
4989
```
5090

51-
The Docker Desktop commands use macOS shell or Windows PowerShell syntax. In Windows Command Prompt replace `${PWD}` with `%cd%`.
52-
53-
On Linux, pass your host user and group so the container can write to the current directory:
91+
After setup finishes, start monitoring with the shorter recurring command:
5492

5593
```sh
56-
docker pull misiektoja/spotify-monitor:latest
57-
docker run --rm -it --init --user "$(id -u):$(id -g)" -v "$PWD:/data:z" misiektoja/spotify-monitor:latest --setup
58-
docker run --rm -it --init --user "$(id -u):$(id -g)" -v "$PWD:/data:z" misiektoja/spotify-monitor:latest --config-file /data/spotify_monitor.conf
94+
docker compose up --no-log-prefix
5995
```
6096

6197
For the manual single-file method, optional extras and upgrade commands for every method, see [Installation](https://misiektoja.github.io/spotify_monitor/installation/).
@@ -101,113 +137,50 @@ For Spotify profile and playlist change tracking, see [spotify_profile_monitor](
101137

102138
For Spotify Web Player token and TOTP utilities, see [Debugging Tools](https://misiektoja.github.io/spotify_monitor/debugging/#debugging-tools).
103139

104-
<a id="documentation"></a>
105-
## Documentation
106-
107-
Full documentation is available at **[misiektoja.github.io/spotify_monitor](https://misiektoja.github.io/spotify_monitor/)**:
108-
109-
- [Installation](https://misiektoja.github.io/spotify_monitor/installation/) - PyPI, manual script, Docker installation and upgrades
110-
- [Quick Start](https://misiektoja.github.io/spotify_monitor/quick-start/) - setup wizard, authentication and first run
111-
- [Configuration](https://misiektoja.github.io/spotify_monitor/configuration/) - Spotify login, targets, SMTP, webhooks and secrets
112-
- [Usage](https://misiektoja.github.io/spotify_monitor/usage/) - command formats, monitoring, container operation, notifications, playback and output
113-
- [Troubleshooting](https://misiektoja.github.io/spotify_monitor/troubleshooting/) - the `--doctor` self-check and logging levels
114-
- [Debugging Tools](https://misiektoja.github.io/spotify_monitor/debugging/) - TOTP token testing and secret extraction
115-
116-
<a id="quick-start"></a>
117-
## Quick Start
118-
119-
<a id="new-here-run-the-setup-wizard"></a>
120-
### New here? Run the setup wizard
121-
122-
The fastest way to get started is `--setup`. It asks who to monitor, how to connect to Spotify and which alerts you want then saves a ready-to-run configuration. Private values stay in `.env`.
123-
124-
On Linux, set `SPOTIFY_MONITOR_UID="$(id -u)"` and `SPOTIFY_MONITOR_GID="$(id -g)"` before using Docker Compose.
125-
126-
Use the command that matches how you run the tool:
127-
128-
```sh
129-
# PyPI install
130-
spotify_monitor --setup
131-
132-
# Manual Python script on macOS or Linux
133-
python3 spotify_monitor.py --setup
134-
135-
# Manual Python script on Windows
136-
python spotify_monitor.py --setup
137-
138-
# Docker Compose (skip curl if you cloned the repository)
139-
curl -fsSLO https://raw.githubusercontent.com/misiektoja/spotify_monitor/refs/heads/main/docker-compose.yml
140-
docker compose run --rm spotify_monitor --setup
141-
142-
# Docker image on macOS or Windows
143-
docker run --rm -it --init -v "${PWD}:/data:z" misiektoja/spotify-monitor:latest --setup
144-
145-
# Docker image on Linux
146-
docker run --rm -it --init --user "$(id -u):$(id -g)" -v "$PWD:/data:z" misiektoja/spotify-monitor:latest --setup
147-
```
148-
149-
Running the tool with no arguments also offers the wizard when no target has been saved. It detects whether you use PyPI, the downloaded script, Docker or Docker Compose then shows matching commands.
150-
151140
<a id="before-monitoring"></a>
152-
### Before monitoring
141+
## Before Monitoring
153142

154143
Spotify only shows a person's listening activity when both of these conditions are met:
155144

156145
1. The Spotify account used by Spotify Monitor follows the person you want to monitor.
157146
2. That person has enabled listening activity sharing in Spotify.
158147

159-
The setup wizard (`spotify_monitor --setup`) checks whether the configured Spotify account follows the target. It offers to follow only when needed and changes the account only after explicit confirmation. If you want to do it manually, open the person's profile in the Spotify desktop or mobile app then use **Share** > **Copy link to profile**. You can paste the complete profile link into the setup wizard. You do not need to extract the user ID yourself. See [Following the Monitored User](https://misiektoja.github.io/spotify_monitor/configuration/#following-the-monitored-user).
148+
The setup wizard checks whether the monitoring account follows the target. It can send the follow request after you confirm. To follow manually, open the target's profile in the Spotify desktop or mobile app. You can use **Share** > **Copy link to profile** and paste the complete link into the wizard. You do not need to extract the user ID. See [Following the Monitored User](https://misiektoja.github.io/spotify_monitor/configuration/#following-the-monitored-user).
149+
150+
Firefox import is the recommended login path for local and container installs. See [Container Operation](https://misiektoja.github.io/spotify_monitor/usage/#import-firefox-into-container-authentication) for the host-specific import commands.
160151

161-
For local installs, Firefox import is the recommended login path. Docker users should use the wizard's hidden manual `sp_dc` entry. See the [full Quick Start guide](https://misiektoja.github.io/spotify_monitor/quick-start/) for details.
152+
<a id="common-commands"></a>
153+
## Common Commands
162154

163-
<a id="not-sure-which-command-you-need"></a>
164-
### Not sure which command you need?
155+
Use [Quick Install & Run](#-quick-install-run) above for first-time setup. The table uses PyPI commands. For manual script, direct Docker and Docker Compose equivalents, see [Run Individual Commands](https://misiektoja.github.io/spotify_monitor/quick-start/#run-individual-commands).
165156

166157
| I want to... | Run this |
167158
| --- | --- |
168-
| Set up Spotify Monitor for the first time | Use the setup command for your installation above |
169159
| Start monitoring with existing authentication | `spotify_monitor TARGET`, where `TARGET` is a raw ID, `spotify:user:` URI or profile URL |
170-
| Start a target saved as `TARGET_USER_URI_ID` | `spotify_monitor --config-file spotify_monitor.conf` or `docker compose up` |
160+
| Start a target saved as `TARGET_USER_URI_ID` | `spotify_monitor --config-file spotify_monitor.conf` |
171161
| Check authentication, connectivity and one target | `spotify_monitor --doctor TARGET` |
172162
| List Spotify friends visible to the configured account | `spotify_monitor --list-friends` |
173163
| Import a Spotify login from Firefox | Open [Spotify Web Player](https://open.spotify.com/) in Firefox, sign in then run `spotify_monitor --import-browser-cookie --browser firefox` |
174164
| Safely set or replace `SP_DC_COOKIE` | Run `spotify_monitor --set-sp-dc` and enter `sp_dc` at the hidden prompt |
175165
| Configure and test webhook alerts | Use the setup wizard or follow [Webhook Settings](https://misiektoja.github.io/spotify_monitor/configuration/#webhook-settings) |
176166

177-
<a id="manual-commands"></a>
178-
### Manual commands
179-
180-
The examples below use a PyPI install. For a manual script install, replace `spotify_monitor` with `python3 spotify_monitor.py` on macOS or Linux and `python spotify_monitor.py` on Windows. Docker users can copy the complete command prefixes from the [Usage guide](https://misiektoja.github.io/spotify_monitor/usage/#command-format).
167+
Running the tool with no arguments offers the wizard if you have not saved a target. If a target is already saved, it starts monitoring that target.
181168

182-
Sign in to [Spotify Web Player](https://open.spotify.com/) with Firefox then import that login:
169+
For authentication, saved targets, configuration backups and setup recovery, see the [full Quick Start guide](https://misiektoja.github.io/spotify_monitor/quick-start/).
183170

184-
```sh
185-
spotify_monitor --import-browser-cookie --browser firefox
186-
```
187-
188-
If browser import is unavailable, enter `sp_dc` through a hidden prompt:
189-
190-
```sh
191-
spotify_monitor --set-sp-dc
192-
```
193-
194-
Start monitoring with a raw user ID, Spotify user URI or profile URL. A target saved by the wizard does not need to be repeated:
195-
196-
```sh
197-
spotify_monitor <spotify_user_uri_id>
198-
spotify_monitor "https://open.spotify.com/user/spotify_user_uri_id"
199-
spotify_monitor --config-file spotify_monitor.conf
200-
```
171+
For browser profiles, manual cookie extraction, Docker authentication, email and webhook setup, see [Configuration](https://misiektoja.github.io/spotify_monitor/configuration/). For notification choices, playback controls and output files, see [Usage](https://misiektoja.github.io/spotify_monitor/usage/).
201172

202-
Run the self-check or view every command:
173+
<a id="documentation"></a>
174+
## Documentation
203175

204-
```sh
205-
spotify_monitor --doctor <spotify_user_uri_id>
206-
spotify_monitor --list-friends
207-
spotify_monitor --help
208-
```
176+
Full documentation is available at **[misiektoja.github.io/spotify_monitor](https://misiektoja.github.io/spotify_monitor/)**:
209177

210-
For browser profiles, manual cookie extraction, Docker authentication, email and webhook setup, see [Configuration](https://misiektoja.github.io/spotify_monitor/configuration/). For notification choices, playback controls and output files, see [Usage](https://misiektoja.github.io/spotify_monitor/usage/).
178+
- [Installation](https://misiektoja.github.io/spotify_monitor/installation/) - PyPI, manual script, Docker installation and upgrades
179+
- [Quick Start](https://misiektoja.github.io/spotify_monitor/quick-start/) - setup wizard, authentication and first run
180+
- [Configuration](https://misiektoja.github.io/spotify_monitor/configuration/) - Spotify login, targets, SMTP, webhooks and secrets
181+
- [Usage](https://misiektoja.github.io/spotify_monitor/usage/) - command formats, monitoring, container operation, notifications, playback and output
182+
- [Troubleshooting](https://misiektoja.github.io/spotify_monitor/troubleshooting/) - the `--doctor` self-check and logging levels
183+
- [Debugging Tools](https://misiektoja.github.io/spotify_monitor/debugging/) - TOTP token testing and secret extraction
211184

212185
<a id="change-log"></a>
213186
## Change Log

RELEASE_NOTES.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,41 @@
22

33
This is a high-level summary of the most important changes.
44

5+
# Changes in 3.1 (23 Jul 2026)
6+
7+
Version **3.1** makes **Docker onboarding portable across macOS, Linux and Windows**. Setup now centers on **host-aware Firefox authentication**, keeps configuration and secrets on the persistent **`/data` bind mount** and carries exact **Doctor and monitoring commands** through recovery.
8+
9+
**Features and improvements**:
10+
11+
- **IMPROVE:** Kept Firefox import as the **recommended Docker authentication path** while making its deferred workflow explicit. Setup now asks whether Docker runs on macOS, standard Linux, Linux with Snap, Linux with Flatpak, Windows PowerShell or Windows Command Prompt then prints the matching read-only profile mount
12+
- **NEW:** Added **Windows-host Firefox import** for direct Docker and Docker Compose through the normal `%APPDATA%\Mozilla\Firefox` profile root with shell-specific PowerShell and Command Prompt commands
13+
- **IMPROVE:** Deferred **Doctor until Firefox authentication has been imported**. Container setup now finishes with ordered commands to import the login, verify authentication and the target then start monitoring
14+
- **IMPROVE:** Preserved **setup guidance across one-time authentication commands** by keeping terminal history visible and repeating the exact Doctor and monitoring commands after a successful Firefox import
15+
- **IMPROVE:** Printed the **install-aware monitoring command** after a successful Doctor run while preserving explicit or saved targets and selected configuration files
16+
17+
**Bug fixes**:
18+
19+
- **BUGFIX:** Fixed generated Docker commands that used the container UID `10001:10001` and always assumed the Linux `~/.mozilla/firefox` profile path. **macOS commands omit Linux user mapping** while Linux commands resolve the host user and group IDs in the host shell
20+
- **BUGFIX:** Stopped standalone container recovery guidance from presenting one Linux-only Firefox command when the Docker host is unknown
21+
- **BUGFIX:** Anchored **default container setup files** to the bind-mounted **`/data` directory** so the generated configuration and dotenv files survive the temporary setup container
22+
- **BUGFIX:** Rejected **Docker setup destinations outside `/data`** instead of saving ephemeral files then printing commands for different paths
23+
- **BUGFIX:** Generated direct Docker commands with **`${PWD}` for macOS, Linux and Windows PowerShell** then switched to `%cd%` for Windows Command Prompt while retaining Linux user mapping
24+
- **BUGFIX:** Saved the **selected dotenv destination** in generated configuration so later config-only starts and secret reloads keep using it
25+
- **BUGFIX:** Printed an **explicit Compose monitoring command** when setup uses nondefault config or dotenv paths instead of falling back to hardcoded defaults
26+
- **BUGFIX:** Preserved the selected configuration path through the hidden **`--set-sp-dc` fallback** and its Doctor and monitoring guidance
27+
- **BUGFIX:** Prevented a **Windows traceback after Ctrl+C** when monitoring was started directly from setup. The setup parent now treats its duplicate console interrupt as the same clean termination already handled by the monitoring child
28+
29+
# Changes in 3.0.1 (22 Jul 2026)
30+
31+
**Features and improvements**:
32+
33+
- **IMPROVE:** Made Firefox login import the recommended Docker and Docker Compose authentication path. A one-time read-only host profile mount imports `sp_dc` into the persistent `.env` file, later runs no longer need the browser mount and hidden manual cookie entry remains available as a fallback
34+
- **IMPROVE:** Updated `spotify_monitor_totp_test --fetch-secrets` to scan current web-player bundles for inline TOTP secret objects while retaining the original runtime hook for older bundle formats
35+
36+
**Bug fixes**:
37+
38+
- **BUGFIX:** Fixed Docker Compose startup after guided setup. The default service command now loads `/data/.env` explicitly, preventing `docker compose up` from reporting a missing `SP_DC_COOKIE` when setup and doctor already saved and validated it
39+
540
# Changes in 3.0 (22 Jul 2026)
641

742
Version **3.0** focuses on making Spotify Monitor easier to set up, safer to configure and easier to recover when something goes wrong. It adds guided onboarding, simpler Spotify login, Docker Compose, clearer terminal output and Discord + ntfy webhook alerts while keeping advanced client mode available for experienced users.
@@ -117,8 +152,8 @@ Special thanks to [@tomballgithub](https://github.com/tomballgithub) for testing
117152

118153
- **IMPROVE:** Added support for loading TOTP secrets from local files via file:// URLs
119154
- **IMPROVE:** Updated remote URL in SECRET_CIPHER_DICT_URL
120-
- **IMPROVE:** Updated [spotify_monitor_secret_grabber](https://github.com/misiektoja/spotify_monitor/blob/dev/debug/spotify_monitor_secret_grabber.py) to dump secrets in different formats. Choose what you need with the `--secret`,` --secretbytes` and `--secretdict` CLI flags, or go all out with the `--all` mode to write all secret formats to files like `secrets.json`, `secretBytes.json` and `secretDict.json` (thanks [@tomballgithub](https://github.com/tomballgithub))
121-
- **IMPROVE:** Added multi-arch Docker image build and compose support for [spotify_monitor_secret_grabber](https://github.com/misiektoja/spotify_monitor/blob/dev/debug/spotify_monitor_secret_grabber.py) - more info at [Secret Key Extraction via Docker](https://misiektoja.github.io/spotify_monitor/debugging/#-secret-key-extraction-via-docker-recommended-easiest-way)
155+
- **IMPROVE:** Updated [spotify_monitor_secret_grabber](https://github.com/misiektoja/spotify_monitor/blob/main/debug/spotify_monitor_secret_grabber.py) to dump secrets in different formats. Choose what you need with the `--secret`,` --secretbytes` and `--secretdict` CLI flags, or go all out with the `--all` mode to write all secret formats to files like `secrets.json`, `secretBytes.json` and `secretDict.json` (thanks [@tomballgithub](https://github.com/tomballgithub))
156+
- **IMPROVE:** Added multi-arch Docker image build and compose support for [spotify_monitor_secret_grabber](https://github.com/misiektoja/spotify_monitor/blob/main/debug/spotify_monitor_secret_grabber.py) - more info at [Secret Key Extraction via Docker](https://misiektoja.github.io/spotify_monitor/debugging/#secret-key-extraction-via-docker)
122157
- **IMPROVE:** Added deletion of flag_file at launch if specified via .conf file. Previously only done when flag_file was specified on command line
123158
- **IMPROVE:** Added info to console output when TOTP secrets are fetched from a remote URL or local file
124159

0 commit comments

Comments
 (0)