1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-04 02:09:26 +02:00

Receive autoplay and other attributes

This commit is contained in:
Roderick van Domburg 2021-12-11 16:43:34 +01:00
parent 9a0d2390b7
commit 51b6c46fcd
No known key found for this signature in database
GPG key ID: A9EF5222A26F0451
3 changed files with 17 additions and 8 deletions

View file

@ -14,6 +14,7 @@ use crate::protocol;
use crate::protocol::keyexchange::{
APResponseMessage, ClientHello, ClientResponsePlaintext, Platform, ProductFlags,
};
use crate::version;
pub async fn handshake<T: AsyncRead + AsyncWrite + Unpin>(
mut connection: T,
@ -84,13 +85,17 @@ where
let mut packet = ClientHello::new();
packet
.mut_build_info()
.set_product(protocol::keyexchange::Product::PRODUCT_LIBSPOTIFY);
// ProductInfo won't push autoplay and perhaps other settings
// when set to anything else than PRODUCT_CLIENT
.set_product(protocol::keyexchange::Product::PRODUCT_CLIENT);
packet
.mut_build_info()
.mut_product_flags()
.push(PRODUCT_FLAGS);
packet.mut_build_info().set_platform(platform);
packet.mut_build_info().set_version(999999999);
packet
.mut_build_info()
.set_version(version::SPOTIFY_VERSION);
packet
.mut_cryptosuites_supported()
.push(protocol::keyexchange::Cryptosuite::CRYPTO_SUITE_SHANNON);