diff --git a/Cargo.lock b/Cargo.lock index 6872098e..f6d8c4ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1424,6 +1424,7 @@ dependencies = [ "ctr", "futures-core", "futures-util", + "http-body-util", "hyper", "hyper-util", "librespot-core", diff --git a/audio/Cargo.toml b/audio/Cargo.toml index 2740616c..9d5ccd8a 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -19,7 +19,9 @@ bytes = "1" ctr = "0.9" futures-core = "0.3" futures-util = "0.3" -hyper = { version = "0.14", features = ["client", "backports", "deprecated"] } +hyper = { version = "1.3", features = [] } +hyper-util = { version = "0.1", features = ["client"] } +http-body-util = "0.1.1" log = "0.4" parking_lot = { version = "0.12", features = ["deadlock_detection"] } tempfile = "3" diff --git a/audio/src/fetch/mod.rs b/audio/src/fetch/mod.rs index f6071936..d1617106 100644 --- a/audio/src/fetch/mod.rs +++ b/audio/src/fetch/mod.rs @@ -12,7 +12,8 @@ use std::{ }; use futures_util::{future::IntoStream, StreamExt, TryFutureExt}; -use hyper::{client::ResponseFuture, header::CONTENT_RANGE, Body, Response, StatusCode}; +use hyper::{body::Incoming, header::CONTENT_RANGE, Response, StatusCode}; +use hyper_util::client::legacy::ResponseFuture; use parking_lot::{Condvar, Mutex}; use tempfile::NamedTempFile; use thiserror::Error; @@ -133,7 +134,7 @@ pub enum AudioFile { #[derive(Debug)] pub struct StreamingRequest { streamer: IntoStream, - initial_response: Option>, + initial_response: Option>, offset: usize, length: usize, } diff --git a/audio/src/fetch/receive.rs b/audio/src/fetch/receive.rs index c5e2456c..4023060d 100644 --- a/audio/src/fetch/receive.rs +++ b/audio/src/fetch/receive.rs @@ -7,9 +7,10 @@ use std::{ use bytes::Bytes; use futures_util::StreamExt; -use hyper::{body::HttpBody, StatusCode}; +use hyper::StatusCode; use tempfile::NamedTempFile; use tokio::sync::{mpsc, oneshot}; +use http_body_util::BodyExt; use librespot_core::{http_client::HttpClient, session::Session, Error};