Created
September 15, 2024 04:25
-
-
Save senthilmpro/8157ba38b480c5c203fbb6f018557d7e to your computer and use it in GitHub Desktop.
youtube channel all videos as playlist
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
// go to channel home page (not any other subtab) | |
// open developer tools - console. | |
// paste the following. | |
let scripts = Array.from(document.querySelectorAll('script')); | |
let script = scripts.filter(x => x.innerHTML?.includes('externalId')) | |
let channelId = script[0]?.innerHTML.split("externalId")[1].split(",")[0]?.replace(":", '')?.replaceAll('"', ''); | |
let playlistUrl = null; | |
if(channelId.substring(0, 2) === 'UC') { | |
newChannelId = 'UU' + channelId.substring(2); | |
playlistUrl = `https://www.youtube.com/playlist?list=${newChannelId}`; | |
console.log(playlistUrl); | |
} else { | |
console.log("INVALID channelId"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment