[GH-ISSUE #941] Error in new-api branch when trying to get token #458

Closed
opened 2026-02-27 19:30:44 +03:00 by kerem · 3 comments
Owner

Originally created by @AbhayAysola on GitHub (Jan 22, 2022).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/941

Originally assigned to: @roderickvd on GitHub.

I ran the get_token example which throws this error -
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Unavailable, error: Response(MercuryResponse { uri: "hm://keymaster/token/authenticated?scope=streaming,user-read-playback-state,user-modify-playback-state,user-read-currently-playing&client_id=&device_id=b05ae3c8-5494-4496-a3ed-61f49d0c6921", status_code: 400, payload: [[123, 34, 99, 111, 100, 101, 34, 58, 50, 125]] }) }', examples\get_token.rs:25:62 stack backtrace:

Originally created by @AbhayAysola on GitHub (Jan 22, 2022). Original GitHub issue: https://github.com/librespot-org/librespot/issues/941 Originally assigned to: @roderickvd on GitHub. I ran the get_token example which throws this error - ```thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Unavailable, error: Response(MercuryResponse { uri: "hm://keymaster/token/authenticated?scope=streaming,user-read-playback-state,user-modify-playback-state,user-read-currently-playing&client_id=&device_id=b05ae3c8-5494-4496-a3ed-61f49d0c6921", status_code: 400, payload: [[123, 34, 99, 111, 100, 101, 34, 58, 50, 125]] }) }', examples\get_token.rs:25:62 stack backtrace:```
kerem 2026-02-27 19:30:44 +03:00
Author
Owner

@roderickvd commented on GitHub (Jan 22, 2022):

I see the client_id is empty. You are running the example as-is or have you got your own code? If it’s as-is I’ll see about fixing the example.

<!-- gh-comment-id:1019128342 --> @roderickvd commented on GitHub (Jan 22, 2022): I see the `client_id` is empty. You are running the example as-is or have you got your own code? If it’s as-is I’ll see about fixing the example.
Author
Owner

@AbhayAysola commented on GitHub (Jan 22, 2022):

I see the client_id is empty.

Yeah that's what I observed as well. After a little bit of digging it seems like the client_id isn't properly initialized in Session::new.

I'm running the example code as-is.

<!-- gh-comment-id:1019136847 --> @AbhayAysola commented on GitHub (Jan 22, 2022): > I see the client_id is empty. Yeah that's what I observed as well. After a little bit of digging it seems like the `client_id` isn't properly initialized in `Session::new`. I'm running the example code as-is.
Author
Owner

@roderickvd commented on GitHub (Jan 22, 2022):

This should be fixed in 0822af0.

<!-- gh-comment-id:1019351455 --> @roderickvd commented on GitHub (Jan 22, 2022): This should be fixed in 0822af0.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#458
No description provided.