import { CookieJar } from "request"; import { ChromecastDevice } from "stratocaster"; import { IVideo } from "youtubish/dist/model"; import { BaseApp } from "../base"; import { YoutubePlayerChannel } from "./channel"; import { IYoutubeOpts } from "./config"; export { IYoutubeOpts } from "./config"; export declare type VideoFilter = (v: IVideo) => boolean; export declare function fillJar(url: string, jar: CookieJar, cookieString: string): void; export declare function pruneCookies(cookiesString: string): string | undefined; export declare function extractCookies(jar: CookieJar): string | undefined; export declare class YoutubeApp extends BaseApp { static tokenConfigKeys: string[]; static configurable: import("../../cli/configurables").CookiesConfigurable; static createPlayerChannel(options?: IYoutubeOpts): YoutubePlayerChannel; private cookies; private readonly bindData; private readonly jar; private rid; private nextRequestId; private sid; private gsessionId; private loungeId; private existingScreen; private readonly youtubish; constructor(device: ChromecastDevice, options?: IYoutubeOpts); /** * Options: * - listId: Id of playlist to enqueue. The given `videoId` should * probably be a member of this playlist * - startTime: Time in seconds to start playback. Defaults to -1 * which resumes wherever the active user (if cookies were * supplied) left off. */ play(videoId: string, options?: { listId?: string; startTime?: number; }): Promise; /** * Play the given playlist. By default, we start with the first * video in the playlist, but you can provide an index into the * playlist via the options map * * @param options.filter If provided, a predicate function that must return True * for a video in the playlist to be considered for playback */ playPlaylist(id: string, options?: { filter?: VideoFilter; index?: number; }): Promise; /** * Requires Youtubish credentials * * @param options.filter If provided, a predicate function that must return True * for a video in the playlist to be considered for playback * @param options.historyDepth How far back to search the history for an item * from this playlist before giving up (default 1000 items) */ resumePlaylist(id: string, options?: { filter?: VideoFilter; historyDepth?: number; }): Promise; /** * Add a video to the end of the queue */ addToQueue(videoId: string): Promise; playNext(videoId: string): Promise; playVideo(videoId: string): Promise; clearPlaylist(): Promise; isAuthenticated(): boolean; private playItemInPlaylist; private get inSession(); private ensureYoutubeSession; private ensureLoungeId; private bind; private queueAction; private sessionRequest; private generateXsrfToken; private getCookies; private playlistById; }