feat: add source info
This commit is contained in:
parent
ae342845f8
commit
1fb7d0c66b
5 changed files with 26 additions and 20 deletions
|
|
@ -74,7 +74,7 @@ export class VidSrc extends Extractor {
|
|||
return {
|
||||
url: m3u8Url,
|
||||
format: Format.hls,
|
||||
label: `${this.label} (${serverName})`,
|
||||
label: serverName,
|
||||
sourceId: `${this.id}_${slugify(serverName)}_${meta.countryCodes?.join('_')}`,
|
||||
ttl: this.ttl,
|
||||
meta: {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ exports[`VidSrc Black Mirror 1`] = `
|
|||
[
|
||||
{
|
||||
"format": "hls",
|
||||
"label": "VidSrc (CloudStream Pro)",
|
||||
"label": "CloudStream Pro",
|
||||
"meta": {
|
||||
"countryCodes": [],
|
||||
"height": 1040,
|
||||
|
|
@ -21,7 +21,7 @@ exports[`VidSrc Full Metal Jacket 1`] = `
|
|||
[
|
||||
{
|
||||
"format": "hls",
|
||||
"label": "VidSrc (CloudStream Pro)",
|
||||
"label": "CloudStream Pro",
|
||||
"meta": {
|
||||
"countryCodes": [],
|
||||
"height": 714,
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ export interface Meta {
|
|||
height?: number | undefined;
|
||||
referer?: string | undefined;
|
||||
title?: string | undefined;
|
||||
sourceLabel?: string | undefined;
|
||||
}
|
||||
|
||||
export enum Format {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export class StreamResolver {
|
|||
const sourceResults = await source.handle(ctx, type, id);
|
||||
|
||||
const sourceUrlResults = await Promise.all(
|
||||
sourceResults.map(({ url, meta }) => this.extractorRegistry.handle(ctx, url, { ...meta, referer: meta.referer ?? source.baseUrl })),
|
||||
sourceResults.map(({ url, meta }) => this.extractorRegistry.handle(ctx, url, { ...meta, referer: meta.referer ?? source.baseUrl, sourceLabel: source.label })),
|
||||
);
|
||||
|
||||
urlResults.push(...sourceUrlResults.flat());
|
||||
|
|
@ -172,7 +172,12 @@ export class StreamResolver {
|
|||
if (urlResult.meta?.bytes) {
|
||||
titleDetailsLine.push(`💾 ${bytes.format(urlResult.meta.bytes, { unitSeparator: ' ' })}`);
|
||||
}
|
||||
titleDetailsLine.push(`🔗 ${urlResult.label}`);
|
||||
const sourceLabel = urlResult.meta?.sourceLabel;
|
||||
if (sourceLabel) {
|
||||
titleDetailsLine.push(`🔗 ${urlResult.label} from ${urlResult.meta?.sourceLabel}`);
|
||||
} else {
|
||||
titleDetailsLine.push(`🔗 ${urlResult.label}`);
|
||||
}
|
||||
titleLines.push(titleDetailsLine.join(' '));
|
||||
|
||||
if (urlResult.error) {
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ exports[`resolve returns sorted results 1`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇩🇪 1080p",
|
||||
"title": "des-teufels-bad-2024
|
||||
💾 1.3 GB 🔗 Dropload",
|
||||
💾 1.3 GB 🔗 Dropload from MeineCloud",
|
||||
"url": "https://srv34.dropload.io/hls2/01/00197/lyo2h1snpe5c_h/master.m3u8?t=MZSqs3F338ocbM2eTs8X23s585dWcYuilGrNNcidNas&s=1749846846&e=14400&f=987607&srv=srv27&i=0.0&sp=0&ii=50.99.15.93&p1=srv27&p2=srv27",
|
||||
},
|
||||
{
|
||||
|
|
@ -203,7 +203,7 @@ exports[`resolve returns sorted results 1`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇮🇹 720p",
|
||||
"title": "the-devils-bath-2024-sd-sub-ita
|
||||
💾 1.1 GB 🔗 Dropload",
|
||||
💾 1.1 GB 🔗 Dropload from MostraGuarda",
|
||||
"url": "https://srv34.dropload.io/hls2/01/00200/xsr90y2ltdyx_h/master.m3u8?t=rsJMeR8rtWZxFi_3DOdlt98U0rvAMincCe4-awDQzHE&s=1749846846&e=14400&f=1004116&srv=srv24&i=0.0&sp=0&ii=50.99.15.93&p1=srv24&p2=srv24",
|
||||
},
|
||||
{
|
||||
|
|
@ -214,7 +214,7 @@ exports[`resolve returns sorted results 1`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇮🇹 720p",
|
||||
"title": "the-devils-bath-2024-sd-sub-ita
|
||||
💾 1.1 GB 🔗 SuperVideo",
|
||||
💾 1.1 GB 🔗 SuperVideo from MostraGuarda",
|
||||
"url": "https://hfs311.serversicuro.cc/hls/,dnzpcjj427g4a3gyvbth53rxqgffbu4vol4o7gg7pskpzb6josghbkwhnisq,.urlset/master.m3u8",
|
||||
},
|
||||
{
|
||||
|
|
@ -225,7 +225,7 @@ exports[`resolve returns sorted results 1`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇩🇪 720p",
|
||||
"title": "des-teufels-bad-2024
|
||||
💾 1 GB 🔗 SuperVideo",
|
||||
💾 1 GB 🔗 SuperVideo from MeineCloud",
|
||||
"url": "https://hfs309.serversicuro.cc/hls/,dnzpfi3d27g4a3gyvbmh5klwtl65qh654hyjtgupd6p577fze64mz3bsmdyq,.urlset/master.m3u8",
|
||||
},
|
||||
{
|
||||
|
|
@ -241,7 +241,7 @@ exports[`resolve returns sorted results 1`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇩🇪",
|
||||
"title": "des-teufels-bad-2024
|
||||
💾 755.03 MB 🔗 DoodStream",
|
||||
💾 755.03 MB 🔗 DoodStream from MeineCloud",
|
||||
"url": "https://aa360cc.cloudatacdn.com/u5kjv4jxytd3sdgge5uogji5dg4huat2pxrm2qibdbm5rlyusvlvslr3u3ta/bibyo6w0dm~mocked-random-string?token=7uebebipnnhusa4xnyea1er4&expiry=639837296000",
|
||||
},
|
||||
{
|
||||
|
|
@ -256,7 +256,7 @@ exports[`resolve returns sorted results 1`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇮🇹",
|
||||
"title": "the-devils-bath-2024-sd-sub-ita
|
||||
🔗 DoodStream",
|
||||
🔗 DoodStream from MostraGuarda",
|
||||
"url": "https://kk892as.cloudatacdn.com/u5kj7j7s27d3sdgge5woezkbi4pu672wktq3aqujw47rbx4declm2mk2k2gq/4msi5kvncy~mocked-random-string?token=aw2v2d8uhbrj2ky54d573ujk&expiry=639837296000",
|
||||
},
|
||||
]
|
||||
|
|
@ -272,7 +272,7 @@ exports[`resolve returns sorted results 2`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇩🇪 1080p",
|
||||
"title": "des-teufels-bad-2024
|
||||
💾 1.3 GB 🔗 Dropload",
|
||||
💾 1.3 GB 🔗 Dropload from MeineCloud",
|
||||
"url": "https://srv34.dropload.io/hls2/01/00197/lyo2h1snpe5c_h/master.m3u8?t=MZSqs3F338ocbM2eTs8X23s585dWcYuilGrNNcidNas&s=1749846846&e=14400&f=987607&srv=srv27&i=0.0&sp=0&ii=50.99.15.93&p1=srv27&p2=srv27",
|
||||
},
|
||||
{
|
||||
|
|
@ -283,7 +283,7 @@ exports[`resolve returns sorted results 2`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇮🇹 720p",
|
||||
"title": "the-devils-bath-2024-sd-sub-ita
|
||||
💾 1.1 GB 🔗 Dropload",
|
||||
💾 1.1 GB 🔗 Dropload from MostraGuarda",
|
||||
"url": "https://srv34.dropload.io/hls2/01/00200/xsr90y2ltdyx_h/master.m3u8?t=rsJMeR8rtWZxFi_3DOdlt98U0rvAMincCe4-awDQzHE&s=1749846846&e=14400&f=1004116&srv=srv24&i=0.0&sp=0&ii=50.99.15.93&p1=srv24&p2=srv24",
|
||||
},
|
||||
{
|
||||
|
|
@ -294,7 +294,7 @@ exports[`resolve returns sorted results 2`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇮🇹 720p",
|
||||
"title": "the-devils-bath-2024-sd-sub-ita
|
||||
💾 1.1 GB 🔗 SuperVideo",
|
||||
💾 1.1 GB 🔗 SuperVideo from MostraGuarda",
|
||||
"url": "https://hfs311.serversicuro.cc/hls/,dnzpcjj427g4a3gyvbth53rxqgffbu4vol4o7gg7pskpzb6josghbkwhnisq,.urlset/master.m3u8",
|
||||
},
|
||||
{
|
||||
|
|
@ -305,7 +305,7 @@ exports[`resolve returns sorted results 2`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇩🇪 720p",
|
||||
"title": "des-teufels-bad-2024
|
||||
💾 1 GB 🔗 SuperVideo",
|
||||
💾 1 GB 🔗 SuperVideo from MeineCloud",
|
||||
"url": "https://hfs309.serversicuro.cc/hls/,dnzpfi3d27g4a3gyvbmh5klwtl65qh654hyjtgupd6p577fze64mz3bsmdyq,.urlset/master.m3u8",
|
||||
},
|
||||
{
|
||||
|
|
@ -321,7 +321,7 @@ exports[`resolve returns sorted results 2`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇩🇪",
|
||||
"title": "des-teufels-bad-2024
|
||||
💾 755.03 MB 🔗 DoodStream",
|
||||
💾 755.03 MB 🔗 DoodStream from MeineCloud",
|
||||
"url": "https://aa360cc.cloudatacdn.com/u5kjv4jxytd3sdgge5uogji5dg4huat2pxrm2qibdbm5rlyusvlvslr3u3ta/bibyo6w0dm~mocked-random-string?token=7uebebipnnhusa4xnyea1er4&expiry=639837296000",
|
||||
},
|
||||
{
|
||||
|
|
@ -336,7 +336,7 @@ exports[`resolve returns sorted results 2`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇮🇹",
|
||||
"title": "the-devils-bath-2024-sd-sub-ita
|
||||
🔗 DoodStream",
|
||||
🔗 DoodStream from MostraGuarda",
|
||||
"url": "https://kk892as.cloudatacdn.com/u5kj7j7s27d3sdgge5woezkbi4pu672wktq3aqujw47rbx4declm2mk2k2gq/4msi5kvncy~mocked-random-string?token=aw2v2d8uhbrj2ky54d573ujk&expiry=639837296000",
|
||||
},
|
||||
{
|
||||
|
|
@ -346,7 +346,7 @@ exports[`resolve returns sorted results 2`] = `
|
|||
},
|
||||
"externalUrl": "https://mixdrop.ag/e/3nzwveprim63or6",
|
||||
"name": "WebStreamr 🇩🇪 ⚠️ external",
|
||||
"title": "🔗 mixdrop.ag",
|
||||
"title": "🔗 mixdrop.ag from MeineCloud",
|
||||
},
|
||||
{
|
||||
"behaviorHints": {
|
||||
|
|
@ -355,7 +355,7 @@ exports[`resolve returns sorted results 2`] = `
|
|||
},
|
||||
"externalUrl": "https://mixdrop.ag/e/vk196d6xfzwwo1",
|
||||
"name": "WebStreamr 🇮🇹 ⚠️ external",
|
||||
"title": "🔗 mixdrop.ag",
|
||||
"title": "🔗 mixdrop.ag from MostraGuarda",
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
|
@ -388,7 +388,7 @@ exports[`resolve returns ytId instead of url for YouTube video 1`] = `
|
|||
},
|
||||
"name": "WebStreamr 🇺🇸",
|
||||
"title": "Solaris | SCIENCE FICTION | FULL MOVIE | directed by Tarkovsky
|
||||
🔗 YouTube",
|
||||
🔗 YouTube from PrimeWire",
|
||||
"ytId": "Z8ZhQPaw4rE",
|
||||
},
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue