Module: utils/yt-urlfmt

Provides all supported YouTube URL formats, including standard URL, shortened URL, channel URL, and playlist URL.

YouTube URLs typically follow a few formats:

  1. Standard Video URL: https://www.youtube.com/watch?v=VIDEO_ID
  2. Shortened URLv https://youtu.be/VIDEO_ID
  3. Playlist URL: https://www.youtube.com/playlist?list=PLAYLIST_ID
  4. Channel URL: https://www.youtube.com/channel/CHANNEL_ID
  5. YouTube Music URL: https://music.youtube.com/watch?v=VIDEO_ID

These formats allow the library to navigate directly to specific videos, playlists, or channels on YouTube.

Additionally, this module also provides the YouTube Music URL pattern. This allows the library to handle a broader range of YouTube-related URLs effectively.

Since:
  • 1.0.0
Author:
  • Ryuu Mitsuki <https://github.com/mitsuki31>
License:
  • MIT
Source:

Members

(inner, constant) YT_URLFORMAT

An object contains regular expressions for matching various YouTube URL formats.

Properties:
Name Type Description
STANDARD RegExp

Regular expression for matching YouTube standard video URLs of the form(s):

  • https://youtube.com/watch?v=VIDEO_ID
  • https://www.youtube.com/watch?v=VIDEO_ID

SHORTENED RegExp

Regular expression for matching YouTube shortened video URLs of the form(s):

  • https://youtu.be/VIDEO_ID

VIDEO RegExp

Regular expression for matching combined YouTube video URLs (standard and shortened formats).

CHANNEL RegExp

Regular expression for matching YouTube channel URLs of the form(s):

  • https://youtube.com/channel/CHANNEL_ID
  • https://www.youtube.com/channel/CHANNEL_ID
PLAYLIST RegExp

Regular expression for matching YouTube playlist URLs of the form(s):

  • https://youtube.com/playlist?list=PLAYLIST_ID
  • https://www.youtube.com/playlist?list=PLAYLIST_ID

MUSIC RegExp

Regular expression for matching YouTube Music URLs of the form(s):

  • https://music.youtube.com/watch?v=VIDEO_ID
  • https://music.youtube.com/playlist?list=PLAYLIST_ID

Since:
  • 1.0.0
Source: