From 8f2e8e492fafdadef510a5e8aa5a7c56a7bad79c Mon Sep 17 00:00:00 2001
From: WebStreamr <210764791+webstreamr@users.noreply.github.com>
Date: Mon, 29 Sep 2025 20:27:49 +0000
Subject: [PATCH] chore(source): improve Eurostreaming search by trimming some
special chars and supporting similarity search
---
src/source/Eurostreaming.test.ts | 5 +
src/source/Eurostreaming.ts | 10 +-
...ttps:api.themoviedb.org3tv157239languageit | 1 +
...ien-pianeta-terra-streaming-streaming.html | 1176 +++++++++++++++++
...ubactionsearchandstoryAlien++Pianeta+Terra | 324 +++++
.../__snapshots__/Eurostreaming.test.ts.snap | 25 +
6 files changed, 1539 insertions(+), 2 deletions(-)
create mode 100644 src/source/__fixtures__/Eurostreaming/https:api.themoviedb.org3tv157239languageit
create mode 100644 src/source/__fixtures__/Eurostreaming/https:eurostreaming.luxestream4331-alien-pianeta-terra-streaming-streaming.html
create mode 100644 src/source/__fixtures__/Eurostreaming/post-https:eurostreaming.luxeindex.phpdosearch-subactionsearchandstoryAlien++Pianeta+Terra
diff --git a/src/source/Eurostreaming.test.ts b/src/source/Eurostreaming.test.ts
index 6f69045..d8b9996 100644
--- a/src/source/Eurostreaming.test.ts
+++ b/src/source/Eurostreaming.test.ts
@@ -40,4 +40,9 @@ describe('Eurostreaming', () => {
const streams = await source.handle(ctx, 'series', new TmdbId(119051, 1, 1));
expect(streams).toMatchSnapshot();
});
+
+ test('alien earth s1e1', async () => {
+ const streams = await source.handle(ctx, 'series', new TmdbId(157239, 1, 1));
+ expect(streams).toMatchSnapshot();
+ });
});
diff --git a/src/source/Eurostreaming.ts b/src/source/Eurostreaming.ts
index f8be565..6155d9d 100644
--- a/src/source/Eurostreaming.ts
+++ b/src/source/Eurostreaming.ts
@@ -1,4 +1,5 @@
import * as cheerio from 'cheerio';
+import levenshtein from 'fast-levenshtein';
import { ContentType } from 'stremio-addon-sdk';
import { Context, CountryCode } from '../types';
import { Fetcher, getTmdbId, getTmdbNameAndYear, Id } from '../utils';
@@ -27,7 +28,7 @@ export class Eurostreaming extends Source {
const tmdbId = await getTmdbId(ctx, this.fetcher, id);
const [name] = await getTmdbNameAndYear(ctx, this.fetcher, tmdbId, 'it');
- const seriesPageUrl = await this.fetchSeriesPageUrl(ctx, name);
+ const seriesPageUrl = await this.fetchSeriesPageUrl(ctx, name.replace(':', '').replace('-', ''));
if (!seriesPageUrl) {
return [];
}
@@ -74,10 +75,15 @@ export class Eurostreaming extends Source {
.map((_i, el) => new URL($(el).attr('href') as string))
.get(0);
+ const similarKeyWordMatchUrl = $(`.post-thumb a[href]:first`)
+ .filter((_i, el) => levenshtein.get(($(el).attr('title') as string).trim(), keyword, { useCollator: true }) < 5)
+ .map((_i, el) => new URL($(el).attr('href') as string))
+ .get(0);
+
const partialKeyWordMatchUrl = $(`.post-thumb a[href][title*="${keyword}"]:first`)
.map((_i, el) => new URL($(el).attr('href') as string))
.get(0);
- return exactKeyWordMatchUrl ?? partialKeyWordMatchUrl;
+ return exactKeyWordMatchUrl ?? similarKeyWordMatchUrl ?? partialKeyWordMatchUrl;
};
}
diff --git a/src/source/__fixtures__/Eurostreaming/https:api.themoviedb.org3tv157239languageit b/src/source/__fixtures__/Eurostreaming/https:api.themoviedb.org3tv157239languageit
new file mode 100644
index 0000000..33b9793
--- /dev/null
+++ b/src/source/__fixtures__/Eurostreaming/https:api.themoviedb.org3tv157239languageit
@@ -0,0 +1 @@
+{"adult":false,"backdrop_path":"/s7Lim1xma0qCNwlrQlaxM9mFLyN.jpg","created_by":[{"id":202816,"credit_id":"620bdfc73e01ea002b2f90b1","name":"Noah Hawley","original_name":"Noah Hawley","gender":2,"profile_path":"/pxVP1lywEBA9y8x5Xe3kM7m4ai3.jpg"}],"episode_run_time":[],"first_air_date":"2025-08-12","genres":[{"id":10765,"name":"Sci-Fi & Fantasy"},{"id":18,"name":"Dramma"}],"homepage":"https://www.fxnetworks.com/shows/alien-earth","id":157239,"in_production":true,"languages":["en"],"last_air_date":"2025-09-23","last_episode_to_air":{"id":6231390,"name":"I veri mostri","overview":"Emerge una nuova dinamica di potere.","vote_average":7.54,"vote_count":25,"air_date":"2025-09-23","episode_number":8,"episode_type":"finale","production_code":"XWYV1008","runtime":48,"season_number":1,"show_id":157239,"still_path":"/tssL6QBaKUkdXtmPUidrsREIEX5.jpg"},"name":"Alien - Pianeta Terra","next_episode_to_air":null,"networks":[{"id":88,"logo_path":"/aexGjtcs42DgRtZh7zOxayiry4J.png","name":"FX","origin_country":"US"},{"id":453,"logo_path":"/pqUTCleNUiTLAVlelGxUgWn1ELh.png","name":"Hulu","origin_country":"US"}],"number_of_episodes":8,"number_of_seasons":1,"origin_country":["US"],"original_language":"en","original_name":"Alien: Earth","overview":"Quando una misteriosa nave spaziale si schianta sulla Terra, una giovane donna (Sydney Chandler) e un gruppo di soldati tattici fanno una scoperta fatidica che li mette faccia a faccia con la più grande minaccia per il pianeta.","popularity":213.6674,"poster_path":"/y6DP95YbjwgDuveTNP28tFqAvWk.jpg","production_companies":[{"id":15990,"logo_path":"/5cT4zwHA66uNAr2p3CcBDLddXu2.png","name":"FX Productions","origin_country":"US"},{"id":221347,"logo_path":"/6Ry6uNBaa0IbbSs1XYIgX5DkA9r.png","name":"Scott Free Productions","origin_country":"US"},{"id":20814,"logo_path":null,"name":"26 Keys Productions","origin_country":"US"}],"production_countries":[{"iso_3166_1":"US","name":"United States of America"}],"seasons":[{"air_date":"2025-08-12","episode_count":8,"id":243129,"name":"Stagione 1","overview":"","poster_path":"/4rZdYuKbxakEGZRrgnPK7Vm5asb.jpg","season_number":1,"vote_average":7.2}],"spoken_languages":[{"english_name":"English","iso_639_1":"en","name":"English"}],"status":"Returning Series","tagline":"Eravamo più al sicuro nello spazio.","type":"Scripted","vote_average":7.616,"vote_count":565}
\ No newline at end of file
diff --git a/src/source/__fixtures__/Eurostreaming/https:eurostreaming.luxestream4331-alien-pianeta-terra-streaming-streaming.html b/src/source/__fixtures__/Eurostreaming/https:eurostreaming.luxestream4331-alien-pianeta-terra-streaming-streaming.html
new file mode 100644
index 0000000..3400351
--- /dev/null
+++ b/src/source/__fixtures__/Eurostreaming/https:eurostreaming.luxestream4331-alien-pianeta-terra-streaming-streaming.html
@@ -0,0 +1,1176 @@
+
+
+
+
+Alien: Pianeta Terra streaming SERIE TV - euroStreaming
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Alien: Pianeta Terra
+
+
+
+
+
+
+
+
+
+
Trama serie tv : Quando una misteriosa nave spaziale si schianta sulla Terra, una giovane donna (Sydney Chandler) e un gruppo di soldati tattici fanno una scoperta fatidica che li mette faccia a faccia con la più grande minaccia per il pianeta.
+ Continua a leggere
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Link disponibili "Alien: Pianeta Terra streaming " per il Download degli episodi:
+
+
+
STAGIONE 1
+
+
+
+
+
+ Neverland: Quando un'astronave si schianta sulla Terra, una sorella cerca suo fratello mentre affronta una minaccia aliena.
+
+
+
+
+
+
+
+ Mr. October: Le tensioni aumentano tra le società rivali man mano che si svolge una riunione e viene scoperto un segreto.
+
+
+
+
+
+
+
+ Metamorfosi: La squadra torna a casa con un carico inaspettato. Si verifica un esperimento inquietante e viene scoperto un nuovo talento.
+
+
+
+
+
+
+
+ Osservazione: Una connessione inattesa si forma mentre una cospirazione nascosta mette a rischio tutto.
+
+
+
+
+
+
+
+ Nello spazio, nessuno...: Un'astronave in pericolo innesca una resa dei conti pericolosa.
+
+
+
+
+
+
+
+ La Mosca: Le tensioni aumentano quando potenti nemici si scontrano e si confrontano, si sviluppa un piano pericoloso e la curiosità porta a conseguenze mortali.
+
+
+
+
+
+
+
+ Emergenza: Un piano di fuga innesca divisioni tra gruppi, tradimenti e uno scontro scioccante.
+
+
+
+
+
+
+
+ Episodio 8: Emerge una nuova dinamica di potere.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Lascia un commento:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Alien: Pianeta Terra (2025)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tutti i film e Serie TV in ITALIANO
+
+
+
+ Guardare e Scaricare senza limiti
+
+
+
+ Contenuto in massima qualità Full HD e 4K
+
+
+
+ Applicazione Mobile per Android e IOS
+
+
+
+ Ricevere gli avvisi sulle nuove uscite
+
+
+
+ Player di riserva in caso di problemi con la connessione
+
+
+
+ 0 pubblicità
+
+
+
+ Collegare fino a 6 dispositivi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/source/__fixtures__/Eurostreaming/post-https:eurostreaming.luxeindex.phpdosearch-subactionsearchandstoryAlien++Pianeta+Terra b/src/source/__fixtures__/Eurostreaming/post-https:eurostreaming.luxeindex.phpdosearch-subactionsearchandstoryAlien++Pianeta+Terra
new file mode 100644
index 0000000..d78302b
--- /dev/null
+++ b/src/source/__fixtures__/Eurostreaming/post-https:eurostreaming.luxeindex.phpdosearch-subactionsearchandstoryAlien++Pianeta+Terra
@@ -0,0 +1,324 @@
+
+
+
+
+Ricerca "Alien Pianeta Terra", trovati: 1 risultati
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Site search
+
+
+
+
+
Cerca sul sito
+
+
Found 1 responses
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/source/__snapshots__/Eurostreaming.test.ts.snap b/src/source/__snapshots__/Eurostreaming.test.ts.snap
index b19e167..3a51965 100644
--- a/src/source/__snapshots__/Eurostreaming.test.ts.snap
+++ b/src/source/__snapshots__/Eurostreaming.test.ts.snap
@@ -1,5 +1,30 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
+exports[`Eurostreaming alien earth s1e1 1`] = `
+[
+ {
+ "meta": {
+ "countryCodes": [
+ "it",
+ ],
+ "referer": "https://eurostreaming.luxe/stream/4331-alien-pianeta-terra-streaming-streaming.html",
+ "title": "Alien - Pianeta Terra 1x1",
+ },
+ "url": "https://supervideo.cc/e/lsz10iyul3ot",
+ },
+ {
+ "meta": {
+ "countryCodes": [
+ "it",
+ ],
+ "referer": "https://eurostreaming.luxe/stream/4331-alien-pianeta-terra-streaming-streaming.html",
+ "title": "Alien - Pianeta Terra 1x1",
+ },
+ "url": "https://dropload.tv/e/xjbjskdi9tuj",
+ },
+]
+`;
+
exports[`Eurostreaming game of thrones s1e1 1`] = `
[
{