Skip to content

Instantly share code, notes, and snippets.

View leotulipan's full-sized avatar

Leonard Tulipan leotulipan

View GitHub Profile
@leotulipan
leotulipan / scrapePlaylist.js
Created May 2, 2026 16:46
Scraper to turn your YouTube watch later list (private no API) into a csv
function scrapePlaylist() {
// 0. go to https://www.youtube.com/playlist?list=WL and run this from the chrome dev console
// 1. Extract the expected number of videos from the metadata
const bylineItems = document.querySelectorAll('ytd-playlist-byline-renderer .byline-item');
let targetCount = 0;
if (bylineItems.length > 0) {
// Extracts digits from strings like "450 videos" or "1,234 views"
const countText = bylineItems[0].innerText;
targetCount = parseInt(countText.replace(/[^0-9]/g, ''), 10);