Skip to content

feat(parser): add getPaidMemberships() with PaidMemberships parser - #1202

Open
HitomaruKonpaku wants to merge 1 commit into
LuanRT:mainfrom
HitomaruKonpaku:main
Open

feat(parser): add getPaidMemberships() with PaidMemberships parser#1202
HitomaruKonpaku wants to merge 1 commit into
LuanRT:mainfrom
HitomaruKonpaku:main

Conversation

@HitomaruKonpaku

Copy link
Copy Markdown

Summary

Adds Innertube.getPaidMemberships() that browses FEmemberships_and_purchases and returns typed data for all 3 sections.

Changes

7 parser classes: CardItemText, CardItemTextCollection, CardItemTextWithImage, ActivityItem, CardItem, CardItemContainer, ThemedImage

1 action class: UpdateCardItemOnClickCommand

2 youtube-level parsers: PaidMemberships, PaidPurchasesSection

Other: InnertubeError named export, OfferItem in IGNORED_LIST, ResponseReceived type alias

Usage

const yt = await Innertube.create({ cookie: '' })
const page = await yt.getPaidMemberships();

// Paginated purchases
let section = page.purchases;
while (section) {
  for (const item of section.items) console.log(item.title?.text?.toString());
  try { section = await section.getContinuation(); } catch { break; }
}

// Memberships
for (const m of page.memberships) console.log(m.channel_name, m.membership_level, m.price);
for (const m of page.inactive_memberships) console.log(m.channel_name, m.expired_date);

@absidue absidue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before I waste anymore of my time reviewing what looks a lot like AI slop, could you please confirm whether a human even bothered to take a look at the changes before they were submitted?

@HitomaruKonpaku

Copy link
Copy Markdown
Author

I reviewed and tested it myself yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants