ai-youtube-transcript
Version:
Fetch and process transcripts from YouTube videos with support for multiple languages, translation, and formatting
34 lines (33 loc) • 1.06 kB
TypeScript
/**
* Helper functions for the YouTube transcript API
*/
export declare class Helpers {
/**
* Extract the YouTube video ID from a URL or ID string
*
* @param videoId - The YouTube video URL or ID
* @returns The extracted video ID
*/
static extractVideoId(videoId: string): string;
/**
* Parse the captions data from YouTube's response
*
* @param html - The HTML content of the YouTube page
* @returns The parsed captions data or undefined if not found
*/
static parseCaptionsFromHtml(html: string): any;
/**
* Check if the HTML contains a CAPTCHA challenge
*
* @param html - The HTML content to check
* @returns Whether the HTML contains a CAPTCHA challenge
*/
static hasCaptchaChallenge(html: string): boolean;
/**
* Check if the video is available
*
* @param html - The HTML content to check
* @returns Whether the video is available
*/
static isVideoAvailable(html: string): boolean;
}