Get a list of subscribed channels
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
]
}
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.
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})`);
});
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.
I don't think this should be closed yet.
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.
Sorry for not getting around to this for so long. So many things to do lately.
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.
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.