mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-03 09:49:31 +02:00
Use new hm endpoint for playlists
This commit is contained in:
parent
9faaaae6d2
commit
e6295a6f9c
4 changed files with 87 additions and 21 deletions
|
@ -18,7 +18,7 @@ use librespot::core::session::Session;
|
|||
use librespot::core::spotify_id::SpotifyId;
|
||||
use librespot::playback::config::PlayerConfig;
|
||||
use librespot::playback::config::Bitrate;
|
||||
use librespot::metadata::{FileFormat, Metadata, PlaylistMeta, Track, Album, Artist, Playlist};
|
||||
use librespot::metadata::{FileFormat, Metadata, Track, Album, Artist, Playlist};
|
||||
|
||||
|
||||
/*
|
||||
|
@ -60,15 +60,13 @@ fn main() {
|
|||
player_config.bitrate = Bitrate::Bitrate320;
|
||||
|
||||
let args: Vec<_> = env::args().collect();
|
||||
if args.len() != 5 {
|
||||
println!("Usage: {} USERNAME PASSWORD PLAYLIST PLISTUSER", args[0]);
|
||||
if args.len() != 4 {
|
||||
println!("Usage: {} USERNAME PASSWORD PLAYLIST", args[0]);
|
||||
}
|
||||
let username = args[1].to_owned();
|
||||
let password = args[2].to_owned();
|
||||
let credentials = Credentials::with_password(username, password);
|
||||
|
||||
let plist_owner = args[4].to_string();
|
||||
|
||||
let mut uri_split = args[3].split(":");
|
||||
let uri_parts: Vec<&str> = uri_split.collect();
|
||||
println!("{}, {}, {}",uri_parts[0], uri_parts[1], uri_parts[2]);
|
||||
|
@ -79,7 +77,7 @@ fn main() {
|
|||
.run(Session::connect(session_config, credentials, None, handle))
|
||||
.unwrap();
|
||||
|
||||
let plist = core.run(Playlist::get(&session, plist_uri, plist_owner, 0, 100)).unwrap();
|
||||
let plist = core.run(Playlist::get(&session, plist_uri)).unwrap();
|
||||
println!("{:?}",plist);
|
||||
for track_id in plist.tracks {
|
||||
let plist_track = core.run(Track::get(&session, track_id)).unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue