@playzone/youtube-transcript
Version:
A JavaScript API which allows you to get the transcripts/subtitles for a given YouTube video. It also works for automatically generated subtitles and it does not require a headless browser.
84 lines • 3.29 kB
TypeScript
/**
* Base exception class for all YouTube Transcript API errors
*/
export declare class YouTubeTranscriptApiException extends Error {
constructor(message: string);
}
/**
* Base class for errors that prevent transcript retrieval
*/
export declare class CouldNotRetrieveTranscript extends YouTubeTranscriptApiException {
readonly videoId: string;
protected static readonly ERROR_MESSAGE = "\nCould not retrieve a transcript for the video {videoUrl}!";
protected static readonly CAUSE_MESSAGE_INTRO = " This is most likely caused by:\n\n{cause}";
protected static readonly GITHUB_REFERRAL: string;
constructor(videoId: string);
protected buildErrorMessage(): string;
protected getCause(): string;
toString(): string;
}
export declare class YouTubeDataUnparsable extends CouldNotRetrieveTranscript {
protected getCause(): string;
}
export declare class YouTubeRequestFailed extends CouldNotRetrieveTranscript {
readonly reason: string;
constructor(videoId: string, reason: string);
protected getCause(): string;
}
export declare class VideoUnplayable extends CouldNotRetrieveTranscript {
readonly reason: string | null;
readonly subReasons: string[];
constructor(videoId: string, reason: string | null, subReasons?: string[]);
protected getCause(): string;
}
export declare class VideoUnavailable extends CouldNotRetrieveTranscript {
protected getCause(): string;
}
export declare class InvalidVideoId extends CouldNotRetrieveTranscript {
protected getCause(): string;
}
export declare class RequestBlocked extends CouldNotRetrieveTranscript {
protected static readonly BASE_CAUSE_MESSAGE: string;
protected static readonly CAUSE_MESSAGE: string;
private _proxyConfig;
constructor(videoId: string);
withProxyConfig(proxyConfig: any): RequestBlocked;
protected getCause(): string;
}
export declare class IpBlocked extends RequestBlocked {
protected getCause(): string;
}
export declare class TranscriptsDisabled extends CouldNotRetrieveTranscript {
protected getCause(): string;
}
export declare class AgeRestricted extends CouldNotRetrieveTranscript {
protected getCause(): string;
}
export declare class NotTranslatable extends CouldNotRetrieveTranscript {
protected getCause(): string;
}
export declare class TranslationLanguageNotAvailable extends CouldNotRetrieveTranscript {
protected getCause(): string;
}
export declare class FailedToCreateConsentCookie extends CouldNotRetrieveTranscript {
protected getCause(): string;
}
export declare class NoTranscriptFound extends CouldNotRetrieveTranscript {
readonly requestedLanguageCodes: string[];
readonly transcriptData: any;
constructor(videoId: string, requestedLanguageCodes: string[], transcriptData: any);
protected getCause(): string;
}
export declare class PoTokenRequired extends CouldNotRetrieveTranscript {
protected getCause(): string;
}
export declare class CookieError extends YouTubeTranscriptApiException {
constructor(message: string);
}
export declare class CookiePathInvalid extends CookieError {
constructor(cookiePath: string);
}
export declare class CookieInvalid extends CookieError {
constructor(cookiePath: string);
}
//# sourceMappingURL=index.d.ts.map