From 736f589ea2653d2554002a4a7446d4f7e5df4e24 Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Fri, 7 Jun 2024 22:56:34 +0800 Subject: [PATCH 1/4] Bug fix - error module should be public - resolves #32 --- ytmapi-rs/src/error.rs | 2 ++ ytmapi-rs/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ytmapi-rs/src/error.rs b/ytmapi-rs/src/error.rs index 3684e317..12d8d7d1 100644 --- a/ytmapi-rs/src/error.rs +++ b/ytmapi-rs/src/error.rs @@ -12,6 +12,8 @@ pub struct Error { } /// The kind of the error. +/// This list may grow over time, and it's not recommended to exhaustively match on it. +#[non_exhaustive] pub enum ErrorKind { /// General web error. // TODO: improve and avoid leaking reqwest::Error diff --git a/ytmapi-rs/src/lib.rs b/ytmapi-rs/src/lib.rs index e1319211..5b336c74 100644 --- a/ytmapi-rs/src/lib.rs +++ b/ytmapi-rs/src/lib.rs @@ -64,7 +64,7 @@ mod nav_consts; // Consider if pub is correct for this pub mod common; mod crawler; -mod error; +pub mod error; pub mod parse; mod process; pub mod query; From 065b1a1dc2c93178e7be82811fc0a75262a5a9a4 Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Wed, 12 Jun 2024 17:19:24 +0800 Subject: [PATCH 2/4] docs: Added documentation for tls options --- ytmapi-rs/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ytmapi-rs/src/lib.rs b/ytmapi-rs/src/lib.rs index 5b336c74..b26a5822 100644 --- a/ytmapi-rs/src/lib.rs +++ b/ytmapi-rs/src/lib.rs @@ -1,3 +1,4 @@ +//! # ytmapi_rs //! Library into YouTube Music's internal API. //! ## Examples //! Basic usage with a pre-created cookie file : @@ -29,6 +30,15 @@ //! Ok(()) //! } //! ``` +//! ## Optional Features +//! ### TLS +//! NOTE: To use an alternative TLS, you will need to specify `default-features = false`. +//! As reqwest preferentially uses default-tls when multiple TLS features are enabled. +//! See reqwest docs for more information. +//! https://docs.rs/reqwest/latest/reqwest/tls/index.html +//! - **default-tls** *(enabled by default)*: Utilises the default TLS from reqwest - at the time of writing is native-tls. +//! - **native-tls**: This feature forces use of the the native-tls crate, reliant on vendors tls. +//! - **rustls-tls**: This feature forces use of the rustls crate, written in rust. use auth::{ browser::BrowserToken, oauth::OAuthDeviceCode, AuthToken, OAuthToken, OAuthTokenGenerator, }; From b1b7ddaae2c725a11bc2b45ddf0f5ee536d344c8 Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Wed, 12 Jun 2024 17:26:16 +0800 Subject: [PATCH 3/4] chore: Update dependencies --- ytmapi-rs/Cargo.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ytmapi-rs/Cargo.toml b/ytmapi-rs/Cargo.toml index 17cb7f63..18501612 100644 --- a/ytmapi-rs/Cargo.toml +++ b/ytmapi-rs/Cargo.toml @@ -10,23 +10,23 @@ repository = "https://github.com/nick42d/youtui" readme = "README.md" [dependencies] -tokio = {version = "1.29.1", features = ["full"]} +tokio = {version = "1.38.0", features = ["full"]} # To allow alternative TLS options, we need to opt out of a single reqwest feature. # This isn't possible in Cargo, so we need to opt back into the other default features. # https://github.com/rust-lang/cargo/issues/3126 # As of 26/4/24 the following are reqwest default features: # http2, default-tls, charset -reqwest = {version = "0.12.1", features = ["json", "http2", "charset"], default-features = false} -serde = {version = "1.0.164", features = ["derive"]} -serde_json = "1.0.99" -sha1 = "0.10.5" -tokio-stream = "0.1.14" +reqwest = {version = "0.12.4", features = ["json", "http2", "charset"], default-features = false} +serde = {version = "1.0.203", features = ["derive"]} +serde_json = "1.0.117" +sha1 = "0.10.6" +tokio-stream = "0.1.15" async-stream = "0.3.5" -const_format = "0.2.31" -chrono = "0.4.31" +const_format = "0.2.32" +chrono = "0.4.38" [dev-dependencies] -pretty_assertions = "1" +pretty_assertions = "1.4.0" [features] # Provide alternative TLS options, but use reqwest's default by default. From 82d82be195746b06195604ed9831b74d61d668fe Mon Sep 17 00:00:00 2001 From: Nick Dowsett Date: Wed, 12 Jun 2024 17:31:07 +0800 Subject: [PATCH 4/4] update version --- ytmapi-rs/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ytmapi-rs/Cargo.toml b/ytmapi-rs/Cargo.toml index 18501612..a44a77d7 100644 --- a/ytmapi-rs/Cargo.toml +++ b/ytmapi-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ytmapi-rs" -version = "0.0.2" +version = "0.0.3" edition = "2021" authors = ["nick42d"] license = "MIT"