Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Filter our members-only section on channel home pages
  • Loading branch information
absidue committed Dec 22, 2024
commit 282e338c9524b447d17edb22ea9c61e0124bb91b
18 changes: 12 additions & 6 deletions src/renderer/helpers/api/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -888,12 +888,18 @@ export function parseChannelHomeTab(homeTab) {
if (itemSection.contents.at(0).type === 'Shelf') {
/** @type {import('youtubei.js').YTNodes.Shelf} */
const shelf = itemSection.contents.at(0)
shelves.push({
title: shelf.title.text,
content: shelf.content.items.map(parseListItem).filter(_ => _),
playlistId: shelf.play_all_button?.endpoint.payload.playlistId,
subtitle: shelf.subtitle?.text
})

const playlistId = shelf.play_all_button?.endpoint.payload.playlistId

// filter out the members-only video section as none of the videos in that section are playable as they require a paid channel membership
if (!playlistId || !playlistId.startsWith('UUMO')) {
shelves.push({
title: shelf.title.text,
content: shelf.content.items.map(parseListItem).filter(_ => _),
playlistId,
subtitle: shelf.subtitle?.text
})
}
} else if (itemSection.contents.at(0).type === 'ReelShelf') {
/** @type {import('youtubei.js').YTNodes.ReelShelf} */
const shelf = itemSection.contents.at(0)
Expand Down