UNPKG

nurlresolver

Version:
34 lines 1.16 kB
import { BaseUrlResolver } from "../BaseResolver.js"; export class ExtralinksResolver extends BaseUrlResolver { constructor() { super({ domains: [/https?:\/\/extralinks/] }); } async resolveInner(_urlToResolve) { const links = []; const page = await this.gotInstance(_urlToResolve); const regex_link = /document\.getElementById\("download"\)\.src="([^"]*)/g; const matchesLink = regex_link.exec(page.body); if (matchesLink && matchesLink[1]) { const result = { link: matchesLink[1], isPlayable: true }; links.push(result); } else { const regex_link02 = /location\.href ="(https:\/\/drive\.google\.com[^"]*)"/g; const anotherMatch = regex_link02.exec(page.body); if (anotherMatch && anotherMatch[1]) { const result = { link: anotherMatch[1], isPlayable: false }; links.push(result); } } return links; } } //# sourceMappingURL=extralinks.js.map