Update dependencies

This commit is contained in:
ByteDream 2022-12-02 17:28:54 +01:00
parent 474e9f5e31
commit 6aa4078be3
6 changed files with 342 additions and 92 deletions

View file

@ -170,29 +170,7 @@ pub async fn cli_entrypoint() {
async fn create_ctx(cli: &Cli) -> Result<Context> {
let crunchy = crunchyroll_session(cli).await?;
// use crunchy.client() when it's possible
// currently crunchy.client() has a cloudflare bypass built-in to access crunchyroll. the servers
// where crunchy stores their videos can't handle this bypass and simply refuses to connect
#[cfg(not(all(windows, target_env = "msvc")))]
let client = isahc::HttpClient::new().unwrap();
#[cfg(all(windows, target_env = "msvc"))]
use isahc::config::Configurable;
#[cfg(all(windows, target_env = "msvc"))]
let client = isahc::HttpClientBuilder::default()
.tls_config(
isahc::tls::TlsConfigBuilder::default()
.root_cert_store(isahc::tls::RootCertStore::custom(
rustls_native_certs::load_native_certs()
.unwrap()
.into_iter()
.map(|l| isahc::tls::Certificate::from_der(l.0)),
))
.build(),
)
.build()
.unwrap();
Ok(Context { crunchy, client })
Ok(Context { crunchy })
}
async fn crunchyroll_session(cli: &Cli) -> Result<Crunchyroll> {