diff --git a/src/index.ts b/src/index.ts index 62b1127..1cb5752 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,7 @@ import { v4 as uuidv4 } from 'uuid'; import winston from 'winston'; import { ConfigureController, ManifestController, StreamController } from './controller'; import { createExtractors, ExtractorRegistry } from './extractor'; -import { CineHDPlus, Cuevana, Eurostreaming, Frembed, FrenchCloud, KinoGer, MeineCloud, MostraGuarda, Soaper, Source, StreamKiste, VerHdLink, VidSrc, VixSrc } from './source'; +import { CineHDPlus, Cuevana, Eurostreaming, Frembed, FrenchCloud, KinoGer, MegaKino, MeineCloud, MostraGuarda, Soaper, Source, StreamKiste, VerHdLink, VidSrc, VixSrc } from './source'; import { envGet, envIsProd, Fetcher, StreamResolver } from './utils'; const logger = winston.createLogger({ @@ -31,6 +31,7 @@ const sources: Source[] = [ new VerHdLink(fetcher), // DE new KinoGer(fetcher), + new MegaKino(fetcher), new MeineCloud(fetcher), new StreamKiste(fetcher), // FR diff --git a/src/source/MegaKino.test.ts b/src/source/MegaKino.test.ts new file mode 100644 index 0000000..d927885 --- /dev/null +++ b/src/source/MegaKino.test.ts @@ -0,0 +1,23 @@ +import { createTestContext } from '../test'; +import { FetcherMock, ImdbId } from '../utils'; +import { MegaKino } from './MegaKino'; + +const ctx = createTestContext({ de: 'on' }); + +describe('MegaKino', () => { + let handler: MegaKino; + + beforeEach(() => { + handler = new MegaKino(new FetcherMock(`${__dirname}/__fixtures__/MegaKino`)); + }); + + test('handles non-existent movies gracefully', async () => { + const streams = await handler.handle(ctx, 'movie', new ImdbId('tt12345678', undefined, undefined)); + expect(streams).toHaveLength(0); + }); + + test('handle imdb baymax', async () => { + const streams = await handler.handle(ctx, 'movie', new ImdbId('tt2245084', undefined, undefined)); + expect(streams).toMatchSnapshot(); + }); +}); diff --git a/src/source/MegaKino.ts b/src/source/MegaKino.ts new file mode 100644 index 0000000..c6c6421 --- /dev/null +++ b/src/source/MegaKino.ts @@ -0,0 +1,55 @@ +import * as cheerio from 'cheerio'; +import { ContentType } from 'stremio-addon-sdk'; +import { Context, CountryCode } from '../types'; +import { Fetcher, getImdbId, Id, ImdbId } from '../utils'; +import { Source, SourceResult } from './types'; + +export class MegaKino implements Source { + public readonly id = 'megakino'; + + public readonly label = 'MegaKino'; + + public readonly contentTypes: ContentType[] = ['movie']; + + public readonly countryCodes: CountryCode[] = [CountryCode.de]; + + private readonly fetcher: Fetcher; + + public constructor(fetcher: Fetcher) { + this.fetcher = fetcher; + } + + public async handle(ctx: Context, _type: string, id: Id): Promise { + const imdbId = await getImdbId(ctx, this.fetcher, id); + + const pageUrl = await this.fetchPageUrl(ctx, imdbId); + if (!pageUrl) { + return []; + } + + const html = await this.fetcher.text(ctx, pageUrl); + + const $ = cheerio.load(html); + + const title = $('title').text().trim(); + + return Promise.all( + $(`.video-inside iframe`) + .map((_i, el) => new URL(($(el).attr('data-src') ?? $(el).attr('src')) as string)) + .toArray() + .map(url => ({ countryCode: CountryCode.de, referer: pageUrl, title, url })), + ); + }; + + private fetchPageUrl = async (ctx: Context, imdbId: ImdbId): Promise => { + const html = await this.fetcher.text(ctx, new URL(`https://megakino.si/?do=search&subaction=search&story=${imdbId.id}`)); + + const $ = cheerio.load(html); + + const url = $('#dle-content a[href].poster:first') + .map((_i, el) => $(el).attr('href')) + .get(0); + + return url !== undefined ? new URL(url) : url; + }; +} diff --git a/src/source/__fixtures__/MegaKino/https:megakino.sidosearchandsubactionsearchandstorytt12345678 b/src/source/__fixtures__/MegaKino/https:megakino.sidosearchandsubactionsearchandstorytt12345678 new file mode 100644 index 0000000..33f6691 --- /dev/null +++ b/src/source/__fixtures__/MegaKino/https:megakino.sidosearchandsubactionsearchandstorytt12345678 @@ -0,0 +1,373 @@ + + + + +Site search » MEGAKino.SI- Filme und Serien Kostenlos in HD online anschauen auf Deutsch + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
+
+ + + + +
+ + + + + + + + +
+
+
Information
+
Unfortunately, site search yielded no results. Try to change or shorten your request.
+
+ + + + +
+ + + + + +
+

Поиск по сайту

+
+ + + +
+ +
+
+ + + + + + +
+ + + + + +
+ + + +
+ Kontakt + + + +
+ + + +
+ + + +
+ + + + + + + + + + + + + + + + + + diff --git a/src/source/__fixtures__/MegaKino/https:megakino.sidosearchandsubactionsearchandstorytt2245084 b/src/source/__fixtures__/MegaKino/https:megakino.sidosearchandsubactionsearchandstorytt2245084 new file mode 100644 index 0000000..bdadb5a --- /dev/null +++ b/src/source/__fixtures__/MegaKino/https:megakino.sidosearchandsubactionsearchandstorytt2245084 @@ -0,0 +1,392 @@ + + + + +Site search » MEGAKino.SI- Filme und Serien Kostenlos in HD online anschauen auf Deutsch + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
+
+ + + + +
+ + + + + + + + +
+ + + + + +
+ + + + + +
+

Поиск по сайту

+
+ + + +
+
Found 1 responses (Query results 1 - 1) :
+
+
+ + +
+ Baymax - Riesiges Robowabohu +
HD
+
+
+
+

Baymax - Riesiges Robowabohu

+
    +
  • United States of, 2014
  • +
  • Filme / Animation / Action / Adventure / Comedy / Family
  • +
+
Hiro Hamada (Stimme: Ryan Potter) ist ein brillanter Teenager und lebt in der futuristischen Stadt San Fransokyo, wo er sein geniales Erfindertalent
+
+
+ + + + + +
+ + + + + + +
+ + + + + +
+ + + +
+ Kontakt + + + +
+ + + +
+ + + +
+ + + + + + + + + + + + + + + + + + diff --git a/src/source/__fixtures__/MegaKino/https:megakino.sifilms693-baymax-riesiges-robowabohu.html b/src/source/__fixtures__/MegaKino/https:megakino.sifilms693-baymax-riesiges-robowabohu.html new file mode 100644 index 0000000..2d66134 --- /dev/null +++ b/src/source/__fixtures__/MegaKino/https:megakino.sifilms693-baymax-riesiges-robowabohu.html @@ -0,0 +1,637 @@ + + + + +Baymax - Riesiges Robowabohu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
+
+ + + + +
+ + + + + + + + +
+ + +
+ MEGAKino.SI Filme Baymax - Riesiges Robowabohu +
+ +
+ + + + + + + +
+ +
+
+ Baymax - Riesiges Robowabohu +
HD
+
+
+ + + +
+

Baymax - Riesiges Robowabohu

+
Big Hero 6
+
United States of America, 2014, 102 min
+
Filme / Animation / Action / Adventure / Comedy / Family
+
16+
+ +
+
7,8
+
+168234
+
Stream Anschauen
+
+
+ + + + + +
+ + + +
+ Kostenlos Baymax - Riesiges Robowabohu in voller länge auf Deutsch anschauen.
+ Unser Team wünscht viel Spaß beim dem Stream. +
+ +
+
+

Inhaltsangabe

+

Hiro Hamada (Stimme: Ryan Potter) ist ein brillanter Teenager und lebt in der futuristischen Stadt San Fransokyo, wo er sein geniales Erfindertalent aber bei weitem nicht so nutzt, wie es sein Bruder Tadashi (Daniel Henney) gerne hätte. Als dieser stirbt, findet Hiro den aufblasbaren Roboter Baymax (Scott Adsit), der von Tadashi entwickelt wurde, um Menschen mit Schmerzen zu helfen. Baymax' tatkräftige Unterstützung kann der aufgeweckte Junge gut gebrauchen, droht doch schon bald ein mysteriöser Mann mit einer Kabuki-Maske damit, seine Heimatstadt zu zerstören. Mit der Hilfe von Baymax und Tadashis Freunden Go Go Tomago (Jamie Chung), Wasabi (Damon Wayans Jr.), Honey Lemon (Genesis Rodriguez) und Fred (T.J. Miller) beschließt Hiro, alles zu tun, um die Katastrophe zu verhindern. Dazu stattet er seine Mitstreiter mit allerlei nützlichen High-Tech-Gerätschaften aus. Gemeinsam sind sie von nun an die "Big Hero 6"...

+ +
+

Stream "Baymax - Riesiges Robowabohu" Kostenlos auf Deutsch

+ +
+
+

Trailer

+
+
+ Baymax - Riesiges Robowabohu +
+
+
+ +
+ 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 + + + Stream in HD +
+ + + + +
+ + +
+ +
+ + + + + +
+ +
+ + + + + + +
+ +
+ 201 + 33 +
+ + +
+
+ +
+ Stream auf Deutsch Baymax - Riesiges Robowabohu in hd online Kostenlos!, Baymax - Riesiges Robowabohu in voller länge kostenlos anschauen, stream Baymax - Riesiges Robowabohu kostenlos, Baymax - Riesiges Robowabohu stream, Baymax - Riesiges Robowabohu deutsch stream, + Kostenlos Baymax - Riesiges Robowabohu anschauen, Baymax - Riesiges Robowabohu in HD anschauen, Kostenlos in HD Baymax - Riesiges Robowabohu, Baymax - Riesiges Robowabohu 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/__snapshots__/MegaKino.test.ts.snap b/src/source/__snapshots__/MegaKino.test.ts.snap new file mode 100644 index 0000000..146c5df --- /dev/null +++ b/src/source/__snapshots__/MegaKino.test.ts.snap @@ -0,0 +1,18 @@ +// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing + +exports[`MegaKino handle imdb baymax 1`] = ` +[ + { + "countryCode": "de", + "referer": "https://megakino.si/films/693-baymax-riesiges-robowabohu.html", + "title": "Baymax - Riesiges Robowabohu", + "url": "https://voe.sx/e/8doq7gwiwtig", + }, + { + "countryCode": "de", + "referer": "https://megakino.si/films/693-baymax-riesiges-robowabohu.html", + "title": "Baymax - Riesiges Robowabohu", + "url": "https://watch.gxplayer.xyz/watch?v=MEKI92PU", + }, +] +`; diff --git a/src/source/index.ts b/src/source/index.ts index 47080a6..469b5fa 100644 --- a/src/source/index.ts +++ b/src/source/index.ts @@ -4,6 +4,7 @@ export * from './Eurostreaming'; export * from './Frembed'; export * from './FrenchCloud'; export * from './KinoGer'; +export * from './MegaKino'; export * from './MeineCloud'; export * from './MostraGuarda'; export * from './Soaper';