source-scraper-flowplayer-runner
Version:
Provides the FlowplayerRunner class for scrapping.
55 lines (54 loc) • 1.89 kB
TypeScript
import { IRunner, IRunnerArgs, Runner } from 'source-scraper-core';
import { IPuppeteerRunner, IPuppeteerRunnerArgs, IPuppeteerRunnerOptions } from 'source-scraper-puppeteer-runner';
import { JSHandle } from 'puppeteer';
export interface IFlowplayerConfigSource {
type: string;
src: string;
}
export interface IFlowplayerClip {
sources: IFlowplayerConfigSource[];
}
export interface IFlowplayerConfig {
debug: boolean;
disabled: boolean;
fullscreen: boolean;
keyboard: boolean;
ratio: number;
adaptiveRatio: boolean;
rtmp: number;
proxy: string;
hlsQualities: boolean;
splash: boolean;
live: boolean;
livePositionOffset: number;
swf: string;
swfHls: string;
speeds: number[];
tooltip: boolean;
mouseoutTimeout: number;
volume: number;
errors: string[];
errorUrls: string[];
playlist: any[];
hlsFix?: any;
clip: IFlowplayerClip;
logo: string;
native_fullscreen: boolean;
share: boolean;
autoplay: boolean;
hostname: string;
origin: string;
}
export declare type IFlowplayerRunnerOptions = IPuppeteerRunnerOptions;
export interface IFlowplayerRunnerArgs extends IPuppeteerRunnerArgs, IRunnerArgs<IFlowplayerRunnerOptions> {
flowplayer: JSHandle;
config: IFlowplayerConfig;
clip: IFlowplayerClip;
sources: IFlowplayerConfigSource[];
}
export interface IFlowplayerRunner<T> extends IRunner<T, IFlowplayerRunnerOptions, IFlowplayerRunnerArgs> {
}
export declare class FlowplayerRunner<T> extends Runner<T, IFlowplayerRunnerOptions, IFlowplayerRunnerArgs> implements IFlowplayerRunner<T>, IPuppeteerRunner<T> {
defaultOptions: IFlowplayerRunnerOptions;
protected exec(url: string, scraper: (args: IFlowplayerRunnerArgs) => Promise<T>, options: IFlowplayerRunnerOptions): Promise<T>;
}