Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lyrics-plus): pick better background color #2221

Merged
merged 4 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions CustomApps/lyrics-plus/ProviderMusixmatch.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
const ProviderMusixmatch = (function () {
const headers = {
authority: "apic-desktop.musixmatch.com",
cookie: "x-mxm-token-guid="
};

async function findLyrics(info) {
const baseURL = `https://apic-desktop.musixmatch.com/ws/1.1/macro.subtitles.get?format=json&namespace=lyrics_richsynched&subtitle_format=mxm&app_id=web-desktop-app-v1.0&`;
Expand All @@ -28,7 +24,10 @@ const ProviderMusixmatch = (function () {
.map(key => key + "=" + encodeURIComponent(params[key]))
.join("&");

let body = await CosmosAsync.get(finalURL, null, headers);
let body = await CosmosAsync.get(finalURL, null, {
authority: "apic-desktop.musixmatch.com",
cookie: "x-mxm-token-guid="
});

body = body.message.body.macro_calls;

Expand Down
4 changes: 2 additions & 2 deletions CustomApps/lyrics-plus/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const CONFIG = {
musixmatch: {
on: getConfig("lyrics-plus:provider:musixmatch:on"),
desc: `Fully compatible with Spotify. Requires a token that can be retrieved from the official Musixmatch app. Follow instructions on <a href="https://spicetify.app/docs/faq#sometimes-popup-lyrics-andor-lyrics-plus-seem-to-not-work">Spicetify Docs</a>.`,
token: localStorage.getItem("lyrics-plus:provider:musixmatch:token") || "21051986b9886beabe1ce01c3ce94c96319411f8f2c122676365e3",
token: localStorage.getItem("lyrics-plus:provider:musixmatch:token") || "2005218b74f939209bda92cb633c7380612e14cb7fe92dcd6a780f|2211116e5392cee08db76d4ce398786a1f2d7ba5c12a6184f28d46",
modes: [SYNCED, UNSYNCED]
},
spotify: {
Expand Down Expand Up @@ -183,7 +183,7 @@ class LyricsContainer extends react.Component {
const colors = await CosmosAsync.get(`wg://colorextractor/v1/extract-presets?uri=${uri}&format=json`);
prominent = colors.entries[0].color_swatches[4].color;
} catch {
prominent = 0;
prominent = 8747370;
}

this.setState({
Expand Down
6 changes: 4 additions & 2 deletions Extensions/popupLyrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ function PopupLyrics() {
const baseURL = `https://apic-desktop.musixmatch.com/ws/1.1/macro.subtitles.get?format=json&namespace=lyrics_synched&subtitle_format=mxm&app_id=web-desktop-app-v1.0&`;

const durr = info.duration / 1000;
const tokens = userConfigs.services.musixmatch.token.split("|");
const usertoken = tokens[Math.floor(Math.random() * tokens.length)];
rxri marked this conversation as resolved.
Show resolved Hide resolved

const params = {
q_album: info.album,
Expand All @@ -109,7 +111,7 @@ function PopupLyrics() {
track_spotify_id: info.uri,
q_duration: durr,
f_subtitle_length: Math.floor(durr),
usertoken: userConfigs.services.musixmatch.token
usertoken
};

const finalURL =
Expand Down Expand Up @@ -271,7 +273,7 @@ function PopupLyrics() {
on: boolLocalStorage("popup-lyrics:services:musixmatch:on"),
call: LyricProviders.fetchMusixmatch,
desc: `Fully compatible with Spotify. Requires a token that can be retrieved from the official Musixmatch app. Follow instructions on <a href="https://spicetify.app/docs/faq#sometimes-popup-lyrics-andor-lyrics-plus-seem-to-not-work">Spicetify Docs</a>.`,
token: LocalStorage.get("popup-lyrics:services:musixmatch:token") || "2005218b74f939209bda92cb633c7380612e14cb7fe92dcd6a780f"
token: LocalStorage.get("popup-lyrics:services:musixmatch:token") || "2005218b74f939209bda92cb633c7380612e14cb7fe92dcd6a780f|2211116e5392cee08db76d4ce398786a1f2d7ba5c12a6184f28d46"
},
spotify: {
on: boolLocalStorage("popup-lyrics:services:spotify:on"),
Expand Down