Created
October 18, 2025 00:19
-
-
Save alirobe/4093d7b11b84de9771c1874e6fb5bea6 to your computer and use it in GitHub Desktop.
Extract YouTube subscription channel metadata from channel page
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
// goto https://www.youtube.com/feed/channels | |
// set to a-z and scroll all the way down until loading ends | |
// run in terminal: | |
arr = Array.from(document.querySelectorAll('ytd-channel-renderer')) | |
data = [] | |
arr.forEach((item, index) => { | |
data.push({ | |
title: item.querySelector('.ytd-channel-name').innerText, | |
handle: item.querySelector('yt-formatted-string#subscribers').innerText, | |
subs: item.querySelector('#video-count').innerText, | |
description: item.querySelector('#description').innerText, | |
link: 'https://youtube.com' + item.querySelector('a#main-link').href | |
}) | |
}) | |
console.log(data) | |
// side-note: why are YouTube using IDs? I thought that was inefficient... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Google sheets AI prompt:
=AI("Determine the high-level category for each YouTube channel based on its description, title, handle, and link. chosen from: STEM, Arts Philosophy and History, Social and Entertainment, Economics Business and Money, Medicine and Health, Technology and Innovation, Opinion News and Politics, Lifestyle & Life skills, Religion, Sports, Other",RANGE)