mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +00:00
Merge pull request #1303 from DaXcess/clienttoken-ver-fix
Fix spotify version in client token request
This commit is contained in:
commit
299b7dec20
2 changed files with 9 additions and 2 deletions
|
@ -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
|
||||||
|
|
|
@ -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(),
|
||||||
|
|
Loading…
Reference in a new issue