mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-06 03:50:06 +02:00
Call stream_from_cdn
with CdnUrl
This commit is contained in:
parent
4646ff3075
commit
0f78fc277e
4 changed files with 26 additions and 15 deletions
|
@ -399,12 +399,13 @@ impl AudioFileStreaming {
|
|||
INITIAL_DOWNLOAD_SIZE
|
||||
};
|
||||
|
||||
trace!("Streaming {}", file_id);
|
||||
|
||||
let cdn_url = CdnUrl::new(file_id).resolve_audio(&session).await?;
|
||||
let url = cdn_url.try_get_url()?;
|
||||
|
||||
trace!("Streaming {:?}", url);
|
||||
|
||||
let mut streamer = session.spclient().stream_file(url, 0, download_size)?;
|
||||
let mut streamer = session
|
||||
.spclient()
|
||||
.stream_from_cdn(&cdn_url, 0, download_size)?;
|
||||
let request_time = Instant::now();
|
||||
|
||||
// Get the first chunk with the headers to get the file size.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue