Skip to content

fix: musixmatch cookie + lyric manager - #249

Open
GDjkhp wants to merge 1 commit into
PerformanC:devfrom
GDjkhp:musixmatch-cookie-fix
Open

GDjkhp wants to merge 1 commit into
PerformanC:devfrom
GDjkhp:musixmatch-cookie-fix

Conversation

@GDjkhp

@GDjkhp GDjkhp commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Changes

musixmatch broke and it has to do with cookies

Why

U='https://apic.musixmatch.com/ws/1.1/token.get?app_id=android-player-v1.0'
UA='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36'
t() { printf '%-30s ' "$1"; shift; curl -s -o /dev/null -w '%{http_code} (http %{http_version})\n' "$@" "$U"; }

t 'default curl'
t 'UA only'                  -H "user-agent: $UA"
t 'UA + placeholder cookie'  -H "user-agent: $UA" -H 'cookie: AWSELB=unknown; x-mxm-user-id=undefined; x-mxm-token-guid=undefined; mxm-encrypted-token='
t 'UA + browser-ish headers' -H "user-agent: $UA" -H 'accept: */*' -H 'accept-language: en-US,en;q=0.9' -H 'sec-fetch-mode: navigate' -H 'sec-fetch-site: none' -H 'upgrade-insecure-requests: 1'
t 'UA only, http1.1'         --http1.1 -H "user-agent: $UA"
default curl                   200 (http 1.1)
UA only                        200 (http 1.1)
UA + placeholder cookie        403 (http 1.1)
UA + browser-ish headers       200 (http 1.1)
UA only, http1.1               200 (http 1.1)

Checkmarks

  • The modified endpoints have been tested.
  • Used the same indentation as the rest of the project.
  • Still compatible with LavaLink clients.

Additional information

i also fixed lyric manager escaping if one provider fails along the way

@ToddyTheNoobDud ToddyTheNoobDud left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another note for later: even with the error fallback, if the loadlyrics params recives the source= param, the fallback does not work

(example: with no source param: musixmatch error -> got a fallback for genius sucess)
(now with the source=musixmatch param: musixmatch error -> error, no fallback)
(i discovered this now lol, probaly been there early)

but thats something for later, thanks for the fix !! :)

Comment thread src/lyrics/musixmatch.ts
const DEFAULT_UA =
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36'

const DEFAULT_COOKIE =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setting the default cookie to:

x-mxm-user-id=undefined; x-mxm-token-guid=undefined; mxm-encrypted-token=undefined

seems to fix it too :P

but yet i still think using the _cookieHeader would be more reliable since it just gets the direct response headers from the server

@GDjkhp

GDjkhp commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

another note for later: even with the error fallback, if the loadlyrics params recives the source= param, the fallback does not work

(example: with no source param: musixmatch error -> got a fallback for genius sucess) (now with the source=musixmatch param: musixmatch error -> error, no fallback) (i discovered this now lol, probaly been there early)

but thats something for later, thanks for the fix !! :)

should i add a fallback for this too before merge?

@ToddyTheNoobDud

Copy link
Copy Markdown
Member

another note for later: even with the error fallback, if the loadlyrics params recives the source= param, the fallback does not work
(example: with no source param: musixmatch error -> got a fallback for genius sucess) (now with the source=musixmatch param: musixmatch error -> error, no fallback) (i discovered this now lol, probaly been there early)
but thats something for later, thanks for the fix !! :)

should i add a fallback for this too before merge?

Nope, since the param is optional it can be removed from the user-side, so i'll see that later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants