- Add support to detect links like
youtube.com/@sp4cebar to the URL interpreter and extract the @handle, both can be done with a single regex (separate from the existing one)
const regex = /^https?:\/\/(?:www\.)?youtube\.com\/@([A-Za-z0-9._-]+)\/?$/;
const url = "https://youtube.com/@sp4cebar";
const match = url.match(regex);
if (match) {
console.log(match[1]); // sp4cebar
}
- Use the YouTube API to get the channel ID:
https://www.googleapis.com/youtube/v3/channels?part=snippet&forHandle=@veritasium&key=API_KEY
- Given a channel ID like mine below, you can change the initial UC to UU and create a link to a playlist with all videos uploaded to this channel as shown below as well.
- my channel ID:
UCNtSJKxSW7GsohL8g3aN_Zg
- my channel playlist:
https://m.youtube.com/playlist?list=UUNtSJKxSW7GsohL8g3aN_Zg
- Notice the IDs starting with UC and UU
youtube.com/@sp4cebarto the URL interpreter and extract the@handle, both can be done with a single regex (separate from the existing one)https://www.googleapis.com/youtube/v3/channels?part=snippet&forHandle=@veritasium&key=API_KEYUCNtSJKxSW7GsohL8g3aN_Zghttps://m.youtube.com/playlist?list=UUNtSJKxSW7GsohL8g3aN_Zg