@iamtraction/play-dl
    Preparing search index...

    Function yt_validate

    • Validate YouTube URL or ID.

      CAUTION : If your search word is 11 or 12 characters long, you might get it validated as video ID.

      To avoid above, add one more condition to yt_validate

      if (url.startsWith('https') && yt_validate(url) === 'video') {
      // YouTube Video Url.
      }

      Parameters

      • url: string

        YouTube URL OR ID

      Returns false | "search" | "video" | "playlist"

      'playlist' | 'video' | 'search' | false