react-native-consumet 1.0.0-rc.0 → 1.0.0-rc.1
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/lib/commonjs/extension-registry.json +81 -81
- package/lib/commonjs/extractors/filemoon.js +2 -2
- package/lib/commonjs/extractors/kwik.js +4 -4
- package/lib/commonjs/extractors/megacloud.js +6 -6
- package/lib/commonjs/index.js +2 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/types.js +4 -4
- package/lib/commonjs/models/video-extractor.js +4 -4
- package/lib/commonjs/providers/anime/animedrive.js +12 -12
- package/lib/commonjs/providers/anime/animekai.js +41 -41
- package/lib/commonjs/providers/anime/animepahe/animepahe.js +16 -15
- package/lib/commonjs/providers/anime/animepahe/animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +0 -1
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/commonjs/providers/anime/animeunity.js +13 -13
- package/lib/commonjs/providers/anime/index.js +4 -4
- package/lib/commonjs/providers/anime/index.js.map +1 -1
- package/lib/commonjs/providers/anime/marin.js +12 -12
- package/lib/commonjs/providers/anime/zoro/create-zoro.js +0 -1
- package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +1 -1
- package/lib/commonjs/providers/anime/zoro/zoro.js +72 -71
- package/lib/commonjs/providers/anime/zoro/zoro.js.map +1 -1
- package/lib/commonjs/providers/manga/brmangas.js +3 -3
- package/lib/commonjs/providers/meta/anilist.js +91 -91
- package/lib/commonjs/providers/meta/mal.js +12 -12
- package/lib/commonjs/providers/meta/tmdb.js +21 -21
- package/lib/commonjs/providers/movies/himovies/create-himovies.js +16 -16
- package/lib/commonjs/providers/movies/himovies/himovies.js +16 -16
- package/lib/commonjs/providers/movies/multimovies.js +15 -15
- package/lib/commonjs/providers/movies/multistream/index.js +16 -16
- package/lib/commonjs/utils/ExtractorManager.js +15 -15
- package/lib/commonjs/utils/ExtractorManager.js.map +1 -1
- package/lib/commonjs/utils/ProviderManager.js +28 -28
- package/lib/commonjs/utils/create-extractor-context.js +2 -2
- package/lib/commonjs/utils/create-provider-context.js +6 -6
- package/lib/commonjs/utils/create-provider-context.js.map +1 -1
- package/lib/commonjs/utils/extension-utils.js +35 -53
- package/lib/commonjs/utils/extension-utils.js.map +1 -1
- package/lib/commonjs/utils/index.js +2 -2
- package/lib/commonjs/utils/provider-maps.js +31 -0
- package/lib/commonjs/utils/provider-maps.js.map +1 -0
- package/lib/commonjs/utils/providers-list.js +4 -4
- package/lib/commonjs/utils/url-polyfill.js +4 -4
- package/lib/module/extension-registry.json +81 -81
- package/lib/module/extractors/filemoon.js +2 -2
- package/lib/module/extractors/kwik.js +4 -4
- package/lib/module/extractors/megacloud.js +6 -6
- package/lib/module/index.js +3 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/types.js +4 -4
- package/lib/module/models/video-extractor.js +4 -4
- package/lib/module/providers/anime/animedrive.js +12 -12
- package/lib/module/providers/anime/animekai.js +41 -41
- package/lib/module/providers/anime/animepahe/animepahe.js +14 -14
- package/lib/module/providers/anime/animepahe/animepahe.js.map +1 -1
- package/lib/module/providers/anime/animepahe/create-animepahe.js +1 -1
- package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/module/providers/anime/animeunity.js +13 -13
- package/lib/module/providers/anime/index.js +2 -2
- package/lib/module/providers/anime/index.js.map +1 -1
- package/lib/module/providers/anime/marin.js +12 -12
- package/lib/module/providers/anime/zoro/create-zoro.js +1 -1
- package/lib/module/providers/anime/zoro/create-zoro.js.map +1 -1
- package/lib/module/providers/anime/zoro/zoro.js +70 -70
- package/lib/module/providers/anime/zoro/zoro.js.map +1 -1
- package/lib/module/providers/manga/brmangas.js +3 -3
- package/lib/module/providers/meta/anilist.js +91 -91
- package/lib/module/providers/meta/mal.js +12 -12
- package/lib/module/providers/meta/tmdb.js +21 -21
- package/lib/module/providers/movies/himovies/create-himovies.js +16 -16
- package/lib/module/providers/movies/himovies/himovies.js +16 -16
- package/lib/module/providers/movies/multimovies.js +15 -15
- package/lib/module/providers/movies/multistream/index.js +16 -16
- package/lib/module/utils/ExtractorManager.js +16 -16
- package/lib/module/utils/ExtractorManager.js.map +1 -1
- package/lib/module/utils/ProviderManager.js +28 -28
- package/lib/module/utils/create-extractor-context.js +2 -2
- package/lib/module/utils/create-provider-context.js +7 -7
- package/lib/module/utils/create-provider-context.js.map +1 -1
- package/lib/module/utils/extension-utils.js +14 -32
- package/lib/module/utils/extension-utils.js.map +1 -1
- package/lib/module/utils/index.js +1 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/provider-maps.js +27 -0
- package/lib/module/utils/provider-maps.js.map +1 -0
- package/lib/module/utils/providers-list.js +4 -4
- package/lib/module/utils/url-polyfill.js +4 -4
- package/lib/typescript/commonjs/src/index.d.ts +4 -4
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/providers/anime/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts +1 -1
- package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/extension-utils.d.ts +1 -20
- package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/provider-maps.d.ts +27 -0
- package/lib/typescript/commonjs/src/utils/provider-maps.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +4 -4
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts +1 -1
- package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/index.d.ts +2 -2
- package/lib/typescript/module/src/providers/anime/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts +1 -1
- package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/ProviderManager.d.ts +1 -1
- package/lib/typescript/module/src/utils/ProviderManager.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/extension-utils.d.ts +1 -20
- package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/index.d.ts +2 -1
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/provider-maps.d.ts +27 -0
- package/lib/typescript/module/src/utils/provider-maps.d.ts.map +1 -0
- package/package.json +206 -203
- package/src/extension-registry.json +81 -81
- package/src/extractors/StreamP2P.ts +60 -60
- package/src/extractors/filemoon.ts +58 -58
- package/src/extractors/index.ts +41 -41
- package/src/extractors/kwik.ts +50 -50
- package/src/extractors/megacloud.ts +163 -163
- package/src/extractors/mixdrop.ts +31 -31
- package/src/extractors/mp4upload.ts +31 -31
- package/src/extractors/streamhub.ts +58 -58
- package/src/extractors/streamwish.ts +120 -120
- package/src/extractors/vidhide.ts +59 -59
- package/src/index.tsx +174 -175
- package/src/models/extension-manifest.ts +77 -77
- package/src/models/extractor-context.ts +41 -41
- package/src/models/index.ts +106 -106
- package/src/models/provider-context.ts +182 -182
- package/src/models/types.ts +531 -531
- package/src/models/video-extractor.ts +48 -48
- package/src/providers/anime/animedrive.ts +245 -245
- package/src/providers/anime/animekai.ts +627 -627
- package/src/providers/anime/animepahe/animepahe.ts +76 -76
- package/src/providers/anime/animepahe/create-animepahe.ts +348 -348
- package/src/providers/anime/animeunity.ts +216 -216
- package/src/providers/anime/index.ts +21 -21
- package/src/providers/anime/marin.ts +319 -319
- package/src/providers/anime/zoro/create-zoro.ts +655 -655
- package/src/providers/anime/zoro/zoro.ts +197 -197
- package/src/providers/index.ts +7 -7
- package/src/providers/manga/brmangas.ts +144 -144
- package/src/providers/meta/anilist.ts +2108 -2108
- package/src/providers/meta/mal.ts +635 -635
- package/src/providers/meta/tmdb.ts +470 -470
- package/src/providers/movies/himovies/create-himovies.ts +529 -529
- package/src/providers/movies/himovies/himovies.ts +90 -90
- package/src/providers/movies/index.ts +15 -15
- package/src/providers/movies/multimovies.ts +495 -495
- package/src/providers/movies/multistream/index.ts +231 -231
- package/src/utils/ExtractorManager.ts +311 -311
- package/src/utils/ProviderManager.ts +424 -424
- package/src/utils/create-extractor-context.ts +22 -22
- package/src/utils/create-provider-context.ts +107 -107
- package/src/utils/extension-utils.ts +91 -114
- package/src/utils/index.ts +96 -95
- package/src/utils/provider-maps.ts +31 -0
- package/src/utils/providers-list.ts +27 -27
- package/src/utils/url-polyfill.ts +642 -642
- package/src/utils/utils.ts +374 -374
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { load } from 'cheerio';
|
|
2
|
-
import type { ExtractorContext } from '../models';
|
|
3
|
-
import { defaultAxios } from './extension-utils';
|
|
4
|
-
import { PolyURL, PolyURLSearchParams } from './url-polyfill';
|
|
5
|
-
import type { ExtractorContextConfig } from '../models/extractor-context';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Create extractor context for context-aware extractors
|
|
9
|
-
*/
|
|
10
|
-
export function createExtractorContext(config: ExtractorContextConfig = {}): ExtractorContext {
|
|
11
|
-
return {
|
|
12
|
-
axios: config.axios || defaultAxios,
|
|
13
|
-
load: config.load || load,
|
|
14
|
-
USER_AGENT:
|
|
15
|
-
config.userAgent ||
|
|
16
|
-
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
|
|
17
|
-
PolyURL: PolyURL,
|
|
18
|
-
PolyURLSearchParams: PolyURLSearchParams,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default createExtractorContext;
|
|
1
|
+
import { load } from 'cheerio';
|
|
2
|
+
import type { ExtractorContext } from '../models';
|
|
3
|
+
import { defaultAxios } from './extension-utils';
|
|
4
|
+
import { PolyURL, PolyURLSearchParams } from './url-polyfill';
|
|
5
|
+
import type { ExtractorContextConfig } from '../models/extractor-context';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create extractor context for context-aware extractors
|
|
9
|
+
*/
|
|
10
|
+
export function createExtractorContext(config: ExtractorContextConfig = {}): ExtractorContext {
|
|
11
|
+
return {
|
|
12
|
+
axios: config.axios || defaultAxios,
|
|
13
|
+
load: config.load || load,
|
|
14
|
+
USER_AGENT:
|
|
15
|
+
config.userAgent ||
|
|
16
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
|
|
17
|
+
PolyURL: PolyURL,
|
|
18
|
+
PolyURLSearchParams: PolyURLSearchParams,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default createExtractorContext;
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
import { load } from 'cheerio';
|
|
2
|
-
import type { ProviderContext, ProviderContextConfig } from '../models/provider-context';
|
|
3
|
-
import {
|
|
4
|
-
AnimeParser,
|
|
5
|
-
MovieParser,
|
|
6
|
-
MangaParser,
|
|
7
|
-
StreamingServers,
|
|
8
|
-
MediaFormat,
|
|
9
|
-
MediaStatus,
|
|
10
|
-
SubOrDub,
|
|
11
|
-
WatchListType,
|
|
12
|
-
TvType,
|
|
13
|
-
Genres,
|
|
14
|
-
Topics,
|
|
15
|
-
} from '../models';
|
|
16
|
-
|
|
17
|
-
import { defaultAxios,
|
|
18
|
-
import { PolyURL, PolyURLSearchParams } from './url-polyfill';
|
|
19
|
-
import { getDdosGuardCookiesWithWebView } from '../NativeConsumet';
|
|
20
|
-
import extensionRegistry from '../extension-registry.json';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Creates a provider context with sensible defaults for extensions
|
|
24
|
-
*
|
|
25
|
-
* @param config Optional configuration to override defaults
|
|
26
|
-
* @returns Complete ProviderContext ready for use with extensions
|
|
27
|
-
*/
|
|
28
|
-
export function createProviderContext(config: ProviderContextConfig = {}): ProviderContext {
|
|
29
|
-
// Create dynamic extractor proxy
|
|
30
|
-
const finalExtractors = new Proxy(
|
|
31
|
-
get: (target: any, prop: string) => {
|
|
32
|
-
// If it's a custom extractor, return it directly
|
|
33
|
-
if (config.extractors && config.extractors[prop]) {
|
|
34
|
-
return config.extractors[prop];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// If it's a static extractor, return it directly for immediate access
|
|
38
|
-
if (target[prop]) {
|
|
39
|
-
return target[prop];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// For dynamic extractors, return an async loader
|
|
43
|
-
return async (...args: any[]) => {
|
|
44
|
-
try {
|
|
45
|
-
// Dynamically import and create ExtractorManager to avoid circular dependency
|
|
46
|
-
const { ExtractorManager } = await import('./ExtractorManager');
|
|
47
|
-
const extractorManager = new ExtractorManager(extensionRegistry, {
|
|
48
|
-
axios: config.axios || defaultExtractorContext.axios,
|
|
49
|
-
load: config.load || defaultExtractorContext.load,
|
|
50
|
-
userAgent: config.userAgent || defaultExtractorContext.USER_AGENT,
|
|
51
|
-
});
|
|
52
|
-
const extractor = await extractorManager.loadExtractor(prop.toLowerCase() as StreamingServers);
|
|
53
|
-
return extractor.extract(args[0], ...args.slice(1));
|
|
54
|
-
} catch (error) {
|
|
55
|
-
console.warn(`⚠️ Failed to load dynamic extractor '${prop}', falling back to static:`, error);
|
|
56
|
-
// Fallback to static if available
|
|
57
|
-
if (target[prop]) {
|
|
58
|
-
return target[prop](...args);
|
|
59
|
-
}
|
|
60
|
-
throw new Error(`Extractor '${prop}' not found in dynamic or static extractors`);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
// Create base URL normalization utility
|
|
67
|
-
const createCustomBaseUrl = (defaultUrl: string, customUrl?: string): string => {
|
|
68
|
-
if (!customUrl) {
|
|
69
|
-
return defaultUrl;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (customUrl.startsWith('http://') || customUrl.startsWith('https://')) {
|
|
73
|
-
return customUrl;
|
|
74
|
-
} else {
|
|
75
|
-
return `http://${customUrl}`;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
axios: config.axios || defaultAxios,
|
|
81
|
-
load: config.load || load,
|
|
82
|
-
USER_AGENT:
|
|
83
|
-
config.userAgent ||
|
|
84
|
-
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
|
|
85
|
-
AnimeParser: config.AnimeParser || AnimeParser,
|
|
86
|
-
MovieParser: config.MovieParser || MovieParser,
|
|
87
|
-
MangaParser: config.MangaParser || MangaParser,
|
|
88
|
-
extractors: finalExtractors,
|
|
89
|
-
PolyURL: PolyURL,
|
|
90
|
-
PolyURLSearchParams: PolyURLSearchParams,
|
|
91
|
-
createCustomBaseUrl,
|
|
92
|
-
enums: {
|
|
93
|
-
StreamingServers,
|
|
94
|
-
MediaFormat,
|
|
95
|
-
MediaStatus,
|
|
96
|
-
SubOrDub,
|
|
97
|
-
WatchListType,
|
|
98
|
-
TvType,
|
|
99
|
-
Genres,
|
|
100
|
-
Topics,
|
|
101
|
-
},
|
|
102
|
-
NativeConsumet: {
|
|
103
|
-
getDdosGuardCookiesWithWebView,
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
export default createProviderContext;
|
|
1
|
+
import { load } from 'cheerio';
|
|
2
|
+
import type { ProviderContext, ProviderContextConfig } from '../models/provider-context';
|
|
3
|
+
import {
|
|
4
|
+
AnimeParser,
|
|
5
|
+
MovieParser,
|
|
6
|
+
MangaParser,
|
|
7
|
+
StreamingServers,
|
|
8
|
+
MediaFormat,
|
|
9
|
+
MediaStatus,
|
|
10
|
+
SubOrDub,
|
|
11
|
+
WatchListType,
|
|
12
|
+
TvType,
|
|
13
|
+
Genres,
|
|
14
|
+
Topics,
|
|
15
|
+
} from '../models';
|
|
16
|
+
|
|
17
|
+
import { defaultAxios, defaultExtractors, defaultExtractorContext } from './extension-utils';
|
|
18
|
+
import { PolyURL, PolyURLSearchParams } from './url-polyfill';
|
|
19
|
+
import { getDdosGuardCookiesWithWebView } from '../NativeConsumet';
|
|
20
|
+
import extensionRegistry from '../extension-registry.json';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Creates a provider context with sensible defaults for extensions
|
|
24
|
+
*
|
|
25
|
+
* @param config Optional configuration to override defaults
|
|
26
|
+
* @returns Complete ProviderContext ready for use with extensions
|
|
27
|
+
*/
|
|
28
|
+
export function createProviderContext(config: ProviderContextConfig = {}): ProviderContext {
|
|
29
|
+
// Create dynamic extractor proxy
|
|
30
|
+
const finalExtractors = new Proxy(defaultExtractors, {
|
|
31
|
+
get: (target: any, prop: string) => {
|
|
32
|
+
// If it's a custom extractor, return it directly
|
|
33
|
+
if (config.extractors && config.extractors[prop]) {
|
|
34
|
+
return config.extractors[prop];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// If it's a static extractor, return it directly for immediate access
|
|
38
|
+
if (target[prop]) {
|
|
39
|
+
return target[prop];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// For dynamic extractors, return an async loader
|
|
43
|
+
return async (...args: any[]) => {
|
|
44
|
+
try {
|
|
45
|
+
// Dynamically import and create ExtractorManager to avoid circular dependency
|
|
46
|
+
const { ExtractorManager } = await import('./ExtractorManager');
|
|
47
|
+
const extractorManager = new ExtractorManager(extensionRegistry, {
|
|
48
|
+
axios: config.axios || defaultExtractorContext.axios,
|
|
49
|
+
load: config.load || defaultExtractorContext.load,
|
|
50
|
+
userAgent: config.userAgent || defaultExtractorContext.USER_AGENT,
|
|
51
|
+
});
|
|
52
|
+
const extractor = await extractorManager.loadExtractor(prop.toLowerCase() as StreamingServers);
|
|
53
|
+
return extractor.extract(args[0], ...args.slice(1));
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.warn(`⚠️ Failed to load dynamic extractor '${prop}', falling back to static:`, error);
|
|
56
|
+
// Fallback to static if available
|
|
57
|
+
if (target[prop]) {
|
|
58
|
+
return target[prop](...args);
|
|
59
|
+
}
|
|
60
|
+
throw new Error(`Extractor '${prop}' not found in dynamic or static extractors`);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Create base URL normalization utility
|
|
67
|
+
const createCustomBaseUrl = (defaultUrl: string, customUrl?: string): string => {
|
|
68
|
+
if (!customUrl) {
|
|
69
|
+
return defaultUrl;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (customUrl.startsWith('http://') || customUrl.startsWith('https://')) {
|
|
73
|
+
return customUrl;
|
|
74
|
+
} else {
|
|
75
|
+
return `http://${customUrl}`;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
axios: config.axios || defaultAxios,
|
|
81
|
+
load: config.load || load,
|
|
82
|
+
USER_AGENT:
|
|
83
|
+
config.userAgent ||
|
|
84
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
|
|
85
|
+
AnimeParser: config.AnimeParser || AnimeParser,
|
|
86
|
+
MovieParser: config.MovieParser || MovieParser,
|
|
87
|
+
MangaParser: config.MangaParser || MangaParser,
|
|
88
|
+
extractors: finalExtractors,
|
|
89
|
+
PolyURL: PolyURL,
|
|
90
|
+
PolyURLSearchParams: PolyURLSearchParams,
|
|
91
|
+
createCustomBaseUrl,
|
|
92
|
+
enums: {
|
|
93
|
+
StreamingServers,
|
|
94
|
+
MediaFormat,
|
|
95
|
+
MediaStatus,
|
|
96
|
+
SubOrDub,
|
|
97
|
+
WatchListType,
|
|
98
|
+
TvType,
|
|
99
|
+
Genres,
|
|
100
|
+
Topics,
|
|
101
|
+
},
|
|
102
|
+
NativeConsumet: {
|
|
103
|
+
getDdosGuardCookiesWithWebView,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export default createProviderContext;
|
|
@@ -1,114 +1,91 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} from '
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'
|
|
35
|
-
'Accept': '
|
|
36
|
-
'Accept-
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
export const extractors = {
|
|
95
|
-
GogoCDN: defaultStaticExtractors.GogoCDN,
|
|
96
|
-
StreamSB: defaultStaticExtractors.StreamSB,
|
|
97
|
-
StreamTape: defaultStaticExtractors.StreamTape,
|
|
98
|
-
MixDrop: defaultStaticExtractors.MixDrop,
|
|
99
|
-
Kwik: defaultStaticExtractors.Kwik,
|
|
100
|
-
RapidCloud: defaultStaticExtractors.RapidCloud,
|
|
101
|
-
StreamWish: defaultStaticExtractors.StreamWish,
|
|
102
|
-
Filemoon: defaultStaticExtractors.Filemoon,
|
|
103
|
-
Voe: defaultStaticExtractors.Voe,
|
|
104
|
-
AsianLoad: defaultStaticExtractors.AsianLoad,
|
|
105
|
-
StreamLare: defaultStaticExtractors.StreamLare,
|
|
106
|
-
VidMoly: defaultStaticExtractors.VidMoly,
|
|
107
|
-
MegaCloud: defaultStaticExtractors.MegaCloud,
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// Type definitions for provider and extractor instances
|
|
111
|
-
export type AnimeProvider = keyof typeof animeProviders;
|
|
112
|
-
export type MovieProvider = keyof typeof movieProviders;
|
|
113
|
-
export type MetaProvider = keyof typeof metaProviders;
|
|
114
|
-
export type Extractor = keyof typeof extractors;
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
|
|
3
|
+
// Import extractors for fallback compatibility
|
|
4
|
+
import {
|
|
5
|
+
AsianLoad,
|
|
6
|
+
Filemoon,
|
|
7
|
+
GogoCDN,
|
|
8
|
+
Kwik,
|
|
9
|
+
MixDrop,
|
|
10
|
+
Mp4Player,
|
|
11
|
+
Mp4Upload,
|
|
12
|
+
RapidCloud,
|
|
13
|
+
MegaCloud,
|
|
14
|
+
StreamHub,
|
|
15
|
+
StreamLare,
|
|
16
|
+
StreamSB,
|
|
17
|
+
StreamTape,
|
|
18
|
+
StreamWish,
|
|
19
|
+
VidMoly,
|
|
20
|
+
VizCloud,
|
|
21
|
+
VidHide,
|
|
22
|
+
Voe,
|
|
23
|
+
MegaUp,
|
|
24
|
+
} from '../extractors';
|
|
25
|
+
import { load } from 'cheerio';
|
|
26
|
+
import { USER_AGENT } from './utils';
|
|
27
|
+
import type { ExtractorContext } from '../models';
|
|
28
|
+
import { PolyURL, PolyURLSearchParams } from './url-polyfill';
|
|
29
|
+
// Default axios instance with optimized settings for scraping
|
|
30
|
+
export const defaultAxios = axios.create({
|
|
31
|
+
timeout: 15000,
|
|
32
|
+
headers: {
|
|
33
|
+
'User-Agent': USER_AGENT,
|
|
34
|
+
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
|
|
35
|
+
'Accept-Language': 'en-US,en;q=0.5',
|
|
36
|
+
'Accept-Encoding': 'gzip, deflate',
|
|
37
|
+
'Cache-Control': 'no-cache',
|
|
38
|
+
'Pragma': 'no-cache',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Create extractor context for passing to context-aware extractors
|
|
43
|
+
export const defaultExtractorContext: ExtractorContext = {
|
|
44
|
+
axios: defaultAxios,
|
|
45
|
+
load: load,
|
|
46
|
+
USER_AGENT: USER_AGENT,
|
|
47
|
+
PolyURL: PolyURL,
|
|
48
|
+
PolyURLSearchParams: PolyURLSearchParams,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// Default static extractors (for backward compatibility)
|
|
52
|
+
export const defaultExtractors = {
|
|
53
|
+
AsianLoad: AsianLoad,
|
|
54
|
+
Filemoon: Filemoon,
|
|
55
|
+
GogoCDN: GogoCDN,
|
|
56
|
+
Kwik: (ctx: ExtractorContext) => Kwik(ctx || defaultExtractorContext),
|
|
57
|
+
MixDrop: MixDrop,
|
|
58
|
+
Mp4Player: Mp4Player,
|
|
59
|
+
Mp4Upload: Mp4Upload,
|
|
60
|
+
RapidCloud: RapidCloud,
|
|
61
|
+
MegaCloud: (ctx: ExtractorContext) => MegaCloud(ctx || defaultExtractorContext),
|
|
62
|
+
StreamHub: StreamHub,
|
|
63
|
+
StreamLare: StreamLare,
|
|
64
|
+
StreamSB: StreamSB,
|
|
65
|
+
StreamTape: StreamTape,
|
|
66
|
+
StreamWish: StreamWish,
|
|
67
|
+
VidMoly: VidMoly,
|
|
68
|
+
VizCloud: VizCloud,
|
|
69
|
+
VidHide: VidHide,
|
|
70
|
+
Voe: Voe,
|
|
71
|
+
MegaUp: MegaUp,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const extractors = {
|
|
75
|
+
GogoCDN: defaultExtractors.GogoCDN,
|
|
76
|
+
StreamSB: defaultExtractors.StreamSB,
|
|
77
|
+
StreamTape: defaultExtractors.StreamTape,
|
|
78
|
+
MixDrop: defaultExtractors.MixDrop,
|
|
79
|
+
Kwik: defaultExtractors.Kwik,
|
|
80
|
+
RapidCloud: defaultExtractors.RapidCloud,
|
|
81
|
+
StreamWish: defaultExtractors.StreamWish,
|
|
82
|
+
Filemoon: defaultExtractors.Filemoon,
|
|
83
|
+
Voe: defaultExtractors.Voe,
|
|
84
|
+
AsianLoad: defaultExtractors.AsianLoad,
|
|
85
|
+
StreamLare: defaultExtractors.StreamLare,
|
|
86
|
+
VidMoly: defaultExtractors.VidMoly,
|
|
87
|
+
MegaCloud: defaultExtractors.MegaCloud,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// Type definitions for provider and extractor instances
|
|
91
|
+
export type Extractor = keyof typeof extractors;
|
package/src/utils/index.ts
CHANGED
|
@@ -1,95 +1,96 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GogoCDN,
|
|
3
|
-
StreamSB,
|
|
4
|
-
MixDrop,
|
|
5
|
-
Kwik,
|
|
6
|
-
RapidCloud,
|
|
7
|
-
MegaCloud,
|
|
8
|
-
StreamTape,
|
|
9
|
-
VizCloud,
|
|
10
|
-
Filemoon,
|
|
11
|
-
AsianLoad,
|
|
12
|
-
StreamHub,
|
|
13
|
-
VidMoly,
|
|
14
|
-
MegaUp,
|
|
15
|
-
} from '../extractors';
|
|
16
|
-
import {
|
|
17
|
-
USER_AGENT,
|
|
18
|
-
splitAuthor,
|
|
19
|
-
floorID,
|
|
20
|
-
formatTitle,
|
|
21
|
-
genElement,
|
|
22
|
-
capitalizeFirstLetter,
|
|
23
|
-
range,
|
|
24
|
-
getDays,
|
|
25
|
-
days,
|
|
26
|
-
isJson,
|
|
27
|
-
convertDuration,
|
|
28
|
-
substringAfter,
|
|
29
|
-
substringBefore,
|
|
30
|
-
calculateStringSimilarity,
|
|
31
|
-
} from './utils';
|
|
32
|
-
import {
|
|
33
|
-
anilistSearchQuery,
|
|
34
|
-
anilistMediaDetailQuery,
|
|
35
|
-
kitsuSearchQuery,
|
|
36
|
-
anilistTrendingQuery,
|
|
37
|
-
anilistPopularQuery,
|
|
38
|
-
anilistAiringScheduleQuery,
|
|
39
|
-
anilistGenresQuery,
|
|
40
|
-
anilistAdvancedQuery,
|
|
41
|
-
anilistSiteStatisticsQuery,
|
|
42
|
-
anilistCharacterQuery,
|
|
43
|
-
anilistStaffInfoQuery,
|
|
44
|
-
} from './queries';
|
|
45
|
-
import getKKey from '../extractors/kisskh/kkey';
|
|
46
|
-
|
|
47
|
-
export {
|
|
48
|
-
USER_AGENT,
|
|
49
|
-
GogoCDN,
|
|
50
|
-
StreamSB,
|
|
51
|
-
StreamHub,
|
|
52
|
-
splitAuthor,
|
|
53
|
-
floorID,
|
|
54
|
-
formatTitle,
|
|
55
|
-
genElement,
|
|
56
|
-
capitalizeFirstLetter,
|
|
57
|
-
MixDrop,
|
|
58
|
-
Kwik,
|
|
59
|
-
anilistSearchQuery,
|
|
60
|
-
anilistMediaDetailQuery,
|
|
61
|
-
kitsuSearchQuery,
|
|
62
|
-
range,
|
|
63
|
-
RapidCloud,
|
|
64
|
-
MegaCloud,
|
|
65
|
-
StreamTape,
|
|
66
|
-
VizCloud,
|
|
67
|
-
anilistTrendingQuery,
|
|
68
|
-
anilistPopularQuery,
|
|
69
|
-
anilistAiringScheduleQuery,
|
|
70
|
-
anilistGenresQuery,
|
|
71
|
-
anilistAdvancedQuery,
|
|
72
|
-
anilistSiteStatisticsQuery,
|
|
73
|
-
anilistStaffInfoQuery,
|
|
74
|
-
Filemoon,
|
|
75
|
-
anilistCharacterQuery,
|
|
76
|
-
getDays,
|
|
77
|
-
days,
|
|
78
|
-
isJson,
|
|
79
|
-
convertDuration,
|
|
80
|
-
AsianLoad,
|
|
81
|
-
substringAfter,
|
|
82
|
-
substringBefore,
|
|
83
|
-
calculateStringSimilarity,
|
|
84
|
-
VidMoly,
|
|
85
|
-
getKKey,
|
|
86
|
-
MegaUp,
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
// Export provider context utilities
|
|
90
|
-
export { createProviderContext } from './create-provider-context';
|
|
91
|
-
export { ProviderManager } from './ProviderManager';
|
|
92
|
-
export { ExtractorManager } from './ExtractorManager';
|
|
93
|
-
export { createExtractorContext } from './create-extractor-context';
|
|
94
|
-
export { defaultAxios, defaultExtractorContext,
|
|
95
|
-
export { PolyURL, PolyURLSearchParams } from './url-polyfill';
|
|
1
|
+
import {
|
|
2
|
+
GogoCDN,
|
|
3
|
+
StreamSB,
|
|
4
|
+
MixDrop,
|
|
5
|
+
Kwik,
|
|
6
|
+
RapidCloud,
|
|
7
|
+
MegaCloud,
|
|
8
|
+
StreamTape,
|
|
9
|
+
VizCloud,
|
|
10
|
+
Filemoon,
|
|
11
|
+
AsianLoad,
|
|
12
|
+
StreamHub,
|
|
13
|
+
VidMoly,
|
|
14
|
+
MegaUp,
|
|
15
|
+
} from '../extractors';
|
|
16
|
+
import {
|
|
17
|
+
USER_AGENT,
|
|
18
|
+
splitAuthor,
|
|
19
|
+
floorID,
|
|
20
|
+
formatTitle,
|
|
21
|
+
genElement,
|
|
22
|
+
capitalizeFirstLetter,
|
|
23
|
+
range,
|
|
24
|
+
getDays,
|
|
25
|
+
days,
|
|
26
|
+
isJson,
|
|
27
|
+
convertDuration,
|
|
28
|
+
substringAfter,
|
|
29
|
+
substringBefore,
|
|
30
|
+
calculateStringSimilarity,
|
|
31
|
+
} from './utils';
|
|
32
|
+
import {
|
|
33
|
+
anilistSearchQuery,
|
|
34
|
+
anilistMediaDetailQuery,
|
|
35
|
+
kitsuSearchQuery,
|
|
36
|
+
anilistTrendingQuery,
|
|
37
|
+
anilistPopularQuery,
|
|
38
|
+
anilistAiringScheduleQuery,
|
|
39
|
+
anilistGenresQuery,
|
|
40
|
+
anilistAdvancedQuery,
|
|
41
|
+
anilistSiteStatisticsQuery,
|
|
42
|
+
anilistCharacterQuery,
|
|
43
|
+
anilistStaffInfoQuery,
|
|
44
|
+
} from './queries';
|
|
45
|
+
import getKKey from '../extractors/kisskh/kkey';
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
USER_AGENT,
|
|
49
|
+
GogoCDN,
|
|
50
|
+
StreamSB,
|
|
51
|
+
StreamHub,
|
|
52
|
+
splitAuthor,
|
|
53
|
+
floorID,
|
|
54
|
+
formatTitle,
|
|
55
|
+
genElement,
|
|
56
|
+
capitalizeFirstLetter,
|
|
57
|
+
MixDrop,
|
|
58
|
+
Kwik,
|
|
59
|
+
anilistSearchQuery,
|
|
60
|
+
anilistMediaDetailQuery,
|
|
61
|
+
kitsuSearchQuery,
|
|
62
|
+
range,
|
|
63
|
+
RapidCloud,
|
|
64
|
+
MegaCloud,
|
|
65
|
+
StreamTape,
|
|
66
|
+
VizCloud,
|
|
67
|
+
anilistTrendingQuery,
|
|
68
|
+
anilistPopularQuery,
|
|
69
|
+
anilistAiringScheduleQuery,
|
|
70
|
+
anilistGenresQuery,
|
|
71
|
+
anilistAdvancedQuery,
|
|
72
|
+
anilistSiteStatisticsQuery,
|
|
73
|
+
anilistStaffInfoQuery,
|
|
74
|
+
Filemoon,
|
|
75
|
+
anilistCharacterQuery,
|
|
76
|
+
getDays,
|
|
77
|
+
days,
|
|
78
|
+
isJson,
|
|
79
|
+
convertDuration,
|
|
80
|
+
AsianLoad,
|
|
81
|
+
substringAfter,
|
|
82
|
+
substringBefore,
|
|
83
|
+
calculateStringSimilarity,
|
|
84
|
+
VidMoly,
|
|
85
|
+
getKKey,
|
|
86
|
+
MegaUp,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// Export provider context utilities
|
|
90
|
+
export { createProviderContext } from './create-provider-context';
|
|
91
|
+
export { ProviderManager } from './ProviderManager';
|
|
92
|
+
export { ExtractorManager } from './ExtractorManager';
|
|
93
|
+
export { createExtractorContext } from './create-extractor-context';
|
|
94
|
+
export { defaultAxios, defaultExtractorContext, defaultExtractors } from './extension-utils';
|
|
95
|
+
export { PolyURL, PolyURLSearchParams } from './url-polyfill';
|
|
96
|
+
export type { AnimeProvider, MovieProvider, animeProviders, movieProviders } from './provider-maps';
|