Created
November 30, 2020 14:21
-
-
Save ronanrodrigo/d39ca56d7af5229ce079ec9a024cd106 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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