Skip to content

Instantly share code, notes, and snippets.

@maifeeulasad
Last active December 15, 2025 09:01
Show Gist options
  • Select an option

  • Save maifeeulasad/e37f7d9f3c7df397e175743d008f09d5 to your computer and use it in GitHub Desktop.

Select an option

Save maifeeulasad/e37f7d9f3c7df397e175743d008f09d5 to your computer and use it in GitHub Desktop.
List all youtube videos in watch later playlist, it can work with other playlist as well
setInterval(function () {
const data = []
// all videos, we need to scroll to the bottom of the page to load all videos (manually)
const videoLinks = document.querySelectorAll(
'a#video-title.yt-simple-endpoint.style-scope.ytd-playlist-video-renderer'
);
videoLinks.forEach(videoLink => {
const title = videoLink.getAttribute('title');
// we can do it for facebook as well :wink:
const url = 'https://www.youtube.com' + videoLink.getAttribute('href');
// console.log(`Title: ${title}`);
// console.log(`URL: ${url}`);
data.push({ title, url});
});
// here we go
console.log(data);
}, 0);

A script to list down all the YouTube watch later videos, it can list other playlist on YouTube as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment