Fix spotify version in client token request

This commit is contained in:
DaXcess 2024-07-01 15:38:50 +02:00
parent cdff6da1f8
commit ba8ec55345
No known key found for this signature in database
GPG key ID: CF78CC72F0FD5EAD
2 changed files with 9 additions and 2 deletions

View file

@ -35,7 +35,7 @@ use crate::{
extended_metadata::BatchedEntityRequest, extended_metadata::BatchedEntityRequest,
}, },
token::Token, token::Token,
version::spotify_version, version::spotify_semantic_version,
Error, FileId, SpotifyId, Error, FileId, SpotifyId,
}; };
@ -182,7 +182,7 @@ impl SpClient {
let client_data = request.mut_client_data(); let client_data = request.mut_client_data();
client_data.client_version = spotify_version(); client_data.client_version = spotify_semantic_version();
// Current state of affairs: keymaster ID works on all tested platforms, but may be phased out, // Current state of affairs: keymaster ID works on all tested platforms, but may be phased out,
// so it seems a good idea to mimick the real clients. `self.session().client_id()` returns the // so it seems a good idea to mimick the real clients. `self.session().client_id()` returns the

View file

@ -29,6 +29,13 @@ pub const SPOTIFY_MOBILE_VERSION: &str = "8.6.84";
pub const FALLBACK_USER_AGENT: &str = "Spotify/117300517 Linux/0 (librespot)"; pub const FALLBACK_USER_AGENT: &str = "Spotify/117300517 Linux/0 (librespot)";
pub fn spotify_version() -> String { pub fn spotify_version() -> String {
match std::env::consts::OS {
"android" | "ios" => SPOTIFY_MOBILE_VERSION.to_owned(),
_ => SPOTIFY_VERSION.to_string(),
}
}
pub fn spotify_semantic_version() -> String {
match std::env::consts::OS { match std::env::consts::OS {
"android" | "ios" => SPOTIFY_MOBILE_VERSION.to_owned(), "android" | "ios" => SPOTIFY_MOBILE_VERSION.to_owned(),
_ => SPOTIFY_SEMANTIC_VERSION.to_string(), _ => SPOTIFY_SEMANTIC_VERSION.to_string(),