Skip to content

add support for YouTube channel links when setting embeds #81

@SP4CEBARsystems

Description

@SP4CEBARsystems
  1. 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
}
  1. Use the YouTube API to get the channel ID: https://www.googleapis.com/youtube/v3/channels?part=snippet&forHandle=@veritasium&key=API_KEY
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions