import { ICaptionTrack } from "./ICaptionTrack"; import { IRequester } from "./crawler"; import { ISubtitle } from "./ISubtitle"; /** * Youtube Caption Retriever * * Note: All Requests are locally cached * @export * @class YoutubeCaption */ export declare class YoutubeCaption { readonly videoId: string; readonly requester: IRequester; private static readonly defaultRequester; private _video_info; private _subtitles; /** * Creates an instance of YoutubeCaption * @param {string} videoId - The Youtube VideoId * @param {IRequester} requester - the http requester, defaults to SuperAgentRequester instance * @memberof YoutubeCaption */ constructor(videoId: string, requester?: IRequester); /** * Retrieve a list of Caption Tracks * * @returns {Promise} * @memberof YoutubeCaption */ getCaptionTracks(): Promise; /** * Retrieve Subtitles * * @param {string} [lang] - language to retrieve, defaults to en * @returns {Promise} * @memberof YoutubeCaption */ getSubtitles(lang?: string): Promise; /** * Retrieve Video Info * * @private * @returns {Promise} * @memberof YoutubeCaption */ private getVideoInfo; /** * Parse and Convert XML string to JSON * * @private * @param {string} xml * @returns {Promise} * @memberof YoutubeCaption */ private parseString; }