-
-
Save pradyumnac/2f7f68c9a7469bc898c115be59afcb5b to your computer and use it in GitHub Desktop.
Youtube Playlist Links
This file contains 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
function getLoadedPlaylist(){ | |
var links=[] | |
document.querySelector('#contents.ytd-playlist-video-list-renderer').childNodes.forEach(e => { | |
try { | |
var url=e.querySelector("#video-title").href | |
var title=e.querySelector("#video-title").text.trim() | |
var channel_name=e.querySelector("#channel-name a").text | |
var channel_url=e.querySelector("#channel-name a").href | |
links.push([url, title, channel_name, channel_url]); | |
} | |
catch(err) { | |
console.log(err) | |
} | |
}) | |
return links | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment