Compare commits
No commits in common. "9743b3f9dc6b6d3e0c45c96ae8375149eb56743e" and "95ab7c91c68c1102a1ed3e2463a4f75021782b25" have entirely different histories.
9743b3f9dc
...
95ab7c91c6
4 changed files with 336 additions and 520 deletions
|
@ -15,7 +15,7 @@ include = ["/src", "README.md", "LICENSE", "!snapshots"]
|
|||
members = [".", "codegen", "downloader", "cli"]
|
||||
|
||||
[features]
|
||||
default = ["rustls-tls-native-roots"]
|
||||
default = ["default-tls"]
|
||||
|
||||
rss = ["quick-xml"]
|
||||
|
||||
|
@ -27,9 +27,6 @@ native-tls-vendored = ["reqwest/native-tls-vendored"]
|
|||
rustls-tls-webpki-roots = ["reqwest/rustls-tls-webpki-roots"]
|
||||
rustls-tls-native-roots = ["reqwest/rustls-tls-native-roots"]
|
||||
|
||||
# Requires RUSTFLAGS='--cfg reqwest_unstable'
|
||||
http3 = ["reqwest/http3"]
|
||||
|
||||
[dependencies]
|
||||
quick-js-dtp = { version = "0.4.1", default-features = false, features = [
|
||||
"patch-dateparser",
|
||||
|
@ -61,7 +58,7 @@ time = { version = "0.3.15", features = [
|
|||
futures = "0.3.21"
|
||||
ress = "0.11.4"
|
||||
phf = "0.11.1"
|
||||
base64 = "0.22.0"
|
||||
base64 = "0.21.0"
|
||||
urlencoding = "2.1.2"
|
||||
quick-xml = { version = "0.31.0", features = ["serialize"], optional = true }
|
||||
tracing = { version = "0.1.37", features = ["log"] }
|
||||
|
|
|
@ -466,11 +466,6 @@ impl RustyPipeBuilder {
|
|||
.brotli(true)
|
||||
.redirect(reqwest::redirect::Policy::none());
|
||||
|
||||
#[cfg(feature = "http3")]
|
||||
{
|
||||
client_builder = client_builder.http3_prior_knowledge();
|
||||
}
|
||||
|
||||
if let Some(timeout) = self.timeout.or_default(|| Duration::from_secs(20)) {
|
||||
client_builder = client_builder.timeout(timeout);
|
||||
}
|
||||
|
@ -1607,24 +1602,24 @@ mod tests {
|
|||
parts[0].parse().unwrap()
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn t_extract_desktop_client_version() {
|
||||
#[test]
|
||||
fn t_extract_desktop_client_version() {
|
||||
let rp = RustyPipe::new();
|
||||
let version = rp.extract_desktop_client_version().await.unwrap();
|
||||
let version = tokio_test::block_on(rp.extract_desktop_client_version()).unwrap();
|
||||
assert!(get_major_version(&version) >= 2);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn t_extract_music_client_version() {
|
||||
#[test]
|
||||
fn t_extract_music_client_version() {
|
||||
let rp = RustyPipe::new();
|
||||
let version = rp.extract_music_client_version().await.unwrap();
|
||||
let version = tokio_test::block_on(rp.extract_music_client_version()).unwrap();
|
||||
assert!(get_major_version(&version) >= 1);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn t_get_visitor_data() {
|
||||
#[test]
|
||||
fn t_get_visitor_data() {
|
||||
let rp = RustyPipe::new();
|
||||
let visitor_data = rp.get_visitor_data().await.unwrap();
|
||||
let visitor_data = tokio_test::block_on(rp.get_visitor_data()).unwrap();
|
||||
|
||||
assert!(
|
||||
visitor_data.starts_with("Cg") && visitor_data.len() > 23,
|
||||
|
|
|
@ -426,18 +426,18 @@ c[36](c[8],c[32]),c[20](c[25],c[10]),c[2](c[22],c[8]),c[32](c[20],c[16]),c[32](c
|
|||
assert_eq!(res, "nrkec0fwgTWolw");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn t_get_player_js_url() {
|
||||
#[test]
|
||||
fn t_get_player_js_url() {
|
||||
let client = Client::new();
|
||||
let url = get_player_js_url(&client).await.unwrap();
|
||||
let url = tokio_test::block_on(get_player_js_url(&client)).unwrap();
|
||||
assert!(url.starts_with("https://www.youtube.com/s/player"));
|
||||
assert_eq!(url.len(), 73);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn t_update() {
|
||||
#[test]
|
||||
fn t_update() {
|
||||
let client = Client::new();
|
||||
let deobf_data = DeobfData::extract(client, None).await.unwrap();
|
||||
let deobf_data = tokio_test::block_on(DeobfData::extract(client, None)).unwrap();
|
||||
let deobf = Deobfuscator::new(&deobf_data).unwrap();
|
||||
|
||||
let deobf_sig = deobf.deobfuscate_sig("GOqGOqGOq0QJ8wRAIgaryQHfplJ9xJSKFywyaSMHuuwZYsoMTAvRvfm51qIGECIA5061zWeyfMPX9hEl_U6f9J0tr7GTJMKyPf5XNrJb5fb5i").unwrap();
|
||||
|
|
814
tests/youtube.rs
814
tests/youtube.rs
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue