mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Fix cms rate limiting error for episodes and movies (#180)
This commit is contained in:
parent
c4c15f9b11
commit
5099fad705
4 changed files with 25 additions and 10 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
|
@ -375,9 +375,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crunchyroll-rs"
|
||||
version = "0.3.3"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "be975d4a27439853f6e80311b497e910fc49fd24525afdc12ca27ace18b84eeb"
|
||||
checksum = "b75b403a64b4cc8ed9a96cb16588475a93cb5c8643cf960907a54ae6f6ac3f0d"
|
||||
dependencies = [
|
||||
"aes",
|
||||
"async-trait",
|
||||
|
|
@ -402,9 +402,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crunchyroll-rs-internal"
|
||||
version = "0.3.3"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b8d71a343838c462ace0531b2f5556fd1ea6b677d7a3e61ac28251e87d158c47"
|
||||
checksum = "d91a9978a505750f606a1fcf1efd5970d20521310e886839f2ad95c31354e54e"
|
||||
dependencies = [
|
||||
"darling 0.14.4",
|
||||
"quote",
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ anyhow = "1.0"
|
|||
async-trait = "0.1"
|
||||
clap = { version = "4.2", features = ["derive", "string"] }
|
||||
chrono = "0.4"
|
||||
crunchyroll-rs = { version = "0.3.3", features = ["dash-stream"] }
|
||||
crunchyroll-rs = { version = "0.3.4", features = ["dash-stream"] }
|
||||
ctrlc = "3.2"
|
||||
dirs = "5.0"
|
||||
derive_setters = "0.1"
|
||||
|
|
|
|||
|
|
@ -54,8 +54,7 @@ pub struct Cli {
|
|||
|
||||
#[arg(help = "Use a proxy to route all traffic through")]
|
||||
#[arg(long_help = "Use a proxy to route all traffic through. \
|
||||
Make sure that the proxy can either forward TLS requests, which is needed to bypass the (cloudflare) bot protection, or that it is configured so that the proxy can bypass the protection itself"
|
||||
)]
|
||||
Make sure that the proxy can either forward TLS requests, which is needed to bypass the (cloudflare) bot protection, or that it is configured so that the proxy can bypass the protection itself")]
|
||||
#[clap(long)]
|
||||
#[arg(value_parser = crate::utils::clap::clap_parse_proxy)]
|
||||
proxy: Option<Proxy>,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use anyhow::Result;
|
|||
use chrono::Duration;
|
||||
use crunchyroll_rs::media::{Resolution, Stream, Subtitle, VariantData};
|
||||
use crunchyroll_rs::{Concert, Episode, Locale, MediaCollection, Movie, MusicVideo};
|
||||
use log::{debug, info};
|
||||
use log::{debug, info, warn};
|
||||
use std::cmp::Ordering;
|
||||
use std::collections::BTreeMap;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
|
@ -126,8 +126,24 @@ impl SingleFormat {
|
|||
|
||||
pub async fn stream(&self) -> Result<Stream> {
|
||||
let stream = match &self.source {
|
||||
MediaCollection::Episode(e) => e.streams().await?,
|
||||
MediaCollection::Movie(m) => m.streams().await?,
|
||||
MediaCollection::Episode(e) => {
|
||||
if let Ok(stream) = e.legacy_streams().await {
|
||||
stream
|
||||
} else {
|
||||
let stream = e.streams().await?;
|
||||
warn!("Failed to get stream via legacy endpoint");
|
||||
stream
|
||||
}
|
||||
}
|
||||
MediaCollection::Movie(m) => {
|
||||
if let Ok(stream) = m.legacy_streams().await {
|
||||
stream
|
||||
} else {
|
||||
let stream = m.streams().await?;
|
||||
warn!("Failed to get stream via legacy endpoint");
|
||||
stream
|
||||
}
|
||||
}
|
||||
MediaCollection::MusicVideo(mv) => mv.streams().await?,
|
||||
MediaCollection::Concert(c) => c.streams().await?,
|
||||
_ => unreachable!(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue