librespot-org/librespot

regression: lyrics API no longer working

Closed this issue · 2 comments

Trying to fetch lyrics is now failing with:

Client specified an invalid argument { Response status code: 400 Bad Request }

I bissected it and this regression has been introduced by d881f46 from @acolombier

(Note that you also need #1280 to get lyrics working but it's unrelated to this problem).

Looks to be an issue with the client token. I either get a 400 Bad Request on the current dev branch, or, if I revert d881f46, I get a 403 Forbidden error.

I took a little peek at how the client token is retrieved on the newer Spotify versions and it looks like the protobuf data uses the new semantic version (e.g. 1.2.40.599.g606b7f29), however the user agent still uses the protocol version (e.g. 124000599).

Splitting these into two seperate functions (version::spotify_version() and version::spotify_semantic_version()) seems to do the trick. I did test this however with #1220 merged locally, so I'm not 100% certain if it will work without it. I'll do some more testing without login5 and if it seems fine I can make a quick PR to fix the lyrics issue.

Did some more testing. Looks like it does fix this original issue (400 Bad Request errors are gone), however it looks like I'm still experiencing 403 Forbidden errors. And it's not consistent either, looks like depending on your IP, it does work, or it doesn't. With login5, there is no 403 to be seen, so a full fix might just depend on #1220. Tested using password login.

Since it fixes the original issue, I've quickly made a PR: #1303