feat: add channel_videos
refactor: unify VideoListItem
This commit is contained in:
parent
86a348f210
commit
67ae1eb21d
19 changed files with 39591 additions and 100 deletions
|
|
@ -18,6 +18,7 @@ pub async fn download_testfiles(project_root: &Path) {
|
|||
playlist(&testfiles),
|
||||
video_details(&testfiles),
|
||||
comments_top(&testfiles),
|
||||
channel_videos(&testfiles),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -159,3 +160,22 @@ async fn comments_top(testfiles: &Path) {
|
|||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
async fn channel_videos(testfiles: &Path) {
|
||||
for (name, id) in [
|
||||
("base", "UC2DjFE7Xf11URZqWBigcVOQ"),
|
||||
("music", "UC_vmjW5e1xEHhYjY2a0kK1A"), // YouTube Music channels have no videos
|
||||
("shorts", "UCh8gHdtzO2tXd593_bjErWg"), // shorts and livestreams are rendered differently
|
||||
("live", "UChs0pSaEoNLV4mevBFGaoKA"),
|
||||
] {
|
||||
let mut json_path = testfiles.to_path_buf();
|
||||
json_path.push("channel");
|
||||
json_path.push(format!("channel_videos_{}.json", name));
|
||||
if json_path.exists() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let rp = rp_testfile(&json_path);
|
||||
rp.query().channel_videos(id).await.unwrap();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue