Skip to main content

Snippets

About 2 minJavaScriptSnippetsjsjavascriptsnippets

Snippets 관련


YouTube

Paste the entire script to the Chrome DevTool (F12) Console

fetchWL
  1. move to /playlist?list=WLopen in new window
  2. Paste the following code to the console
const videos = Array.from(document.querySelector('ytd-browse[page-subtype="playlist"] #primary #contents.style-scope.ytd-playlist-video-list-renderer').querySelectorAll('ytd-playlist-video-renderer'))
.map((e) => {
  const vInfo = e.querySelector('a#video-title')
  const cInfo = e.querySelector('.ytd-channel-name.complex-string a.yt-simple-endpoint.style-scope.yt-formatted-string')
  return {
    channelId: cInfo.href.replace('https://www.youtube.com/@', ''),
    channelName: cInfo.innerHTML,
    id: vInfo.href.match(/(?<=https\:\/\/www.youtube.com\/watch\?v=)(.*)(?=\&list=)/g).join(''),    
    title: vInfo.innerHTML.match(/(?<=          )(.*)/g).join('').replace(/&amp;/g, '&')
  }
})
console.log(JSON.stringify(videos[0]))
copy(JSON.stringify(videos))

이찬희 (MarkiiimarK)
Never Stop Learning.