diff --git a/src/source/HomeCine.test.ts b/src/source/HomeCine.test.ts index 48b100b..bc01b57 100644 --- a/src/source/HomeCine.test.ts +++ b/src/source/HomeCine.test.ts @@ -31,6 +31,11 @@ describe('HomeCine', () => { expect(streams).toMatchSnapshot(); }); + test('handle marvel - the punisher', async () => { + const streams = await source.handle(createTestContext({ es: 'on' }), 'movie', new TmdbId(67178, 1, 1)); + expect(streams).toMatchSnapshot(); + }); + test('does not return mx content for es', async () => { const streams = await source.handle(createTestContext({ es: 'on' }), 'movie', new TmdbId(559969, undefined, undefined)); expect(streams).toMatchSnapshot(); diff --git a/src/source/HomeCine.ts b/src/source/HomeCine.ts index a72ab48..32199ea 100644 --- a/src/source/HomeCine.ts +++ b/src/source/HomeCine.ts @@ -62,18 +62,28 @@ export class HomeCine implements Source { }).toArray(); }; - private readonly fetchPageUrl = async (ctx: Context, keyword: string, year: number, tmdbId: TmdbId): Promise => { - const searchUrl = new URL(`/?s=${encodeURIComponent(keyword)}`, this.baseUrl); + private readonly fetchPageUrl = async (ctx: Context, name: string, year: number, tmdbId: TmdbId): Promise => { + const searchUrl = new URL(`/?s=${encodeURIComponent(name)}`, this.baseUrl); const html = await this.fetcher.text(ctx, searchUrl); const $ = cheerio.load(html); - const urls = $(`a[oldtitle="${keyword} (${year})"], a[oldtitle="${keyword}"]`) - .filter((_i, el) => $(el).siblings('#hidden_tip').find(`a[href$="release-year/${year}"]`).length !== 0) - .map((_i, el) => new URL($(el).attr('href') as string)) - .toArray() - .filter(url => tmdbId.season ? url.href.includes('/series/') : !url.href.includes('/series/')); + const keywords = [ + name, + name.replace('-', '–'), + ]; + + const urls: URL[] = []; + keywords.map((keyword) => { + urls.push( + ...$(`a[oldtitle="${keyword} (${year})"], a[oldtitle="${keyword}"]`) + .filter((_i, el) => $(el).siblings('#hidden_tip').find(`a[href$="release-year/${year}"]`).length !== 0) + .map((_i, el) => new URL($(el).attr('href') as string)) + .toArray() + .filter(url => tmdbId.season ? url.href.includes('/series/') : !url.href.includes('/series/')), + ); + }); return urls[0]; }; diff --git a/src/source/__fixtures__/HomeCine/https:api.themoviedb.org3tv67178languagees b/src/source/__fixtures__/HomeCine/https:api.themoviedb.org3tv67178languagees new file mode 100644 index 0000000..cbb6ccf --- /dev/null +++ b/src/source/__fixtures__/HomeCine/https:api.themoviedb.org3tv67178languagees @@ -0,0 +1 @@ +{"adult":false,"backdrop_path":"/jBGjbSDRxOEudW9rmQbWDzJUKq9.jpg","created_by":[{"id":1240816,"credit_id":"580d4a20c3a3682286013d6b","name":"Steve Lightfoot","original_name":"Steve Lightfoot","gender":2,"profile_path":"/2CPBXSicKlQO0xnhmYgEhWUGL42.jpg"}],"episode_run_time":[53],"first_air_date":"2017-11-17","genres":[{"id":10759,"name":"Action & Adventure"},{"id":80,"name":"Crimen"},{"id":18,"name":"Drama"}],"homepage":"https://www.disneyplus.com/series/the-punisher/6JOZHgU6cBS3","id":67178,"in_production":false,"languages":["en"],"last_air_date":"2019-01-18","last_episode_to_air":{"id":1675739,"name":"El torbellino","overview":"Frank, Pilgrim, Madani, Russo, Amy, Curt y la familia Schultz. La conclusión explosiva de la segunda temporada no escatima en munición.","vote_average":8.228,"vote_count":57,"air_date":"2019-01-18","episode_number":13,"episode_type":"finale","production_code":"","runtime":57,"season_number":2,"show_id":67178,"still_path":"/oqu7NwokmhEQRCplas6wixHJ9H2.jpg"},"name":"Marvel - The Punisher","next_episode_to_air":null,"networks":[{"id":213,"logo_path":"/wwemzKWzjKYJFfCeiB57q3r4Bcm.png","name":"Netflix","origin_country":""}],"number_of_episodes":26,"number_of_seasons":2,"origin_country":["US"],"original_language":"en","original_name":"Marvel's The Punisher","overview":"Un antiguo marine decidido a castigar a los asesinos de su familia termina atrapado en una conspiración militar.","popularity":17.2499,"poster_path":"/8OdIbo68mFE4w6jXA20aL8ocPsE.jpg","production_companies":[{"id":38679,"logo_path":"/v2y3LuLxYtW36hvLa8IDGQk3Oql.png","name":"Marvel Television","origin_country":"US"},{"id":19366,"logo_path":"/vOH8dyQhLK01pg5fYkgiS31jlFm.png","name":"ABC Studios","origin_country":"US"},{"id":156964,"logo_path":null,"name":"Bohemian Risk Productions","origin_country":"US"}],"production_countries":[{"iso_3166_1":"US","name":"United States of America"}],"seasons":[{"air_date":"2017-11-17","episode_count":13,"id":78693,"name":"Temporada 1","overview":"Tras vengarse de los responsables de la muerte de su mujer y sus hijos, tomándose la justicia por su mano, Frank Castle descubre una conspiración que va mucho más allá del submundo criminal de Nueva York. Ahora conocido en toda la ciudad como el Castigador, debe descubrir la verdad sobre injusticias que afectan más familias aparte de la suya propia.","poster_path":"/ngg9srI1F4op7bRHX33QJhls9zq.jpg","season_number":1,"vote_average":8.0},{"air_date":"2019-01-18","episode_count":13,"id":115281,"name":"Temporada 2","overview":"Frank Castle, ex marine convertido en vigilante, llevaba una vida tranquila en la carretera hasta que, de repente, tiene que salvar a una joven chica de ser asesinada. A medida que se ve envuelto en el misterio que rodea a la joven y a aquellos que persiguen la información que ella posee, Castle atrae un nuevo objetivo a su espalda mientras nuevos y viejos enemigos le obligan a enfrentarse a si debe aceptar su destino y abrazar la vida como \"El Castigador\".","poster_path":"/kMYg7RbRYjzv9xQbkSg70G7fIM3.jpg","season_number":2,"vote_average":8.0}],"spoken_languages":[{"english_name":"English","iso_639_1":"en","name":"English"}],"status":"Canceled","tagline":"","type":"Scripted","vote_average":8.1,"vote_count":2825} \ No newline at end of file diff --git a/src/source/__fixtures__/HomeCine/https:www3.homecine.toepisodemarvel-the-punisher-temporada-1-capitulo-1 b/src/source/__fixtures__/HomeCine/https:www3.homecine.toepisodemarvel-the-punisher-temporada-1-capitulo-1 new file mode 100644 index 0000000..1ed10b1 --- /dev/null +++ b/src/source/__fixtures__/HomeCine/https:www3.homecine.toepisodemarvel-the-punisher-temporada-1-capitulo-1 @@ -0,0 +1,925 @@ + + + + + + +Marvel – The Punisher Temporada 1 Capitulo 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+
+
+
+

Únete a nuestro grupo de TELEGRAM Pide tu Pelicula o Serie, Reporta Errores, Etc.. ¡Clic Aquí!.

+
+
+
+ + + + +
+
+ +
+ +

Ver Marvel – The Punisher Temporada 1 Capitulo 1

+
+

*REPRODUCTOR BLOQUEADO*


+

DESBLOQUEAR

+
+

TUTORIAL: CLICK AQUI PARA APRENDER A DESBLOQUEAR LOS VIDEOS

+ +
+

+
+ +
+
+
+
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+ +
+
+ + Turn off light + + + Favorite + + +AnteriorSiguiente + +Comments +(0) + + + Report + +
+
+ + + +
+ +
+ +
+
+ + + + + + + +
+ + +
+
+
+
+ +
+ +
+ +
+

Marvel – The Punisher Temporada 1 Capitulo 1

+
+ +
+
+ +
+

El exmarine Frank Castle vive como un espectro en el infierno que el mismo creó para vengar a su familia. La furia late en sus ojos. La justicia está en sus manos.

+
+ +
+
+
+
+ +
+ + + + +
+
+
Marvel – The Punisher Temporada 1 Capitulo 1
+
Marvel – The Punisher Temporada 1 Capitulo 1
+
+
+
+
+ + +
+ + +
+ + +
+
+
+ Server +Language +Quality +Links +
+ + +
+
+ + + + + + + + +
+ + + +
+ + + +
+
+ +

Comments

+

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

+ +

+ +

+
+
+ + +
+ + + + +
+
+
+
+ + + +
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/src/source/__fixtures__/HomeCine/https:www3.homecine.tosMarvelpercent20-percent20Thepercent20Punisher b/src/source/__fixtures__/HomeCine/https:www3.homecine.tosMarvelpercent20-percent20Thepercent20Punisher new file mode 100644 index 0000000..3243594 --- /dev/null +++ b/src/source/__fixtures__/HomeCine/https:www3.homecine.tosMarvelpercent20-percent20Thepercent20Punisher @@ -0,0 +1,405 @@ + + + + + + + Marvel – The Punisher Resultados de la búsqueda + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+
+
+ +
+ + +
+
+Search results for "Marvel - The Punisher" +
+
+
+
+ + +HD 1080p + + +Marvel – The Punisher +

Marvel – The Punisher

+
+ +
+
Marvel – The Punisher
+
HD 1080p
+ + +
+
TMDb: 8.11
+ + + + + +
53 min
+
+
+ +

Un antiguo marine decidido a castigar a los asesinos de su familia termina atrapado en una conspiración militar.

+

+ +
Status: Canceled
+ + + + + +
+
+ +
+
+ + +
+ +
+
+
+ + +
+ +
+ + + + + + + + + + + \ No newline at end of file diff --git a/src/source/__fixtures__/HomeCine/https:www3.homecine.toseriesmarvel-the-punisher b/src/source/__fixtures__/HomeCine/https:www3.homecine.toseriesmarvel-the-punisher new file mode 100644 index 0000000..6da52c5 --- /dev/null +++ b/src/source/__fixtures__/HomeCine/https:www3.homecine.toseriesmarvel-the-punisher @@ -0,0 +1,961 @@ + + + + + + +Marvel – The Punisher + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+
+
+
+
+

Únete a nuestro grupo de TELEGRAM Pide tu Pelicula o Serie, Reporta Errores, Etc.. ¡Clic Aquí!.

+
+
+
+ +
+ +
+
+
+ + + + + Favorite + + + + +Comments +(0) + + + Report + +
+
+ + + + +
+ + + + +
+ + + + +
+
+
+
+ +
+
+

Marvel – The Punisher

+ +
+ +
+
+
+

Un antiguo marine decidido a castigar a los asesinos de su familia termina atrapado en una conspiración militar.

+
+
+ +
+

TV Status: Canceled

+ +

Duration: 53 min

+ +

Release:

+
+ + +
+ + + + + + +
+ +

TMDb: 8.11

+

Networks:

+
+
+
+
+
+
+
+ + + +
+ + + + + +
+
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
Marvel – The Punisher
+
+
+
+
+ + + + + + +
+
+ +

Comments

+

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

+ +

+ +

+
+
+ + +
+ + + + + + + +
+
+ +
+ + + + +
+ +
+ + + + + + + + + + + \ No newline at end of file diff --git a/src/source/__snapshots__/HomeCine.test.ts.snap b/src/source/__snapshots__/HomeCine.test.ts.snap index e2a732a..7ce9e6d 100644 --- a/src/source/__snapshots__/HomeCine.test.ts.snap +++ b/src/source/__snapshots__/HomeCine.test.ts.snap @@ -35,6 +35,16 @@ exports[`HomeCine handle el camino 1`] = ` ] `; +exports[`HomeCine handle marvel - the punisher 1`] = ` +[ + { + "countryCode": "es", + "title": "Marvel - The Punisher 1x1", + "url": "https://fastream.to/embed-ujq9uojoftog.html", + }, +] +`; + exports[`HomeCine handle walking dead s1e1 1`] = ` [ {