Skip to content

Commit 299b7de

Browse files
authored
Merge pull request #1303 from DaXcess/clienttoken-ver-fix
Fix spotify version in client token request
2 parents cdff6da + ba8ec55 commit 299b7de

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

core/src/spclient.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use crate::{
3535
extended_metadata::BatchedEntityRequest,
3636
},
3737
token::Token,
38-
version::spotify_version,
38+
version::spotify_semantic_version,
3939
Error, FileId, SpotifyId,
4040
};
4141

@@ -182,7 +182,7 @@ impl SpClient {
182182

183183
let client_data = request.mut_client_data();
184184

185-
client_data.client_version = spotify_version();
185+
client_data.client_version = spotify_semantic_version();
186186

187187
// Current state of affairs: keymaster ID works on all tested platforms, but may be phased out,
188188
// so it seems a good idea to mimick the real clients. `self.session().client_id()` returns the

core/src/version.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ pub const SPOTIFY_MOBILE_VERSION: &str = "8.6.84";
2929
pub const FALLBACK_USER_AGENT: &str = "Spotify/117300517 Linux/0 (librespot)";
3030

3131
pub fn spotify_version() -> String {
32+
match std::env::consts::OS {
33+
"android" | "ios" => SPOTIFY_MOBILE_VERSION.to_owned(),
34+
_ => SPOTIFY_VERSION.to_string(),
35+
}
36+
}
37+
38+
pub fn spotify_semantic_version() -> String {
3239
match std::env::consts::OS {
3340
"android" | "ios" => SPOTIFY_MOBILE_VERSION.to_owned(),
3441
_ => SPOTIFY_SEMANTIC_VERSION.to_string(),

0 commit comments

Comments
 (0)