diff --git a/Cargo.lock b/Cargo.lock index d6e694c..2f866df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -1179,8 +1179,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -1492,6 +1494,20 @@ dependencies = [ "webpki", ] +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper 0.14.30", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", +] + [[package]] name = "hyper-rustls" version = "0.26.0" @@ -1857,8 +1873,9 @@ dependencies = [ [[package]] name = "librespot" -version = "0.5.0-dev" -source = "git+https://github.com/librespot-org/librespot?rev=f647331#f6473319f6309b2702a20ff5371763c48e129676" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96e4b1f97b2767e35327b8443dcc1d2360a83c1c09a8686bf824ff61ab50f04c" dependencies = [ "data-encoding", "env_logger", @@ -1869,28 +1886,26 @@ dependencies = [ "librespot-core", "librespot-discovery", "librespot-metadata", + "librespot-oauth", "librespot-playback", "librespot-protocol", "log", - "rpassword", "sha1", "sysinfo", "thiserror", "tokio", "url", - "webpki", ] [[package]] name = "librespot-audio" -version = "0.5.0-dev" -source = "git+https://github.com/librespot-org/librespot?rev=f647331#f6473319f6309b2702a20ff5371763c48e129676" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e07566fe7553042936c61bbdd9bedb524114a904aa7f9738e266c641468bab8" dependencies = [ "aes", - "byteorder", "bytes", "ctr", - "futures-core", "futures-util", "http-body-util", "hyper 1.4.1", @@ -1905,8 +1920,9 @@ dependencies = [ [[package]] name = "librespot-connect" -version = "0.5.0-dev" -source = "git+https://github.com/librespot-org/librespot?rev=f647331#f6473319f6309b2702a20ff5371763c48e129676" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ce3a5634669ce051a425cff5437a474831111df045fd5a2bb37fabe316fa60" dependencies = [ "form_urlencoded", "futures-util", @@ -1925,8 +1941,9 @@ dependencies = [ [[package]] name = "librespot-core" -version = "0.5.0-dev" -source = "git+https://github.com/librespot-org/librespot?rev=f647331#f6473319f6309b2702a20ff5371763c48e129676" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4c76303efcf949a59f9380220ca420c4d72fa32dbb3641a0079f429cc5e44e7" dependencies = [ "aes", "base64 0.22.1", @@ -1945,6 +1962,7 @@ dependencies = [ "hyper-proxy2", "hyper-rustls 0.27.3", "hyper-util", + "librespot-oauth", "librespot-protocol", "log", "nonzero_ext", @@ -1955,6 +1973,7 @@ dependencies = [ "once_cell", "parking_lot", "pbkdf2", + "pin-project-lite", "priority-queue", "protobuf", "quick-xml", @@ -1978,13 +1997,13 @@ dependencies = [ [[package]] name = "librespot-discovery" -version = "0.5.0-dev" -source = "git+https://github.com/librespot-org/librespot?rev=f647331#f6473319f6309b2702a20ff5371763c48e129676" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94a952d28c775562b9b6039102c0e3a834cb31157fccb2f2a68a26dc4397fea8" dependencies = [ "aes", "base64 0.22.1", "bytes", - "cfg-if", "ctr", "form_urlencoded", "futures-core", @@ -1998,6 +2017,7 @@ dependencies = [ "log", "rand", "serde_json", + "serde_repr", "sha1", "thiserror", "tokio", @@ -2005,11 +2025,11 @@ dependencies = [ [[package]] name = "librespot-metadata" -version = "0.5.0-dev" -source = "git+https://github.com/librespot-org/librespot?rev=f647331#f6473319f6309b2702a20ff5371763c48e129676" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cf6d5c46a401b1dd3e062ebdce959aa694bbae1039841756545d2e9c4f8be5f" dependencies = [ "async-trait", - "byteorder", "bytes", "librespot-core", "librespot-protocol", @@ -2022,11 +2042,23 @@ dependencies = [ ] [[package]] -name = "librespot-playback" -version = "0.5.0-dev" -source = "git+https://github.com/librespot-org/librespot?rev=f647331#f6473319f6309b2702a20ff5371763c48e129676" +name = "librespot-oauth" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00dcad779aa6c3b442e493e2a40ca83a5c5fcf38a65c05b026c3587bd4f8d14f" +dependencies = [ + "log", + "oauth2", + "thiserror", + "url", +] + +[[package]] +name = "librespot-playback" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ed1f776a04c8c9275407f8d4df034f2615ea729ec6c6d0fa69f423fc571df64" dependencies = [ - "byteorder", "cpal", "futures-util", "librespot-audio", @@ -2046,8 +2078,9 @@ dependencies = [ [[package]] name = "librespot-protocol" -version = "0.5.0-dev" -source = "git+https://github.com/librespot-org/librespot?rev=f647331#f6473319f6309b2702a20ff5371763c48e129676" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80802f52b5a1b3a2157454e6aca483a627fbf7b942e0a5fea037ebf3ed8b0546" dependencies = [ "protobuf", "protobuf-codegen", @@ -2338,6 +2371,26 @@ dependencies = [ "libc", ] +[[package]] +name = "oauth2" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c38841cdd844847e3e7c8d29cef9dcfed8877f8f56f9071f77843ecf3baf937f" +dependencies = [ + "base64 0.13.1", + "chrono", + "getrandom", + "http 0.2.12", + "rand", + "reqwest 0.11.27", + "serde", + "serde_json", + "serde_path_to_error", + "sha2", + "thiserror", + "url", +] + [[package]] name = "object" version = "0.36.4" @@ -2871,6 +2924,7 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "hyper 0.14.30", + "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -2880,6 +2934,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls 0.21.12", "rustls-pemfile 1.0.4", "serde", "serde_json", @@ -2888,11 +2943,13 @@ dependencies = [ "system-configuration 0.5.1", "tokio", "tokio-native-tls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "winreg", ] @@ -2964,17 +3021,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "rpassword" -version = "7.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" -dependencies = [ - "libc", - "rtoolbox", - "windows-sys 0.48.0", -] - [[package]] name = "rsa" version = "0.9.6" @@ -2995,16 +3041,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rtoolbox" -version = "0.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "rustc-demangle" version = "0.1.24" @@ -3030,6 +3066,18 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.7", + "sct", +] + [[package]] name = "rustls" version = "0.22.4" @@ -3039,7 +3087,7 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] @@ -3054,7 +3102,7 @@ dependencies = [ "log", "once_cell", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] @@ -3110,6 +3158,16 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustls-webpki" version = "0.102.7" @@ -3168,6 +3226,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "security-framework" version = "2.11.1" @@ -3232,6 +3300,27 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3255,6 +3344,17 @@ dependencies = [ "digest", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shannon" version = "0.2.0" @@ -3672,6 +3772,16 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.12", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.25.0" @@ -3707,14 +3817,14 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" dependencies = [ "futures-util", "log", "rustls 0.23.12", - "rustls-native-certs 0.7.3", + "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -3814,9 +3924,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" dependencies = [ "byteorder", "bytes", @@ -3880,6 +3990,7 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -4073,6 +4184,12 @@ dependencies = [ "untrusted", ] +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + [[package]] name = "which" version = "4.4.2" diff --git a/Cargo.toml b/Cargo.toml index 9828eba..2dab2be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ reqwest = "0" colored = "2" lame = "0" aspotify = "0" -librespot = { git = "https://github.com/librespot-org/librespot", rev = "f647331" } +librespot = "0" async-std = { version = "1", features = ["attributes", "tokio1"] } serde_json = "1" async-stream = "0" diff --git a/src/downloader.rs b/src/downloader.rs index a378b38..00aac6c 100644 --- a/src/downloader.rs +++ b/src/downloader.rs @@ -728,7 +728,12 @@ impl From for AudioFormat { FileFormat::MP3_160_ENC => Self::Mp3, FileFormat::AAC_24 => Self::Aac, FileFormat::AAC_48 => Self::Aac, + FileFormat::AAC_160 => Self::Aac, + FileFormat::AAC_320 => Self::Aac, FileFormat::FLAC_FLAC => Self::Flac, + FileFormat::MP4_128 => Self::Mp4, + FileFormat::OTHER5 => AudioFormat::Unknown, + FileFormat::UNKNOWN_FORMAT => AudioFormat::Unknown, } } }