Skip to content

Commit

Permalink
Fix dependencies so we don't pull in openssl
Browse files Browse the repository at this point in the history
  • Loading branch information
cycle-five committed Jul 9, 2024
1 parent 4b16aa5 commit b2b0fac
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
14 changes: 13 additions & 1 deletion rsget_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,22 @@ tracing = "0.1"
tracing-subscriber = "0.3.18"
clap = { version = "4.4.11", features = ["derive"] }
tokio = { version = "1", features = ["fs", "rt-multi-thread", "io-util", "io-std"] }
reqwest = "0.12"
reqwest = { version = "0.12", default-features = false}
indicatif = "0.17.7"
futures-util = "0.3.30"

[features]
# Default to rustls so we don't pull in openssl
default = ["rustls-tls"]
rustls-tls = [
"reqwest/rustls-tls",
"reqwest/rustls-tls-webpki-roots",
]
native-tls = [
"reqwest/native-tls",
"reqwest/rustls-tls-native-roots",
]

[[bin]]
name = "rsget"
path = "src/main.rs"
14 changes: 13 additions & 1 deletion rsget_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ regex = "1.10"
http = "0.2.11"
chrono = "0.4"
hls_m3u8 = "0.4"
reqwest = { version = "0.12", features = ["json"] }
reqwest = { version = "0.12", default-features = false, features = ["json"] }
rand = { version ="0.8", features = ["small_rng"] }
async-trait = "0.1"
webbrowser = "0.8"
Expand All @@ -29,3 +29,15 @@ default-features = false
version = "0.5.0"
path = "../stream_lib"
features = []

[features]
# Default to rustls so we don't pull in openssl
default = ["rustls-tls"]
rustls-tls = [
"reqwest/rustls-tls",
"reqwest/rustls-tls-webpki-roots",
]
native-tls = [
"reqwest/native-tls",
"reqwest/rustls-tls-native-roots",
]
2 changes: 0 additions & 2 deletions rsget_lib/src/plugins/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
mod afreeca;
mod bilibili;
mod dlive;
mod drdk;
mod twitch;
mod vlive;

pub use afreeca::Afreeca;
pub use bilibili::Bilibili;
pub use dlive::DLive;
pub use drdk::Drdk;
pub use twitch::Twitch;
pub use vlive::Vlive;
8 changes: 4 additions & 4 deletions rsget_lib/src/utils/sites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use crate::plugins::{
mixer::Mixer, tiktok::TikTok, twitch::Twitch, vlive::Vlive,
};
*/
use crate::plugins::{Afreeca, Bilibili, DLive, Drdk, Twitch, Vlive};
//use crate::plugins::{Afreeca, Bilibili, DLive, Twitch, Vlive};
use crate::plugins::{Afreeca, Bilibili, DLive, Twitch, Vlive};
//use crate::plugins::{Afreeca, Bilibili, DLive, Drdk, Twitch, Vlive};
use crate::utils::error::RsgetError;
use crate::utils::error::StreamError;
use crate::utils::error::StreamResult;
Expand All @@ -25,7 +25,7 @@ pub async fn get_site(input: &str) -> StreamResult<Box<dyn Streamable + Send>> {
}

async fn _get_site(input: &str) -> StreamResult<Box<dyn Streamable + Send>> {
let re_drdk: Regex = Regex::new(r"^(?:https?://)?(?:www\.)?dr\.dk/drtv/kanal/[a-zA-Z0-9-_]+")?;
//let re_drdk: Regex = Regex::new(r"^(?:https?://)?(?:www\.)?dr\.dk/drtv/kanal/[a-zA-Z0-9-_]+")?;
let re_afreeca: Regex = Regex::new(
r"^(?:https?://)?(?:www\.)?(?:play\.)?afreecatv.com/[a-zA-Z0-9]+/?(?:/[0-9]+)?",
)?;
Expand All @@ -45,7 +45,7 @@ async fn _get_site(input: &str) -> StreamResult<Box<dyn Streamable + Send>> {
url if re_afreeca.is_match(url) => Ok(Afreeca::new(String::from(url)).await?),
url if re_bilibili.is_match(url) => Ok(Bilibili::new(String::from(url)).await?),
url if re_dlive.is_match(url) => Ok(DLive::new(String::from(url)).await?),
url if re_drdk.is_match(url) => Ok(Drdk::new(String::from(url)).await?),
//url if re_drdk.is_match(url) => Ok(Drdk::new(String::from(url)).await?),
url if re_twitch.is_match(url) => Ok(Twitch::new(String::from(url)).await?),
url if re_vlive.is_match(url) => Ok(Vlive::new(String::from(url)).await?),
/*
Expand Down
17 changes: 13 additions & 4 deletions stream_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,27 @@ repository = "https://github.com/Erk-/rsget/tree/master/stream_lib"

[dependencies]
hls_m3u8 = "0.4.1"
reqwest = { version = "0.12.5", features = ["stream"] }
reqwest = { version = "0.12", default-features = false, features = ["stream"] }
tracing = "0.1.40"
url = "2.5.0"
futures-util = "0.3.30"
tokio = { version = "1.35.1", default-features = false, features = ["rt", "sync", "time"] }
tokio = { version = "1.38.0", default-features = false, features = ["rt", "sync", "time"] }
patricia_tree = "0.8.0"
futures-core = "0.3.30"
bytes = "1.5.0"

[dev-dependencies]
tracing-subscriber = "0.3.18"
tokio = { version = "1.35.1", default-features = false, features = ["fs", "rt", "sync", "time", "macros"] }
tokio = { version = "1.38", default-features = false, features = ["fs", "rt", "sync", "time", "macros"] }

[features]
default = []
# Default to rustls so we don't pull in openssl
default = ["rustls-tls"]
rustls-tls = [
"reqwest/rustls-tls",
"reqwest/rustls-tls-webpki-roots",
]
native-tls = [
"reqwest/native-tls",
"reqwest/rustls-tls-native-roots",
]

0 comments on commit b2b0fac

Please sign in to comment.