Compare commits
No commits in common. "edb5ab0abb4f2cc0d7f9c016720511196d79365d" and "95ab7c91c68c1102a1ed3e2463a4f75021782b25" have entirely different histories.
edb5ab0abb
...
95ab7c91c6
4 changed files with 335 additions and 511 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.22.0"
|
base64 = "0.21.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()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[test]
|
||||||
async fn t_extract_desktop_client_version() {
|
fn t_extract_desktop_client_version() {
|
||||||
let rp = RustyPipe::new();
|
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);
|
assert!(get_major_version(&version) >= 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[test]
|
||||||
async fn t_extract_music_client_version() {
|
fn t_extract_music_client_version() {
|
||||||
let rp = RustyPipe::new();
|
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);
|
assert!(get_major_version(&version) >= 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[test]
|
||||||
async fn t_get_visitor_data() {
|
fn t_get_visitor_data() {
|
||||||
let rp = RustyPipe::new();
|
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!(
|
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");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[test]
|
||||||
async fn t_get_player_js_url() {
|
fn t_get_player_js_url() {
|
||||||
let client = Client::new();
|
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!(url.starts_with("https://www.youtube.com/s/player"));
|
||||||
assert_eq!(url.len(), 73);
|
assert_eq!(url.len(), 73);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[test]
|
||||||
async fn t_update() {
|
fn t_update() {
|
||||||
let client = Client::new();
|
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 = Deobfuscator::new(&deobf_data).unwrap();
|
||||||
|
|
||||||
let deobf_sig = deobf.deobfuscate_sig("GOqGOqGOq0QJ8wRAIgaryQHfplJ9xJSKFywyaSMHuuwZYsoMTAvRvfm51qIGECIA5061zWeyfMPX9hEl_U6f9J0tr7GTJMKyPf5XNrJb5fb5i").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