Skip to content

Instantly share code, notes, and snippets.

@transkatgirl
Last active May 3, 2022 21:42
Show Gist options
  • Save transkatgirl/b3ba44cbb89c491a7e1d54d8c8b09b98 to your computer and use it in GitHub Desktop.
Save transkatgirl/b3ba44cbb89c491a7e1d54d8c8b09b98 to your computer and use it in GitHub Desktop.
Export YouTube subscriptions
// How to use this:
// 1. Go to https://www.youtube.com/feed/channels
// 2. Scroll down to the bottom to load in complete channel list
// 3. Open the browser console and paste this snippet:
let channels = $$("#main-link.channel-link");
let channel_text = "";
for (let i = 0; i < channels.length; i += 1) {
if (channels[i].href != undefined) {
channel_text += channels[i].parentElement.parentElement.parentElement.getElementsByTagName("yt-formatted-string")[1].innerText + " - " + channels[i].href + "\n";
}
}
console.log(channel_text);
// 4. Copy the output to your clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment