From 6a5a579e3947109af0e7c2a318aef40edb8484f8 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Fri, 1 Dec 2023 02:03:36 +0100 Subject: [PATCH] fix(Channel)!: Remove `getChannels()` and `has_channels`, as YouTube removed the tab (#542) BREAKING CHANGE: YouTube removed the "Channels" tab on channels, so this pull request removes the `getChannels()` method and `has_channels` getter from the `YT.Channel` class, as they are no longer useful. The featured channels are now shown on the channel home tab. To get them you can use the `channels` getter on the home tab of the channel. Please note that some channel owners might not have added that section to their home page yet, so you won't be able to get the featured channels for those channels. The home tab is the default tab that is returned when you call `InnerTube#getChannel()`, you can also access that tab by calling `getHome()` on a `YT.Channel` object. --- src/parser/youtube/Channel.ts | 9 --------- test/main.test.ts | 8 -------- 2 files changed, 17 deletions(-) diff --git a/src/parser/youtube/Channel.ts b/src/parser/youtube/Channel.ts index 832825f02..4300bd303 100644 --- a/src/parser/youtube/Channel.ts +++ b/src/parser/youtube/Channel.ts @@ -185,11 +185,6 @@ export default class Channel extends TabbedFeed { return new Channel(this.actions, tab.page, true); } - async getChannels(): Promise { - const tab = await this.getTabByURL('channels'); - return new Channel(this.actions, tab.page, true); - } - /** * Retrieves the about page. * Note that this does not return a new {@link Channel} object. @@ -245,10 +240,6 @@ export default class Channel extends TabbedFeed { return this.hasTabWithURL('community'); } - get has_channels(): boolean { - return this.hasTabWithURL('channels'); - } - get has_about(): boolean { return this.hasTabWithURL('about'); } diff --git a/test/main.test.ts b/test/main.test.ts index 3f78eb645..59e1dc59b 100644 --- a/test/main.test.ts +++ b/test/main.test.ts @@ -208,14 +208,6 @@ describe('YouTube.js Tests', () => { expect(community.posts.length).toBeGreaterThan(0); }); - test('Channel#getChannels', async () => { - const channels = await channel.getChannels(); - expect(channels).toBeDefined(); - expect(channels.current_tab).toBeDefined(); - expect(channels.current_tab?.content).toBeDefined(); - expect(channels.channels.length).toBeGreaterThan(0); - }); - test('Channel#getAbout', async () => { const about = await channel.getAbout(); expect(about).toBeDefined();