fix: add visitor_data to recommendation paginator

This commit is contained in:
ThetaDev 2022-10-17 23:32:12 +02:00
parent 39fca50731
commit 3a0db09e23
18 changed files with 155 additions and 124 deletions

View file

@ -193,6 +193,12 @@ pub struct ContinuationAction {
pub continuation_items: MapResult<Vec<YouTubeListItem>>,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ResponseContext {
pub visitor_data: Option<String>,
}
// YouTube Music
#[serde_as]

View file

@ -1,7 +1,7 @@
use serde::Deserialize;
use serde_with::{serde_as, VecSkipError};
use super::{video_item::YouTubeListRendererWrap, ContentRenderer};
use super::{video_item::YouTubeListRendererWrap, ContentRenderer, ResponseContext};
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
@ -35,9 +35,3 @@ pub struct BrowseResults {
pub struct Tab<T> {
pub tab_renderer: ContentRenderer<T>,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ResponseContext {
pub visitor_data: Option<String>,
}

View file

@ -10,11 +10,11 @@ use crate::serializer::{
MapResult, VecLogError,
};
use super::YouTubeListItem;
use super::{
url_endpoint::BrowseEndpoint, ContinuationEndpoint, ContinuationItemRenderer, Icon,
MusicContinuation, Thumbnails, VideoOwner,
};
use super::{ResponseContext, YouTubeListItem};
/*
#VIDEO DETAILS
@ -32,6 +32,7 @@ pub struct VideoDetails {
/// Video chapters + comment section
#[serde_as(as = "VecLogError<_>")]
pub engagement_panels: MapResult<Vec<EngagementPanel>>,
pub response_context: ResponseContext,
}
/// Video details main object, contains video metadata and recommended videos