react-native-consumet 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/generated/java/com/consumet/NativeConsumetSpec.java +1 -1
- package/android/generated/jni/RNConsumetSpec-generated.cpp +2 -2
- package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI-generated.cpp +3 -2
- package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI.h +5 -5
- package/android/src/main/assets/crypto-js.js +1 -0
- package/android/src/main/assets/megacloud.decodedpng.js +606 -0
- package/android/src/main/assets/megacloud.getsrcs.js +832 -0
- package/android/src/main/java/com/consumet/ConsumetModule.kt +37 -69
- package/ios/generated/RNConsumetSpec/RNConsumetSpec-generated.mm +2 -2
- package/ios/generated/RNConsumetSpec/RNConsumetSpec.h +2 -1
- package/ios/generated/RNConsumetSpecJSI-generated.cpp +3 -2
- package/ios/generated/RNConsumetSpecJSI.h +5 -5
- package/lib/commonjs/NativeConsumet.ts +9 -2
- package/lib/commonjs/extractors/megacloud/index.js +2 -3
- package/lib/commonjs/extractors/megacloud/index.js.map +1 -1
- package/lib/commonjs/extractors/megaup.js +56 -63
- package/lib/commonjs/extractors/megaup.js.map +1 -1
- package/lib/commonjs/extractors/vidcloud.js +2 -3
- package/lib/commonjs/extractors/vidcloud.js.map +1 -1
- package/lib/commonjs/index.js +0 -13
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/types.js +1 -0
- package/lib/commonjs/models/types.js.map +1 -1
- package/lib/commonjs/providers/anime/animekai.js +3 -2
- package/lib/commonjs/providers/anime/animekai.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe.js +3 -3
- package/lib/commonjs/providers/anime/animepahe.js.map +1 -1
- package/lib/commonjs/providers/movies/himovies.js +404 -0
- package/lib/commonjs/providers/movies/himovies.js.map +1 -0
- package/lib/commonjs/providers/movies/index.js +3 -1
- package/lib/commonjs/providers/movies/index.js.map +1 -1
- package/lib/commonjs/providers/movies/netflixmirror.js +2 -2
- package/lib/commonjs/providers/movies/netflixmirror.js.map +1 -1
- package/lib/commonjs/utils/providers-list.js +1 -1
- package/lib/commonjs/utils/providers-list.js.map +1 -1
- package/lib/module/NativeConsumet.ts +9 -2
- package/lib/module/extractors/megacloud/index.js +2 -2
- package/lib/module/extractors/megacloud/index.js.map +1 -1
- package/lib/module/extractors/megaup.js +56 -63
- package/lib/module/extractors/megaup.js.map +1 -1
- package/lib/module/extractors/vidcloud.js +2 -2
- package/lib/module/extractors/vidcloud.js.map +1 -1
- package/lib/module/index.js +0 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/types.js +1 -0
- package/lib/module/models/types.js.map +1 -1
- package/lib/module/providers/anime/animekai.js +3 -2
- package/lib/module/providers/anime/animekai.js.map +1 -1
- package/lib/module/providers/anime/animepahe.js +1 -1
- package/lib/module/providers/anime/animepahe.js.map +1 -1
- package/lib/module/providers/movies/himovies.js +401 -0
- package/lib/module/providers/movies/himovies.js.map +1 -0
- package/lib/module/providers/movies/index.js +3 -1
- package/lib/module/providers/movies/index.js.map +1 -1
- package/lib/module/providers/movies/netflixmirror.js +1 -1
- package/lib/module/providers/movies/netflixmirror.js.map +1 -1
- package/lib/module/utils/providers-list.js +1 -1
- package/lib/module/utils/providers-list.js.map +1 -1
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts +16 -3
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/megaup.d.ts +7 -5
- package/lib/typescript/commonjs/src/extractors/megaup.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +0 -10
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/types.d.ts +2 -1
- package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/movies/himovies.d.ts +41 -0
- package/lib/typescript/commonjs/src/providers/movies/himovies.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/providers-list.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/providers-list.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeConsumet.d.ts +16 -3
- package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/megaup.d.ts +7 -5
- package/lib/typescript/module/src/extractors/megaup.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +0 -10
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/types.d.ts +2 -1
- package/lib/typescript/module/src/models/types.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/movies/himovies.d.ts +41 -0
- package/lib/typescript/module/src/providers/movies/himovies.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/movies/index.d.ts +2 -0
- package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/providers-list.d.ts +1 -1
- package/lib/typescript/module/src/utils/providers-list.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeConsumet.ts +9 -2
- package/src/extractors/megacloud/index.ts +2 -2
- package/src/extractors/megaup.ts +60 -83
- package/src/extractors/vidcloud.ts +2 -2
- package/src/index.tsx +135 -138
- package/src/models/types.ts +1 -0
- package/src/providers/anime/animekai.ts +2 -2
- package/src/providers/anime/animepahe.ts +1 -1
- package/src/providers/movies/himovies.ts +495 -0
- package/src/providers/movies/index.ts +2 -0
- package/src/providers/movies/netflixmirror.ts +1 -1
- package/src/utils/providers-list.ts +1 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { MovieParser, TvType, type IMovieInfo, type IEpisodeServer, StreamingServers, type ISource, type IMovieResult, type ISearch } from '../../models';
|
|
2
|
+
declare class HiMovies extends MovieParser {
|
|
3
|
+
readonly name = "HiMovies";
|
|
4
|
+
protected baseUrl: string;
|
|
5
|
+
protected logo: string;
|
|
6
|
+
protected classPath: string;
|
|
7
|
+
supportedTypes: Set<TvType>;
|
|
8
|
+
constructor(customBaseURL?: string);
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param query search query string
|
|
12
|
+
* @param page page number (default 1) (optional)
|
|
13
|
+
*/
|
|
14
|
+
search: (query: string, page?: number) => Promise<ISearch<IMovieResult>>;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param mediaId media link or id
|
|
18
|
+
*/
|
|
19
|
+
fetchMediaInfo: (mediaId: string) => Promise<IMovieInfo>;
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @param episodeId episode id
|
|
23
|
+
* @param mediaId media id
|
|
24
|
+
* @param server server type (default `MegaCloud`) (optional)
|
|
25
|
+
*/
|
|
26
|
+
fetchEpisodeSources: (episodeId: string, mediaId: string, server?: StreamingServers) => Promise<ISource>;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param episodeId takes episode link or movie id
|
|
30
|
+
* @param mediaId takes movie link or id (found on movie info object)
|
|
31
|
+
*/
|
|
32
|
+
fetchEpisodeServers: (episodeId: string, mediaId: string) => Promise<IEpisodeServer[]>;
|
|
33
|
+
fetchRecentMovies: () => Promise<IMovieResult[]>;
|
|
34
|
+
fetchRecentTvShows: () => Promise<IMovieResult[]>;
|
|
35
|
+
fetchTrendingMovies: () => Promise<IMovieResult[]>;
|
|
36
|
+
fetchTrendingTvShows: () => Promise<IMovieResult[]>;
|
|
37
|
+
fetchByCountry: (country: string, page?: number) => Promise<ISearch<IMovieResult>>;
|
|
38
|
+
fetchByGenre: (genre: string, page?: number) => Promise<ISearch<IMovieResult>>;
|
|
39
|
+
}
|
|
40
|
+
export default HiMovies;
|
|
41
|
+
//# sourceMappingURL=himovies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"himovies.d.ts","sourceRoot":"","sources":["../../../../../../src/providers/movies/himovies.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,MAAM,EACN,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,gBAAgB,EAChB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,OAAO,EACb,MAAM,cAAc,CAAC;AAGtB,cAAM,QAAS,SAAQ,WAAW;IAChC,SAAkB,IAAI,cAAc;IACpC,UAAmB,OAAO,SAAyB;IACnD,UAAmB,IAAI,SAA4D;IACnF,UAAmB,SAAS,SAAqB;IACxC,cAAc,cAA4C;gBACvD,aAAa,CAAC,EAAE,MAAM;IAalC;;;;OAIG;IACM,MAAM,GAAU,OAAO,MAAM,EAAE,OAAM,MAAU,KAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAmCvF;IAEF;;;OAGG;IACM,cAAc,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,UAAU,CAAC,CAgGpE;IAEF;;;;;OAKG;IACM,mBAAmB,GAC1B,WAAW,MAAM,EACjB,SAAS,MAAM,EACf,SAAQ,gBAA6C,KACpD,OAAO,CAAC,OAAO,CAAC,CA0CjB;IAEF;;;;OAIG;IACM,mBAAmB,GAAU,WAAW,MAAM,EAAE,SAAS,MAAM,KAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CA0BlG;IAEF,iBAAiB,QAAa,OAAO,CAAC,YAAY,EAAE,CAAC,CA6BnD;IAEF,kBAAkB,QAAa,OAAO,CAAC,YAAY,EAAE,CAAC,CA6BpD;IAEF,mBAAmB,QAAa,OAAO,CAAC,YAAY,EAAE,CAAC,CA2BrD;IAEF,oBAAoB,QAAa,OAAO,CAAC,YAAY,EAAE,CAAC,CA2BtD;IAEF,cAAc,GAAU,SAAS,MAAM,EAAE,OAAM,MAAU,KAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CA+CxF;IAEF,YAAY,GAAU,OAAO,MAAM,EAAE,OAAM,MAAU,KAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAiDpF;CACH;AAWD,eAAe,QAAQ,CAAC"}
|
|
@@ -10,6 +10,7 @@ import ViewAsian from './viewAsian';
|
|
|
10
10
|
import SFlix from './sflix';
|
|
11
11
|
import MultiMovies from './multimovies';
|
|
12
12
|
import NetflixMirror from './netflixmirror';
|
|
13
|
+
import HiMovies from './himovies';
|
|
13
14
|
declare const _default: {
|
|
14
15
|
DramaCool: typeof DramaCool;
|
|
15
16
|
FlixHQ: typeof FlixHQ;
|
|
@@ -23,6 +24,7 @@ declare const _default: {
|
|
|
23
24
|
SFlix: typeof SFlix;
|
|
24
25
|
MultiMovies: typeof MultiMovies;
|
|
25
26
|
NetflixMirror: typeof NetflixMirror;
|
|
27
|
+
HiMovies: typeof HiMovies;
|
|
26
28
|
};
|
|
27
29
|
export default _default;
|
|
28
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/providers/movies/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,aAAa,MAAM,iBAAiB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/providers/movies/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,QAAQ,MAAM,YAAY,CAAC;;;;;;;;;;;;;;;;AAElC,wBAcE"}
|
|
@@ -8,7 +8,7 @@ export declare const PROVIDERS_LIST: {
|
|
|
8
8
|
MANGA: (import("../providers/manga/mangadex").default | import("../providers/manga/comick").default | import("../providers/manga/mangahere").default | import("../providers/manga/mangakakalot").default | import("../providers/manga/mangasee123").default | import("../providers/manga/mangapark").default | import("../providers/manga/mangapill").default | import("../providers/manga/mangareader").default | import("../providers/manga/flamescans").default | import("../providers/manga/mangahost").default | import("../providers/manga/brmangas").default)[];
|
|
9
9
|
COMICS: import("../providers/comics/getComics").default[];
|
|
10
10
|
LIGHT_NOVELS: import("../providers/light-novels/readlightnovels").default[];
|
|
11
|
-
MOVIES: (import("../providers/movies/dramacool").default | import("../providers/movies/flixhq").default | import("../providers/movies/fmovies").default | import("../providers/movies/goku").default | import("../providers/movies/kissasian").default | import("../providers/movies/moviehdwatch").default | import("../providers/movies/viewAsian").default | import("../providers/movies/sflix").default | import("../providers/movies/multimovies").default | import("../providers/movies/netflixmirror").default)[];
|
|
11
|
+
MOVIES: (import("../providers/movies/dramacool").default | import("../providers/movies/flixhq").default | import("../providers/movies/fmovies").default | import("../providers/movies/goku").default | import("../providers/movies/kissasian").default | import("../providers/movies/moviehdwatch").default | import("../providers/movies/viewAsian").default | import("../providers/movies/sflix").default | import("../providers/movies/multimovies").default | import("../providers/movies/netflixmirror").default | import("../providers/movies/himovies").default)[];
|
|
12
12
|
NEWS: import("../providers/news/animenewsnetwork").default[];
|
|
13
13
|
META: (import("../providers/meta/anilist").default | import("../providers/meta/mal").default | import("../providers/meta/tmdb").default)[];
|
|
14
14
|
OTHERS: never[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers-list.d.ts","sourceRoot":"","sources":["../../../../../src/utils/providers-list.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"providers-list.d.ts","sourceRoot":"","sources":["../../../../../src/utils/providers-list.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;;CA0C1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-consumet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "React Native library providing access to entertainment media information (anime, movies, manga, etc.) from multiple sources, adapting the Consumet API for mobile applications.",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
package/src/NativeConsumet.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { TurboModule } from 'react-native';
|
|
|
2
2
|
import { TurboModuleRegistry } from 'react-native';
|
|
3
3
|
|
|
4
4
|
export interface Spec extends TurboModule {
|
|
5
|
-
getSources(
|
|
5
|
+
getSources(embedUrl: string, site: string): Promise<string>;
|
|
6
6
|
bypassDdosGuard(url: string): Promise<{ cookie: string }>;
|
|
7
7
|
getDdosGuardCookiesWithWebView(url: string): Promise<string>;
|
|
8
8
|
makeGetRequestWithWebView(
|
|
@@ -16,4 +16,11 @@ export interface Spec extends TurboModule {
|
|
|
16
16
|
}>;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
const NativeConsumet = TurboModuleRegistry.getEnforcing<Spec>('Consumet');
|
|
20
|
+
|
|
21
|
+
export const bypassDdosGuard = NativeConsumet.bypassDdosGuard;
|
|
22
|
+
export const getDdosGuardCookiesWithWebView = NativeConsumet.getDdosGuardCookiesWithWebView;
|
|
23
|
+
export const makeGetRequestWithWebView = NativeConsumet.makeGetRequestWithWebView;
|
|
24
|
+
export const getSources = NativeConsumet.getSources;
|
|
25
|
+
|
|
26
|
+
export default NativeConsumet;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ISource, type IVideo, VideoExtractor } from '../../models';
|
|
2
|
-
import
|
|
2
|
+
import { getSources } from '../../NativeConsumet';
|
|
3
3
|
|
|
4
4
|
class MegaCloud extends VideoExtractor {
|
|
5
5
|
protected override serverName = 'MegaCloud';
|
|
@@ -21,7 +21,7 @@ class MegaCloud extends VideoExtractor {
|
|
|
21
21
|
};
|
|
22
22
|
const regex = /\/([^\/?]+)(?=\?)/;
|
|
23
23
|
const xrax = embedIframeURL.toString().match(regex)?.[1];
|
|
24
|
-
const jsonResponse = await
|
|
24
|
+
const jsonResponse = await getSources(embedIframeURL.href, referer);
|
|
25
25
|
const resp = JSON.parse(jsonResponse);
|
|
26
26
|
|
|
27
27
|
if (!resp) return extractedData;
|
package/src/extractors/megaup.ts
CHANGED
|
@@ -1,120 +1,97 @@
|
|
|
1
1
|
//extractor for https://animekai.to
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
// https://raw.githubusercontent.com/amarullz/kaicodex/
|
|
5
|
-
// as this repository auto-updates the extraction keys when they change.
|
|
6
|
-
// If something breaks in the future, blame this part.
|
|
3
|
+
// Keys required for the decryption to work are loaded dynamically from
|
|
4
|
+
// https://raw.githubusercontent.com/amarullz/kaicodex/main/generated/keys.json
|
|
7
5
|
|
|
8
6
|
import { type ISource, type IVideo, VideoExtractor } from '../models';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
interface KaiCodex {
|
|
13
|
-
rc4: (key: string, str: string) => string;
|
|
14
|
-
safeBtoa: (s: string) => string;
|
|
15
|
-
safeAtob: (s: string) => string;
|
|
16
|
-
reverseString: (s: string) => string;
|
|
17
|
-
replaceChars: (s: string, f: string, r: string) => string;
|
|
18
|
-
enc: (n: string) => string;
|
|
19
|
-
dec: (n: string) => string;
|
|
20
|
-
decMega: (n: string) => string;
|
|
21
|
-
}
|
|
7
|
+
import type { AxiosAdapter } from 'axios';
|
|
8
|
+
import type { ProxyConfig } from '../models/types';
|
|
22
9
|
|
|
23
10
|
export class MegaUp extends VideoExtractor {
|
|
24
11
|
protected serverName: string = 'MegaUp';
|
|
25
12
|
protected sources: IVideo[] = [];
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
|
|
29
|
-
/* Old decrypting functions in case the new ones break
|
|
30
|
-
|
|
31
|
-
#reverseIt = (n: string) => {
|
|
32
|
-
return n.split('').reverse().join('');
|
|
33
|
-
};
|
|
34
|
-
#base64UrlEncode = (str: string) => {
|
|
35
|
-
return btoa(str).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
|
36
|
-
};
|
|
37
|
-
#substitute = (input: string, keys: string, values: string) => {
|
|
38
|
-
const map = Object.fromEntries(keys.split('').map((key, i) => [key, values[i] || '']));
|
|
39
|
-
const a = input
|
|
40
|
-
.split('')
|
|
41
|
-
.map(char => map[char] || char)
|
|
42
|
-
.join('');
|
|
43
|
-
return a;
|
|
44
|
-
};
|
|
45
|
-
#transform = (n: string, t: string) => {
|
|
46
|
-
const v = Array.from({ length: 256 }, (_, i) => i);
|
|
47
|
-
let c = 0,
|
|
48
|
-
f = '';
|
|
49
|
-
|
|
50
|
-
for (let w = 0; w < 256; w++) {
|
|
51
|
-
c = (c + v[w] + n.charCodeAt(w % n.length)) % 256;
|
|
52
|
-
[v[w], v[c]] = [v[c], v[w]];
|
|
53
|
-
}
|
|
54
|
-
for (let a = (c = 0), w = 0; a < t.length; a++) {
|
|
55
|
-
w = (w + 1) % 256;
|
|
56
|
-
c = (c + v[w]) % 256;
|
|
57
|
-
[v[w], v[c]] = [v[c], v[w]];
|
|
58
|
-
f += String.fromCharCode(t.charCodeAt(a) ^ v[(v[w] + v[c]) % 256]);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return f;
|
|
62
|
-
};
|
|
63
|
-
#base64UrlDecode = (n: string) => {
|
|
64
|
-
n = n
|
|
65
|
-
.padEnd(n.length + ((4 - (n.length % 4)) % 4), '=')
|
|
66
|
-
.replace(/-/g, '+')
|
|
67
|
-
.replace(/_/g, '/');
|
|
68
|
-
return atob(n);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
*/
|
|
13
|
+
private homeKeys: string[] = [];
|
|
14
|
+
private megaKeys: string[] = [];
|
|
15
|
+
private kaiKeysReady: Promise<void>;
|
|
72
16
|
|
|
73
17
|
constructor(
|
|
74
18
|
protected proxyConfig?: ProxyConfig,
|
|
75
19
|
protected adapter?: AxiosAdapter
|
|
76
20
|
) {
|
|
77
21
|
super(proxyConfig, adapter);
|
|
78
|
-
this.
|
|
22
|
+
this.kaiKeysReady = this.loadKAIKEYS();
|
|
79
23
|
}
|
|
80
24
|
|
|
81
|
-
private async
|
|
82
|
-
const
|
|
83
|
-
'https://raw.githubusercontent.com/amarullz/kaicodex/refs/heads/main/generated/kai_codex.js';
|
|
84
|
-
|
|
85
|
-
const response = await fetch(extraction_code);
|
|
86
|
-
const originalCode = await response.text();
|
|
25
|
+
private async loadKAIKEYS(): Promise<void> {
|
|
26
|
+
const extraction_keys = 'https://raw.githubusercontent.com/amarullz/kaicodex/main/generated/keys.json';
|
|
87
27
|
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
return KAICODEX;
|
|
91
|
-
`;
|
|
28
|
+
const response = await this.client.get(extraction_keys);
|
|
29
|
+
const keys = await response.data;
|
|
92
30
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
31
|
+
for (var i = 0; i < keys.kai.length; i++) {
|
|
32
|
+
this.homeKeys.push(atob(keys.kai[i]));
|
|
33
|
+
}
|
|
34
|
+
for (var i = 0; i < keys.mega.length; i++) {
|
|
35
|
+
this.megaKeys.push(atob(keys.mega[i]));
|
|
36
|
+
}
|
|
96
37
|
}
|
|
97
38
|
|
|
39
|
+
private keysChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-~!*()'.".split('');
|
|
40
|
+
|
|
98
41
|
GenerateToken = (n: string) => {
|
|
99
|
-
|
|
42
|
+
n = encodeURIComponent(n);
|
|
43
|
+
const l = n.length;
|
|
44
|
+
let o = [];
|
|
45
|
+
for (var i = 0; i < l; i++) {
|
|
46
|
+
const kc = this.homeKeys[this.keysChar.indexOf(n.charAt(i))];
|
|
47
|
+
const c = kc?.charAt(i % kc.length!);
|
|
48
|
+
o.push(c);
|
|
49
|
+
}
|
|
50
|
+
return btoa(o.join('')).replace(/\//g, '_').replace(/\+/g, '-').replace(/\=/g, '');
|
|
100
51
|
};
|
|
101
52
|
|
|
102
53
|
DecodeIframeData = (n: string) => {
|
|
103
|
-
|
|
54
|
+
n = atob(n.replace(/_/g, '/').replace(/-/g, '+'));
|
|
55
|
+
const l = n.length;
|
|
56
|
+
let o = [];
|
|
57
|
+
for (var i = 0; i < l; i++) {
|
|
58
|
+
const c = n.charCodeAt(i);
|
|
59
|
+
const k = this.megaKeys[c];
|
|
60
|
+
o.push(k?.charCodeAt(i % k.length!));
|
|
61
|
+
}
|
|
62
|
+
return decodeURIComponent(String.fromCharCode.apply(null, o.filter((val) => val !== undefined) as number[]));
|
|
104
63
|
};
|
|
105
64
|
|
|
106
65
|
Decode = (n: string) => {
|
|
107
|
-
|
|
66
|
+
n = atob(n.replace(/_/g, '/').replace(/-/g, '+'));
|
|
67
|
+
const l = n.length;
|
|
68
|
+
let o = [];
|
|
69
|
+
for (var i = 0; i < l; i++) {
|
|
70
|
+
const c = n.charCodeAt(i);
|
|
71
|
+
let cp = '';
|
|
72
|
+
for (var j = 0; j < this.homeKeys.length; j++) {
|
|
73
|
+
var ck = this.homeKeys[j]?.charCodeAt(i % this.homeKeys[j]?.length!);
|
|
74
|
+
if (ck === c) {
|
|
75
|
+
cp = this.keysChar[j]!;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (cp) {
|
|
80
|
+
o.push(cp);
|
|
81
|
+
} else {
|
|
82
|
+
o.push('%');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return decodeURIComponent(o.join(''));
|
|
108
86
|
};
|
|
109
87
|
|
|
110
88
|
override extract = async (videoUrl: URL): Promise<ISource> => {
|
|
111
89
|
try {
|
|
112
|
-
await this.
|
|
90
|
+
await this.kaiKeysReady;
|
|
113
91
|
|
|
114
92
|
const url = videoUrl.href.replace(/\/(e|e2)\//, '/media/');
|
|
115
93
|
const res = await this.client.get(url);
|
|
116
|
-
|
|
117
|
-
const decrypted = JSON.parse(this.KAICODEX.decMega(res.data.result).replace(/\\/g, ''));
|
|
94
|
+
const decrypted = JSON.parse(this.DecodeIframeData(res.data.result).replace(/\\/g, ''));
|
|
118
95
|
const data: ISource = {
|
|
119
96
|
sources: decrypted.sources.map((s: { file: string }) => ({
|
|
120
97
|
url: s.file,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VideoExtractor, type IVideo, type ISubtitle, type Intro } from '../models';
|
|
2
2
|
import { USER_AGENT } from '../utils';
|
|
3
|
-
import
|
|
3
|
+
import { getSources } from '../NativeConsumet';
|
|
4
4
|
|
|
5
5
|
class VidCloud extends VideoExtractor {
|
|
6
6
|
protected override serverName = 'VidCloud';
|
|
@@ -26,7 +26,7 @@ class VidCloud extends VideoExtractor {
|
|
|
26
26
|
|
|
27
27
|
const regex = /\/([^\/?]+)(?=\?)/;
|
|
28
28
|
const xrax = videoUrl.toString().match(regex)?.[1];
|
|
29
|
-
const jsonResponse = await
|
|
29
|
+
const jsonResponse = await getSources(videoUrl.href, referer);
|
|
30
30
|
const res = JSON.parse(jsonResponse);
|
|
31
31
|
const sources = res.sources;
|
|
32
32
|
|
package/src/index.tsx
CHANGED
|
@@ -1,138 +1,135 @@
|
|
|
1
|
-
import 'react-native-url-polyfill/auto';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
type
|
|
34
|
-
type
|
|
35
|
-
type
|
|
36
|
-
type
|
|
37
|
-
type
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
type
|
|
45
|
-
type
|
|
46
|
-
type
|
|
47
|
-
type
|
|
48
|
-
type
|
|
49
|
-
type
|
|
50
|
-
type
|
|
51
|
-
|
|
52
|
-
type
|
|
53
|
-
type
|
|
54
|
-
|
|
55
|
-
type
|
|
56
|
-
type
|
|
57
|
-
type
|
|
58
|
-
|
|
59
|
-
type
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
type
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
type
|
|
66
|
-
type
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
AniZipEpisode,
|
|
137
|
-
IMovieSeason,
|
|
138
|
-
};
|
|
1
|
+
import 'react-native-url-polyfill/auto';
|
|
2
|
+
|
|
3
|
+
import { ANIME, COMICS, LIGHT_NOVELS, MANGA, MOVIES, META, NEWS } from './providers';
|
|
4
|
+
import { PROVIDERS_LIST } from './utils/providers-list';
|
|
5
|
+
import {
|
|
6
|
+
AsianLoad,
|
|
7
|
+
BilibiliExtractor,
|
|
8
|
+
Filemoon,
|
|
9
|
+
GogoCDN,
|
|
10
|
+
Kwik,
|
|
11
|
+
MixDrop,
|
|
12
|
+
Mp4Upload,
|
|
13
|
+
RapidCloud,
|
|
14
|
+
SmashyStream,
|
|
15
|
+
StreamHub,
|
|
16
|
+
StreamLare,
|
|
17
|
+
StreamSB,
|
|
18
|
+
StreamTape,
|
|
19
|
+
StreamWish,
|
|
20
|
+
VidCloud,
|
|
21
|
+
VidMoly,
|
|
22
|
+
VizCloud,
|
|
23
|
+
Mp4Player,
|
|
24
|
+
MegaCloud,
|
|
25
|
+
VidHide,
|
|
26
|
+
Voe,
|
|
27
|
+
MegaUp,
|
|
28
|
+
} from './extractors';
|
|
29
|
+
import {
|
|
30
|
+
type IProviderStats,
|
|
31
|
+
type ISearch,
|
|
32
|
+
type IAnimeEpisode,
|
|
33
|
+
type IAnimeInfo,
|
|
34
|
+
type IAnimeResult,
|
|
35
|
+
type IEpisodeServer,
|
|
36
|
+
type IVideo,
|
|
37
|
+
type LibgenBook,
|
|
38
|
+
StreamingServers,
|
|
39
|
+
MediaStatus,
|
|
40
|
+
SubOrSub,
|
|
41
|
+
type IMangaResult,
|
|
42
|
+
type IMangaChapter,
|
|
43
|
+
type IMangaInfo,
|
|
44
|
+
type ILightNovelResult,
|
|
45
|
+
type ILightNovelInfo,
|
|
46
|
+
type ILightNovelChapter,
|
|
47
|
+
type ILightNovelChapterContent,
|
|
48
|
+
type GetComicsComics,
|
|
49
|
+
type ComicRes,
|
|
50
|
+
type IMangaChapterPage,
|
|
51
|
+
TvType,
|
|
52
|
+
type IMovieEpisode,
|
|
53
|
+
type IMovieInfo,
|
|
54
|
+
type ISource,
|
|
55
|
+
type ISubtitle,
|
|
56
|
+
type IMovieResult,
|
|
57
|
+
type Intro,
|
|
58
|
+
Genres,
|
|
59
|
+
type INewsFeed,
|
|
60
|
+
Topics,
|
|
61
|
+
type INewsInfo,
|
|
62
|
+
type FuzzyDate,
|
|
63
|
+
type ITitle,
|
|
64
|
+
MediaFormat,
|
|
65
|
+
type ProxyConfig,
|
|
66
|
+
type AniZipEpisode,
|
|
67
|
+
type IMovieSeason,
|
|
68
|
+
} from './models';
|
|
69
|
+
|
|
70
|
+
export { ANIME, COMICS, MANGA, LIGHT_NOVELS, MOVIES, META, NEWS };
|
|
71
|
+
export { PROVIDERS_LIST };
|
|
72
|
+
export {
|
|
73
|
+
Topics,
|
|
74
|
+
Genres,
|
|
75
|
+
SubOrSub,
|
|
76
|
+
StreamingServers,
|
|
77
|
+
MediaStatus,
|
|
78
|
+
TvType,
|
|
79
|
+
MediaFormat,
|
|
80
|
+
GogoCDN,
|
|
81
|
+
StreamSB,
|
|
82
|
+
VidCloud,
|
|
83
|
+
MixDrop,
|
|
84
|
+
Kwik,
|
|
85
|
+
RapidCloud,
|
|
86
|
+
StreamTape,
|
|
87
|
+
StreamLare,
|
|
88
|
+
StreamHub,
|
|
89
|
+
SmashyStream,
|
|
90
|
+
VizCloud,
|
|
91
|
+
AsianLoad,
|
|
92
|
+
BilibiliExtractor,
|
|
93
|
+
Filemoon,
|
|
94
|
+
Mp4Upload,
|
|
95
|
+
StreamWish,
|
|
96
|
+
VidMoly,
|
|
97
|
+
MegaUp,
|
|
98
|
+
Mp4Player,
|
|
99
|
+
MegaCloud,
|
|
100
|
+
VidHide,
|
|
101
|
+
Voe,
|
|
102
|
+
};
|
|
103
|
+
export type {
|
|
104
|
+
IProviderStats,
|
|
105
|
+
IAnimeEpisode,
|
|
106
|
+
IAnimeInfo,
|
|
107
|
+
IAnimeResult,
|
|
108
|
+
IEpisodeServer,
|
|
109
|
+
IVideo,
|
|
110
|
+
LibgenBook,
|
|
111
|
+
IMangaResult,
|
|
112
|
+
IMangaChapter,
|
|
113
|
+
IMangaInfo,
|
|
114
|
+
ILightNovelResult,
|
|
115
|
+
ILightNovelInfo,
|
|
116
|
+
ILightNovelChapter,
|
|
117
|
+
ILightNovelChapterContent,
|
|
118
|
+
GetComicsComics,
|
|
119
|
+
ComicRes,
|
|
120
|
+
ISearch,
|
|
121
|
+
IMangaChapterPage,
|
|
122
|
+
IMovieEpisode,
|
|
123
|
+
IMovieInfo,
|
|
124
|
+
ISource,
|
|
125
|
+
ISubtitle,
|
|
126
|
+
IMovieResult,
|
|
127
|
+
Intro,
|
|
128
|
+
INewsFeed,
|
|
129
|
+
INewsInfo,
|
|
130
|
+
FuzzyDate,
|
|
131
|
+
ITitle,
|
|
132
|
+
ProxyConfig,
|
|
133
|
+
AniZipEpisode,
|
|
134
|
+
IMovieSeason,
|
|
135
|
+
};
|
package/src/models/types.ts
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import { MegaUp } from '../../utils';
|
|
18
18
|
import axios from 'axios';
|
|
19
19
|
|
|
20
|
-
const { GenerateToken, DecodeIframeData } = new MegaUp();
|
|
20
|
+
const { GenerateToken, DecodeIframeData, Decode } = new MegaUp();
|
|
21
21
|
|
|
22
22
|
class AnimeKai extends AnimeParser {
|
|
23
23
|
override readonly name = 'AnimeKai';
|
|
@@ -576,7 +576,7 @@ class AnimeKai extends AnimeParser {
|
|
|
576
576
|
const { data } = await this.client.get(`${this.baseUrl}/ajax/links/view?id=${id}&_=${GenerateToken(id!)}`, {
|
|
577
577
|
headers: this.Headers(),
|
|
578
578
|
});
|
|
579
|
-
const decodedData = JSON.parse(
|
|
579
|
+
const decodedData = JSON.parse(Decode(data.result));
|
|
580
580
|
servers.push({
|
|
581
581
|
name: `MegaUp ${$(server).text().trim()}`!, //megaup is the only server for now
|
|
582
582
|
url: decodedData.url,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
SubOrSub,
|
|
14
14
|
} from '../../models';
|
|
15
15
|
import { Kwik } from '../../extractors';
|
|
16
|
-
import { bypassDdosGuard, getDdosGuardCookiesWithWebView } from '
|
|
16
|
+
import { bypassDdosGuard, getDdosGuardCookiesWithWebView } from '../../NativeConsumet';
|
|
17
17
|
|
|
18
18
|
class AnimePahe extends AnimeParser {
|
|
19
19
|
override readonly name = 'AnimePahe';
|