1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-05 10:49:40 +02:00

Add configurable client ID and listen for updates

This commit is contained in:
Roderick van Domburg 2022-01-12 22:09:57 +01:00
parent 0b7ccc803c
commit 32df4a401d
No known key found for this signature in database
GPG key ID: A9EF5222A26F0451
6 changed files with 34 additions and 24 deletions

View file

@ -52,8 +52,6 @@ struct TokenData {
}
impl TokenProvider {
const KEYMASTER_CLIENT_ID: &'static str = "65b708073fc0480ea92a077233ca87bd";
fn find_token(&self, scopes: Vec<&str>) -> Option<usize> {
self.lock(|inner| {
for i in 0..inner.tokens.len() {
@ -84,8 +82,8 @@ impl TokenProvider {
let query_uri = format!(
"hm://keymaster/token/authenticated?scope={}&client_id={}&device_id={}",
scopes,
Self::KEYMASTER_CLIENT_ID,
self.session().device_id()
self.session().client_id(),
self.session().device_id(),
);
let request = self.session().mercury().get(query_uri)?;
let response = request.await?;