UNPKG

nurlresolver

Version:
31 lines 1.08 kB
import { BaseUrlResolver } from "../BaseResolver.js"; export class VideobinResolver extends BaseUrlResolver { constructor() { super({ domains: [/https?:\/\/(videobin)/], useCookies: true, speedRank: 50 }); } async resolveInner(_urlToResolve) { const response = await this.gotInstance(_urlToResolve); const matches = /sources: \[([^\]]*)/.exec(response.body); const hrefmatches = matches?.[1].match(/http[^"]*/g); const resultoreturn = []; if (hrefmatches) { for (const link of hrefmatches) { if (link.indexOf('m3u8') > 0) continue; const title = `${this.scrapePageTitle(response.body)}.mp4`; //this.extractFileNameFromUrl(link); const result = { link, title, isPlayable: true }; resultoreturn.push(result); } } return resultoreturn; } } //# sourceMappingURL=videobin.js.map