fix: handle age restricted channels

refactor! rename ExtractionError::VideoUnavailable to ExtractionError::Unavailable
This commit is contained in:
ThetaDev 2023-11-05 22:43:04 +01:00
parent b145080631
commit 1a22dc835a
7 changed files with 1200 additions and 51 deletions

View file

@ -36,7 +36,7 @@ pub(crate) struct TabRendererWrap {
pub(crate) struct TabRenderer {
#[serde(default)]
pub content: TabContent,
pub endpoint: ChannelTabEndpoint,
pub endpoint: Option<ChannelTabEndpoint>,
}
#[serde_as]
@ -148,10 +148,16 @@ pub(crate) struct MicroformatDataRenderer {
#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct ChannelAbout {
#[serde_as(as = "VecSkipError<_>")]
pub on_response_received_endpoints: Vec<ContinuationActionWrap<AboutChannelRendererWrap>>,
#[serde(untagged)]
pub(crate) enum ChannelAbout {
#[serde(rename_all = "camelCase")]
ReceivedEndpoints {
#[serde_as(as = "VecSkipError<_>")]
on_response_received_endpoints: Vec<ContinuationActionWrap<AboutChannelRendererWrap>>,
},
Content {
contents: Option<Contents>,
},
}
#[derive(Debug, Deserialize)]