YouTube.js icon indicating copy to clipboard operation
YouTube.js copied to clipboard

Get a list of subscribed channels

Open aparatext opened this issue 3 years ago • 4 comments

Expected Behavior

Allow receiving a list of channels the user is subscribed to.

Sample Code

const channels = await youtube.getChannelList();

{
  channels: [
    id: string,
    name: string,
    url: string
  ]
}

aparatext avatar May 31 '22 15:05 aparatext

youtube.actions.browse("FEchannels") can provide a list of subscribed channels. All that's left is a bit of parsing. Thanks for marking this as a good first issue, encouraging me to look into how the library I depend on works.

aparatext avatar Jun 08 '22 10:06 aparatext

I tried parsing the response. I'm not familiar with how the proper parser works, but here's my attempt. It misses feed continuations but seems to work fine.

let channels = await youtube.actions.browse("FEchannels");
channels = channels.data.contents.twoColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].shelfRenderer.content.expandedShelfContentsRenderer.items;
// console.log(channels);

channels.forEach(item => {
    console.log(`${item.channelRenderer.title.simpleText} (${item.channelRenderer.channelId})`);
});

aparatext avatar Jun 08 '22 10:06 aparatext

I tried parsing the response. I'm not familiar with how the proper parser works, but here's my attempt. It misses feed continuations but seems to work fine.

let channels = await youtube.actions.browse("FEchannels");
channels = channels.data.contents.twoColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].shelfRenderer.content.expandedShelfContentsRenderer.items;
// console.log(channels);

channels.forEach(item => {
    console.log(`${item.channelRenderer.title.simpleText} (${item.channelRenderer.channelId})`);
});

Nice! The new parser makes that much easier tho -- you can learn more about it here: #65. This feature will probably be implemented in the Library class.

LuanRT avatar Jun 09 '22 00:06 LuanRT

I don't think this should be closed yet.

aparatext avatar Jul 09 '22 10:07 aparatext

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 26 '22 04:08 github-actions[bot]

Sorry for not getting around to this for so long. So many things to do lately.

aparatext avatar Aug 26 '22 19:08 aparatext

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 26 '22 03:10 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Dec 26 '22 02:12 github-actions[bot]