feat: get YouTube visitor data

This commit is contained in:
ThetaDev 2022-10-28 18:49:10 +02:00
parent 4ebee5856e
commit 1c0c64a8bf
40 changed files with 62 additions and 5 deletions

View file

@ -3,7 +3,7 @@ use serde_with::serde_as;
use serde_with::{DefaultOnError, VecSkipError};
use super::url_endpoint::NavigationEndpoint;
use super::{Alert, ChannelBadge};
use super::{Alert, ChannelBadge, ResponseContext};
use super::{ContentRenderer, ContentsRenderer};
use super::{Thumbnails, YouTubeListItem};
use crate::serializer::ignore_any;
@ -21,6 +21,7 @@ pub(crate) struct Channel {
pub microformat: Option<Microformat>,
#[serde_as(as = "Option<DefaultOnError>")]
pub alerts: Option<Vec<Alert>>,
pub response_context: ResponseContext,
}
#[derive(Debug, Deserialize)]

View file

@ -4,7 +4,7 @@ use serde::Deserialize;
use serde_with::serde_as;
use serde_with::{json::JsonString, DefaultOnError};
use super::Thumbnails;
use super::{ResponseContext, Thumbnails};
use crate::serializer::{text::Text, MapResult, VecLogError};
#[derive(Debug, Deserialize)]
@ -14,6 +14,7 @@ pub(crate) struct Player {
pub streaming_data: Option<StreamingData>,
pub captions: Option<Captions>,
pub video_details: Option<VideoDetails>,
pub response_context: ResponseContext,
}
#[derive(Debug, Deserialize)]

View file

@ -6,7 +6,8 @@ use crate::serializer::{ignore_any, MapResult, VecLogError};
use crate::util::MappingError;
use super::{
Alert, ContentRenderer, ContentsRenderer, ContinuationEndpoint, Thumbnails, ThumbnailsWrap,
Alert, ContentRenderer, ContentsRenderer, ContinuationEndpoint, ResponseContext, Thumbnails,
ThumbnailsWrap,
};
#[serde_as]
@ -18,6 +19,7 @@ pub(crate) struct Playlist {
pub sidebar: Option<Sidebar>,
#[serde_as(as = "Option<DefaultOnError>")]
pub alerts: Option<Vec<Alert>>,
pub response_context: ResponseContext,
}
#[serde_as]

View file

@ -1,7 +1,7 @@
use serde::Deserialize;
use serde_with::{json::JsonString, serde_as};
use super::video_item::YouTubeListRendererWrap;
use super::{video_item::YouTubeListRendererWrap, ResponseContext};
#[serde_as]
#[derive(Debug, Deserialize)]
@ -10,6 +10,7 @@ pub(crate) struct Search {
#[serde_as(as = "Option<JsonString>")]
pub estimated_results: Option<u64>,
pub contents: Contents,
pub response_context: ResponseContext,
}
#[derive(Debug, Deserialize)]