mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-04 18:29:45 +02:00
Lay groundwork for new Spotify API client (#805)
Lay groundwork for new Spotify API before removing `spirc` * Add token provider * Introduce HTTP client * Introduce caching `ApResolver` component * Remove `keymaster` and update example * Use `PacketType` instead of hex identifiers * Document new unknown packet 0xb6
This commit is contained in:
parent
113ac94c07
commit
39bf40bcc7
62 changed files with 3101 additions and 1837 deletions
|
@ -2,7 +2,6 @@ use std::env;
|
|||
|
||||
use librespot::core::authentication::Credentials;
|
||||
use librespot::core::config::SessionConfig;
|
||||
use librespot::core::keymaster;
|
||||
use librespot::core::session::Session;
|
||||
|
||||
const SCOPES: &str =
|
||||
|
@ -13,8 +12,8 @@ async fn main() {
|
|||
let session_config = SessionConfig::default();
|
||||
|
||||
let args: Vec<_> = env::args().collect();
|
||||
if args.len() != 4 {
|
||||
eprintln!("Usage: {} USERNAME PASSWORD CLIENT_ID", args[0]);
|
||||
if args.len() != 3 {
|
||||
eprintln!("Usage: {} USERNAME PASSWORD", args[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -26,8 +25,6 @@ async fn main() {
|
|||
|
||||
println!(
|
||||
"Token: {:#?}",
|
||||
keymaster::get_token(&session, &args[3], SCOPES)
|
||||
.await
|
||||
.unwrap()
|
||||
session.token_provider().get_token(SCOPES).await.unwrap()
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue