diff --git a/src/source/MegaKino.test.ts b/src/source/MegaKino.test.ts index 872443d..8597635 100644 --- a/src/source/MegaKino.test.ts +++ b/src/source/MegaKino.test.ts @@ -20,4 +20,14 @@ describe('MegaKino', () => { const streams = await source.handle(ctx, 'movie', new ImdbId('tt2245084', undefined, undefined)); expect(streams).toMatchSnapshot(); }); + + test('lego movie 2014', async () => { + const streams = await source.handle(ctx, 'movie', new ImdbId('tt1490017', undefined, undefined)); + expect(streams).toMatchSnapshot(); + }); + + test('lego movie 2 2019', async () => { + const streams = await source.handle(ctx, 'movie', new ImdbId('tt3513498', undefined, undefined)); + expect(streams).toMatchSnapshot(); + }); }); diff --git a/src/source/MegaKino.ts b/src/source/MegaKino.ts index ede6e70..55d15e9 100644 --- a/src/source/MegaKino.ts +++ b/src/source/MegaKino.ts @@ -1,5 +1,6 @@ import * as cheerio from 'cheerio'; import { ContentType } from 'stremio-addon-sdk'; +import { Cookie } from 'tough-cookie'; import { Context, CountryCode } from '../types'; import { Fetcher, getImdbId, Id, ImdbId } from '../utils'; import { Source, SourceResult } from './Source'; @@ -13,7 +14,7 @@ export class MegaKino extends Source { public readonly countryCodes: CountryCode[] = [CountryCode.de]; - public readonly baseUrl = 'https://megakino.si'; + public readonly baseUrl = 'https://megakino.haus'; private readonly fetcher: Fetcher; @@ -26,16 +27,18 @@ export class MegaKino extends Source { public async handleInternal(ctx: Context, _type: string, id: Id): Promise { const imdbId = await getImdbId(ctx, this.fetcher, id); - const pageUrl = await this.fetchPageUrl(ctx, imdbId); + const cookie = await this.getCookie(ctx); + + const pageUrl = await this.fetchPageUrl(ctx, imdbId, cookie); if (!pageUrl) { return []; } - const html = await this.fetcher.text(ctx, pageUrl); + const html = await this.fetcher.text(ctx, pageUrl, { headers: { Cookie: cookie.cookieString() } }); const $ = cheerio.load(html); - const title = $('title').text().trim(); + const title = $('meta[property="og:title"]').attr('content')?.trim(); return Promise.all( $(`.video-inside iframe`) @@ -45,15 +48,37 @@ export class MegaKino extends Source { ); }; - private fetchPageUrl = async (ctx: Context, imdbId: ImdbId): Promise => { - const html = await this.fetcher.text(ctx, new URL(`/?do=search&subaction=search&story=${imdbId.id}`, this.baseUrl)); + private fetchPageUrl = async (ctx: Context, imdbId: ImdbId, cookie: Cookie): Promise => { + const postUrl = new URL(this.baseUrl); + + const form = new URLSearchParams(); + form.append('do', 'search'); + form.append('subaction', 'search'); + form.append('story', `${imdbId.id}`); + + const html = await this.fetcher.textPost( + ctx, + postUrl, + form.toString(), + { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Referer': postUrl.origin, + 'Cookie': cookie.cookieString(), + }, + }, + ); const $ = cheerio.load(html); - const url = $('#dle-content a[href].poster:first') - .map((_i, el) => $(el).attr('href')) + return $('#dle-content a[href].poster:first') + .map((_i, el) => new URL($(el).attr('href') as string)) .get(0); + }; - return url !== undefined ? new URL(url) : url; + private getCookie = async (ctx: Context): Promise => { + const headers = await this.fetcher.head(ctx, new URL('/?yg=token', this.baseUrl)) as Record; + + return Cookie.parse(headers['set-cookie'] as string) as Cookie; }; } diff --git a/src/source/__fixtures__/MegaKino/head-https:megakino.hausygtoken b/src/source/__fixtures__/MegaKino/head-https:megakino.hausygtoken new file mode 100644 index 0000000..377d84e --- /dev/null +++ b/src/source/__fixtures__/MegaKino/head-https:megakino.hausygtoken @@ -0,0 +1 @@ +{"alt-svc":"h3=\":443\"; ma=86400","cache-control":"no-store","cf-cache-status":"DYNAMIC","cf-ray":"986ad05a3e58dc85-FRA","connection":"close","content-type":"text/html; charset=UTF-8","date":"Mon, 29 Sep 2025 10:31:57 GMT","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","referrer-policy":"strict-origin-when-cross-origin","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=1XKlmeSVu4MFh71WP%2FGYiuZyA22P1OT%2FQEo%2FQ5ZaoNK%2BuY%2FfQ4vqoeBZJxyouBCOM3Vs017jQPSt7IajFPZM2JpD9RR6B30xuqcxMeA9hPTfePvNwP6Giyo%3D\"}]}","server":"cloudflare","set-cookie":"yg_token=1759141917.2d9e1e4f8f41901c949a0b072fc37daf71edac9083a8e12fe62eb88997189242; HttpOnly; SameSite=Lax; Path=/; Max-Age=900; Expires=Mon, 29 Sep 2025 10:46:57 GMT","x-frame-options":"SAMEORIGIN"} \ No newline at end of file diff --git a/src/source/__fixtures__/MegaKino/https:megakino.hausadventure4804-the-lego-movie-2.html b/src/source/__fixtures__/MegaKino/https:megakino.hausadventure4804-the-lego-movie-2.html new file mode 100644 index 0000000..f6ffbbb --- /dev/null +++ b/src/source/__fixtures__/MegaKino/https:megakino.hausadventure4804-the-lego-movie-2.html @@ -0,0 +1,635 @@ + + + + +The LEGO Movie 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
+
+ + + + +
+ + + + + + + + +
+ + +
+ MEGAKino Adventure The LEGO Movie 2 +
+ +
+ + + + + + + +
+ +
+
+ The LEGO Movie 2 +
HD
+
+
+ + + +
+

The LEGO Movie 2

+
The Lego Movie 2: The Second Part
+
Canada, Denmark, United States of America, 2019, 107 min
+
Adventure / Animation / Filme
+
16+
+ +
+
6.681
+
+2840
+
Stream Anschauen
+
+
+ + + + + +
+ + + +
+ Kostenlos The LEGO Movie 2 in voller länge auf Deutsch anschauen.
+ Unser Team wünscht viel Spaß beim dem Stream. +
+ +
+
+

Inhaltsangabe

+

Fünf Jahre, nachdem die Pläne des skrupellosen Lord Business (Stimme im Original: Will Ferrell) vereitelt werden konnten, haben die DUPLO-Invasoren aus dem Weltall die heile LEGO-Welt zerstört. Mittlerweile ist Steinstadt nur noch eine postapokalyptische Brache, die heute Apokalypstadt heißt. Emmet führt sein Leben jedoch unbeirrt weiter. Im Gegensatz zu allen anderen, die sich für weitere Kämpfe wappnen, sieht er darin keinen Sinn. Doch dann müssen sich die Helden erneut zusammentun, um eine Bedrohung abzuwenden, denn ein außerirdischer Eindringling namens General Mischmasch (Stephanie Beatriz) aus dem Systar-System erscheint auf der Bildfläche. Mischmasch entführt Lucy (Elizabeth Banks), Batman (Will Arnett), EisenBart (Nick Offerman), Einhorn-Kitty (Alison Brie), Benny (Charlie Day) und Emmet (Chris Pratt) bleibt allein zurück. Er bricht auf, um seine Freunde zu retten und erhält dabei Hilfe vom intergalaktischen Abenteurer Rex Abenteuerweste (ebenfalls Chris Pratt)...

+ +
+

Stream "The LEGO Movie 2" Kostenlos auf Deutsch

+ +
+
+

Trailer

+
+
+ The LEGO Movie 2 +
+
+
+ +
+ Bei uns kannst du dir kostenlos Filme und Serien als Stream anschauen.
+ Wir zeigen dir in der Schritt-für-Schritt Anleitung wie es geht.
+ So funktioniert's +

+ +
+
+ +
+ Voe + + + +
+ + + + +
+ + +
+ +
+ + + + + + + + + + +
+ +
+ 34 + 6 +
+ + +
+
+ + + +
+ Stream auf Deutsch The LEGO Movie 2 in hd online Kostenlos!, The LEGO Movie 2 in voller länge kostenlos anschauen, stream The LEGO Movie 2 kostenlos, The LEGO Movie 2 stream, The LEGO Movie 2 deutsch stream, + Kostenlos The LEGO Movie 2 anschauen, The LEGO Movie 2 in HD anschauen, Kostenlos in HD The LEGO Movie 2, The LEGO Movie 2 auf deutsch +
+
+ + + +
+
Kommentare
+
+ + Die Mindestkommentarlänge beträgt 20 Zeichen. Respektiere dich und andere! +
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ + reload, if the code cannot be seen +
+
+ + +
+
+ + + + + +
+
+ +
+ + +
+
+
Es gibt noch keine Kommentare. Willst du der Erste sein?
+ +
+ +
+
+ +
+
+ + + + + + + + + + + + + + + +
+
+ +
+ + + + +
+ + + + + + +
+ + + + + +
+ + + +
+ Kontakt + + + +
+ + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + diff --git a/src/source/__fixtures__/MegaKino/https:megakino.sifilms693-baymax-riesiges-robowabohu.html b/src/source/__fixtures__/MegaKino/https:megakino.hausfilms693-baymax-riesiges-robowabohu.html similarity index 75% rename from src/source/__fixtures__/MegaKino/https:megakino.sifilms693-baymax-riesiges-robowabohu.html rename to src/source/__fixtures__/MegaKino/https:megakino.hausfilms693-baymax-riesiges-robowabohu.html index 2d66134..bcea754 100644 --- a/src/source/__fixtures__/MegaKino/https:megakino.sifilms693-baymax-riesiges-robowabohu.html +++ b/src/source/__fixtures__/MegaKino/https:megakino.hausfilms693-baymax-riesiges-robowabohu.html @@ -6,16 +6,15 @@ - + - - - + + - - - + + + @@ -39,17 +38,16 @@ - + - @@ -67,7 +65,7 @@ - +
Harry Potter und die Heiligtümer des Todes - Teil 1
@@ -368,7 +368,7 @@
- +
Ramstein - Das durchstoßene Herz
@@ -381,7 +381,7 @@
- +
Drachenzähmen leicht gemacht
@@ -398,7 +398,6 @@
-
Kommentare
@@ -438,7 +437,7 @@
- +
Es gibt noch keine Kommentare. Willst du der Erste sein?
@@ -449,12 +448,12 @@
- + - + @@ -499,7 +498,8 @@ let aaScript = document.createElement('script') .pmovie__player { position: relative; } -
+ +
@@ -519,11 +519,11 @@ let aaScript = document.createElement('script')