feat: remove manual PO token options from downloader/cli, add new rustypipe-botguard options

This commit is contained in:
ThetaDev 2025-02-03 02:48:54 +01:00
parent b90a252a5e
commit cddb32f190
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
3 changed files with 19 additions and 64 deletions

View file

@ -71,7 +71,6 @@ videos can be downloaded in parallel for improved performance.
- `-c`, `--client-type` YT clients used to fetch player data (options: desktop, tv,
tv-embed, android, ios; if multiple clients are specified, they are attempted in
order)
- `--pot` token to circumvent bot detection
## `vdata`: Get visitor data
@ -142,6 +141,11 @@ Fetch a list of all the items saved in your YouTube/YouTube Music profile.
`~/.local/share/rustypipe/rustypipe_cache.json`)
- `--report-dir` Change the RustyPipe report directory location (Default:
`~/.local/share/rustypipe/rustypipe_reports`)
- `--botguard-bin` Use a
[rustypipe-botguard](https://codeberg.org/ThetaDev/rustypipe-botguard) binary from the
given path for generating PO tokens
- `--no-botguard` Disable Botguard, only download videos using clients that dont require
it
### Output format

View file

@ -2,6 +2,7 @@
#![warn(clippy::todo, clippy::dbg_macro)]
use std::{
ffi::OsString,
path::PathBuf,
str::FromStr,
sync::{atomic::AtomicUsize, Arc},
@ -63,6 +64,12 @@ struct Cli {
/// RustyPipe report folder
#[clap(long, global = true)]
report_dir: Option<PathBuf>,
/// Path to rustypipe-botguard binary
#[clap(long, global = true)]
botguard_bin: Option<OsString>,
/// Disable Botguard
#[clap(long, global = true)]
no_botguard: bool,
}
#[derive(Parser)]
@ -130,9 +137,6 @@ enum Commands {
/// YT Client used to fetch player data
#[clap(short, long)]
client_type: Option<Vec<ClientTypeArg>>,
/// `pot` token to circumvent bot detection
#[clap(long)]
pot: Option<String>,
},
/// Extract video, playlist, album or channel data
Get {
@ -903,6 +907,12 @@ async fn run() -> anyhow::Result<()> {
if let Some(country) = cli.country {
rp = rp.country(Country::from_str(&country.to_ascii_uppercase()).expect("invalid country"));
}
if let Some(botguard_bin) = cli.botguard_bin {
rp = rp.botguard_bin(botguard_bin);
}
if cli.no_botguard {
rp = rp.no_botguard();
}
if cli.auth {
rp = rp.authenticated();
}
@ -918,7 +928,6 @@ async fn run() -> anyhow::Result<()> {
music,
limit,
client_type,
pot,
} => {
let url_target = rp.query().resolve_string(&id, false).await?;
@ -940,9 +949,6 @@ async fn run() -> anyhow::Result<()> {
dl = dl.audio_tag().crop_cover();
filter = filter.no_video();
}
if let Some(pot) = pot {
dl = dl.pot(pot);
}
let dl = dl.stream_filter(filter).build();
let cts = client_type.map(|c| c.into_iter().map(ClientType::from).collect::<Vec<_>>());