Skip to content

Commit

Permalink
fix(yt): support slim variant grid renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Jul 4, 2024
1 parent 391ef97 commit 48fd04f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/youtube/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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!()
}
Expand Down
7 changes: 5 additions & 2 deletions src/youtube/types/streams_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ pub struct BrowseEndpoint {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum FeedContentsRenderer {
RichGridRenderer { contents: Vec<RichGridItem>, header: FeedHeaderRenderer },
SectionListRenderer { contents: Vec<simd_json::OwnedValue> }
RichGridRenderer {
contents: Vec<RichGridItem>
},
#[serde(other)]
Other
}

#[derive(Debug, Deserialize)]
Expand Down

0 comments on commit 48fd04f

Please sign in to comment.