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.
Files changed (171) hide show
  1. package/lib/commonjs/extension-registry.json +81 -81
  2. package/lib/commonjs/extractors/filemoon.js +2 -2
  3. package/lib/commonjs/extractors/kwik.js +4 -4
  4. package/lib/commonjs/extractors/megacloud.js +6 -6
  5. package/lib/commonjs/index.js +2 -11
  6. package/lib/commonjs/index.js.map +1 -1
  7. package/lib/commonjs/models/types.js +4 -4
  8. package/lib/commonjs/models/video-extractor.js +4 -4
  9. package/lib/commonjs/providers/anime/animedrive.js +12 -12
  10. package/lib/commonjs/providers/anime/animekai.js +41 -41
  11. package/lib/commonjs/providers/anime/animepahe/animepahe.js +16 -15
  12. package/lib/commonjs/providers/anime/animepahe/animepahe.js.map +1 -1
  13. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +0 -1
  14. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
  15. package/lib/commonjs/providers/anime/animeunity.js +13 -13
  16. package/lib/commonjs/providers/anime/index.js +4 -4
  17. package/lib/commonjs/providers/anime/index.js.map +1 -1
  18. package/lib/commonjs/providers/anime/marin.js +12 -12
  19. package/lib/commonjs/providers/anime/zoro/create-zoro.js +0 -1
  20. package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +1 -1
  21. package/lib/commonjs/providers/anime/zoro/zoro.js +72 -71
  22. package/lib/commonjs/providers/anime/zoro/zoro.js.map +1 -1
  23. package/lib/commonjs/providers/manga/brmangas.js +3 -3
  24. package/lib/commonjs/providers/meta/anilist.js +91 -91
  25. package/lib/commonjs/providers/meta/mal.js +12 -12
  26. package/lib/commonjs/providers/meta/tmdb.js +21 -21
  27. package/lib/commonjs/providers/movies/himovies/create-himovies.js +16 -16
  28. package/lib/commonjs/providers/movies/himovies/himovies.js +16 -16
  29. package/lib/commonjs/providers/movies/multimovies.js +15 -15
  30. package/lib/commonjs/providers/movies/multistream/index.js +16 -16
  31. package/lib/commonjs/utils/ExtractorManager.js +15 -15
  32. package/lib/commonjs/utils/ExtractorManager.js.map +1 -1
  33. package/lib/commonjs/utils/ProviderManager.js +28 -28
  34. package/lib/commonjs/utils/create-extractor-context.js +2 -2
  35. package/lib/commonjs/utils/create-provider-context.js +6 -6
  36. package/lib/commonjs/utils/create-provider-context.js.map +1 -1
  37. package/lib/commonjs/utils/extension-utils.js +35 -53
  38. package/lib/commonjs/utils/extension-utils.js.map +1 -1
  39. package/lib/commonjs/utils/index.js +2 -2
  40. package/lib/commonjs/utils/provider-maps.js +31 -0
  41. package/lib/commonjs/utils/provider-maps.js.map +1 -0
  42. package/lib/commonjs/utils/providers-list.js +4 -4
  43. package/lib/commonjs/utils/url-polyfill.js +4 -4
  44. package/lib/module/extension-registry.json +81 -81
  45. package/lib/module/extractors/filemoon.js +2 -2
  46. package/lib/module/extractors/kwik.js +4 -4
  47. package/lib/module/extractors/megacloud.js +6 -6
  48. package/lib/module/index.js +3 -7
  49. package/lib/module/index.js.map +1 -1
  50. package/lib/module/models/types.js +4 -4
  51. package/lib/module/models/video-extractor.js +4 -4
  52. package/lib/module/providers/anime/animedrive.js +12 -12
  53. package/lib/module/providers/anime/animekai.js +41 -41
  54. package/lib/module/providers/anime/animepahe/animepahe.js +14 -14
  55. package/lib/module/providers/anime/animepahe/animepahe.js.map +1 -1
  56. package/lib/module/providers/anime/animepahe/create-animepahe.js +1 -1
  57. package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
  58. package/lib/module/providers/anime/animeunity.js +13 -13
  59. package/lib/module/providers/anime/index.js +2 -2
  60. package/lib/module/providers/anime/index.js.map +1 -1
  61. package/lib/module/providers/anime/marin.js +12 -12
  62. package/lib/module/providers/anime/zoro/create-zoro.js +1 -1
  63. package/lib/module/providers/anime/zoro/create-zoro.js.map +1 -1
  64. package/lib/module/providers/anime/zoro/zoro.js +70 -70
  65. package/lib/module/providers/anime/zoro/zoro.js.map +1 -1
  66. package/lib/module/providers/manga/brmangas.js +3 -3
  67. package/lib/module/providers/meta/anilist.js +91 -91
  68. package/lib/module/providers/meta/mal.js +12 -12
  69. package/lib/module/providers/meta/tmdb.js +21 -21
  70. package/lib/module/providers/movies/himovies/create-himovies.js +16 -16
  71. package/lib/module/providers/movies/himovies/himovies.js +16 -16
  72. package/lib/module/providers/movies/multimovies.js +15 -15
  73. package/lib/module/providers/movies/multistream/index.js +16 -16
  74. package/lib/module/utils/ExtractorManager.js +16 -16
  75. package/lib/module/utils/ExtractorManager.js.map +1 -1
  76. package/lib/module/utils/ProviderManager.js +28 -28
  77. package/lib/module/utils/create-extractor-context.js +2 -2
  78. package/lib/module/utils/create-provider-context.js +7 -7
  79. package/lib/module/utils/create-provider-context.js.map +1 -1
  80. package/lib/module/utils/extension-utils.js +14 -32
  81. package/lib/module/utils/extension-utils.js.map +1 -1
  82. package/lib/module/utils/index.js +1 -1
  83. package/lib/module/utils/index.js.map +1 -1
  84. package/lib/module/utils/provider-maps.js +27 -0
  85. package/lib/module/utils/provider-maps.js.map +1 -0
  86. package/lib/module/utils/providers-list.js +4 -4
  87. package/lib/module/utils/url-polyfill.js +4 -4
  88. package/lib/typescript/commonjs/src/index.d.ts +4 -4
  89. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts.map +1 -1
  91. package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts +1 -1
  92. package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/src/providers/anime/index.d.ts +2 -2
  94. package/lib/typescript/commonjs/src/providers/anime/index.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts +1 -1
  96. package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts +1 -1
  99. package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts +1 -20
  101. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/src/utils/index.d.ts +2 -1
  103. package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts +27 -0
  105. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts.map +1 -0
  106. package/lib/typescript/module/src/index.d.ts +4 -4
  107. package/lib/typescript/module/src/index.d.ts.map +1 -1
  108. package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts.map +1 -1
  109. package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts +1 -1
  110. package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
  111. package/lib/typescript/module/src/providers/anime/index.d.ts +2 -2
  112. package/lib/typescript/module/src/providers/anime/index.d.ts.map +1 -1
  113. package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts +1 -1
  114. package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
  115. package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts.map +1 -1
  116. package/lib/typescript/module/src/utils/ProviderManager.d.ts +1 -1
  117. package/lib/typescript/module/src/utils/ProviderManager.d.ts.map +1 -1
  118. package/lib/typescript/module/src/utils/extension-utils.d.ts +1 -20
  119. package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -1
  120. package/lib/typescript/module/src/utils/index.d.ts +2 -1
  121. package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
  122. package/lib/typescript/module/src/utils/provider-maps.d.ts +27 -0
  123. package/lib/typescript/module/src/utils/provider-maps.d.ts.map +1 -0
  124. package/package.json +206 -203
  125. package/src/extension-registry.json +81 -81
  126. package/src/extractors/StreamP2P.ts +60 -60
  127. package/src/extractors/filemoon.ts +58 -58
  128. package/src/extractors/index.ts +41 -41
  129. package/src/extractors/kwik.ts +50 -50
  130. package/src/extractors/megacloud.ts +163 -163
  131. package/src/extractors/mixdrop.ts +31 -31
  132. package/src/extractors/mp4upload.ts +31 -31
  133. package/src/extractors/streamhub.ts +58 -58
  134. package/src/extractors/streamwish.ts +120 -120
  135. package/src/extractors/vidhide.ts +59 -59
  136. package/src/index.tsx +174 -175
  137. package/src/models/extension-manifest.ts +77 -77
  138. package/src/models/extractor-context.ts +41 -41
  139. package/src/models/index.ts +106 -106
  140. package/src/models/provider-context.ts +182 -182
  141. package/src/models/types.ts +531 -531
  142. package/src/models/video-extractor.ts +48 -48
  143. package/src/providers/anime/animedrive.ts +245 -245
  144. package/src/providers/anime/animekai.ts +627 -627
  145. package/src/providers/anime/animepahe/animepahe.ts +76 -76
  146. package/src/providers/anime/animepahe/create-animepahe.ts +348 -348
  147. package/src/providers/anime/animeunity.ts +216 -216
  148. package/src/providers/anime/index.ts +21 -21
  149. package/src/providers/anime/marin.ts +319 -319
  150. package/src/providers/anime/zoro/create-zoro.ts +655 -655
  151. package/src/providers/anime/zoro/zoro.ts +197 -197
  152. package/src/providers/index.ts +7 -7
  153. package/src/providers/manga/brmangas.ts +144 -144
  154. package/src/providers/meta/anilist.ts +2108 -2108
  155. package/src/providers/meta/mal.ts +635 -635
  156. package/src/providers/meta/tmdb.ts +470 -470
  157. package/src/providers/movies/himovies/create-himovies.ts +529 -529
  158. package/src/providers/movies/himovies/himovies.ts +90 -90
  159. package/src/providers/movies/index.ts +15 -15
  160. package/src/providers/movies/multimovies.ts +495 -495
  161. package/src/providers/movies/multistream/index.ts +231 -231
  162. package/src/utils/ExtractorManager.ts +311 -311
  163. package/src/utils/ProviderManager.ts +424 -424
  164. package/src/utils/create-extractor-context.ts +22 -22
  165. package/src/utils/create-provider-context.ts +107 -107
  166. package/src/utils/extension-utils.ts +91 -114
  167. package/src/utils/index.ts +96 -95
  168. package/src/utils/provider-maps.ts +31 -0
  169. package/src/utils/providers-list.ts +27 -27
  170. package/src/utils/url-polyfill.ts +642 -642
  171. 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, defaultStaticExtractors, 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(defaultStaticExtractors, {
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
- import { ANIME, MOVIES, META } from '../providers';
3
-
4
- // Import extractors for fallback compatibility
5
- import {
6
- AsianLoad,
7
- Filemoon,
8
- GogoCDN,
9
- Kwik,
10
- MixDrop,
11
- Mp4Player,
12
- Mp4Upload,
13
- RapidCloud,
14
- MegaCloud,
15
- StreamHub,
16
- StreamLare,
17
- StreamSB,
18
- StreamTape,
19
- StreamWish,
20
- VidMoly,
21
- VizCloud,
22
- VidHide,
23
- Voe,
24
- MegaUp,
25
- } from '../extractors';
26
- import { load } from 'cheerio';
27
- import { USER_AGENT } from './utils';
28
- import type { ExtractorContext } from '../models';
29
- import { PolyURL, PolyURLSearchParams } from './url-polyfill';
30
- // Default axios instance with optimized settings for scraping
31
- export const defaultAxios = axios.create({
32
- timeout: 15000,
33
- headers: {
34
- 'User-Agent': USER_AGENT,
35
- 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
36
- 'Accept-Language': 'en-US,en;q=0.5',
37
- 'Accept-Encoding': 'gzip, deflate',
38
- 'Cache-Control': 'no-cache',
39
- 'Pragma': 'no-cache',
40
- },
41
- });
42
-
43
- // Create extractor context for passing to context-aware extractors
44
- export const defaultExtractorContext: ExtractorContext = {
45
- axios: defaultAxios,
46
- load: load,
47
- USER_AGENT: USER_AGENT,
48
- PolyURL: PolyURL,
49
- PolyURLSearchParams: PolyURLSearchParams,
50
- };
51
-
52
- // Default static extractors (for backward compatibility)
53
- export const defaultStaticExtractors = {
54
- AsianLoad: AsianLoad,
55
- Filemoon: Filemoon,
56
- GogoCDN: GogoCDN,
57
- Kwik: (ctx: ExtractorContext) => Kwik(ctx || defaultExtractorContext),
58
- MixDrop: MixDrop,
59
- Mp4Player: Mp4Player,
60
- Mp4Upload: Mp4Upload,
61
- RapidCloud: RapidCloud,
62
- MegaCloud: (ctx: ExtractorContext) => MegaCloud(ctx || defaultExtractorContext),
63
- StreamHub: StreamHub,
64
- StreamLare: StreamLare,
65
- StreamSB: StreamSB,
66
- StreamTape: StreamTape,
67
- StreamWish: StreamWish,
68
- VidMoly: VidMoly,
69
- VizCloud: VizCloud,
70
- VidHide: VidHide,
71
- Voe: Voe,
72
- MegaUp: MegaUp,
73
- };
74
-
75
- // Define provider and extractor maps
76
- export const animeProviders = {
77
- Zoro: ANIME.Zoro,
78
- AnimePahe: ANIME.AnimePahe,
79
- };
80
-
81
- export const movieProviders = {
82
- HiMovies: MOVIES.HiMovies,
83
- MultiMovies: MOVIES.MultiMovies,
84
- DramaCool: MOVIES.DramaCool,
85
- MultiStream: MOVIES.MultiStream,
86
- };
87
-
88
- const metaProviders = {
89
- Anilist: META.Anilist,
90
- TMDB: META.TMDB,
91
- MAL: META.Myanimelist,
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;
@@ -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, defaultStaticExtractors } from './extension-utils';
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';