fix(handler): do not ignore main link in Eurostreaming

This commit is contained in:
WebStreamr 2025-05-23 09:20:20 +00:00
parent 1447adad1b
commit f4a0b03246
No known key found for this signature in database
2 changed files with 19 additions and 8 deletions

View file

@ -37,14 +37,17 @@ export class Eurostreaming implements Handler {
const $ = cheerio.load(html);
return Promise.all(
$(`[data-num="${imdbId.series}x${imdbId.episode}"]`)
.siblings('.mirrors')
.children('[data-link!="#"]')
.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, 'it')),
const mainDataLinkElements = $(`[data-num="${imdbId.series}x${imdbId.episode}"][data-link!="#"]`);
const mirrorDataLinkElements = $(`[data-num="${imdbId.series}x${imdbId.episode}"]`)
.siblings('.mirrors')
.children('[data-link!="#"]');
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, 'it')),
);
};

View file

@ -10,6 +10,14 @@ exports[`Eurostreaming handle imdb black mirror s2e4 1`] = `
"sourceId": "supervideo_it",
"url": "https://hfs309.serversicuro.cc/hls/dnzpdeoe5xg4a3gyvaqx5ojpswtxjd5a22rklgah7,khdhascykjrixs7huqq,obtfascykj3vna7rk5a,.urlset/master.m3u8",
},
{
"bytes": 875875532,
"countryCode": "it",
"height": 1080,
"label": "SuperVideo",
"sourceId": "supervideo_it",
"url": "https://hfs309.serversicuro.cc/hls/dnzpdeoe5xg4a3gyvaqx5ojpswtxjd5a22rklgah7,khdhascykjrixs7huqq,obtfascykj3vna7rk5a,.urlset/master.m3u8",
},
{
"bytes": 875875532,
"countryCode": "it",