fix: add new attributed_text description
add mapping tests for video_details
This commit is contained in:
parent
0659a64361
commit
bf97f31173
19 changed files with 32747 additions and 9856 deletions
|
|
@ -18,6 +18,8 @@ pub async fn download_testfiles(project_root: &Path) {
|
|||
playlist(&testfiles),
|
||||
video_details(&testfiles),
|
||||
comments_top(&testfiles),
|
||||
comments_latest(&testfiles),
|
||||
recommendations(&testfiles),
|
||||
channel_videos(&testfiles),
|
||||
);
|
||||
}
|
||||
|
|
@ -161,6 +163,39 @@ async fn comments_top(testfiles: &Path) {
|
|||
.unwrap();
|
||||
}
|
||||
|
||||
async fn comments_latest(testfiles: &Path) {
|
||||
let mut json_path = testfiles.to_path_buf();
|
||||
json_path.push("video_details");
|
||||
json_path.push("comments_latest.json");
|
||||
if json_path.exists() {
|
||||
return;
|
||||
}
|
||||
|
||||
let rp = RustyPipe::new();
|
||||
let details = rp.query().video_details("ZeerrnuLi5E").await.unwrap();
|
||||
|
||||
let rp = rp_testfile(&json_path);
|
||||
rp.query()
|
||||
.video_comments(&details.latest_comments.ctoken.unwrap())
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
async fn recommendations(testfiles: &Path) {
|
||||
let mut json_path = testfiles.to_path_buf();
|
||||
json_path.push("video_details");
|
||||
json_path.push("recommendations.json");
|
||||
if json_path.exists() {
|
||||
return;
|
||||
}
|
||||
|
||||
let rp = RustyPipe::new();
|
||||
let details = rp.query().video_details("ZeerrnuLi5E").await.unwrap();
|
||||
|
||||
let rp = rp_testfile(&json_path);
|
||||
details.recommended.next(rp.query()).await.unwrap();
|
||||
}
|
||||
|
||||
async fn channel_videos(testfiles: &Path) {
|
||||
for (name, id) in [
|
||||
("base", "UC2DjFE7Xf11URZqWBigcVOQ"),
|
||||
|
|
|
|||
Reference in a new issue