From 48fd04f8e8eb5e15df48fe435c43dc7e6c68bb4d Mon Sep 17 00:00:00 2001 From: "Carson M." Date: Thu, 4 Jul 2024 14:05:46 -0500 Subject: [PATCH] fix(yt): support slim variant grid renderer --- src/youtube/context.rs | 4 ++-- src/youtube/types/streams_page.rs | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/youtube/context.rs b/src/youtube/context.rs index 0f5878f..14d2cde 100644 --- a/src/youtube/context.rs +++ b/src/youtube/context.rs @@ -108,7 +108,7 @@ impl ChatContext { .ok_or_else(|| Error::NoMatchingStream(channel_id.to_string()))? { TabItemRenderer::TabRenderer { content, .. } => match content.as_ref().unwrap() { - FeedContentsRenderer::RichGridRenderer { contents, .. } => { + FeedContentsRenderer::RichGridRenderer { contents } => { let finder = |c: &&RichGridItem| match c { RichGridItem::RichItemRenderer { content, .. } => match content { RichItemContent::VideoRenderer { thumbnail_overlays, video_id, .. } => thumbnail_overlays.iter().any(|c| match c { @@ -145,7 +145,7 @@ impl ChatContext { } .ok_or_else(|| Error::NoMatchingStream(channel_id.to_string()))? } - FeedContentsRenderer::SectionListRenderer { .. } => return Err(Error::NoMatchingStream(channel_id.to_string())) + _ => return Err(Error::NoMatchingStream(channel_id.to_string())) }, TabItemRenderer::ExpandableTabRenderer { .. } => unreachable!() } diff --git a/src/youtube/types/streams_page.rs b/src/youtube/types/streams_page.rs index b0bb631..70a8697 100644 --- a/src/youtube/types/streams_page.rs +++ b/src/youtube/types/streams_page.rs @@ -58,8 +58,11 @@ pub struct BrowseEndpoint { #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub enum FeedContentsRenderer { - RichGridRenderer { contents: Vec, header: FeedHeaderRenderer }, - SectionListRenderer { contents: Vec } + RichGridRenderer { + contents: Vec + }, + #[serde(other)] + Other } #[derive(Debug, Deserialize)]