Skip to content

Commit c7b25b5

Browse files
authored
Merge pull request #104 from Fabrizz/dev-features
V6.0.0
2 parents 2e2094c + 110c698 commit c7b25b5

68 files changed

Lines changed: 2237 additions & 908 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
2.22 MB
Loading
1.28 MB
Loading
-642 KB
Loading
28.9 KB
Loading

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ package-lock.json
4141
# Example responeses
4242
ex.json
4343
test.json
44+
test2.json
45+
tast3.json
4446
api.json
4547
svgs.html
4648
lyrics.js
4749
vizualizer.html
50+
stats.html

MMM-OnSpotify.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ Module.register("MMM-OnSpotify", {
1414
name: "MMM-OnSpotify",
1515
/* configDeepMerge: true, deepMerge: true, <-- Does not work */
1616

17+
// Spotify API credentials
18+
clientID: "",
19+
clientSecret: "",
20+
accessToken: "",
21+
refreshToken: "",
22+
// Experimental secondary credentials for the backend
23+
// Should rewritte the full module but for now it just multiple polls the API
24+
secondaryClientID: "",
25+
secondaryClientSecret: "",
26+
secondaryAccessToken: "",
27+
secondaryRefreshToken: "",
28+
1729
// Sends notifications containin them locking. Works with other DynamicTheme modules.
1830
advertisePlayerTheme: true,
1931
// What to display when the player is idle
@@ -701,6 +713,12 @@ Module.register("MMM-OnSpotify", {
701713
refreshToken: this.config.refreshToken,
702714
experimentalCanvasSPDCookie: this.config.experimentalCanvasSPDCookie,
703715
},
716+
secondaryCredentials: {
717+
clientId: this.config.secondaryClientID,
718+
clientSecret: this.config.secondaryClientSecret,
719+
accessToken: this.config.secondaryAccessToken,
720+
refreshToken: this.config.secondaryRefreshToken,
721+
},
704722
language: this.config.language,
705723
backendExpectId: this.backendExpectId,
706724
});

README.md

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
<img alt="MMM-OnSpotify banner" src=".github/content/readme/ONSP-BANNER-hero.png" width="100%">
44

5-
**MMM-OnSpotify** for MagicMirror² is a highly configurable module that displays Spotify activity on your MagicMirror display (including podcasts, and when available, audiobooks).
5+
**MMM-OnSpotify** for MagicMirror² is a highly configurable module that displays Spotify activity on your MagicMirror display (including podcasts, and when available, audiobooks). https://onsp.fabriz.co/
66

7-
The module includes a web service that will guide you through the set up and configuration of the Spotify App and module. MMM-OnSpotify does not use any third party service, just the Spotify Web API.
7+
The module provides a static web service that walks you through setting up and configuring both the Spotify app and the module itself. MMM-OnSpotify relies solely on the official Spotify Web API and does not use any third-party services.
88

99
https://github.com/Fabrizz/MMM-OnSpotify/assets/65259076/5d78672e-8feb-45de-92f4-ed44f0771432
1010

@@ -23,20 +23,14 @@ npm install
2323

2424
### Step 2: Create a Spotify App and authorize the app
2525

26-
> [!WARNING]
27-
> You cannot use MMM-NowPlayingOnSpotify (or other module) credentials, the API scopes are different.
2826

29-
The module includes a web service that guides you in the creation fo the Spotify App, to use it (inside your module folder) run:
27+
The module includes a static web service that guides you in the creation of the Spotify App needed to use this module, you can view the source code inside `/web`.
3028

31-
<img alt="MMM-OnSpotify banner" align="right" height="90" width="160" src=".github/content/readme/banner-authservice.svg">
29+
> The online tool saves the credentials **ONLY** in your browser and its a static page. If you do not want to use the online tool, you can host it by running the Vite proyect inside `/web`.
3230
33-
```bash
34-
npm run auth
35-
> [Authorization Service] Open http://localhost:8100/ to configure your mirror.
36-
```
37-
Once you finish, you are all set with the basic configuration. Scroll down to see all the different theming options for the module.
31+
Access it by going to https://onsp.fabriz.co/
32+
[<img alt="Auth banner" src=".github/content/readme/n-auth-logo.png" width="200" align="right">](https://fabriz.co/)
3833

39-
> Once the Authorization Service is running, you can access it from the same device where you ran the command by going to `http://localhost:8100/`. You can clone the module on another device to use the service and copy the resulting config snippet to the desired MM².
4034

4135
# Updating
4236
```bash
@@ -47,7 +41,7 @@ npm install
4741
# Module Configuration
4842

4943
**Extended full configuration object:**
50-
Do not copy everything! Just what you want to change. Below are the defaults:
44+
Copy only the parts you want to change to your configuration file. The defaults are shown below:
5145

5246
```js
5347
{
@@ -95,12 +89,6 @@ Do not copy everything! Just what you want to change. Below are the defaults:
9589
spotifyCodeExperimentalUseColor: true,
9690
spotifyCodeExperimentalSeparateItem: true,
9791

98-
// Canvas Videos [SEE BELOW]
99-
experimentalCanvas: false,
100-
experimentalCanvasEffect: 'cover',
101-
experimentalCanvasAlbumOverlay: false,
102-
experimentalCanvasSPDCookie: "",
103-
10492
// Theming General [SEE BELOW]
10593
roundMediaCorners: true,
10694
roundProgressBar: true,
@@ -189,17 +177,18 @@ experimentalCSSOverridesForMM2: [
189177

190178
#### Canvas
191179
> [!IMPORTANT]
192-
> EXPERIMENTAL - Using this without auth will get this funtion rate-limited. For that you can add a `experimentalCanvasSPDCookie`. This is more advanced as it requieres you to get the cookie from a Spotify Web session. Not recommended for all users.
180+
> Removed direct support for canvases
193181
194-
> [!CAUTION]
195-
> Canvases are an internal implementation by the Spotify team and its not available in the web API. Use at your own discretion, personal usage only.
182+
Relevant disscussion about Spotify changes and it affecting lots of OSS projects:
183+
https://github.com/misiektoja/spotify_monitor/issues/2#issuecomment-2730297484
184+
https://github.com/librespot-org/librespot/issues/1475#issue-2921162399
185+
186+
TL;DR: It now uses another request and TOTP auth and it seems that they are currently changing some stuff on their end.
187+
188+
You can check the last version with canvas support here [dev-canvas-support branch](https://github.com/Fabrizz/MMM-OnSpotify/tree/dev-canvas-support). Im open to having PRs that add the OTP or new auth but I will not directly support/fix the feature.
189+
190+
> Thanks to https://github.com/dientuki & https://github.com/bartleyg/my-spotify-canvas for the implementation!
196191
197-
| Key | Description |
198-
| :-- | :-- |
199-
| experimentalCanvas <br> `false` | Shows the Spotify Canvas if available. This is an experimental feature, as this API is not documented and private. |
200-
| experimentalCanvasAlbumOverlay <br> `true` | Show the cover art inside the Spotify Canvas. |
201-
| experimentalCanvasEffect <br> `cover` | Control how is the canvas is going to be displayed. Options are: <br />- `cover`: The Canvas is clipped to have the same height as the album cover. Recommended for low-power devices and if the module is not in a `bottom_*` position. <br />- `scale`: Scale up/down the module to fit the entire Canvas without clipping it. <br /> |
202-
| experimentalCanvasSPDCookie <br> `""` | Adds the SPD cookie from a web Spotify session to stop Spotify from returning a 500 error. Spotify could decide also to just send a 500 error depending on the user agents and other factors, this just affects the module. Still, this feature is optional and this API is NOT public. You can search "Extract Spotify SPD cookie" in youtube/other to learn how to do this. **DO NOT** share this cookie!. |
203192

204193
#### General Theming options
205194
| Key | Description |
@@ -220,23 +209,20 @@ experimentalCSSOverridesForMM2: [
220209
> See also: [Disabling **all** color based theming](#other)
221210
222211
## MMM-LiveLyrics
223-
View more on the [**MMM-LiveLyrics** repository](https://github.com/Fabrizz/MMM-LiveLyrics). This module uses web scrapping to get the Lyrics from Genius. Not recommended for basic usage.
212+
View more on the [**MMM-LiveLyrics** repository](https://github.com/Fabrizz/MMM-LiveLyrics).
213+
214+
<img alt="MMM-Livelyrics" src=".github/content/readme/banner-livelyrics.png" width="80%">
224215

225-
<img alt="MMM-Livelyrics" src=".github/content/readme/banner-livelyrics.png" width="70%">
216+
> This module uses web scrapping to get the Lyrics from Genius, could stop working at any time but now its +3 years solid!
226217
227-
## MMM-HomeKit
228-
Control your mirror (and other modules) using Apple Homekit protocol! (Also compatible with HomeAssistant or other automation systems with simulated HK controllers)
218+
## More modules!
219+
- [**MMM-Matter**](https://github.com/Fabrizz/MMM-LiveLyrics) Adds native Matter to MagicMirror and provides an API to control other modules from ANY smarthome provider (Homekit, Google Home, Amazon Alexa, Home Assistant, etc).
229220

230-
#### >>> [MMM-HomeKit repository](https://github.com/Fabrizz/MMM-HomeKit) <<<
231-
- Control your screen on/off, brightness
232-
- Set the mirror accent color
233-
- Turn on/off on-screen lyrics
234-
- Send notifications
235-
- **With native HK accessories**
221+
Old modules:
222+
- [**MMM-HomeKit**](https://github.com/Fabrizz/MMM-HomeKit) Adds HomeKit support to MagicMirror.
236223

237-
<img alt="MMM-Homekit" src=".github/content/readme/banner-homekit.png" width="70%">
224+
- [**MMM-DolarArgentina**](https://github.com/Fabrizz/MMM-DolarArgentina) Displays the current exchange rate for ARS/USD compra/venta.
238225

239-
> To learn how to use OnSpotify and HomeKit provided accent colors together, read the guide in the [MMM-HomeKit repository](https://github.com/Fabrizz/MMM-HomeKit).
240226

241227
## Notification API
242228
| key | Description |

auth/authorization.js

Lines changed: 0 additions & 151 deletions
This file was deleted.

0 commit comments

Comments
 (0)