fix: remove clone from response models

This commit is contained in:
ThetaDev 2022-10-09 14:52:22 +02:00
parent a3e3269fb3
commit 6251ec1bd9
10 changed files with 176 additions and 174 deletions

View file

@ -991,12 +991,14 @@ impl RustyPipeQuery {
if !mapres.warnings.is_empty() { if !mapres.warnings.is_empty() {
create_report( create_report(
Level::WRN, Level::WRN,
Some(ExtractionError::Warnings.to_string()), Some(ExtractionError::DeserializationWarnings.to_string()),
mapres.warnings, mapres.warnings,
); );
if self.opts.strict { if self.opts.strict {
return Err(Error::Extraction(ExtractionError::Warnings)); return Err(Error::Extraction(
ExtractionError::DeserializationWarnings,
));
} }
} else if self.opts.report { } else if self.opts.report {
create_report(Level::DBG, None, vec![]); create_report(Level::DBG, None, vec![]);

View file

@ -9,7 +9,7 @@ use crate::serializer::ignore_any;
use crate::serializer::{text::Text, MapResult, VecLogError}; use crate::serializer::{text::Text, MapResult, VecLogError};
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Channel { pub struct Channel {
pub header: Header, pub header: Header,
@ -19,13 +19,13 @@ pub struct Channel {
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ChannelCont { pub struct ChannelCont {
pub on_response_received_actions: Vec<OnResponseReceivedAction>, pub on_response_received_actions: Vec<OnResponseReceivedAction>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Contents { pub struct Contents {
pub two_column_browse_results_renderer: TabsRenderer, pub two_column_browse_results_renderer: TabsRenderer,
@ -34,26 +34,26 @@ pub struct Contents {
/// YouTube channel tab view. Contains multiple tabs /// YouTube channel tab view. Contains multiple tabs
/// (Home, Videos, Playlists, About...). We can ignore unknown tabs. /// (Home, Videos, Playlists, About...). We can ignore unknown tabs.
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct TabsRenderer { pub struct TabsRenderer {
#[serde_as(as = "VecSkipError<_>")] #[serde_as(as = "VecSkipError<_>")]
pub tabs: Vec<TabRendererWrap>, pub tabs: Vec<TabRendererWrap>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct TabRendererWrap { pub struct TabRendererWrap {
pub tab_renderer: ContentRenderer<SectionListRendererWrap>, pub tab_renderer: ContentRenderer<SectionListRendererWrap>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct SectionListRendererWrap { pub struct SectionListRendererWrap {
pub section_list_renderer: SectionListRenderer, pub section_list_renderer: SectionListRenderer,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct SectionListRenderer { pub struct SectionListRenderer {
pub contents: Vec<ItemSectionRendererWrap>, pub contents: Vec<ItemSectionRendererWrap>,
@ -63,14 +63,14 @@ pub struct SectionListRenderer {
pub target_id: Option<String>, pub target_id: Option<String>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ItemSectionRendererWrap { pub struct ItemSectionRendererWrap {
pub item_section_renderer: ContentsRenderer<ChannelContent>, pub item_section_renderer: ContentsRenderer<ChannelContent>,
} }
#[serde_as] #[serde_as]
#[derive(Default, Clone, Debug, Deserialize)] #[derive(Default, Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum ChannelContent { pub enum ChannelContent {
GridRenderer { GridRenderer {
@ -83,14 +83,14 @@ pub enum ChannelContent {
None, None,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Header { pub struct Header {
pub c4_tabbed_header_renderer: HeaderRenderer, pub c4_tabbed_header_renderer: HeaderRenderer,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct HeaderRenderer { pub struct HeaderRenderer {
pub channel_id: String, pub channel_id: String,
@ -114,26 +114,26 @@ pub struct HeaderRenderer {
pub tv_banner: Thumbnails, pub tv_banner: Thumbnails,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Metadata { pub struct Metadata {
pub channel_metadata_renderer: ChannelMetadataRenderer, pub channel_metadata_renderer: ChannelMetadataRenderer,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ChannelMetadataRenderer { pub struct ChannelMetadataRenderer {
pub description: String, pub description: String,
pub vanity_channel_url: Option<String>, pub vanity_channel_url: Option<String>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Microformat { pub struct Microformat {
pub microformat_data_renderer: MicroformatDataRenderer, pub microformat_data_renderer: MicroformatDataRenderer,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MicroformatDataRenderer { pub struct MicroformatDataRenderer {
#[serde(default)] #[serde(default)]
@ -141,7 +141,7 @@ pub struct MicroformatDataRenderer {
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ChannelFullMetadata { pub struct ChannelFullMetadata {
#[serde_as(as = "Text")] #[serde_as(as = "Text")]
@ -153,7 +153,7 @@ pub struct ChannelFullMetadata {
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PrimaryLink { pub struct PrimaryLink {
#[serde_as(as = "Text")] #[serde_as(as = "Text")]
@ -161,26 +161,26 @@ pub struct PrimaryLink {
pub navigation_endpoint: NavigationEndpoint, pub navigation_endpoint: NavigationEndpoint,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct NavigationEndpoint { pub struct NavigationEndpoint {
pub url_endpoint: UrlEndpoint, pub url_endpoint: UrlEndpoint,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct UrlEndpoint { pub struct UrlEndpoint {
pub url: String, pub url: String,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct OnResponseReceivedAction { pub struct OnResponseReceivedAction {
pub append_continuation_items_action: AppendAction, pub append_continuation_items_action: AppendAction,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct AppendAction { pub struct AppendAction {
#[serde_as(as = "VecLogError<_>")] #[serde_as(as = "VecLogError<_>")]

View file

@ -3,7 +3,7 @@ use serde::Deserialize;
use super::Thumbnail; use super::Thumbnail;
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct ChannelRss { pub struct ChannelRss {
#[serde(rename = "$unflatten=yt:channelId")] #[serde(rename = "$unflatten=yt:channelId")]
pub channel_id: String, pub channel_id: String,
@ -14,7 +14,7 @@ pub struct ChannelRss {
pub entry: Vec<Entry>, pub entry: Vec<Entry>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct Entry { pub struct Entry {
#[serde(rename = "$unflatten=yt:videoId")] #[serde(rename = "$unflatten=yt:videoId")]
pub video_id: String, pub video_id: String,
@ -28,7 +28,7 @@ pub struct Entry {
pub media_group: MediaGroup, pub media_group: MediaGroup,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct MediaGroup { pub struct MediaGroup {
#[serde(rename = "$unflatten=media:thumbnail")] #[serde(rename = "$unflatten=media:thumbnail")]
pub thumbnail: Thumbnail, pub thumbnail: Thumbnail,
@ -38,7 +38,7 @@ pub struct MediaGroup {
pub community: Community, pub community: Community,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct Community { pub struct Community {
#[serde(rename = "$unflatten=media:starRating")] #[serde(rename = "$unflatten=media:starRating")]
pub rating: Rating, pub rating: Rating,
@ -46,12 +46,12 @@ pub struct Community {
pub statistics: Statistics, pub statistics: Statistics,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct Rating { pub struct Rating {
pub count: u32, pub count: u32,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct Statistics { pub struct Statistics {
pub views: u64, pub views: u64,
} }

View file

@ -27,20 +27,20 @@ use crate::serializer::{
text::{Text, TextComponent}, text::{Text, TextComponent},
}; };
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ContentRenderer<T> { pub struct ContentRenderer<T> {
pub content: T, pub content: T,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ContentsRenderer<T> { pub struct ContentsRenderer<T> {
#[serde(alias = "tabs")] #[serde(alias = "tabs")]
pub contents: Vec<T>, pub contents: Vec<T>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ThumbnailsWrap { pub struct ThumbnailsWrap {
#[serde(default)] #[serde(default)]
@ -49,14 +49,14 @@ pub struct ThumbnailsWrap {
/// List of images in different resolutions. /// List of images in different resolutions.
/// Not only used for thumbnails, but also for avatars and banners. /// Not only used for thumbnails, but also for avatars and banners.
#[derive(Default, Clone, Debug, Deserialize)] #[derive(Default, Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Thumbnails { pub struct Thumbnails {
#[serde(default)] #[serde(default)]
pub thumbnails: Vec<Thumbnail>, pub thumbnails: Vec<Thumbnail>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Thumbnail { pub struct Thumbnail {
pub url: String, pub url: String,
@ -64,7 +64,7 @@ pub struct Thumbnail {
pub height: u32, pub height: u32,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum VideoListItem { pub enum VideoListItem {
GridVideoRenderer(GridVideoRenderer), GridVideoRenderer(GridVideoRenderer),
@ -90,7 +90,7 @@ pub enum VideoListItem {
/// Video displayed on a channel page /// Video displayed on a channel page
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct GridVideoRenderer { pub struct GridVideoRenderer {
pub video_id: String, pub video_id: String,
@ -111,7 +111,7 @@ pub struct GridVideoRenderer {
/// Video displayed in recommendations /// Video displayed in recommendations
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CompactVideoRenderer { pub struct CompactVideoRenderer {
pub video_id: String, pub video_id: String,
@ -145,7 +145,7 @@ pub struct CompactVideoRenderer {
/// Video displayed in a playlist /// Video displayed in a playlist
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PlaylistVideoRenderer { pub struct PlaylistVideoRenderer {
pub video_id: String, pub video_id: String,
@ -160,7 +160,7 @@ pub struct PlaylistVideoRenderer {
/// Playlist displayed on a channel page /// Playlist displayed on a channel page
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct GridPlaylistRenderer { pub struct GridPlaylistRenderer {
pub playlist_id: String, pub playlist_id: String,
@ -172,7 +172,7 @@ pub struct GridPlaylistRenderer {
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct UpcomingEventData { pub struct UpcomingEventData {
/// Unixtime in seconds /// Unixtime in seconds
@ -180,26 +180,26 @@ pub struct UpcomingEventData {
pub start_time: i64, pub start_time: i64,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ContinuationItemRenderer { pub struct ContinuationItemRenderer {
pub continuation_endpoint: ContinuationEndpoint, pub continuation_endpoint: ContinuationEndpoint,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ContinuationEndpoint { pub struct ContinuationEndpoint {
pub continuation_command: ContinuationCommand, pub continuation_command: ContinuationCommand,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ContinuationCommand { pub struct ContinuationCommand {
pub token: String, pub token: String,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Icon { pub struct Icon {
pub icon_type: IconType, pub icon_type: IconType,
@ -216,14 +216,14 @@ pub enum IconType {
Like, Like,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct VideoOwner { pub struct VideoOwner {
pub video_owner_renderer: VideoOwnerRenderer, pub video_owner_renderer: VideoOwnerRenderer,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct VideoOwnerRenderer { pub struct VideoOwnerRenderer {
pub title: TextComponent, pub title: TextComponent,
@ -235,13 +235,13 @@ pub struct VideoOwnerRenderer {
pub badges: Vec<ChannelBadge>, pub badges: Vec<ChannelBadge>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ChannelBadge { pub struct ChannelBadge {
pub metadata_badge_renderer: ChannelBadgeRenderer, pub metadata_badge_renderer: ChannelBadgeRenderer,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ChannelBadgeRenderer { pub struct ChannelBadgeRenderer {
pub style: ChannelBadgeStyle, pub style: ChannelBadgeStyle,
@ -254,14 +254,14 @@ pub enum ChannelBadgeStyle {
BadgeStyleTypeVerifiedArtist, BadgeStyleTypeVerifiedArtist,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct TimeOverlay { pub struct TimeOverlay {
pub thumbnail_overlay_time_status_renderer: TimeOverlayRenderer, pub thumbnail_overlay_time_status_renderer: TimeOverlayRenderer,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct TimeOverlayRenderer { pub struct TimeOverlayRenderer {
/// `29:54` /// `29:54`
@ -285,7 +285,7 @@ pub enum TimeOverlayStyle {
/// Badges are displayed on the video thumbnail and /// Badges are displayed on the video thumbnail and
/// show certain video properties (e.g. active livestream) /// show certain video properties (e.g. active livestream)
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct VideoBadge { pub struct VideoBadge {
pub metadata_badge_renderer: VideoBadgeRenderer, pub metadata_badge_renderer: VideoBadgeRenderer,
@ -293,7 +293,7 @@ pub struct VideoBadge {
/// Badges are displayed on the video thumbnail and /// Badges are displayed on the video thumbnail and
/// show certain video properties (e.g. active livestream) /// show certain video properties (e.g. active livestream)
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct VideoBadgeRenderer { pub struct VideoBadgeRenderer {
pub style: VideoBadgeStyle, pub style: VideoBadgeStyle,
@ -309,7 +309,7 @@ pub enum VideoBadgeStyle {
// YouTube Music // YouTube Music
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MusicItem { pub struct MusicItem {
pub thumbnail: MusicThumbnailRenderer, pub thumbnail: MusicThumbnailRenderer,
@ -322,21 +322,21 @@ pub struct MusicItem {
pub fixed_columns: Vec<MusicColumn>, pub fixed_columns: Vec<MusicColumn>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MusicThumbnailRenderer { pub struct MusicThumbnailRenderer {
#[serde(alias = "croppedSquareThumbnailRenderer")] #[serde(alias = "croppedSquareThumbnailRenderer")]
pub music_thumbnail_renderer: ThumbnailsWrap, pub music_thumbnail_renderer: ThumbnailsWrap,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PlaylistItemData { pub struct PlaylistItemData {
pub video_id: String, pub video_id: String,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MusicContentsRenderer<T> { pub struct MusicContentsRenderer<T> {
pub contents: Vec<T>, pub contents: Vec<T>,
@ -344,7 +344,7 @@ pub struct MusicContentsRenderer<T> {
pub continuations: Option<Vec<MusicContinuation>>, pub continuations: Option<Vec<MusicContinuation>>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct MusicColumn { pub struct MusicColumn {
#[serde( #[serde(
rename = "musicResponsiveListItemFlexColumnRenderer", rename = "musicResponsiveListItemFlexColumnRenderer",
@ -354,18 +354,18 @@ pub struct MusicColumn {
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct MusicColumnRenderer { pub struct MusicColumnRenderer {
pub text: TextComponent, pub text: TextComponent,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MusicContinuation { pub struct MusicContinuation {
pub next_continuation_data: MusicContinuationData, pub next_continuation_data: MusicContinuationData,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MusicContinuationData { pub struct MusicContinuationData {
pub continuation: String, pub continuation: String,

View file

@ -8,7 +8,7 @@ use serde_with::{json::JsonString, DefaultOnError};
use super::Thumbnails; use super::Thumbnails;
use crate::serializer::{text::Text, MapResult, VecLogError}; use crate::serializer::{text::Text, MapResult, VecLogError};
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Player { pub struct Player {
pub playability_status: PlayabilityStatus, pub playability_status: PlayabilityStatus,
@ -18,7 +18,7 @@ pub struct Player {
pub microformat: Option<Microformat>, pub microformat: Option<Microformat>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(tag = "status", rename_all = "SCREAMING_SNAKE_CASE")] #[serde(tag = "status", rename_all = "SCREAMING_SNAKE_CASE")]
pub enum PlayabilityStatus { pub enum PlayabilityStatus {
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
@ -36,11 +36,11 @@ pub enum PlayabilityStatus {
Error { reason: String }, Error { reason: String },
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct Empty {} pub struct Empty {}
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct StreamingData { pub struct StreamingData {
#[serde_as(as = "JsonString")] #[serde_as(as = "JsonString")]
@ -58,7 +58,7 @@ pub struct StreamingData {
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Format { pub struct Format {
pub itag: u32, pub itag: u32,
@ -152,7 +152,7 @@ pub enum FormatType {
FormatStreamTypeOtf, FormatStreamTypeOtf,
} }
#[derive(Default, Clone, Debug, Deserialize)] #[derive(Default, Debug, Deserialize)]
#[serde(default, rename_all = "camelCase")] #[serde(default, rename_all = "camelCase")]
pub struct ColorInfo { pub struct ColorInfo {
pub primaries: Primaries, pub primaries: Primaries,
@ -166,7 +166,7 @@ pub enum Primaries {
ColorPrimariesBt2020, ColorPrimariesBt2020,
} }
#[derive(Default, Clone, Debug, Deserialize)] #[derive(Default, Debug, Deserialize)]
#[serde(default, rename_all = "camelCase")] #[serde(default, rename_all = "camelCase")]
pub struct AudioTrack { pub struct AudioTrack {
pub id: String, pub id: String,
@ -174,20 +174,20 @@ pub struct AudioTrack {
pub audio_is_default: bool, pub audio_is_default: bool,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Captions { pub struct Captions {
pub player_captions_tracklist_renderer: PlayerCaptionsTracklistRenderer, pub player_captions_tracklist_renderer: PlayerCaptionsTracklistRenderer,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PlayerCaptionsTracklistRenderer { pub struct PlayerCaptionsTracklistRenderer {
pub caption_tracks: Vec<CaptionTrack>, pub caption_tracks: Vec<CaptionTrack>,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CaptionTrack { pub struct CaptionTrack {
pub base_url: String, pub base_url: String,
@ -197,7 +197,7 @@ pub struct CaptionTrack {
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct VideoDetails { pub struct VideoDetails {
pub video_id: String, pub video_id: String,
@ -215,7 +215,7 @@ pub struct VideoDetails {
pub is_live_content: bool, pub is_live_content: bool,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Microformat { pub struct Microformat {
#[serde(alias = "microformatDataRenderer")] #[serde(alias = "microformatDataRenderer")]
@ -223,7 +223,7 @@ pub struct Microformat {
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PlayerMicroformatRenderer { pub struct PlayerMicroformatRenderer {
#[serde(alias = "familySafe")] #[serde(alias = "familySafe")]

View file

@ -7,7 +7,7 @@ use crate::serializer::{MapResult, VecLogError};
use super::{ContentRenderer, ContentsRenderer, ThumbnailsWrap, VideoListItem}; use super::{ContentRenderer, ContentsRenderer, ThumbnailsWrap, VideoListItem};
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Playlist { pub struct Playlist {
pub contents: Contents, pub contents: Contents,
@ -16,59 +16,59 @@ pub struct Playlist {
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PlaylistCont { pub struct PlaylistCont {
#[serde_as(as = "VecSkipError<_>")] #[serde_as(as = "VecSkipError<_>")]
pub on_response_received_actions: Vec<OnResponseReceivedAction>, pub on_response_received_actions: Vec<OnResponseReceivedAction>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Contents { pub struct Contents {
pub two_column_browse_results_renderer: ContentsRenderer<Tab>, pub two_column_browse_results_renderer: ContentsRenderer<Tab>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Tab { pub struct Tab {
pub tab_renderer: ContentRenderer<SectionList>, pub tab_renderer: ContentRenderer<SectionList>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct SectionList { pub struct SectionList {
pub section_list_renderer: ContentsRenderer<ItemSection>, pub section_list_renderer: ContentsRenderer<ItemSection>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ItemSection { pub struct ItemSection {
pub item_section_renderer: ContentsRenderer<PlaylistVideoListRenderer>, pub item_section_renderer: ContentsRenderer<PlaylistVideoListRenderer>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PlaylistVideoListRenderer { pub struct PlaylistVideoListRenderer {
pub playlist_video_list_renderer: PlaylistVideoList, pub playlist_video_list_renderer: PlaylistVideoList,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PlaylistVideoList { pub struct PlaylistVideoList {
#[serde_as(as = "VecLogError<_>")] #[serde_as(as = "VecLogError<_>")]
pub contents: MapResult<Vec<VideoListItem>>, pub contents: MapResult<Vec<VideoListItem>>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Header { pub struct Header {
pub playlist_header_renderer: HeaderRenderer, pub playlist_header_renderer: HeaderRenderer,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct HeaderRenderer { pub struct HeaderRenderer {
pub playlist_id: String, pub playlist_id: String,
@ -87,48 +87,48 @@ pub struct HeaderRenderer {
pub byline: Vec<Byline>, pub byline: Vec<Byline>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PlaylistHeaderBanner { pub struct PlaylistHeaderBanner {
pub hero_playlist_thumbnail_renderer: ThumbnailsWrap, pub hero_playlist_thumbnail_renderer: ThumbnailsWrap,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Byline { pub struct Byline {
pub playlist_byline_renderer: BylineRenderer, pub playlist_byline_renderer: BylineRenderer,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct BylineRenderer { pub struct BylineRenderer {
#[serde_as(as = "Text")] #[serde_as(as = "Text")]
pub text: String, pub text: String,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Sidebar { pub struct Sidebar {
pub playlist_sidebar_renderer: SidebarRenderer, pub playlist_sidebar_renderer: SidebarRenderer,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct SidebarRenderer { pub struct SidebarRenderer {
#[serde_as(as = "VecSkipError<_>")] #[serde_as(as = "VecSkipError<_>")]
pub items: Vec<SidebarItemPrimary>, pub items: Vec<SidebarItemPrimary>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct SidebarItemPrimary { pub struct SidebarItemPrimary {
pub playlist_sidebar_primary_info_renderer: SidebarPrimaryInfoRenderer, pub playlist_sidebar_primary_info_renderer: SidebarPrimaryInfoRenderer,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct SidebarPrimaryInfoRenderer { pub struct SidebarPrimaryInfoRenderer {
pub thumbnail_renderer: PlaylistThumbnailRenderer, pub thumbnail_renderer: PlaylistThumbnailRenderer,
@ -139,7 +139,7 @@ pub struct SidebarPrimaryInfoRenderer {
pub stats: Vec<String>, pub stats: Vec<String>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PlaylistThumbnailRenderer { pub struct PlaylistThumbnailRenderer {
// the alternative field name is used by YTM playlists // the alternative field name is used by YTM playlists
@ -147,14 +147,14 @@ pub struct PlaylistThumbnailRenderer {
pub playlist_video_thumbnail_renderer: ThumbnailsWrap, pub playlist_video_thumbnail_renderer: ThumbnailsWrap,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct OnResponseReceivedAction { pub struct OnResponseReceivedAction {
pub append_continuation_items_action: AppendAction, pub append_continuation_items_action: AppendAction,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct AppendAction { pub struct AppendAction {
#[serde_as(as = "VecLogError<_>")] #[serde_as(as = "VecLogError<_>")]

View file

@ -9,33 +9,33 @@ use super::{
ContentRenderer, ContentsRenderer, MusicContentsRenderer, MusicContinuation, MusicItem, ContentRenderer, ContentsRenderer, MusicContentsRenderer, MusicContinuation, MusicItem,
}; };
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PlaylistMusic { pub struct PlaylistMusic {
pub contents: Contents, pub contents: Contents,
pub header: Header, pub header: Header,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Contents { pub struct Contents {
pub single_column_browse_results_renderer: ContentsRenderer<Tab>, pub single_column_browse_results_renderer: ContentsRenderer<Tab>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Tab { pub struct Tab {
pub tab_renderer: ContentRenderer<SectionList>, pub tab_renderer: ContentRenderer<SectionList>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct SectionList { pub struct SectionList {
/// Includes a continuation token for fetching recommendations /// Includes a continuation token for fetching recommendations
pub section_list_renderer: MusicContentsRenderer<ItemSection>, pub section_list_renderer: MusicContentsRenderer<ItemSection>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ItemSection { pub struct ItemSection {
#[serde(alias = "musicPlaylistShelfRenderer")] #[serde(alias = "musicPlaylistShelfRenderer")]
@ -43,7 +43,7 @@ pub struct ItemSection {
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MusicShelf { pub struct MusicShelf {
/// Playlist ID (only for playlists) /// Playlist ID (only for playlists)
@ -55,20 +55,20 @@ pub struct MusicShelf {
pub continuations: Option<Vec<MusicContinuation>>, pub continuations: Option<Vec<MusicContinuation>>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct PlaylistMusicItem { pub struct PlaylistMusicItem {
pub music_responsive_list_item_renderer: MusicItem, pub music_responsive_list_item_renderer: MusicItem,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Header { pub struct Header {
pub music_detail_header_renderer: HeaderRenderer, pub music_detail_header_renderer: HeaderRenderer,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct HeaderRenderer { pub struct HeaderRenderer {
#[serde_as(as = "crate::serializer::text::Text")] #[serde_as(as = "crate::serializer::text::Text")]

View file

@ -22,7 +22,7 @@ use super::{
/// Video details response /// Video details response
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct VideoDetails { pub struct VideoDetails {
/// Video metadata + recommended videos /// Video metadata + recommended videos
@ -35,13 +35,13 @@ pub struct VideoDetails {
} }
/// Video details main object, contains video metadata and recommended videos /// Video details main object, contains video metadata and recommended videos
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Contents { pub struct Contents {
pub two_column_watch_next_results: TwoColumnWatchNextResults, pub two_column_watch_next_results: TwoColumnWatchNextResults,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct TwoColumnWatchNextResults { pub struct TwoColumnWatchNextResults {
/// Metadata about the video /// Metadata about the video
@ -53,7 +53,7 @@ pub struct TwoColumnWatchNextResults {
} }
/// Metadata about the video /// Metadata about the video
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct VideoResultsWrap { pub struct VideoResultsWrap {
pub results: VideoResults, pub results: VideoResults,
@ -61,7 +61,7 @@ pub struct VideoResultsWrap {
/// Video metadata items /// Video metadata items
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct VideoResults { pub struct VideoResults {
#[serde_as(as = "VecLogError<_>")] #[serde_as(as = "VecLogError<_>")]
@ -70,7 +70,7 @@ pub struct VideoResults {
/// Video metadata item /// Video metadata item
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum VideoResultsItem { pub enum VideoResultsItem {
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
@ -104,14 +104,14 @@ pub enum VideoResultsItem {
None, None,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ViewCount { pub struct ViewCount {
pub video_view_count_renderer: ViewCountRenderer, pub video_view_count_renderer: ViewCountRenderer,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ViewCountRenderer { pub struct ViewCountRenderer {
/// View count (`232,975,196 views`) /// View count (`232,975,196 views`)
@ -122,7 +122,7 @@ pub struct ViewCountRenderer {
} }
/// Like/Dislike buttons /// Like/Dislike buttons
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct VideoActions { pub struct VideoActions {
pub menu_renderer: VideoActionsMenu, pub menu_renderer: VideoActionsMenu,
@ -130,7 +130,7 @@ pub struct VideoActions {
/// Like/Dislike buttons /// Like/Dislike buttons
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct VideoActionsMenu { pub struct VideoActionsMenu {
#[serde_as(as = "VecSkipError<_>")] #[serde_as(as = "VecSkipError<_>")]
@ -143,7 +143,7 @@ pub struct VideoActionsMenu {
/// ///
/// See: https://github.com/TeamNewPipe/NewPipeExtractor/pull/926 /// See: https://github.com/TeamNewPipe/NewPipeExtractor/pull/926
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum TopLevelButton { pub enum TopLevelButton {
ToggleButtonRenderer(ToggleButton), ToggleButtonRenderer(ToggleButton),
@ -154,7 +154,7 @@ pub enum TopLevelButton {
} }
/// Like/Dislike button /// Like/Dislike button
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ToggleButtonWrap { pub struct ToggleButtonWrap {
pub toggle_button_renderer: ToggleButton, pub toggle_button_renderer: ToggleButton,
@ -162,7 +162,7 @@ pub struct ToggleButtonWrap {
/// Like/Dislike button /// Like/Dislike button
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ToggleButton { pub struct ToggleButton {
/// Icon type: `LIKE` / `DISLIKE` /// Icon type: `LIKE` / `DISLIKE`
@ -176,7 +176,7 @@ pub struct ToggleButton {
/// Shows additional video metadata. Its only known use is for /// Shows additional video metadata. Its only known use is for
/// the Creative Commonse License. /// the Creative Commonse License.
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MetadataRowContainer { pub struct MetadataRowContainer {
pub metadata_row_container_renderer: MetadataRowContainerRenderer, pub metadata_row_container_renderer: MetadataRowContainerRenderer,
@ -184,14 +184,14 @@ pub struct MetadataRowContainer {
/// Shows additional video metadata. Its only known use is for /// Shows additional video metadata. Its only known use is for
/// the Creative Commonse License. /// the Creative Commonse License.
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MetadataRowContainerRenderer { pub struct MetadataRowContainerRenderer {
pub rows: Vec<MetadataRow>, pub rows: Vec<MetadataRow>,
} }
/// Additional video metadata item (Creative Commons License) /// Additional video metadata item (Creative Commons License)
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MetadataRow { pub struct MetadataRow {
pub metadata_row_renderer: MetadataRowRenderer, pub metadata_row_renderer: MetadataRowRenderer,
@ -199,7 +199,7 @@ pub struct MetadataRow {
/// Additional video metadata item (Creative Commons License) /// Additional video metadata item (Creative Commons License)
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MetadataRowRenderer { pub struct MetadataRowRenderer {
// `License` // `License`
@ -214,13 +214,13 @@ pub struct MetadataRowRenderer {
} }
/// Contains current video ID /// Contains current video ID
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CurrentVideoEndpoint { pub struct CurrentVideoEndpoint {
pub watch_endpoint: CurrentVideoWatchEndpoint, pub watch_endpoint: CurrentVideoWatchEndpoint,
} }
/// Contains current video ID /// Contains current video ID
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CurrentVideoWatchEndpoint { pub struct CurrentVideoWatchEndpoint {
pub video_id: String, pub video_id: String,
@ -231,7 +231,7 @@ pub struct CurrentVideoWatchEndpoint {
/// 1. CommentsEntryPointHeaderRenderer: contains number of comments /// 1. CommentsEntryPointHeaderRenderer: contains number of comments
/// 2. ContinuationItemRenderer: contains continuation token /// 2. ContinuationItemRenderer: contains continuation token
#[serde_as] #[serde_as]
#[derive(Default, Clone, Debug, Deserialize)] #[derive(Default, Debug, Deserialize)]
#[serde(rename_all = "kebab-case", tag = "sectionIdentifier")] #[serde(rename_all = "kebab-case", tag = "sectionIdentifier")]
pub enum ItemSection { pub enum ItemSection {
CommentsEntryPoint { CommentsEntryPoint {
@ -247,7 +247,7 @@ pub enum ItemSection {
} }
/// Item section containing comment count /// Item section containing comment count
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ItemSectionCommentCount { pub struct ItemSectionCommentCount {
pub comments_entry_point_header_renderer: CommentsEntryPointHeaderRenderer, pub comments_entry_point_header_renderer: CommentsEntryPointHeaderRenderer,
@ -255,7 +255,7 @@ pub struct ItemSectionCommentCount {
/// Renderer of item section containing comment count /// Renderer of item section containing comment count
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CommentsEntryPointHeaderRenderer { pub struct CommentsEntryPointHeaderRenderer {
#[serde_as(as = "Text")] #[serde_as(as = "Text")]
@ -263,14 +263,14 @@ pub struct CommentsEntryPointHeaderRenderer {
} }
/// Item section containing comments ctoken /// Item section containing comments ctoken
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ItemSectionComments { pub struct ItemSectionComments {
pub continuation_item_renderer: ContinuationItemRenderer, pub continuation_item_renderer: ContinuationItemRenderer,
} }
/// Video recommendations /// Video recommendations
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct RecommendationResultsWrap { pub struct RecommendationResultsWrap {
pub secondary_results: RecommendationResults, pub secondary_results: RecommendationResults,
@ -278,7 +278,7 @@ pub struct RecommendationResultsWrap {
/// Video recommendations /// Video recommendations
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct RecommendationResults { pub struct RecommendationResults {
/// Can be `None` for age-restricted videos /// Can be `None` for age-restricted videos
@ -288,7 +288,7 @@ pub struct RecommendationResults {
/// The engagement panels are displayed below the video and contain chapter markers /// The engagement panels are displayed below the video and contain chapter markers
/// and the comment section. /// and the comment section.
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EngagementPanel { pub struct EngagementPanel {
pub engagement_panel_section_list_renderer: EngagementPanelRenderer, pub engagement_panel_section_list_renderer: EngagementPanelRenderer,
@ -296,7 +296,7 @@ pub struct EngagementPanel {
/// The engagement panels are displayed below the video and contain chapter markers /// The engagement panels are displayed below the video and contain chapter markers
/// and the comment section. /// and the comment section.
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "kebab-case", tag = "targetId")] #[serde(rename_all = "kebab-case", tag = "targetId")]
pub enum EngagementPanelRenderer { pub enum EngagementPanelRenderer {
/// Chapter markers /// Chapter markers
@ -315,7 +315,7 @@ pub enum EngagementPanelRenderer {
} }
/// Chapter markers /// Chapter markers
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ChapterMarkersContent { pub struct ChapterMarkersContent {
pub macro_markers_list_renderer: MacroMarkersListRenderer, pub macro_markers_list_renderer: MacroMarkersListRenderer,
@ -323,7 +323,7 @@ pub struct ChapterMarkersContent {
/// Chapter markers /// Chapter markers
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MacroMarkersListRenderer { pub struct MacroMarkersListRenderer {
#[serde_as(as = "VecLogError<_>")] #[serde_as(as = "VecLogError<_>")]
@ -331,7 +331,7 @@ pub struct MacroMarkersListRenderer {
} }
/// Chapter marker /// Chapter marker
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MacroMarkersListItem { pub struct MacroMarkersListItem {
pub macro_markers_list_item_renderer: MacroMarkersListItemRenderer, pub macro_markers_list_item_renderer: MacroMarkersListItemRenderer,
@ -339,7 +339,7 @@ pub struct MacroMarkersListItem {
/// Chapter marker /// Chapter marker
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MacroMarkersListItemRenderer { pub struct MacroMarkersListItemRenderer {
/// Contains chapter start time in seconds /// Contains chapter start time in seconds
@ -352,13 +352,13 @@ pub struct MacroMarkersListItemRenderer {
} }
/// Contains chapter start time in seconds /// Contains chapter start time in seconds
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MacroMarkersListItemOnTap { pub struct MacroMarkersListItemOnTap {
pub watch_endpoint: MacroMarkersListItemWatchEndpoint, pub watch_endpoint: MacroMarkersListItemWatchEndpoint,
} }
/// Contains chapter start time in seconds /// Contains chapter start time in seconds
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MacroMarkersListItemWatchEndpoint { pub struct MacroMarkersListItemWatchEndpoint {
/// Chapter start time in seconds /// Chapter start time in seconds
@ -367,7 +367,7 @@ pub struct MacroMarkersListItemWatchEndpoint {
/// Comment section header /// Comment section header
/// (contains continuation tokens for fetching top/latest comments) /// (contains continuation tokens for fetching top/latest comments)
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CommentItemSectionHeader { pub struct CommentItemSectionHeader {
pub engagement_panel_title_header_renderer: CommentItemSectionHeaderRenderer, pub engagement_panel_title_header_renderer: CommentItemSectionHeaderRenderer,
@ -376,7 +376,7 @@ pub struct CommentItemSectionHeader {
/// Comment section header /// Comment section header
/// (contains continuation tokens for fetching top/latest comments) /// (contains continuation tokens for fetching top/latest comments)
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CommentItemSectionHeaderRenderer { pub struct CommentItemSectionHeaderRenderer {
/// Approximate comment count (e.g. `81`, `2.2K`, `705K`) /// Approximate comment count (e.g. `81`, `2.2K`, `705K`)
@ -390,7 +390,7 @@ pub struct CommentItemSectionHeaderRenderer {
} }
/// Comment section menu /// Comment section menu
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CommentItemSectionHeaderMenu { pub struct CommentItemSectionHeaderMenu {
pub sort_filter_sub_menu_renderer: CommentItemSectionHeaderMenuRenderer, pub sort_filter_sub_menu_renderer: CommentItemSectionHeaderMenuRenderer,
@ -401,14 +401,14 @@ pub struct CommentItemSectionHeaderMenu {
/// Items: /// Items:
/// - Top comments /// - Top comments
/// - Latest comments /// - Latest comments
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CommentItemSectionHeaderMenuRenderer { pub struct CommentItemSectionHeaderMenuRenderer {
pub sub_menu_items: Vec<CommentItemSectionHeaderMenuItem>, pub sub_menu_items: Vec<CommentItemSectionHeaderMenuItem>,
} }
/// Comment section menu item /// Comment section menu item
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CommentItemSectionHeaderMenuItem { pub struct CommentItemSectionHeaderMenuItem {
/// Continuation token for fetching comments /// Continuation token for fetching comments
@ -420,14 +420,14 @@ pub struct CommentItemSectionHeaderMenuItem {
*/ */
/// Video recommendations continuation response /// Video recommendations continuation response
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct VideoRecommendations { pub struct VideoRecommendations {
pub on_response_received_endpoints: Vec<RecommendationsContItem>, pub on_response_received_endpoints: Vec<RecommendationsContItem>,
} }
/// Video recommendations continuation /// Video recommendations continuation
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct RecommendationsContItem { pub struct RecommendationsContItem {
pub append_continuation_items_action: AppendRecommendations, pub append_continuation_items_action: AppendRecommendations,
@ -435,7 +435,7 @@ pub struct RecommendationsContItem {
/// Video recommendations continuation /// Video recommendations continuation
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct AppendRecommendations { pub struct AppendRecommendations {
#[serde_as(as = "VecLogError<_>")] #[serde_as(as = "VecLogError<_>")]
@ -448,7 +448,7 @@ pub struct AppendRecommendations {
/// Video comments continuation response /// Video comments continuation response
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct VideoComments { pub struct VideoComments {
/// - Initial response: 2*reloadContinuationItemsCommand /// - Initial response: 2*reloadContinuationItemsCommand
@ -466,7 +466,7 @@ pub struct VideoComments {
} }
/// Video comments continuation /// Video comments continuation
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CommentsContItem { pub struct CommentsContItem {
#[serde(alias = "reloadContinuationItemsCommand")] #[serde(alias = "reloadContinuationItemsCommand")]
@ -475,7 +475,7 @@ pub struct CommentsContItem {
/// Video comments continuation action /// Video comments continuation action
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct AppendComments { pub struct AppendComments {
#[serde_as(as = "VecLogError<_>")] #[serde_as(as = "VecLogError<_>")]
@ -483,7 +483,7 @@ pub struct AppendComments {
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum CommentListItem { pub enum CommentListItem {
/// Top-level comment /// Top-level comment
@ -513,14 +513,14 @@ pub enum CommentListItem {
}, },
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Comment { pub struct Comment {
pub comment_renderer: CommentRenderer, pub comment_renderer: CommentRenderer,
} }
#[serde_as] #[serde_as]
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CommentRenderer { pub struct CommentRenderer {
/// Author name /// Author name
@ -551,19 +551,19 @@ pub struct CommentRenderer {
pub action_buttons: CommentActionButtons, pub action_buttons: CommentActionButtons,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct AuthorEndpoint { pub struct AuthorEndpoint {
pub browse_endpoint: BrowseEndpoint, pub browse_endpoint: BrowseEndpoint,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct BrowseEndpoint { pub struct BrowseEndpoint {
pub browse_id: String, pub browse_id: String,
} }
#[derive(Default, Clone, Copy, Debug, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Default, Clone, Copy, Debug, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")] #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum CommentPriority { pub enum CommentPriority {
/// Default rendering priority /// Default rendering priority
@ -575,7 +575,7 @@ pub enum CommentPriority {
/// Does not contain replies directly but a continuation token /// Does not contain replies directly but a continuation token
/// for fetching them. /// for fetching them.
#[derive(Default, Clone, Debug, Deserialize)] #[derive(Default, Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Replies { pub struct Replies {
pub comment_replies_renderer: RepliesRenderer, pub comment_replies_renderer: RepliesRenderer,
@ -584,7 +584,7 @@ pub struct Replies {
/// Does not contain replies directly but a continuation token /// Does not contain replies directly but a continuation token
/// for fetching them. /// for fetching them.
#[serde_as] #[serde_as]
#[derive(Default, Clone, Debug, Deserialize)] #[derive(Default, Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct RepliesRenderer { pub struct RepliesRenderer {
#[serde_as(as = "VecSkipError<_>")] #[serde_as(as = "VecSkipError<_>")]
@ -593,7 +593,7 @@ pub struct RepliesRenderer {
/// These are the buttons for comment interaction (Like/Dislike/Reply). /// These are the buttons for comment interaction (Like/Dislike/Reply).
/// Contains the CreatorHeart. /// Contains the CreatorHeart.
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CommentActionButtons { pub struct CommentActionButtons {
pub comment_action_buttons_renderer: CommentActionButtonsRenderer, pub comment_action_buttons_renderer: CommentActionButtonsRenderer,
@ -601,7 +601,7 @@ pub struct CommentActionButtons {
/// These are the buttons for comment interaction (Like/Dislike/Reply). /// These are the buttons for comment interaction (Like/Dislike/Reply).
/// Contains the CreatorHeart. /// Contains the CreatorHeart.
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CommentActionButtonsRenderer { pub struct CommentActionButtonsRenderer {
pub like_button: ToggleButtonWrap, pub like_button: ToggleButtonWrap,
@ -609,27 +609,27 @@ pub struct CommentActionButtonsRenderer {
} }
/// Video creators can endorse comments by marking them with a ❤️. /// Video creators can endorse comments by marking them with a ❤️.
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CreatorHeart { pub struct CreatorHeart {
pub creator_heart_renderer: CreatorHeartRenderer, pub creator_heart_renderer: CreatorHeartRenderer,
} }
/// Video creators can endorse comments by marking them with a ❤️. /// Video creators can endorse comments by marking them with a ❤️.
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CreatorHeartRenderer { pub struct CreatorHeartRenderer {
pub is_hearted: bool, pub is_hearted: bool,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct AuthorCommentBadge { pub struct AuthorCommentBadge {
pub author_comment_badge_renderer: AuthorCommentBadgeRenderer, pub author_comment_badge_renderer: AuthorCommentBadgeRenderer,
} }
/// YouTube channel badge (verified) of the comment author /// YouTube channel badge (verified) of the comment author
#[derive(Clone, Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct AuthorCommentBadgeRenderer { pub struct AuthorCommentBadgeRenderer {
/// Verified: `CHECK` /// Verified: `CHECK`

View file

@ -82,7 +82,7 @@ pub enum ExtractionError {
#[error("got wrong result from YT: {0}")] #[error("got wrong result from YT: {0}")]
WrongResult(String), WrongResult(String),
#[error("Warnings during deserialization/mapping")] #[error("Warnings during deserialization/mapping")]
Warnings, DeserializationWarnings,
} }
/// Internal error /// Internal error

View file

@ -453,11 +453,11 @@ pub struct VideoDetails {
pub view_count: u64, pub view_count: u64,
/// Number of likes /// Number of likes
/// ///
/// `None` if the like count was hidden by the creator. /// [`None`] if the like count was hidden by the creator.
pub like_count: Option<u32>, pub like_count: Option<u32>,
/// Video publishing date. Start date in case of a livestream. /// Video publishing date. Start date in case of a livestream.
/// ///
/// `None` if the date could not be parsed. /// [`None`] if the date could not be parsed.
pub publish_date: Option<DateTime<Local>>, pub publish_date: Option<DateTime<Local>>,
/// Textual video publishing date (e.g. `Aug 2, 2013`, depends on language) /// Textual video publishing date (e.g. `Aug 2, 2013`, depends on language)
pub publish_date_txt: String, pub publish_date_txt: String,
@ -516,7 +516,7 @@ pub struct RecommendedVideo {
pub title: String, pub title: String,
/// Video length in seconds. /// Video length in seconds.
/// ///
/// Is `None` for livestreams. /// Is [`None`] for livestreams.
pub length: Option<u32>, pub length: Option<u32>,
/// Video thumbnail /// Video thumbnail
pub thumbnail: Vec<Thumbnail>, pub thumbnail: Vec<Thumbnail>,
@ -524,15 +524,15 @@ pub struct RecommendedVideo {
pub channel: ChannelTag, pub channel: ChannelTag,
/// Video publishing date. /// Video publishing date.
/// ///
/// `None` if the date could not be parsed. /// [`None`] if the date could not be parsed.
pub publish_date: Option<DateTime<Local>>, pub publish_date: Option<DateTime<Local>>,
/// Textual video publish date (e.g. `11 months ago`, depends on language) /// Textual video publish date (e.g. `11 months ago`, depends on language)
/// ///
/// Is `None` for livestreams. /// Is [`None`] for livestreams.
pub publish_date_txt: Option<String>, pub publish_date_txt: Option<String>,
/// View count /// View count
/// ///
/// `None` if it could not be extracted. /// [`None`] if it could not be extracted.
pub view_count: Option<u64>, pub view_count: Option<u64>,
/// Is the video an active livestream? /// Is the video an active livestream?
pub is_live: bool, pub is_live: bool,
@ -554,7 +554,7 @@ pub struct ChannelTag {
pub verification: Verification, pub verification: Verification,
/// Approximate number of subscribers /// Approximate number of subscribers
/// ///
/// `None` if hidden by the owner or not present. /// [`None`] if hidden by the owner or not present.
/// ///
/// Info: This is only present in the `VideoDetails` response /// Info: This is only present in the `VideoDetails` response
pub subscriber_count: Option<u64>, pub subscriber_count: Option<u64>,
@ -600,7 +600,7 @@ pub struct Comment {
pub author: Option<ChannelTag>, pub author: Option<ChannelTag>,
/// Comment publishing date. /// Comment publishing date.
/// ///
/// `None` if the date could not be parsed. /// [`None`] if the date could not be parsed.
pub publish_date: Option<DateTime<Local>>, pub publish_date: Option<DateTime<Local>>,
/// Textual comment publish date (e.g. `14 hours ago`), depends on language setting /// Textual comment publish date (e.g. `14 hours ago`), depends on language setting
pub publish_date_txt: String, pub publish_date_txt: String,
@ -635,7 +635,7 @@ pub struct Channel<T> {
pub name: String, pub name: String,
/// Channel subscriber count /// Channel subscriber count
/// ///
/// `None` if the subscriber count was hidden by the owner /// [`None`] if the subscriber count was hidden by the owner
/// or could not be parsed. /// or could not be parsed.
pub subscriber_count: Option<u64>, pub subscriber_count: Option<u64>,
/// Channel avatar / profile picture /// Channel avatar / profile picture
@ -667,22 +667,22 @@ pub struct ChannelVideo {
pub title: String, pub title: String,
/// Video length in seconds. /// Video length in seconds.
/// ///
/// Is `None` for livestreams. /// Is [`None`] for livestreams.
pub length: Option<u32>, pub length: Option<u32>,
/// Video thumbnail /// Video thumbnail
pub thumbnail: Vec<Thumbnail>, pub thumbnail: Vec<Thumbnail>,
/// Video publishing date. /// Video publishing date.
/// ///
/// `None` if the date could not be parsed. /// [`None`] if the date could not be parsed.
/// May be in the future for upcoming videos /// May be in the future for upcoming videos
pub publish_date: Option<DateTime<Local>>, pub publish_date: Option<DateTime<Local>>,
/// Textual video publish date (e.g. `11 months ago`, depends on language) /// Textual video publish date (e.g. `11 months ago`, depends on language)
/// ///
/// Is `None` for livestreams and upcoming videos. /// Is [`None`] for livestreams and upcoming videos.
pub publish_date_txt: Option<String>, pub publish_date_txt: Option<String>,
/// Number of views / current viewers in case of a livestream. /// Number of views / current viewers in case of a livestream.
/// ///
/// `None` if it could not be extracted. /// [`None`] if it could not be extracted.
pub view_count: Option<u64>, pub view_count: Option<u64>,
/// Is the video an active livestream? /// Is the video an active livestream?
pub is_live: bool, pub is_live: bool,