Skip to content

Instantly share code, notes, and snippets.

@ronanrodrigo
Created November 30, 2020 14:21
Show Gist options
  • Save ronanrodrigo/d39ca56d7af5229ce079ec9a024cd106 to your computer and use it in GitHub Desktop.
Save ronanrodrigo/d39ca56d7af5229ce079ec9a024cd106 to your computer and use it in GitHub Desktop.
var channels = "";
ytInitialData
.contents
.twoColumnBrowseResultsRenderer
.tabs[0]
.tabRenderer
.content
.sectionListRenderer
.contents[0]
.itemSectionRenderer
.contents[0]
.shelfRenderer
.content
.expandedShelfContentsRenderer
.items
.map(function(item) {
let title = item.channelRenderer.title.simpleText
let description = ''
if (item.channelRenderer.descriptionSnippet != null) {
description = item.channelRenderer.descriptionSnippet.runs[0].text.replace(/(\r\n|\n|\r)/gm, "")
}
let xhmlUrl = 'https://www.youtube.com/feeds/videos.xml?channel_id=' + item.channelRenderer.subscribeButton.subscribeButtonRenderer.channelId
let htmlUrl = 'https://www.youtube.com/channel/' + item.channelRenderer.subscribeButton.subscribeButtonRenderer.channelId
channels = channels + '<outline text="' + title + '" title="' + title + '" description="' + description + '" type="rss" version="RSS" htmlUrl="' + htmlUrl + '" xmlUrl="' + xhmlUrl + '"/>\n'
})
console.log(channels)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment