Compare commits
2 commits
95ab7c91c6
...
edb5ab0abb
Author | SHA1 | Date | |
---|---|---|---|
edb5ab0abb | |||
eecabffd18 |
4 changed files with 511 additions and 335 deletions
|
@ -58,7 +58,7 @@ time = { version = "0.3.15", features = [
|
||||||
futures = "0.3.21"
|
futures = "0.3.21"
|
||||||
ress = "0.11.4"
|
ress = "0.11.4"
|
||||||
phf = "0.11.1"
|
phf = "0.11.1"
|
||||||
base64 = "0.21.0"
|
base64 = "0.22.0"
|
||||||
urlencoding = "2.1.2"
|
urlencoding = "2.1.2"
|
||||||
quick-xml = { version = "0.31.0", features = ["serialize"], optional = true }
|
quick-xml = { version = "0.31.0", features = ["serialize"], optional = true }
|
||||||
tracing = { version = "0.1.37", features = ["log"] }
|
tracing = { version = "0.1.37", features = ["log"] }
|
||||||
|
|
|
@ -1602,24 +1602,24 @@ mod tests {
|
||||||
parts[0].parse().unwrap()
|
parts[0].parse().unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[tokio::test]
|
||||||
fn t_extract_desktop_client_version() {
|
async fn t_extract_desktop_client_version() {
|
||||||
let rp = RustyPipe::new();
|
let rp = RustyPipe::new();
|
||||||
let version = tokio_test::block_on(rp.extract_desktop_client_version()).unwrap();
|
let version = rp.extract_desktop_client_version().await.unwrap();
|
||||||
assert!(get_major_version(&version) >= 2);
|
assert!(get_major_version(&version) >= 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[tokio::test]
|
||||||
fn t_extract_music_client_version() {
|
async fn t_extract_music_client_version() {
|
||||||
let rp = RustyPipe::new();
|
let rp = RustyPipe::new();
|
||||||
let version = tokio_test::block_on(rp.extract_music_client_version()).unwrap();
|
let version = rp.extract_music_client_version().await.unwrap();
|
||||||
assert!(get_major_version(&version) >= 1);
|
assert!(get_major_version(&version) >= 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[tokio::test]
|
||||||
fn t_get_visitor_data() {
|
async fn t_get_visitor_data() {
|
||||||
let rp = RustyPipe::new();
|
let rp = RustyPipe::new();
|
||||||
let visitor_data = tokio_test::block_on(rp.get_visitor_data()).unwrap();
|
let visitor_data = rp.get_visitor_data().await.unwrap();
|
||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
visitor_data.starts_with("Cg") && visitor_data.len() > 23,
|
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");
|
assert_eq!(res, "nrkec0fwgTWolw");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[tokio::test]
|
||||||
fn t_get_player_js_url() {
|
async fn t_get_player_js_url() {
|
||||||
let client = Client::new();
|
let client = Client::new();
|
||||||
let url = tokio_test::block_on(get_player_js_url(&client)).unwrap();
|
let url = get_player_js_url(&client).await.unwrap();
|
||||||
assert!(url.starts_with("https://www.youtube.com/s/player"));
|
assert!(url.starts_with("https://www.youtube.com/s/player"));
|
||||||
assert_eq!(url.len(), 73);
|
assert_eq!(url.len(), 73);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[tokio::test]
|
||||||
fn t_update() {
|
async fn t_update() {
|
||||||
let client = Client::new();
|
let client = Client::new();
|
||||||
let deobf_data = tokio_test::block_on(DeobfData::extract(client, None)).unwrap();
|
let deobf_data = DeobfData::extract(client, None).await.unwrap();
|
||||||
let deobf = Deobfuscator::new(&deobf_data).unwrap();
|
let deobf = Deobfuscator::new(&deobf_data).unwrap();
|
||||||
|
|
||||||
let deobf_sig = deobf.deobfuscate_sig("GOqGOqGOq0QJ8wRAIgaryQHfplJ9xJSKFywyaSMHuuwZYsoMTAvRvfm51qIGECIA5061zWeyfMPX9hEl_U6f9J0tr7GTJMKyPf5XNrJb5fb5i").unwrap();
|
let deobf_sig = deobf.deobfuscate_sig("GOqGOqGOq0QJ8wRAIgaryQHfplJ9xJSKFywyaSMHuuwZYsoMTAvRvfm51qIGECIA5061zWeyfMPX9hEl_U6f9J0tr7GTJMKyPf5XNrJb5fb5i").unwrap();
|
||||||
|
|
754
tests/youtube.rs
754
tests/youtube.rs
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue