1
0
Fork 0
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:
Roderick van Domburg 2021-12-27 21:37:22 +01:00
parent 4646ff3075
commit 0f78fc277e
No known key found for this signature in database
GPG key ID: A9EF5222A26F0451
4 changed files with 26 additions and 15 deletions

View file

@ -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.