feat: add title to meta, restructure result name

This commit is contained in:
WebStreamr 2025-05-25 20:13:48 +02:00
parent f27fc6c38a
commit d4e402e5c9
No known key found for this signature in database
18 changed files with 87 additions and 28 deletions

View file

@ -1,4 +1,5 @@
import randomstring from 'randomstring';
import * as cheerio from 'cheerio';
import { Extractor } from './types';
import { Fetcher } from '../utils';
import { Context, Meta } from '../types';
@ -34,11 +35,17 @@ export class DoodStream implements Extractor {
const baseUrl = await this.fetcher.text(ctx, new URL(`http://dood.to${passMd5Match[0]}`));
const $ = cheerio.load(html);
const title = $('title').text().trim().replace(/ - DoodStream$/, '').trim();
return {
url: new URL(`${baseUrl}${randomstring.generate(10)}?token=${token}&expiry=${Date.now()}`),
label: this.label,
sourceId: `${this.id}_${meta.countryCode.toLowerCase()}`,
meta,
meta: {
title,
...meta,
},
requestHeaders: {
Referer: 'http://dood.to/',
},

View file

@ -1,4 +1,5 @@
import bytes from 'bytes';
import * as cheerio from 'cheerio';
import { Extractor } from './types';
import { extractUrlFromPacked, Fetcher } from '../utils';
import { Context, Meta } from '../types';
@ -31,14 +32,18 @@ export class Dropload implements Extractor {
const sizeMatch = html.match(/([\d.]+ ?[GM]B)/) as string[];
const $ = cheerio.load(html);
const title = $('.videoplayer h1').text().trim();
return {
url: extractUrlFromPacked(html, [/sources:\[{file:"(.*?)"/]),
label: this.label,
sourceId: `${this.id}_${meta.countryCode.toLowerCase()}`,
meta: {
...meta,
bytes: bytes.parse(sizeMatch[1] as string) as number,
height: parseInt(heightMatch[1] as string) as number,
title,
...meta,
},
};
};

View file

@ -1,4 +1,5 @@
import bytes from 'bytes';
import * as cheerio from 'cheerio';
import { Extractor } from './types';
import { extractUrlFromPacked, Fetcher } from '../utils';
import { Context, Meta } from '../types';
@ -24,14 +25,18 @@ export class SuperVideo implements Extractor {
const heightAndSizeMatch = html.match(/\d{3,}x(\d{3,}), ([\d.]+ ?[GM]B)/) as string[];
const $ = cheerio.load(html);
const title = $('title').text().trim().replace(/^Watch /, '').trim();
return {
url: extractUrlFromPacked(html, [/sources:\[{file:"(.*?)"/]),
label: this.label,
sourceId: `${this.id}_${meta.countryCode.toLowerCase()}`,
meta: {
...meta,
bytes: bytes.parse(heightAndSizeMatch[2] as string) as number,
height: parseInt(heightAndSizeMatch[1] as string) as number,
title,
...meta,
},
};
};

View file

@ -42,6 +42,8 @@ export class CineHDPlus implements Handler {
return [];
}
const title = $('meta[property="og:title"]').attr('content') as string;
return Promise.all(
$(`[data-num="${imdbId.series}x${imdbId.episode}"]`)
.siblings('.mirrors')
@ -49,7 +51,7 @@ export class CineHDPlus implements Handler {
.map((_i, el) => new URL(($(el).attr('data-link') as string).replace(/^(https:)?\/\//, 'https://')))
.toArray()
.filter(url => !url.host.match(/cinehdplus/))
.map(url => this.extractorRegistry.handle(ctx, url, { countryCode })),
.map(url => this.extractorRegistry.handle(ctx, url, { countryCode, title: `${title.trim()} ${imdbId.series}x${imdbId.episode}` })),
);
};

View file

@ -42,12 +42,14 @@ export class Eurostreaming implements Handler {
.siblings('.mirrors')
.children('[data-link!="#"]');
const title = $('meta[property="og:title"]').attr('content') as string;
return Promise.all(mainDataLinkElements
.add(mirrorDataLinkElements)
.map((_i, el) => new URL(($(el).attr('data-link') as string).replace(/^(https:)?\/\//, 'https://')))
.toArray()
.filter(url => !url.host.match(/eurostreaming/))
.map(url => this.extractorRegistry.handle(ctx, url, { countryCode: 'it' })),
.map(url => this.extractorRegistry.handle(ctx, url, { countryCode: 'it', title: `${title.trim()} ${imdbId.series}x${imdbId.episode}` })),
);
};

View file

@ -46,7 +46,7 @@ export class Frembed implements Handler {
}
}
return Promise.all(urls.map(url => this.extractorRegistry.handle(ctx, url, { countryCode: 'fr' })));
return Promise.all(urls.map(url => this.extractorRegistry.handle(ctx, url, { countryCode: 'fr', title: `${json['title']} ${tmdbId.series}x${tmdbId.episode}` })));
};
private readonly apiCall = async (ctx: Context, url: URL): Promise<string | undefined> => {

View file

@ -37,6 +37,8 @@ export class KinoKiste implements Handler {
const $ = cheerio.load(html);
const title = $('meta[property="og:title"]').attr('content') as string;
return Promise.all(
$(`[data-num="${imdbId.series}x${imdbId.episode}"]`)
.siblings('.mirrors')
@ -44,7 +46,7 @@ export class KinoKiste implements Handler {
.map((_i, el) => new URL(($(el).attr('data-link') as string).replace(/^(https:)?\/\//, 'https://')))
.toArray()
.filter(url => !url.host.match(/kinokiste/))
.map(url => this.extractorRegistry.handle(ctx, url, { countryCode: 'de' })),
.map(url => this.extractorRegistry.handle(ctx, url, { countryCode: 'de', title: `${title.trim()} ${imdbId.series}x${imdbId.episode}` })),
);
};

View file

@ -8,6 +8,7 @@ exports[`CineHDPlus handle imdb babylon 5 s2e3 (es) 1`] = `
"bytes": 219571814,
"countryCode": "es",
"height": 344,
"title": "Babylon 5 2x3",
},
"sourceId": "supervideo_es",
"url": "https://hfs294.serversicuro.cc/hls/,dnzpealv5xg4a3gyvavh52jryms77x3wwakzvgy2ly3yfusnblczjnvvweua,.urlset/master.m3u8",
@ -18,6 +19,7 @@ exports[`CineHDPlus handle imdb babylon 5 s2e3 (es) 1`] = `
"bytes": 219571814,
"countryCode": "es",
"height": 344,
"title": "Babylon 5 2x3",
},
"sourceId": "dropload_es",
"url": "https://srv29.dropload.io/hls2/01/00295/957hny8mzrvh_h/master.m3u8?t=VpcZJYlXpp0FJb0Nh0yJR0nyI8-SKB2tGFwpcTx9v2w&s=1747213958&e=14400&f=1476559&i=0.0&sp=0&ii=130.61.236.204",
@ -33,6 +35,7 @@ exports[`CineHDPlus handle imdb black mirror s2e3 (mx) 1`] = `
"bytes": 146800640,
"countryCode": "mx",
"height": 360,
"title": "Black Mirror 2x3",
},
"sourceId": "supervideo_mx",
"url": "https://hfs299.serversicuro.cc/hls/,dnzpff262hg4a3gyvcex5ojxt23vrieljzut7xhjydwidlbp4g7nqswkpfwq,.urlset/master.m3u8",
@ -43,6 +46,7 @@ exports[`CineHDPlus handle imdb black mirror s2e3 (mx) 1`] = `
"bytes": 146800640,
"countryCode": "mx",
"height": 360,
"title": "Black Mirror 2x3",
},
"sourceId": "dropload_mx",
"url": "https://srv27.dropload.io/hls2/01/00075/t058ulwwkwn6_h/master.m3u8?t=GkktV2WgIMrvrgNLyjn6Bxeo2fArEAz6y9nSi_6dVAs&s=1747213564&e=14400&f=376684&i=0.0&sp=0&ii=130.61.236.204",

View file

@ -8,6 +8,7 @@ exports[`Eurostreaming handle imdb black mirror s2e4 1`] = `
"bytes": 875875532,
"countryCode": "it",
"height": 1080,
"title": "Black Mirror 2x4",
},
"sourceId": "supervideo_it",
"url": "https://hfs309.serversicuro.cc/hls/dnzpdeoe5xg4a3gyvaqx5ojpswtxjd5a22rklgah7,khdhascykjrixs7huqq,obtfascykj3vna7rk5a,.urlset/master.m3u8",
@ -18,6 +19,7 @@ exports[`Eurostreaming handle imdb black mirror s2e4 1`] = `
"bytes": 875875532,
"countryCode": "it",
"height": 1080,
"title": "Black Mirror 2x4",
},
"sourceId": "supervideo_it",
"url": "https://hfs309.serversicuro.cc/hls/dnzpdeoe5xg4a3gyvaqx5ojpswtxjd5a22rklgah7,khdhascykjrixs7huqq,obtfascykj3vna7rk5a,.urlset/master.m3u8",
@ -28,6 +30,7 @@ exports[`Eurostreaming handle imdb black mirror s2e4 1`] = `
"bytes": 875875532,
"countryCode": "it",
"height": 1080,
"title": "Black Mirror 2x4",
},
"sourceId": "dropload_it",
"url": "https://srv24.dropload.io/hls2/01/00289/978xyyxi3ldq_h/master.m3u8?t=unq9qxjYC-zgcmoXiSQ6rkMu7qHrSpN_pWOc95IPYwk&s=1747217151&e=14400&f=1448116&i=0.0&sp=0&ii=130.61.236.204",

View file

@ -6,6 +6,7 @@ exports[`Frembed handle imdb black mirror s4e2 1`] = `
"label": "DoodStream",
"meta": {
"countryCode": "fr",
"title": "Black Mirror 4x2",
},
"requestHeaders": {
"Referer": "http://dood.to/",
@ -18,6 +19,7 @@ exports[`Frembed handle imdb black mirror s4e2 1`] = `
"label": "netu.frembed.art",
"meta": {
"countryCode": "fr",
"title": "Black Mirror 4x2",
},
"sourceId": "external_fr",
"url": "https://netu.frembed.art/e/0DFgfkcXOsDP",
@ -27,6 +29,7 @@ exports[`Frembed handle imdb black mirror s4e2 1`] = `
"label": "johnalwayssame.com",
"meta": {
"countryCode": "fr",
"title": "Black Mirror 4x2",
},
"sourceId": "external_fr",
"url": "https://johnalwayssame.com/e/cqy9oue7sv0g",

View file

@ -8,6 +8,7 @@ exports[`FrenchCloud handle imdb the devil's bath 1`] = `
"bytes": 966682214,
"countryCode": "fr",
"height": 720,
"title": "the devils bath enfant pour diable 2024 cam",
},
"sourceId": "supervideo_fr",
"url": "https://hfs292.serversicuro.cc/hls/,dnzpfwdj5dg4a3gyvbwx5lbvtu65tuwysrizwl7puv6u7dkpym3afmw5hnga,.urlset/master.m3u8",
@ -18,6 +19,7 @@ exports[`FrenchCloud handle imdb the devil's bath 1`] = `
"bytes": 966682214,
"countryCode": "fr",
"height": 720,
"title": "the-devils-bath-un-enfant-pour-le-diable-2024-cam",
},
"sourceId": "dropload_fr",
"url": "https://srv28.dropload.io/hls2/01/00215/w4yit5wiia9y_h/master.m3u8?t=ujTsd4AYOdgaA6EhuMJDrC-xYzMVEbqrrd3qsoZ8iAY&s=1747054860&e=14400&f=1076096&i=0.0&sp=0&ii=130.61.236.204",
@ -35,6 +37,7 @@ exports[`FrenchCloud handle imdb the devil's bath 1`] = `
"label": "DoodStream",
"meta": {
"countryCode": "fr",
"title": "the-devils-bath-un-enfant-pour-le-diable-2024-cam",
},
"requestHeaders": {
"Referer": "http://dood.to/",

View file

@ -8,6 +8,7 @@ exports[`KinoKiste handle imdb black mirror s2e4 1`] = `
"bytes": 733793484,
"countryCode": "de",
"height": 720,
"title": "Black Mirror 2x4",
},
"sourceId": "supervideo_de",
"url": "https://hfs279.serversicuro.cc/hls/,dnzpervt3xg4a3gyvdix52ttsqpj5jgxs7keazdmhvru2uyin5g7f67a5u4a,.urlset/master.m3u8",
@ -18,6 +19,7 @@ exports[`KinoKiste handle imdb black mirror s2e4 1`] = `
"bytes": 733793484,
"countryCode": "de",
"height": 720,
"title": "Black Mirror 2x4",
},
"sourceId": "dropload_de",
"url": "https://srv34.dropload.io/hls2/01/00007/jvjwrkpijr0f_h/master.m3u8?t=9B5k5sYgDD2kS_549tQ4WYh1o74hO1QR9zzyXrVRqv4&s=1746903685&e=14400&f=35986&srv=srv27&i=0.0&sp=0&ii=130.61.236.204&p1=srv27&p2=srv27",

View file

@ -8,6 +8,7 @@ exports[`MeineCloud handle imdb the devil's bath 1`] = `
"bytes": 1073741824,
"countryCode": "de",
"height": 720,
"title": "des teufels bad 2024",
},
"sourceId": "supervideo_de",
"url": "https://hfs290.serversicuro.cc/hls/,dnzpfi3d27g4a3gyvbmh5klwtl65qh654hyjtgupd6p56thhyqu6ra3olbfa,.urlset/master.m3u8",
@ -18,6 +19,7 @@ exports[`MeineCloud handle imdb the devil's bath 1`] = `
"bytes": 1395864371,
"countryCode": "de",
"height": 1080,
"title": "des-teufels-bad-2024",
},
"sourceId": "dropload_de",
"url": "https://srv27.dropload.io/hls2/01/00197/lyo2h1snpe5c_h/master.m3u8?t=qTZsRGIMnUjXsQ4o2LRLlsT4tGG1AdJrRBRDGttNLPM&s=1746903744&e=14400&f=987607&i=0.0&sp=0&ii=130.61.236.204",
@ -35,6 +37,7 @@ exports[`MeineCloud handle imdb the devil's bath 1`] = `
"label": "DoodStream",
"meta": {
"countryCode": "de",
"title": "des-teufels-bad-2024",
},
"requestHeaders": {
"Referer": "http://dood.to/",

View file

@ -8,6 +8,7 @@ exports[`MostraGuarda handle imdb the devil's bath 1`] = `
"bytes": 1181116006,
"countryCode": "it",
"height": 720,
"title": "the devils bath 2024 sub ita",
},
"sourceId": "supervideo_it",
"url": "https://hfs279.serversicuro.cc/hls/,dnzpejj427g4a3gyvbth53rxqewqgqqzp3wr6zwutysvud7zroar3cb75d3q,.urlset/master.m3u8",
@ -18,6 +19,7 @@ exports[`MostraGuarda handle imdb the devil's bath 1`] = `
"bytes": 1181116006,
"countryCode": "it",
"height": 720,
"title": "the-devils-bath-2024-sd-sub-ita",
},
"sourceId": "dropload_it",
"url": "https://srv34.dropload.io/hls2/01/00200/xsr90y2ltdyx_h/master.m3u8?t=avFOZ-10hDxo6__iaoSUrq7o4yY3ldLw6XDlXxpXF8E&s=1747059001&e=14400&f=1004116&srv=srv24&i=0.0&sp=0&ii=130.61.236.204&p1=srv24&p2=srv24",
@ -35,6 +37,7 @@ exports[`MostraGuarda handle imdb the devil's bath 1`] = `
"label": "DoodStream",
"meta": {
"countryCode": "it",
"title": "the-devils-bath-2024-sd-sub-ita",
},
"requestHeaders": {
"Referer": "http://dood.to/",

View file

@ -8,6 +8,7 @@ exports[`VerHdLink handle titanic 1`] = `
"bytes": 1503238553,
"countryCode": "mx",
"height": 556,
"title": "titanic 1997 [latino]",
},
"sourceId": "supervideo_mx",
"url": "https://hfs292.serversicuro.cc/hls/,dnzpejlw37g4a3gyvdzh5p3xttjqd3ccheao6qexhjbv4ecdpod7hxlh4a7a,.urlset/master.m3u8",
@ -18,6 +19,7 @@ exports[`VerHdLink handle titanic 1`] = `
"bytes": 1503238553,
"countryCode": "mx",
"height": 556,
"title": "titanic-1997-[latino]",
},
"sourceId": "dropload_mx",
"url": "https://srv22.dropload.io/hls2/01/00046/jjjx9j5joiz8_h/master.m3u8?t=_sOFVDjKUqBAK_gJtH7YVQnCm6nj7kr4df3PNsKeKAA&s=1747060128&e=14400&f=230703&i=0.0&sp=0&ii=130.61.236.204",
@ -37,6 +39,7 @@ exports[`VerHdLink handle titanic 1`] = `
"bytes": 1610612736,
"countryCode": "es",
"height": 544,
"title": "titanic 1997 2[castellano]",
},
"sourceId": "supervideo_es",
"url": "https://hfs295.serversicuro.cc/hls/,dnzpfv3w37g4a3gyvdzh5kjeyi4vtoyw4x4it5gxl4zzwiv4t3fxkvagrhea,.urlset/master.m3u8",
@ -47,6 +50,7 @@ exports[`VerHdLink handle titanic 1`] = `
"bytes": 1610612736,
"countryCode": "es",
"height": 544,
"title": "titanic-1997-2[castellano]",
},
"sourceId": "dropload_es",
"url": "https://srv23.dropload.io/hls2/01/00046/ick4ti66vt6s_h/master.m3u8?t=OUbNiE0qRNUy69JP4AIj1bGcV5kaljyNrAUlCYWGVOs&s=1747060128&e=14400&f=230700&i=0.0&sp=0&ii=130.61.236.204",

View file

@ -16,6 +16,7 @@ export interface Meta {
bytes?: number;
countryCode: CountryCode;
height?: number;
title?: string;
}
export interface UrlResult {

View file

@ -70,6 +70,9 @@ export class StreamResolver {
streams.push(
...urlResults.map((urlResult) => {
let name = 'WebStreamr';
if (urlResult.meta.countryCode) {
name += ` ${flag(urlResult.meta.countryCode)}`;
}
if (urlResult.meta.height) {
name += ` ${urlResult.meta.height}p`;
}
@ -77,13 +80,12 @@ export class StreamResolver {
name += ` external`;
}
let title = urlResult.label;
const titleSecondLineEntries: string[] = [];
if (urlResult.meta.bytes) {
title += ` | 💾 ${bytes.format(urlResult.meta.bytes, { unitSeparator: ' ' })}`;
}
if (urlResult.meta.countryCode) {
title += ` | ${flag(urlResult.meta.countryCode)}`;
titleSecondLineEntries.push(`💾 ${bytes.format(urlResult.meta.bytes, { unitSeparator: ' ' })}`);
}
titleSecondLineEntries.push(`⚙️ ${urlResult.label}`);
const title = [urlResult.meta.title ?? '', titleSecondLineEntries.join(' ')].join('\n');
return {
[urlResult.isExternal ? 'externalUrl' : 'url']: urlResult.url.href,

View file

@ -7,8 +7,9 @@ exports[`resolve returns sorted results 1`] = `
"bingeGroup": "webstreamr-dropload_de",
"videoSize": 1395864371,
},
"name": "WebStreamr 1080p",
"title": "Dropload | 💾 1.3 GB | 🇩🇪",
"name": "WebStreamr 🇩🇪 1080p",
"title": "des-teufels-bad-2024
💾 1.3 GB ⚙️ Dropload",
"url": "https://srv27.dropload.io/hls2/01/00197/lyo2h1snpe5c_h/master.m3u8?t=qTZsRGIMnUjXsQ4o2LRLlsT4tGG1AdJrRBRDGttNLPM&s=1746903744&e=14400&f=987607&i=0.0&sp=0&ii=130.61.236.204",
},
{
@ -16,8 +17,9 @@ exports[`resolve returns sorted results 1`] = `
"bingeGroup": "webstreamr-dropload_it",
"videoSize": 1181116006,
},
"name": "WebStreamr 720p",
"title": "Dropload | 💾 1.1 GB | 🇮🇹",
"name": "WebStreamr 🇮🇹 720p",
"title": "the-devils-bath-2024-sd-sub-ita
💾 1.1 GB ⚙️ Dropload",
"url": "https://srv34.dropload.io/hls2/01/00200/xsr90y2ltdyx_h/master.m3u8?t=avFOZ-10hDxo6__iaoSUrq7o4yY3ldLw6XDlXxpXF8E&s=1747059001&e=14400&f=1004116&srv=srv24&i=0.0&sp=0&ii=130.61.236.204&p1=srv24&p2=srv24",
},
{
@ -25,8 +27,9 @@ exports[`resolve returns sorted results 1`] = `
"bingeGroup": "webstreamr-supervideo_it",
"videoSize": 1181116006,
},
"name": "WebStreamr 720p",
"title": "SuperVideo | 💾 1.1 GB | 🇮🇹",
"name": "WebStreamr 🇮🇹 720p",
"title": "the devils bath 2024 sub ita
💾 1.1 GB ⚙️ SuperVideo",
"url": "https://hfs279.serversicuro.cc/hls/,dnzpejj427g4a3gyvbth53rxqewqgqqzp3wr6zwutysvud7zroar3cb75d3q,.urlset/master.m3u8",
},
{
@ -34,8 +37,9 @@ exports[`resolve returns sorted results 1`] = `
"bingeGroup": "webstreamr-supervideo_de",
"videoSize": 1073741824,
},
"name": "WebStreamr 720p",
"title": "SuperVideo | 💾 1 GB | 🇩🇪",
"name": "WebStreamr 🇩🇪 720p",
"title": "des teufels bad 2024
💾 1 GB ⚙️ SuperVideo",
"url": "https://hfs290.serversicuro.cc/hls/,dnzpfi3d27g4a3gyvbmh5klwtl65qh654hyjtgupd6p56thhyqu6ra3olbfa,.urlset/master.m3u8",
},
{
@ -48,8 +52,9 @@ exports[`resolve returns sorted results 1`] = `
},
},
},
"name": "WebStreamr",
"title": "DoodStream | 🇩🇪",
"name": "WebStreamr 🇩🇪",
"title": "des-teufels-bad-2024
⚙️ DoodStream",
"url": "https://aa360cc.cloudatacdn.com/u5kjv4jxytd3sdgge5uogji5dg4huat2pxrm2qibdbm5rtpmbzgb5tornooa/k9wk0js17e~mocked-random-string?token=7uebebipnnhusa4xnyea1er4&expiry=639837296000",
},
{
@ -62,8 +67,9 @@ exports[`resolve returns sorted results 1`] = `
},
},
},
"name": "WebStreamr",
"title": "DoodStream | 🇮🇹",
"name": "WebStreamr 🇮🇹",
"title": "the-devils-bath-2024-sd-sub-ita
⚙️ DoodStream",
"url": "https://kk892as.cloudatacdn.com/u5kj7j7s27d3sdgge5woezkbi4pu672wktq3aqujw47rbpl3xog2gtqnw2xa/awn9rgotuu~mocked-random-string?token=aw2v2d8uhbrj2ky54d573ujk&expiry=639837296000",
},
{
@ -71,16 +77,18 @@ exports[`resolve returns sorted results 1`] = `
"bingeGroup": "webstreamr-external_de",
},
"externalUrl": "https://mixdrop.ag/e/3nzwveprim63or6",
"name": "WebStreamr external",
"title": "mixdrop.ag | 🇩🇪",
"name": "WebStreamr 🇩🇪 external",
"title": "
⚙️ mixdrop.ag",
},
{
"behaviorHints": {
"bingeGroup": "webstreamr-external_it",
},
"externalUrl": "https://mixdrop.ag/e/vk196d6xfzwwo1",
"name": "WebStreamr external",
"title": "mixdrop.ag | 🇮🇹",
"name": "WebStreamr 🇮🇹 external",
"title": "
⚙️ mixdrop.ag",
},
]
`;