UNPKG

source-scraper-jwplayer-runner

Version:

Provides the JWPlayerRunner class for scrapping.

27 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const JWPlayerRunner_1 = require("./JWPlayerRunner"); const JWPlayerSource_1 = require("./JWPlayerSource"); const source_scraper_core_1 = require("source-scraper-core"); class SimpleJWPlayerScraper extends source_scraper_core_1.SourceRunnerScraper { constructor() { super(...arguments); this.name = 'jwplayer'; this.domains = []; this.urlPattern = /.*/i; this.runner = new JWPlayerRunner_1.JWPlayerRunner(); this.defaultOptions = {}; } async execWithArgs({ sources, poster }) { return { poster, sources: sources.map(s => { const url = s.file; delete s.file; return { ...s, url }; }).map(s => new JWPlayerSource_1.JWPlayerSource(s)) }; } } exports.SimpleJWPlayerScraper = SimpleJWPlayerScraper; //# sourceMappingURL=SimpleJWPlayerScraper.js.map