Skip to content

Commit

Permalink
Merge pull request #1303 from DaXcess/clienttoken-ver-fix
Browse files Browse the repository at this point in the history
Fix spotify version in client token request
  • Loading branch information
roderickvd authored Jul 1, 2024
2 parents cdff6da + ba8ec55 commit 299b7de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/spclient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use crate::{
extended_metadata::BatchedEntityRequest,
},
token::Token,
version::spotify_version,
version::spotify_semantic_version,
Error, FileId, SpotifyId,
};

Expand Down Expand Up @@ -182,7 +182,7 @@ impl SpClient {

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,
// so it seems a good idea to mimick the real clients. `self.session().client_id()` returns the
Expand Down
7 changes: 7 additions & 0 deletions core/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 {
"android" | "ios" => SPOTIFY_MOBILE_VERSION.to_owned(),
_ => SPOTIFY_SEMANTIC_VERSION.to_string(),
Expand Down

0 comments on commit 299b7de

Please sign in to comment.