fix(extractor): grab VixSrc height from playlist
This commit is contained in:
parent
8b5588936e
commit
c5da7c1997
2 changed files with 2 additions and 15 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import bytes from 'bytes';
|
||||
import { Context, CountryCode, Format, Meta, UrlResult } from '../types';
|
||||
import {
|
||||
buildMediaFlowProxyExtractorStreamUrl,
|
||||
buildMediaFlowProxyExtractorStreamUrl, guessHeightFromPlaylist,
|
||||
hasMultiEnabled,
|
||||
iso639FromCountryCode,
|
||||
supportsMediaFlowProxy,
|
||||
|
|
@ -20,12 +19,6 @@ export class VixSrc extends Extractor {
|
|||
}
|
||||
|
||||
protected async extractInternal(ctx: Context, url: URL, meta: Meta): Promise<UrlResult[]> {
|
||||
const html = await this.fetcher.text(ctx, url);
|
||||
|
||||
const filenameMatch = html.match(/"filename":"(.*?)"/);
|
||||
const sizeMatch = html.match(/"size":(\d+)/);
|
||||
const qualityMatch = html.match(/"quality":(\d+)/);
|
||||
|
||||
const playlistUrl = await buildMediaFlowProxyExtractorStreamUrl(ctx, this.fetcher, 'VixCloud', url);
|
||||
const countryCodes = await this.determineCountryCodesFromPlaylist(ctx, playlistUrl);
|
||||
|
||||
|
|
@ -42,9 +35,7 @@ export class VixSrc extends Extractor {
|
|||
ttl: this.ttl,
|
||||
meta: {
|
||||
countryCodes,
|
||||
...(filenameMatch && { title: filenameMatch[1] }),
|
||||
...(sizeMatch && { bytes: bytes.parse(`${sizeMatch[1]} kb`) as number }),
|
||||
...(qualityMatch && { height: parseInt(qualityMatch[1] as string) }),
|
||||
height: await guessHeightFromPlaylist(ctx, this.fetcher, playlistUrl),
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -6,13 +6,11 @@ exports[`VixSrc Black Mirror 1`] = `
|
|||
"format": "hls",
|
||||
"label": "VixSrc (via MediaFlow Proxy)",
|
||||
"meta": {
|
||||
"bytes": 2389338112,
|
||||
"countryCodes": [
|
||||
"it",
|
||||
"en",
|
||||
],
|
||||
"height": 1080,
|
||||
"title": "Black.Mirror.S04E02.Arkangel.1080p.NF.WEB-DL.ITA.ENG.DDP5.1.H.264.mkv",
|
||||
},
|
||||
"sourceId": "vixsrc_",
|
||||
"ttl": 900000,
|
||||
|
|
@ -29,13 +27,11 @@ exports[`VixSrc Full Metal Jacket 1`] = `
|
|||
"format": "hls",
|
||||
"label": "VixSrc (via MediaFlow Proxy)",
|
||||
"meta": {
|
||||
"bytes": 8544718848,
|
||||
"countryCodes": [
|
||||
"it",
|
||||
"en",
|
||||
],
|
||||
"height": 1080,
|
||||
"title": "Full.metal.jacket.1987.1080p.x264.AC3.ITA.AAC.ENG.Subs.mkv",
|
||||
},
|
||||
"sourceId": "vixsrc_",
|
||||
"ttl": 900000,
|
||||
|
|
|
|||
Loading…
Reference in a new issue