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

Synced Lyrics no do not work after playing song with no lyrics #1090

Closed
znicuuu opened this issue Sep 23, 2021 · 44 comments
Closed

Synced Lyrics no do not work after playing song with no lyrics #1090

znicuuu opened this issue Sep 23, 2021 · 44 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@znicuuu
Copy link

znicuuu commented Sep 23, 2021

ℹ Computer information

  • Spotify version: 1.1.68.632.g2b11de83
  • Spicetify version: 2.6.4

✔️ Expected result

popupLyrics showing lyrics normally

❌ Actual result

popupLyrics saying theres no lyrics for every song

📷 Screenshots

image

@znicuuu znicuuu added the 🐛 bug Something isn't working label Sep 23, 2021
@itsmeow
Copy link
Member

itsmeow commented Sep 23, 2021

Can you see if 2.6.5 fixes this for you?

@afonsojramos
Copy link
Member

afonsojramos commented Sep 24, 2021

Please run spicetify upgrade and then spicetify restore backup apply to check if it fixes it.
But actually, first can you test with a more known music? I can suggest Planet B - King Gizzard and the Lizard Wizzard

@Lseoksee
Copy link
Contributor

Please run spicetify upgrade and then spicetify restore backup apply to check if it fixes it.
But actually, first can you test with a more known music? I can suggest Planet B - King Gizzard and the Lizard Wizzard

If you play some songs without lyrics and play songs with lyrics again, it says there are no lyrics. This is the same in lyrics-plus.

@afonsojramos
Copy link
Member

@Lseoksee tested it myself, you are right! I'll investigate further!

@afonsojramos afonsojramos self-assigned this Sep 24, 2021
@afonsojramos afonsojramos changed the title popupLyrics saying theres no lyrics for every song Synced Lyrics no do not work after playing song with no lyrics Sep 24, 2021
@itsmeow
Copy link
Member

itsmeow commented Sep 26, 2021

I cannot reproduce this myself. Playing a song with no lyrics then playing another, it still works. On 2.6.6.

@AntServiceApps
Copy link

AntServiceApps commented Sep 26, 2021

Even in 2.6.6 there is definitely a bug with the popuplyrics extension. Below 4 examples of popular songs where it just showed "No lyric". I had it working moments ago but after a few songs without lyrics it just shows "No lyric" for all songs.

BugSpicetify

UPDATE: As pictured below, after restarting spicetify it works again for the same songs.

BugSpicetifyv2

And again after playing a song where there are no lyrics available, I get the "No lyric" for the same 4 songs again (see screenshot 1).

Spotify version = 1.1.68.632.g2b11de83
Spiceify version = 2.6.6

@itsmeow
Copy link
Member

itsmeow commented Sep 26, 2021

Is there any output in the console?

@AntServiceApps
Copy link

AntServiceApps commented Sep 27, 2021

Is there any output in the console?

My console looks like this:

vendor~xpui.js:1 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
vendor~xpui.js:1 MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 change listeners added. Use emitter.setMaxListeners() to increase limit
    at c (https://xpui.app.spotify.com/vendor~xpui.js:29:2353172)
    at t.o.addListener (https://xpui.app.spotify.com/vendor~xpui.js:29:2355454)
    at https://xpui.app.spotify.com/vendor~xpui.js:29:2048746
    at Pa (https://xpui.app.spotify.com/vendor~xpui.js:29:2595327)
    at As (https://xpui.app.spotify.com/vendor~xpui.js:29:2619179)
    at t.unstable_runWithPriority (https://xpui.app.spotify.com/vendor~xpui.js:29:2793496)
    at hi (https://xpui.app.spotify.com/vendor~xpui.js:29:2564835)
    at ks (https://xpui.app.spotify.com/vendor~xpui.js:29:2618958)
    at Os (https://xpui.app.spotify.com/vendor~xpui.js:29:2603729)
    at vs (https://xpui.app.spotify.com/vendor~xpui.js:29:2602651)
    at https://xpui.app.spotify.com/vendor~xpui.js:29:2565107
    at t.unstable_runWithPriority (https://xpui.app.spotify.com/vendor~xpui.js:29:2793496)
    at hi (https://xpui.app.spotify.com/vendor~xpui.js:29:2564835)
    at yi (https://xpui.app.spotify.com/vendor~xpui.js:29:2565052)
    at vi (https://xpui.app.spotify.com/vendor~xpui.js:29:2564987)
    at Es (https://xpui.app.spotify.com/vendor~xpui.js:29:2603150)
    at rl (https://xpui.app.spotify.com/vendor~xpui.js:29:2629563)
    at render (https://xpui.app.spotify.com/vendor~xpui.js:29:2632674)
    at https://xpui.app.spotify.com/xpui.js:1:1034228
vendor~xpui.js:1 
Object
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/vendor~xpui.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/xpui.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/22.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/xpui-desktop-modals.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/xpui-routes-playlist.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/service-worker.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED


@afonsojramos
Copy link
Member

I mean, I don't think those are the culprits as it is just failing to load the source map.
Other than those warnings, when skipping songs only the normal Sets show up.
image

@itsmeow
Copy link
Member

itsmeow commented Sep 28, 2021

All of you with this issue, have you retrieved your own musixmatch token, or are you using the embedded one? Try getting your own again (as per wiki instructions https://github.com/khanhas/spicetify-cli/wiki/Musixmatch-Token).
Does that fix it? You can set the token in the popup config by right clicking popup icon. You can set it in lyrics-plus as well by clicking the user profile menu and pressing "Lyrics Plus config".

@AntServiceApps
Copy link

AntServiceApps commented Sep 28, 2021

I used the embedded one before. Just got my own and it unfortunately it does not fix the issue.

Popup Lyrics works until I'm playing a few songs without lyrics, I can however confirm it is not always the first song without lyrics that triggers the extension to stop working. Perhaps an issue with local files?

@shallowswimmer
Copy link

I also have the same issue and well something else relating to the pop ul lyrics as well, the pop up lyrics sometimes closes by themselves when a song ends and this happens when there is a long instrumental part in the songs without any lyrics it closes by itself.

@itsmeow
Copy link
Member

itsmeow commented Sep 30, 2021

I found the culprit! It's a captcha response from musixmatch. I changed some of the error debug outputs in popupLyrics.
image

Your token is getting automatically filtered as being "bot-like" for making invalid/too many requests.

@shallowswimmer
Copy link

so what should we do to solve this?
sorry I'm kinda not that well versed with the technical aspects as yall guys so can yall please help me

@itsmeow
Copy link
Member

itsmeow commented Oct 1, 2021

I also have the same issue and well something else relating to the pop ul lyrics as well, the pop up lyrics sometimes closes by themselves when a song ends and this happens when there is a long instrumental part in the songs without any lyrics it closes by itself.

Can you confirm this after updating 2.7.0? I fixed an issue like this in my PR @shallowswimmer

@Lseoksee
Copy link
Contributor

Lseoksee commented Oct 2, 2021

I also have the same issue and well something else relating to the pop ul lyrics as well, the pop up lyrics sometimes closes by themselves when a song ends and this happens when there is a long instrumental part in the songs without any lyrics it closes by itself.

Can you confirm this after updating 2.7.0? I fixed an issue like this in my PR @shallowswimmer

It seems to be better than before, but the problem still hasn't been completely solved. If you switch several songs quickly, you will get an error.
Desktop Screenshot 2021 10 02 - 09 31 57 59 Desktop Screenshot 2021 10 02 - 09 27 43 91

@itsmeow
Copy link
Member

itsmeow commented Oct 2, 2021

@Lseoksee There's nothing that can be done about that part, I was specifically addressing the "randomly closing itself" error. That seems to be caused by musixmatch implementing anti-spam measures. Maybe we could add a way to submit captchas, but I'm not sure how that even works.

@itsmeow
Copy link
Member

itsmeow commented Oct 2, 2021

Can anyone who has updated also verify what error they are getting in the console now? I changed the error handling to be more descriptive.

@znicuuu
Copy link
Author

znicuuu commented Oct 2, 2021

Can anyone who has updated also verify what error they are getting in the console now? I changed the error handling to be more descriptive.
image
These are the errors I get in console.

@AntServiceApps
Copy link

AntServiceApps commented Oct 2, 2021

After spamming songs where I know there won't be lyrics available (new songs in other languages) I could replicate the bug, my console looks like this.

Knipsel

At the point where the pop-up-lyrics-request errors appear PopupLyrics screen is already frozen and doesn't update upon changing songs.

Feel free to ask more details, I don't really know how most of this works but I'd like to help you find what you're looking for.

@afonsojramos
Copy link
Member

afonsojramos commented Oct 2, 2021

However, from my experience, if you keep playing songs without skipping, eventually, it comes back

I guess we're just getting flagged for bot-like behaviour.

@itsmeow
Copy link
Member

itsmeow commented Oct 3, 2021

@AntServiceApps You aren't running 2.7.0! That error output is old. Also, expand those popup-lyrics-request-update for me.

@itsmeow
Copy link
Member

itsmeow commented Oct 3, 2021

@znicuuu Hmm... I guess I will need to improve the error messaging further. It seems the body object doesn't have matcher.track.get on it.

@rxri
Copy link
Member

rxri commented Oct 3, 2021

Musixmatch itself has broken API for either website & desktop app (actually used by spiectify). It's very ratelimited and breaks a lot. I already tried to debug it sometime ago to check what happens - but, it's basically API failing to sometimes send lyrics and sometimes it's captcha or sometimes it will return it as 404, sometimes will not. PopupLyrics breaks because of it most of time and it to fix it, you need to restart spotify (or do CTRL+R in DevTools) like @AntServiceApps did. There is nothing to do, since I already tried to contact Musixmatch developers but they seem to don't care (since I wanted to use their API for my own app).

@TheGeeKing
Copy link
Contributor

if it is ratelimited, we can maybe add multiple tokens so it falls back (need to see how tokens are generated (IP, or other tracking systems)
or use another service

@rxri
Copy link
Member

rxri commented Oct 3, 2021

need to see how tokens are generated

edit: #1090 (comment)

if it is ratelimited, we can maybe add multiple tokens so it falls back

It's ratelimited - but, like I say, API sometimes fail to just send lyrics and returns 404 in body.

or use another service

There is no big service like this :/

@TheGeeKing
Copy link
Contributor

It's usertoken per account. You can't just "generate it". You need to create account that will assign you usertoken that is always the same. It's random string with numbers that SHOULD be always 216-bit.

It generates a token when you download the app and don't register. Was speaking about that to see if we can automate or create multiple tokens easily. The app use things like IP and other things so can't just uninstall and reinstall to get a new token.

It's ratelimited - but, like I say, API sometimes fail to just send lyrics and returns 404 in body.

So lyrics can retry the request if error 404

@rxri
Copy link
Member

rxri commented Oct 3, 2021

It generates a token when you download the app and don't register. Was speaking about that to see if we can automate or create multiple tokens easily. The app use things like IP and other things so can't just uninstall and reinstall to get a new token.

My bad. Yeah, it uses https://apic-desktop.musixmatch.com/ws/1.1/token.get to get new token - but looks like it's assigned to IP from what you say so yeah :/
(I got this by just unpacking their app lol)

Update; It's assigned to guid that can be generated by this code:

console.log("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
                /[xy]/g,
                function (e) {
                  var t;
                  return (
                    (t = (16 * Math.random()) | 0),
                    ("x" === e ? t : (3 & t) | 8).toString(16)
                  );
                }
              ))

Example: https://apic-desktop.musixmatch.com/ws/1.1/token.get?format=json&guid=xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx&app_id=web-desktop-app-v1.0&signature=%2B5swfni2M%2FmgY8o5ZHmd%2Bb1hwjU%3D&signature_protocol=sha1

@TheGeeKing
Copy link
Contributor

TheGeeKing commented Oct 3, 2021

you just created a token generator😳
so we can easily

console.log("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
                /[xy]/g,
                function (e) {
                  var t;
                  return (
                    (t = (16 * Math.random()) | 0),
                    ("x" === e ? t : (3 & t) | 8).toString(16)
                  );
                }
              ))

and parse the json and get a new token
will try to do something with that

@rxri
Copy link
Member

rxri commented Oct 3, 2021

This code is from Musixmatch app (without console.log()).
And yes, you can generate a lot of tokens with it. I dont think there is limit on IP. Would need to check.

@afonsojramos
Copy link
Member

I mean, I would suggest for someone to try this locally before even thinking of pushing this change. But if it works, I'm good with it 👀

I'm afraid of an IP ban however

@TheGeeKing
Copy link
Contributor

This code is from Musixmatch app (without console.log()).

Fascinated and interested in how you did and found that

But if it works, I'm good with it 👀

It's a deeply hidden feature, not an exploit.

I'm afraid of an IP ban however

Should be OK if we just create like 3 tokens in localstorage or whatever it uses and go through them if one doesn't work.

@rxri
Copy link
Member

rxri commented Oct 3, 2021

I'm afraid of an IP ban however

Probably not.

Fascinated and interested in how you did and found that

Basically just unpacked app and was looking in JavaScript files.

@ImQrispy
Copy link

I've been having the same issue for awhile now. Was this ever fixed or is it out of our control?

@jamesf-hub
Copy link

@afonsojramos @ririxidev

@itsmeow
Copy link
Member

itsmeow commented Oct 29, 2021

There is a solution we have devised for this, but I have not yet taken the time to implement it.

@github-actions
Copy link

Marking this issue as stale.

Let someone know if I'm wrong, after all, I'm just a bot!

@github-actions github-actions bot added the ☠️ stale Stale issue or PR label Nov 14, 2021
@itsmeow
Copy link
Member

itsmeow commented Nov 16, 2021

Here is some log output I got when synced lyrics were stuck on loading for a bit, refreshing and clicking around seemed to fix it

Failed to load resource: the server responded with a status of 403 ()
guc3-spclient.spotify.com/remote-config-resolver/v2/configs/platforms/web/clients/desktop-ui/property-sets/XXXXXXXXXXX?installation-id=XXXXXXXXXXXXXXXXXXXX&fetch-type=delayed:1 Failed to load resource: the server responded with a status of 404 ()
guc3-spclient.spotify.com/quicksilverdev/v2/messages?ctv_type=web-modal&trigger=app%3Astart&action=DISMISS&action=URL&action=EXTERNAL_URL&locale=en&trig_type=CLIENT_EVENT:1 Failed to load resource: the server responded with a status of 403 ()
index.html:1 Uncaught (in promise) hbody: {error: {…}}headers: g {get: ƒ, has: ƒ}metadata: nulloffline: falseok: falseretries: {count: 0}status: 403timing: nullurl: "https://guc3-spclient.spotify.com/quicksilverdev/v2/messages?ctv_type=web-modal&trigger=app%3Astart&action=DISMISS&action=URL&action=EXTERNAL_URL&locale=en&trig_type=CLIENT_EVENT"[[Prototype]]: Objectconstructor: class hgetStatusFamily: ƒ getStatusFamily()[[Prototype]]: Object
index.html:1 Uncaught (in promise) SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.getSynced (spicetify-routes-lyrics-plus.js:640)
    at Object.musixmatch (spicetify-routes-lyrics-plus.js:888)
    at async LyricsContainer.tryServices (spicetify-routes-lyrics-plus.js:165)
    at async LyricsContainer.fetchLyrics (spicetify-routes-lyrics-plus.js:200)
Uncaught (in promise) SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.getSynced (spicetify-routes-lyrics-plus.js:640)
    at Object.musixmatch (spicetify-routes-lyrics-plus.js:888)
    at async LyricsContainer.tryServices (spicetify-routes-lyrics-plus.js:165)
    at async LyricsContainer.fetchLyrics (spicetify-routes-lyrics-plus.js:200)
index.html:1 Uncaught (in promise) SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.getSynced (spicetify-routes-lyrics-plus.js:640)
    at Object.musixmatch (spicetify-routes-lyrics-plus.js:888)
    at async LyricsContainer.tryServices (spicetify-routes-lyrics-plus.js:165)
    at async LyricsContainer.fetchLyrics (spicetify-routes-lyrics-plus.js:200)
spicetify-routes-lyrics-plus.js:793 Set(1)
spicetify-routes-lyrics-plus.js:778 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'length')
    at fetchLyricsVersion (spicetify-routes-lyrics-plus.js:778)
    at async Object.fetchLyrics (spicetify-routes-lyrics-plus.js:810)
    at async Object.genius (spicetify-routes-lyrics-plus.js:936)
    at async LyricsContainer.tryServices (spicetify-routes-lyrics-plus.js:165)
    at async LyricsContainer.fetchLyrics (spicetify-routes-lyrics-plus.js:200)

@github-actions github-actions bot removed the ☠️ stale Stale issue or PR label Nov 17, 2021
@itsmeow
Copy link
Member

itsmeow commented Nov 17, 2021

@khanhas I have found a way to process captcha requests from musixmatch's API, but I need to disable the web security policy in order to rip the response out of an iframe within the client... Would it be a terrible idea to insert --disable-web-security in the Spotify startup args or not? Because... it does work! I don't know that there would be much of a security concern considering Spotify isn't an actual browser and won't load external pages, so iframe jacking wouldn't be a huge security concern.

Anyone have any thoughts on this?

@frodo36
Copy link

frodo36 commented Nov 17, 2021

I have no idea what any of that means, but if it fixes musixmatch lyrics, yes please.

@khanhas
Copy link
Contributor

khanhas commented Nov 18, 2021

@khanhas I have found a way to process captcha requests from musixmatch's API, but I need to disable the web security policy in order to rip the response out of an iframe within the client... Would it be a terrible idea to insert --disable-web-security in the Spotify startup args or not? Because... it does work! I don't know that there would be much of a security concern considering Spotify isn't an actual browser and won't load external pages, so iframe jacking wouldn't be a huge security concern.

Anyone have any thoughts on this?

I think it's just too many steps and requirements to fix a rarely happening scenario. User just need to wait 10 to 15m cooldown till API is usable again.
Moreover, any Musixmatch page is filled with Google trackers and shit, I don't want any of that. Plus, telling users to "disable web security" screams suspicious even if it didn't do anything harmful.

@khanhas
Copy link
Contributor

khanhas commented Nov 18, 2021

@ririxidev Does your Musixmatch token generator function still work? Do you have fully working code, I can test it out and implement into Lyrics app setting menu.

@itsmeow
Copy link
Member

itsmeow commented Nov 18, 2021

I added token generation locally already, it is still affected by captcha response. The captcha page has no trackers actually, just google recaptcha script. The users would not have to disable policy, it would be inserted into Spotify launch flags automatically.

@itsmeow
Copy link
Member

itsmeow commented Nov 19, 2021

It seems this won't be as necessary anymore because Spotify has just implemented lyrics for U.S. users. They work quite well.

@khanhas khanhas closed this as completed Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests