fix: a/b test 11: parsing like count with new data model

This commit is contained in:
ThetaDev 2023-11-04 02:46:17 +01:00
parent 53cc9f1a27
commit 4d124c6d98
4 changed files with 100 additions and 7 deletions

View file

@ -27,6 +27,7 @@ pub enum ABTest {
TrackViewcount = 8,
PlaylistsForShorts = 9,
ChannelAboutModal = 10,
LikeButtonViewmodel = 11,
}
const TESTS_TO_RUN: [ABTest; 3] = [
@ -100,6 +101,7 @@ pub async fn run_test(
ABTest::PlaylistsForShorts => playlists_for_shorts(&query).await,
ABTest::TrackViewcount => track_viewcount(&query).await,
ABTest::ChannelAboutModal => channel_about_modal(&query).await,
ABTest::LikeButtonViewmodel => like_button_viewmodel(&query).await,
}
.unwrap();
pb.inc(1);
@ -301,3 +303,19 @@ pub async fn channel_about_modal(rp: &RustyPipeQuery) -> Result<bool> {
.unwrap();
Ok(!res.contains("\"EgVhYm91dPIGBAoCEgA%3D\""))
}
pub async fn like_button_viewmodel(rp: &RustyPipeQuery) -> Result<bool> {
let res = rp
.raw(
ClientType::Desktop,
"next",
&QVideo {
context: rp.get_context(ClientType::Desktop, true, None).await,
video_id: "ZeerrnuLi5E",
content_check_ok: true,
racy_check_ok: true,
},
)
.await?;
Ok(res.contains("\"segmentedLikeDislikeButtonViewModel\""))
}