Update Streamtape.ts

This commit is contained in:
GSTAR 2025-11-07 07:33:55 +01:00 committed by webstreamr
parent 6eb28c8b0f
commit 088427bbf4

View file

@ -9,23 +9,14 @@ import { Extractor } from './Extractor';
export class Streamtape extends Extractor {
public readonly id = 'streamtape';
public readonly label = 'Streamtape(MFP)';
// ✅ Add the domains list here
public readonly domains = [
'streamtape.com', 'strtape.cloud', 'streamtape.net', 'streamta.pe', 'streamtape.site',
'strcloud.link', 'strcloud.club', 'strtpe.link', 'streamtape.cc', 'scloud.online', 'stape.fun',
'streamadblockplus.com', 'shavetape.cash', 'streamtape.to', 'streamta.site',
'streamadblocker.xyz', 'tapewithadblock.org', 'adblocktape.wiki', 'antiadtape.com',
'streamtape.xyz', 'tapeblocker.com', 'streamnoads.com', 'tapeadvertisement.com',
'tapeadsenjoyer.com', 'watchadsontape.com'
];
public readonly label = 'Streamtape (via MediaFlow Proxy)';
public supports(ctx: Context, url: URL): boolean {
// ✅ Match any of the known domains dynamically
const isSupportedDomain = this.domains.some(domain => url.hostname.endsWith(domain));
return isSupportedDomain && supportsMediaFlowProxy(ctx);
}
return null !== url.host.match(
/(streamtape|strtape\.cloud|streamtape\.net|streamta\.pe|streamtape\.site|strcloud\.link|strcloud\.club|strtpe\.link|streamtape\.cc|scloud\.online|stape\.fun|streamadblockplus\.com|shavetape\.cash|streamtape\.to|streamta\.site|streamadblocker\.xyz|tapewithadblock\.org|adblocktape\.wiki|antiadtape\.com|streamtape\.xyz|tapeblocker\.com|streamnoads\.com|tapeadvertisement\.com|tapeadsenjoyer\.com|watchadsontape\.com)/
) && supportsMediaFlowProxy(ctx);
}
public override normalize(url: URL): URL {
return new URL(url.href.replace('/e/', '/v/'));
@ -40,6 +31,7 @@ export class Streamtape extends Extractor {
const html = await this.fetcher.text(ctx, url, { headers });
const sizeMatch = html.match(/([\d.]+ ?[GM]B)/) as string[];
const $ = cheerio.load(html);
const title = $('meta[name="og:title"]').attr('content') as string;
@ -53,7 +45,7 @@ export class Streamtape extends Extractor {
meta: {
...meta,
title,
bytes: bytes.parse(sizeMatch?.[1] ?? '0') as number,
bytes: bytes.parse(sizeMatch[1] as string) as number,
},
},
];