react-native-consumet 1.3.0 → 1.4.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.
Files changed (382) hide show
  1. package/Consumet.podspec +26 -26
  2. package/LICENSE +673 -673
  3. package/README.md +102 -102
  4. package/android/build.gradle +106 -106
  5. package/android/gradle.properties +5 -5
  6. package/android/src/main/AndroidManifest.xml +4 -4
  7. package/android/src/main/AndroidManifestNew.xml +3 -3
  8. package/android/src/main/java/com/consumet/ConsumetModule.kt +63 -63
  9. package/android/src/main/java/com/consumet/ConsumetPackage.kt +33 -33
  10. package/android/src/main/java/com/consumet/DdosGuardModule.kt +213 -213
  11. package/android/src/main/java/com/consumet/DeobfuscatorModule.kt +89 -89
  12. package/android/src/main/java/com/consumet/HttpRequestModule.kt +417 -417
  13. package/ios/Consumet.h +6 -6
  14. package/ios/Consumet.mm +18 -18
  15. package/lib/commonjs/extension-registry.json +60 -64
  16. package/lib/commonjs/extractors/{streamp2p.js → StreamP2P.js} +1 -1
  17. package/lib/commonjs/extractors/StreamP2P.js.map +1 -0
  18. package/lib/commonjs/extractors/asianload.js.map +1 -1
  19. package/lib/commonjs/extractors/filemoon.js.map +1 -1
  20. package/lib/commonjs/extractors/gdflix.js +167 -0
  21. package/lib/commonjs/extractors/gdflix.js.map +1 -0
  22. package/lib/commonjs/extractors/gofile.js +152 -0
  23. package/lib/commonjs/extractors/gofile.js.map +1 -0
  24. package/lib/commonjs/extractors/gogocdn.js.map +1 -1
  25. package/lib/commonjs/extractors/hubcloud.js +320 -0
  26. package/lib/commonjs/extractors/hubcloud.js.map +1 -0
  27. package/lib/commonjs/extractors/index.js +28 -0
  28. package/lib/commonjs/extractors/index.js.map +1 -1
  29. package/lib/commonjs/extractors/kisskh/kkey.js.map +1 -1
  30. package/lib/commonjs/extractors/kisskh/staticdata.js.map +1 -1
  31. package/lib/commonjs/extractors/kwik.js +1 -1
  32. package/lib/commonjs/extractors/kwik.js.map +1 -1
  33. package/lib/commonjs/extractors/megacloud.js.map +1 -1
  34. package/lib/commonjs/extractors/megaplay.js +169 -0
  35. package/lib/commonjs/extractors/megaplay.js.map +1 -0
  36. package/lib/commonjs/extractors/megaup.js.map +1 -1
  37. package/lib/commonjs/extractors/mixdrop.js.map +1 -1
  38. package/lib/commonjs/extractors/mp4player.js.map +1 -1
  39. package/lib/commonjs/extractors/mp4upload.js.map +1 -1
  40. package/lib/commonjs/extractors/rapidcloud.js.map +1 -1
  41. package/lib/commonjs/extractors/streamhub.js.map +1 -1
  42. package/lib/commonjs/extractors/streamlare.js.map +1 -1
  43. package/lib/commonjs/extractors/streamsb.js.map +1 -1
  44. package/lib/commonjs/extractors/streamtape.js.map +1 -1
  45. package/lib/commonjs/extractors/streamwish.js.map +1 -1
  46. package/lib/commonjs/extractors/vidhide.js.map +1 -1
  47. package/lib/commonjs/extractors/vidmoly.js.map +1 -1
  48. package/lib/commonjs/extractors/vizcloud.js.map +1 -1
  49. package/lib/commonjs/extractors/voe.js.map +1 -1
  50. package/lib/commonjs/index.js +24 -0
  51. package/lib/commonjs/index.js.map +1 -1
  52. package/lib/commonjs/models/anime-parser.js.map +1 -1
  53. package/lib/commonjs/models/base-parser.js.map +1 -1
  54. package/lib/commonjs/models/base-provider.js.map +1 -1
  55. package/lib/commonjs/models/base-types.js.map +1 -1
  56. package/lib/commonjs/models/extension-manifest.js.map +1 -1
  57. package/lib/commonjs/models/extractor-context.js.map +1 -1
  58. package/lib/commonjs/models/index.js.map +1 -1
  59. package/lib/commonjs/models/lightnovel-parser.js.map +1 -1
  60. package/lib/commonjs/models/manga-parser.js.map +1 -1
  61. package/lib/commonjs/models/movie-parser.js.map +1 -1
  62. package/lib/commonjs/models/provider-context.js.map +1 -1
  63. package/lib/commonjs/models/types.js +4 -0
  64. package/lib/commonjs/models/types.js.map +1 -1
  65. package/lib/commonjs/models/video-extractor.js.map +1 -1
  66. package/lib/commonjs/providers/anime/anify.js.map +1 -1
  67. package/lib/commonjs/providers/anime/anikoto/anikoto.js +186 -0
  68. package/lib/commonjs/providers/anime/anikoto/anikoto.js.map +1 -0
  69. package/lib/commonjs/providers/anime/anikoto/create-anikoto.js +533 -0
  70. package/lib/commonjs/providers/anime/anikoto/create-anikoto.js.map +1 -0
  71. package/lib/commonjs/providers/anime/animedrive.js.map +1 -1
  72. package/lib/commonjs/providers/anime/animekai/animekai.js.map +1 -1
  73. package/lib/commonjs/providers/anime/animekai/create-animekai.js.map +1 -1
  74. package/lib/commonjs/providers/anime/animepahe/animepahe.js.map +1 -1
  75. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +2 -2
  76. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
  77. package/lib/commonjs/providers/anime/animesuge/animesuge.js.map +1 -1
  78. package/lib/commonjs/providers/anime/animesuge/create-animesuge.js.map +1 -1
  79. package/lib/commonjs/providers/anime/animeunity.js.map +1 -1
  80. package/lib/commonjs/providers/anime/index.js +4 -4
  81. package/lib/commonjs/providers/anime/index.js.map +1 -1
  82. package/lib/commonjs/providers/anime/kickassanime.js.map +1 -1
  83. package/lib/commonjs/providers/anime/marin.js.map +1 -1
  84. package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +1 -1
  85. package/lib/commonjs/providers/anime/zoro/zoro.js.map +1 -1
  86. package/lib/commonjs/providers/index.js.map +1 -1
  87. package/lib/commonjs/providers/light-novels/index.js.map +1 -1
  88. package/lib/commonjs/providers/light-novels/novelupdates.js.map +1 -1
  89. package/lib/commonjs/providers/light-novels/readlightnovels.js.map +1 -1
  90. package/lib/commonjs/providers/manga/asurascans.js.map +1 -1
  91. package/lib/commonjs/providers/manga/brmangas.js.map +1 -1
  92. package/lib/commonjs/providers/manga/comick.js.map +1 -1
  93. package/lib/commonjs/providers/manga/flamescans.js.map +1 -1
  94. package/lib/commonjs/providers/manga/index.js.map +1 -1
  95. package/lib/commonjs/providers/manga/mangadex.js.map +1 -1
  96. package/lib/commonjs/providers/manga/mangahere.js.map +1 -1
  97. package/lib/commonjs/providers/manga/mangahost.js.map +1 -1
  98. package/lib/commonjs/providers/manga/mangakakalot.js.map +1 -1
  99. package/lib/commonjs/providers/manga/mangapark.js.map +1 -1
  100. package/lib/commonjs/providers/manga/mangapill.js.map +1 -1
  101. package/lib/commonjs/providers/manga/mangareader.js.map +1 -1
  102. package/lib/commonjs/providers/manga/mangasee123.js.map +1 -1
  103. package/lib/commonjs/providers/manga/readmanga.js.map +1 -1
  104. package/lib/commonjs/providers/manga/vyvymanga.js.map +1 -1
  105. package/lib/commonjs/providers/meta/anilist.js +2 -2
  106. package/lib/commonjs/providers/meta/anilist.js.map +1 -1
  107. package/lib/commonjs/providers/meta/index.js.map +1 -1
  108. package/lib/commonjs/providers/meta/mal.js.map +1 -1
  109. package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
  110. package/lib/commonjs/providers/movies/dramacool.js.map +1 -1
  111. package/lib/commonjs/providers/movies/himovies/create-himovies.js.map +1 -1
  112. package/lib/commonjs/providers/movies/himovies/himovies.js.map +1 -1
  113. package/lib/commonjs/providers/movies/index.js +18 -1
  114. package/lib/commonjs/providers/movies/index.js.map +1 -1
  115. package/lib/commonjs/providers/movies/multimovies/create-multimovies.js.map +1 -1
  116. package/lib/commonjs/providers/movies/multimovies/multimovies.js.map +1 -1
  117. package/lib/commonjs/providers/movies/multistream/index.js.map +1 -1
  118. package/lib/commonjs/providers/movies/multistream/utils.js.map +1 -1
  119. package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
  120. package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js.map +1 -1
  121. package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js +812 -0
  122. package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js.map +1 -0
  123. package/lib/commonjs/providers/movies/vegamovies/vegamovies.js +56 -0
  124. package/lib/commonjs/providers/movies/vegamovies/vegamovies.js.map +1 -0
  125. package/lib/commonjs/providers/movies/yflix/create-yflix.js.map +1 -1
  126. package/lib/commonjs/providers/movies/yflix/yflix.js.map +1 -1
  127. package/lib/commonjs/providers/movies/yflix.js.map +1 -1
  128. package/lib/commonjs/utils/ExtractorManager.js +10 -2
  129. package/lib/commonjs/utils/ExtractorManager.js.map +1 -1
  130. package/lib/commonjs/utils/ProviderManager.js.map +1 -1
  131. package/lib/commonjs/utils/constants.js.map +1 -1
  132. package/lib/commonjs/utils/create-extractor-context.js.map +1 -1
  133. package/lib/commonjs/utils/create-provider-context.js.map +1 -1
  134. package/lib/commonjs/utils/extension-utils.js +11 -2
  135. package/lib/commonjs/utils/extension-utils.js.map +1 -1
  136. package/lib/commonjs/utils/index.js.map +1 -1
  137. package/lib/commonjs/utils/provider-maps.js +5 -2
  138. package/lib/commonjs/utils/provider-maps.js.map +1 -1
  139. package/lib/commonjs/utils/queries.js.map +1 -1
  140. package/lib/commonjs/utils/url-polyfill.js.map +1 -1
  141. package/lib/commonjs/utils/utils.js.map +1 -1
  142. package/lib/module/extension-registry.json +60 -64
  143. package/lib/module/extractors/{streamp2p.js → StreamP2P.js} +1 -1
  144. package/lib/module/extractors/StreamP2P.js.map +1 -0
  145. package/lib/module/extractors/asianload.js.map +1 -1
  146. package/lib/module/extractors/filemoon.js.map +1 -1
  147. package/lib/module/extractors/gdflix.js +162 -0
  148. package/lib/module/extractors/gdflix.js.map +1 -0
  149. package/lib/module/extractors/gofile.js +147 -0
  150. package/lib/module/extractors/gofile.js.map +1 -0
  151. package/lib/module/extractors/gogocdn.js.map +1 -1
  152. package/lib/module/extractors/hubcloud.js +315 -0
  153. package/lib/module/extractors/hubcloud.js.map +1 -0
  154. package/lib/module/extractors/index.js +5 -1
  155. package/lib/module/extractors/index.js.map +1 -1
  156. package/lib/module/extractors/kisskh/kkey.js.map +1 -1
  157. package/lib/module/extractors/kisskh/staticdata.js.map +1 -1
  158. package/lib/module/extractors/kwik.js +1 -1
  159. package/lib/module/extractors/kwik.js.map +1 -1
  160. package/lib/module/extractors/megacloud.js.map +1 -1
  161. package/lib/module/extractors/megaplay.js +163 -0
  162. package/lib/module/extractors/megaplay.js.map +1 -0
  163. package/lib/module/extractors/megaup.js.map +1 -1
  164. package/lib/module/extractors/mixdrop.js.map +1 -1
  165. package/lib/module/extractors/mp4player.js.map +1 -1
  166. package/lib/module/extractors/mp4upload.js.map +1 -1
  167. package/lib/module/extractors/rapidcloud.js.map +1 -1
  168. package/lib/module/extractors/streamhub.js.map +1 -1
  169. package/lib/module/extractors/streamlare.js.map +1 -1
  170. package/lib/module/extractors/streamsb.js.map +1 -1
  171. package/lib/module/extractors/streamtape.js.map +1 -1
  172. package/lib/module/extractors/streamwish.js.map +1 -1
  173. package/lib/module/extractors/vidhide.js.map +1 -1
  174. package/lib/module/extractors/vidmoly.js.map +1 -1
  175. package/lib/module/extractors/vizcloud.js.map +1 -1
  176. package/lib/module/extractors/voe.js.map +1 -1
  177. package/lib/module/index.js +2 -2
  178. package/lib/module/index.js.map +1 -1
  179. package/lib/module/models/anime-parser.js.map +1 -1
  180. package/lib/module/models/base-parser.js.map +1 -1
  181. package/lib/module/models/base-provider.js.map +1 -1
  182. package/lib/module/models/base-types.js.map +1 -1
  183. package/lib/module/models/extension-manifest.js.map +1 -1
  184. package/lib/module/models/extractor-context.js.map +1 -1
  185. package/lib/module/models/index.js.map +1 -1
  186. package/lib/module/models/lightnovel-parser.js.map +1 -1
  187. package/lib/module/models/manga-parser.js.map +1 -1
  188. package/lib/module/models/movie-parser.js.map +1 -1
  189. package/lib/module/models/provider-context.js.map +1 -1
  190. package/lib/module/models/types.js +4 -0
  191. package/lib/module/models/types.js.map +1 -1
  192. package/lib/module/models/video-extractor.js.map +1 -1
  193. package/lib/module/providers/anime/anify.js.map +1 -1
  194. package/lib/module/providers/anime/anikoto/anikoto.js +181 -0
  195. package/lib/module/providers/anime/anikoto/anikoto.js.map +1 -0
  196. package/lib/module/providers/anime/anikoto/create-anikoto.js +529 -0
  197. package/lib/module/providers/anime/anikoto/create-anikoto.js.map +1 -0
  198. package/lib/module/providers/anime/animedrive.js.map +1 -1
  199. package/lib/module/providers/anime/animekai/animekai.js.map +1 -1
  200. package/lib/module/providers/anime/animekai/create-animekai.js.map +1 -1
  201. package/lib/module/providers/anime/animepahe/animepahe.js.map +1 -1
  202. package/lib/module/providers/anime/animepahe/create-animepahe.js +2 -2
  203. package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
  204. package/lib/module/providers/anime/animesuge/animesuge.js.map +1 -1
  205. package/lib/module/providers/anime/animesuge/create-animesuge.js.map +1 -1
  206. package/lib/module/providers/anime/animeunity.js.map +1 -1
  207. package/lib/module/providers/anime/index.js +4 -4
  208. package/lib/module/providers/anime/index.js.map +1 -1
  209. package/lib/module/providers/anime/kickassanime.js.map +1 -1
  210. package/lib/module/providers/anime/marin.js.map +1 -1
  211. package/lib/module/providers/anime/zoro/create-zoro.js.map +1 -1
  212. package/lib/module/providers/anime/zoro/zoro.js.map +1 -1
  213. package/lib/module/providers/index.js.map +1 -1
  214. package/lib/module/providers/light-novels/index.js.map +1 -1
  215. package/lib/module/providers/light-novels/novelupdates.js.map +1 -1
  216. package/lib/module/providers/light-novels/readlightnovels.js.map +1 -1
  217. package/lib/module/providers/manga/asurascans.js.map +1 -1
  218. package/lib/module/providers/manga/brmangas.js.map +1 -1
  219. package/lib/module/providers/manga/comick.js.map +1 -1
  220. package/lib/module/providers/manga/flamescans.js.map +1 -1
  221. package/lib/module/providers/manga/index.js.map +1 -1
  222. package/lib/module/providers/manga/mangadex.js.map +1 -1
  223. package/lib/module/providers/manga/mangahere.js.map +1 -1
  224. package/lib/module/providers/manga/mangahost.js.map +1 -1
  225. package/lib/module/providers/manga/mangakakalot.js.map +1 -1
  226. package/lib/module/providers/manga/mangapark.js.map +1 -1
  227. package/lib/module/providers/manga/mangapill.js.map +1 -1
  228. package/lib/module/providers/manga/mangareader.js.map +1 -1
  229. package/lib/module/providers/manga/mangasee123.js.map +1 -1
  230. package/lib/module/providers/manga/readmanga.js.map +1 -1
  231. package/lib/module/providers/manga/vyvymanga.js.map +1 -1
  232. package/lib/module/providers/meta/anilist.js +1 -1
  233. package/lib/module/providers/meta/anilist.js.map +1 -1
  234. package/lib/module/providers/meta/index.js.map +1 -1
  235. package/lib/module/providers/meta/mal.js.map +1 -1
  236. package/lib/module/providers/meta/tmdb.js.map +1 -1
  237. package/lib/module/providers/movies/dramacool.js.map +1 -1
  238. package/lib/module/providers/movies/himovies/create-himovies.js.map +1 -1
  239. package/lib/module/providers/movies/himovies/himovies.js.map +1 -1
  240. package/lib/module/providers/movies/index.js +6 -1
  241. package/lib/module/providers/movies/index.js.map +1 -1
  242. package/lib/module/providers/movies/multimovies/create-multimovies.js.map +1 -1
  243. package/lib/module/providers/movies/multimovies/multimovies.js.map +1 -1
  244. package/lib/module/providers/movies/multistream/index.js.map +1 -1
  245. package/lib/module/providers/movies/multistream/utils.js.map +1 -1
  246. package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
  247. package/lib/module/providers/movies/netflixmirror/netflixmirror.js.map +1 -1
  248. package/lib/module/providers/movies/vegamovies/create-vegamovies.js +808 -0
  249. package/lib/module/providers/movies/vegamovies/create-vegamovies.js.map +1 -0
  250. package/lib/module/providers/movies/vegamovies/vegamovies.js +47 -0
  251. package/lib/module/providers/movies/vegamovies/vegamovies.js.map +1 -0
  252. package/lib/module/providers/movies/yflix/create-yflix.js.map +1 -1
  253. package/lib/module/providers/movies/yflix/yflix.js.map +1 -1
  254. package/lib/module/providers/movies/yflix.js.map +1 -1
  255. package/lib/module/utils/ExtractorManager.js +10 -2
  256. package/lib/module/utils/ExtractorManager.js.map +1 -1
  257. package/lib/module/utils/ProviderManager.js.map +1 -1
  258. package/lib/module/utils/constants.js.map +1 -1
  259. package/lib/module/utils/create-extractor-context.js.map +1 -1
  260. package/lib/module/utils/create-provider-context.js.map +1 -1
  261. package/lib/module/utils/extension-utils.js +12 -3
  262. package/lib/module/utils/extension-utils.js.map +1 -1
  263. package/lib/module/utils/index.js.map +1 -1
  264. package/lib/module/utils/provider-maps.js +5 -2
  265. package/lib/module/utils/provider-maps.js.map +1 -1
  266. package/lib/module/utils/queries.js.map +1 -1
  267. package/lib/module/utils/url-polyfill.js.map +1 -1
  268. package/lib/module/utils/utils.js.map +1 -1
  269. package/lib/typescript/commonjs/src/extractors/{streamp2p.d.ts → StreamP2P.d.ts} +1 -1
  270. package/lib/typescript/commonjs/src/extractors/{streamp2p.d.ts.map → StreamP2P.d.ts.map} +1 -1
  271. package/lib/typescript/commonjs/src/extractors/gdflix.d.ts +8 -0
  272. package/lib/typescript/commonjs/src/extractors/gdflix.d.ts.map +1 -0
  273. package/lib/typescript/commonjs/src/extractors/gofile.d.ts +8 -0
  274. package/lib/typescript/commonjs/src/extractors/gofile.d.ts.map +1 -0
  275. package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts +8 -0
  276. package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts.map +1 -0
  277. package/lib/typescript/commonjs/src/extractors/index.d.ts +5 -1
  278. package/lib/typescript/commonjs/src/extractors/index.d.ts.map +1 -1
  279. package/lib/typescript/commonjs/src/extractors/megaplay.d.ts +9 -0
  280. package/lib/typescript/commonjs/src/extractors/megaplay.d.ts.map +1 -0
  281. package/lib/typescript/commonjs/src/index.d.ts +2 -2
  282. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  283. package/lib/typescript/commonjs/src/models/provider-context.d.ts +12 -0
  284. package/lib/typescript/commonjs/src/models/provider-context.d.ts.map +1 -1
  285. package/lib/typescript/commonjs/src/models/types.d.ts +9 -1
  286. package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
  287. package/lib/typescript/commonjs/src/providers/anime/anikoto/anikoto.d.ts +144 -0
  288. package/lib/typescript/commonjs/src/providers/anime/anikoto/anikoto.d.ts.map +1 -0
  289. package/lib/typescript/{module/src/providers/anime/aniwatchtv/create-aniwatchtv.d.ts → commonjs/src/providers/anime/anikoto/create-anikoto.d.ts} +10 -12
  290. package/lib/typescript/commonjs/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -0
  291. package/lib/typescript/commonjs/src/providers/anime/index.d.ts +4 -4
  292. package/lib/typescript/commonjs/src/providers/anime/index.d.ts.map +1 -1
  293. package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts.map +1 -1
  294. package/lib/typescript/commonjs/src/providers/movies/index.d.ts +5 -0
  295. package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
  296. package/lib/typescript/commonjs/src/providers/movies/vegamovies/create-vegamovies.d.ts +22 -0
  297. package/lib/typescript/commonjs/src/providers/movies/vegamovies/create-vegamovies.d.ts.map +1 -0
  298. package/lib/typescript/commonjs/src/providers/movies/vegamovies/vegamovies.d.ts +25 -0
  299. package/lib/typescript/commonjs/src/providers/movies/vegamovies/vegamovies.d.ts.map +1 -0
  300. package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts.map +1 -1
  301. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts +9 -0
  302. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -1
  303. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts +2 -1
  304. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts.map +1 -1
  305. package/lib/typescript/module/src/extractors/{streamp2p.d.ts → StreamP2P.d.ts} +1 -1
  306. package/lib/typescript/module/src/extractors/{streamp2p.d.ts.map → StreamP2P.d.ts.map} +1 -1
  307. package/lib/typescript/module/src/extractors/gdflix.d.ts +8 -0
  308. package/lib/typescript/module/src/extractors/gdflix.d.ts.map +1 -0
  309. package/lib/typescript/module/src/extractors/gofile.d.ts +8 -0
  310. package/lib/typescript/module/src/extractors/gofile.d.ts.map +1 -0
  311. package/lib/typescript/module/src/extractors/hubcloud.d.ts +8 -0
  312. package/lib/typescript/module/src/extractors/hubcloud.d.ts.map +1 -0
  313. package/lib/typescript/module/src/extractors/index.d.ts +5 -1
  314. package/lib/typescript/module/src/extractors/index.d.ts.map +1 -1
  315. package/lib/typescript/module/src/extractors/megaplay.d.ts +9 -0
  316. package/lib/typescript/module/src/extractors/megaplay.d.ts.map +1 -0
  317. package/lib/typescript/module/src/index.d.ts +2 -2
  318. package/lib/typescript/module/src/index.d.ts.map +1 -1
  319. package/lib/typescript/module/src/models/provider-context.d.ts +12 -0
  320. package/lib/typescript/module/src/models/provider-context.d.ts.map +1 -1
  321. package/lib/typescript/module/src/models/types.d.ts +9 -1
  322. package/lib/typescript/module/src/models/types.d.ts.map +1 -1
  323. package/lib/typescript/module/src/providers/anime/anikoto/anikoto.d.ts +144 -0
  324. package/lib/typescript/module/src/providers/anime/anikoto/anikoto.d.ts.map +1 -0
  325. package/lib/typescript/{commonjs/src/providers/anime/aniwatchtv/create-aniwatchtv.d.ts → module/src/providers/anime/anikoto/create-anikoto.d.ts} +10 -12
  326. package/lib/typescript/module/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -0
  327. package/lib/typescript/module/src/providers/anime/index.d.ts +4 -4
  328. package/lib/typescript/module/src/providers/anime/index.d.ts.map +1 -1
  329. package/lib/typescript/module/src/providers/meta/anilist.d.ts.map +1 -1
  330. package/lib/typescript/module/src/providers/movies/index.d.ts +5 -0
  331. package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
  332. package/lib/typescript/module/src/providers/movies/vegamovies/create-vegamovies.d.ts +22 -0
  333. package/lib/typescript/module/src/providers/movies/vegamovies/create-vegamovies.d.ts.map +1 -0
  334. package/lib/typescript/module/src/providers/movies/vegamovies/vegamovies.d.ts +25 -0
  335. package/lib/typescript/module/src/providers/movies/vegamovies/vegamovies.d.ts.map +1 -0
  336. package/lib/typescript/module/src/utils/ExtractorManager.d.ts.map +1 -1
  337. package/lib/typescript/module/src/utils/extension-utils.d.ts +9 -0
  338. package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -1
  339. package/lib/typescript/module/src/utils/provider-maps.d.ts +2 -1
  340. package/lib/typescript/module/src/utils/provider-maps.d.ts.map +1 -1
  341. package/package.json +217 -217
  342. package/react-native.config.js +12 -12
  343. package/src/extension-registry.json +60 -64
  344. package/src/extractors/gdflix.ts +167 -0
  345. package/src/extractors/gofile.ts +182 -0
  346. package/src/extractors/hubcloud.ts +357 -0
  347. package/src/extractors/index.ts +8 -0
  348. package/src/extractors/kwik.ts +1 -1
  349. package/src/extractors/megaplay.ts +182 -0
  350. package/src/index.tsx +8 -0
  351. package/src/models/provider-context.ts +12 -0
  352. package/src/models/types.ts +8 -0
  353. package/src/providers/anime/anikoto/anikoto.ts +215 -0
  354. package/src/providers/anime/anikoto/create-anikoto.ts +637 -0
  355. package/src/providers/anime/animepahe/create-animepahe.ts +2 -2
  356. package/src/providers/anime/index.ts +4 -4
  357. package/src/providers/meta/anilist.ts +1 -1
  358. package/src/providers/movies/index.ts +6 -0
  359. package/src/providers/movies/vegamovies/create-vegamovies.ts +921 -0
  360. package/src/providers/movies/vegamovies/vegamovies.ts +63 -0
  361. package/src/utils/ExtractorManager.ts +7 -1
  362. package/src/utils/extension-utils.ts +13 -0
  363. package/src/utils/provider-maps.ts +5 -2
  364. package/lib/commonjs/extractors/streamp2p.js.map +0 -1
  365. package/lib/commonjs/providers/anime/aniwatchtv/aniwatchtv.js +0 -187
  366. package/lib/commonjs/providers/anime/aniwatchtv/aniwatchtv.js.map +0 -1
  367. package/lib/commonjs/providers/anime/aniwatchtv/create-aniwatchtv.js +0 -572
  368. package/lib/commonjs/providers/anime/aniwatchtv/create-aniwatchtv.js.map +0 -1
  369. package/lib/module/extractors/streamp2p.js.map +0 -1
  370. package/lib/module/providers/anime/aniwatchtv/aniwatchtv.js +0 -184
  371. package/lib/module/providers/anime/aniwatchtv/aniwatchtv.js.map +0 -1
  372. package/lib/module/providers/anime/aniwatchtv/create-aniwatchtv.js +0 -569
  373. package/lib/module/providers/anime/aniwatchtv/create-aniwatchtv.js.map +0 -1
  374. package/lib/typescript/commonjs/src/providers/anime/aniwatchtv/aniwatchtv.d.ts +0 -134
  375. package/lib/typescript/commonjs/src/providers/anime/aniwatchtv/aniwatchtv.d.ts.map +0 -1
  376. package/lib/typescript/commonjs/src/providers/anime/aniwatchtv/create-aniwatchtv.d.ts.map +0 -1
  377. package/lib/typescript/module/src/providers/anime/aniwatchtv/aniwatchtv.d.ts +0 -134
  378. package/lib/typescript/module/src/providers/anime/aniwatchtv/aniwatchtv.d.ts.map +0 -1
  379. package/lib/typescript/module/src/providers/anime/aniwatchtv/create-aniwatchtv.d.ts.map +0 -1
  380. package/src/providers/anime/aniwatchtv/aniwatchtv.ts +0 -198
  381. package/src/providers/anime/aniwatchtv/create-aniwatchtv.ts +0 -632
  382. /package/src/extractors/{streamp2p.ts → StreamP2P.ts} +0 -0
@@ -0,0 +1,167 @@
1
+ import { type ExtractorContext, type ISource, type IVideo, type IVideoExtractor } from '../models';
2
+ import type { PolyURL } from '../utils/url-polyfill';
3
+
4
+ const DEFAULT_USER_AGENT =
5
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
6
+
7
+ /**
8
+ * GDFlix extractor function / factory relying on ExtractorContext
9
+ * Follows react-native-consumet conventions (Kwik, MegaUp, MegaPlay)
10
+ */
11
+ export function GDFlix(ctx: ExtractorContext): IVideoExtractor {
12
+ const serverName = 'GDFlix';
13
+ const sources: IVideo[] = [];
14
+ const { axios: client, load, USER_AGENT, PolyURL } = ctx;
15
+ const userAgent = USER_AGENT || DEFAULT_USER_AGENT;
16
+
17
+ const extract = async (videoUrl: PolyURL, referer?: string): Promise<ISource> => {
18
+ try {
19
+ const urlHref = typeof videoUrl === 'string' ? videoUrl : videoUrl.href;
20
+ const urlObj = typeof videoUrl === 'object' && videoUrl.origin ? videoUrl : new PolyURL(urlHref);
21
+ const baseUrl = urlObj.origin;
22
+
23
+ const pageHeaders: Record<string, string> = {
24
+ 'User-Agent': userAgent,
25
+ 'Referer': referer || baseUrl,
26
+ };
27
+
28
+ const res = await client.get(urlHref, { headers: pageHeaders });
29
+ let $ = load(res.data);
30
+
31
+ // Handle location.replace redirect in body onload
32
+ const bodyOnload = $('body').attr('onload');
33
+ if (bodyOnload?.includes('location.replace')) {
34
+ const redirectUrl = bodyOnload.split("location.replace('")?.[1]?.split("'")?.[0];
35
+ if (redirectUrl) {
36
+ const redirectRes = await client.get(redirectUrl, { headers: pageHeaders });
37
+ $ = load(redirectRes.data);
38
+ }
39
+ }
40
+
41
+ const rawTitle = $('title').text() || '';
42
+ const qualityMatch = rawTitle.match(/\b(2160p|4k|1080p|720p|480p|360p)\b/i);
43
+ const pageQuality = qualityMatch
44
+ ? qualityMatch[1]!.toLowerCase() === '4k'
45
+ ? '2160p'
46
+ : qualityMatch[1]!.toLowerCase()
47
+ : 'auto';
48
+
49
+ const extractedSources: IVideo[] = [];
50
+
51
+ // 1. Resume Cloud / Resume Bot
52
+ try {
53
+ const resumeDrive = $('.btn-secondary').attr('href') || '';
54
+ if (resumeDrive) {
55
+ if (resumeDrive.includes('indexbot')) {
56
+ const resumeBotRes = await client.get(resumeDrive, { headers: pageHeaders });
57
+ const tokenMatch = resumeBotRes.data.match(/formData\.append\('token',\s*'([a-f0-9]+)'\)/);
58
+ const resumeBotToken = tokenMatch ? tokenMatch[1] : '';
59
+
60
+ const pathMatch = resumeBotRes.data.match(/fetch\('\/download\?id=([a-zA-Z0-9\/+]+)'/);
61
+ const resumeBotPath = pathMatch ? pathMatch[1] : '';
62
+ const resumeBotBaseUrl = resumeDrive.split('/download')[0];
63
+
64
+ if (resumeBotToken && resumeBotPath) {
65
+ const postRes = await client.post(
66
+ `${resumeBotBaseUrl}/download?id=${resumeBotPath}`,
67
+ `token=${encodeURIComponent(resumeBotToken)}`,
68
+ {
69
+ headers: {
70
+ 'Referer': resumeDrive,
71
+ 'Cookie': 'PHPSESSID=7e9658ce7c805dab5bbcea9046f7f308',
72
+ 'Content-Type': 'application/x-www-form-urlencoded',
73
+ },
74
+ }
75
+ );
76
+ const downloadUrl = postRes.data?.url;
77
+ if (downloadUrl) {
78
+ extractedSources.push({
79
+ url: downloadUrl,
80
+ server: 'ResumeBot',
81
+ quality: pageQuality,
82
+ isM3U8: downloadUrl.includes('.m3u8'),
83
+ });
84
+ }
85
+ }
86
+ } else {
87
+ const targetUrl = resumeDrive.startsWith('http') ? resumeDrive : `${baseUrl}${resumeDrive}`;
88
+ const resumeDriveRes = await client.get(targetUrl, { headers: pageHeaders });
89
+ const $resumeDrive = load(resumeDriveRes.data);
90
+ const resumeUrl = $resumeDrive('.btn-success').attr('href');
91
+ if (resumeUrl) {
92
+ extractedSources.push({
93
+ url: resumeUrl,
94
+ server: 'ResumeCloud',
95
+ quality: pageQuality,
96
+ isM3U8: resumeUrl.includes('.m3u8'),
97
+ });
98
+ }
99
+ }
100
+ }
101
+ } catch {
102
+ // Resume link not found
103
+ }
104
+
105
+ // 2. Instant Link (G-Drive)
106
+ try {
107
+ const seed = $('.btn-danger').attr('href') || '';
108
+ if (seed) {
109
+ if (!seed.includes('?url=')) {
110
+ const headRes = await client.head(seed, { headers: pageHeaders });
111
+ const redirected = (headRes.request as any)?.responseURL || seed;
112
+ const driveUrl = redirected.includes('?url=') ? redirected.split('?url=')[1] : redirected;
113
+ if (driveUrl) {
114
+ extractedSources.push({
115
+ url: driveUrl,
116
+ server: 'G-Drive',
117
+ quality: pageQuality,
118
+ isM3U8: driveUrl.includes('.m3u8'),
119
+ });
120
+ }
121
+ } else {
122
+ const instantToken = seed.split('=')[1];
123
+ const videoSeedUrl = seed.split('/').slice(0, 3).join('/') + '/api';
124
+
125
+ if (instantToken) {
126
+ const postRes = await client.post(videoSeedUrl, `keys=${encodeURIComponent(instantToken)}`, {
127
+ headers: {
128
+ 'x-token': videoSeedUrl,
129
+ 'Content-Type': 'application/x-www-form-urlencoded',
130
+ },
131
+ });
132
+ const instantLinkData = typeof postRes.data === 'string' ? JSON.parse(postRes.data) : postRes.data;
133
+ if (instantLinkData && instantLinkData.error === false && instantLinkData.url) {
134
+ extractedSources.push({
135
+ url: instantLinkData.url,
136
+ server: 'G-Drive (download only)',
137
+ quality: pageQuality,
138
+ isM3U8: instantLinkData.url.includes('.m3u8'),
139
+ });
140
+ }
141
+ }
142
+ }
143
+ }
144
+ } catch {
145
+ // Instant link not found
146
+ }
147
+
148
+ return {
149
+ sources: extractedSources,
150
+ headers: {
151
+ 'User-Agent': userAgent,
152
+ 'Referer': baseUrl,
153
+ },
154
+ };
155
+ } catch (error) {
156
+ throw new Error(`[GDFlix] Failed to extract: ${(error as Error).message}`);
157
+ }
158
+ };
159
+
160
+ return {
161
+ serverName,
162
+ sources,
163
+ extract,
164
+ };
165
+ }
166
+
167
+ export default GDFlix;
@@ -0,0 +1,182 @@
1
+ import { type ExtractorContext, type ISource, type IVideo, type IVideoExtractor } from '../models';
2
+ import type { PolyURL } from '../utils/url-polyfill';
3
+
4
+ const GOFILE_API = 'https://api.gofile.io';
5
+ const GOFILE_LANGUAGE = 'en-US';
6
+ const DEFAULT_USER_AGENT =
7
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36';
8
+
9
+ type GofileContent = {
10
+ id?: string;
11
+ type?: string;
12
+ link?: string;
13
+ children?: Record<string, GofileContent>;
14
+ };
15
+
16
+ let cachedAccountToken: string | null = null;
17
+ let cachedGenerateWT: ((token: string) => string) | null = null;
18
+ let cachedWTTime = 0;
19
+
20
+ async function getOrFetchGenerateWT(axiosClient: any, userAgent: string): Promise<(token: string) => string> {
21
+ const now = Date.now();
22
+ if (cachedGenerateWT && now - cachedWTTime < 3 * 60 * 60 * 1000) {
23
+ return cachedGenerateWT;
24
+ }
25
+
26
+ try {
27
+ const res = await axiosClient.get('https://gofile.io/js/wt.obf.js', {
28
+ headers: {
29
+ 'User-Agent': userAgent,
30
+ 'Referer': 'https://gofile.io/',
31
+ },
32
+ });
33
+
34
+ const code = res.data;
35
+ const runner = new Function(
36
+ 'navigator',
37
+ 'window',
38
+ 'document',
39
+ 'location',
40
+ `${code}\nreturn typeof generateWT !== 'undefined' ? generateWT : (window && window.generateWT);`
41
+ );
42
+ const fakeNav = {
43
+ userAgent,
44
+ language: GOFILE_LANGUAGE,
45
+ };
46
+ const fakeWin: any = {
47
+ navigator: fakeNav,
48
+ location: {
49
+ href: 'https://gofile.io/',
50
+ protocol: 'https:',
51
+ host: 'gofile.io',
52
+ },
53
+ };
54
+
55
+ const generateWT = runner(fakeNav, fakeWin, {}, fakeWin.location);
56
+ if (typeof generateWT === 'function') {
57
+ cachedGenerateWT = generateWT;
58
+ cachedWTTime = now;
59
+ return generateWT;
60
+ }
61
+ } catch (err: any) {
62
+ console.warn('[Gofile] Failed to fetch or execute wt.obf.js:', err?.message || err);
63
+ }
64
+
65
+ // Fallback if wt.obf.js is unreachable
66
+ return (accountToken: string) => accountToken;
67
+ }
68
+
69
+ async function getOrFetchToken(axiosClient: any, userAgent: string): Promise<string> {
70
+ if (cachedAccountToken) return cachedAccountToken;
71
+
72
+ const accountResponse = await axiosClient.post(
73
+ `${GOFILE_API}/accounts`,
74
+ {},
75
+ {
76
+ headers: {
77
+ 'User-Agent': userAgent,
78
+ 'Origin': 'https://gofile.io',
79
+ 'Referer': 'https://gofile.io/',
80
+ },
81
+ }
82
+ );
83
+ const token = accountResponse.data?.data?.token;
84
+
85
+ if (!token) throw new Error('[Gofile] Did not return an account token');
86
+
87
+ cachedAccountToken = token;
88
+ return token;
89
+ }
90
+
91
+ function findFirstFile(content: GofileContent): GofileContent | undefined {
92
+ if (content?.type === 'file' && content?.link) return content;
93
+
94
+ for (const child of Object.values(content?.children ?? {})) {
95
+ const file = findFirstFile(child);
96
+ if (file) return file;
97
+ }
98
+
99
+ return undefined;
100
+ }
101
+
102
+ /**
103
+ * Gofile extractor function / factory relying on ExtractorContext
104
+ * Follows react-native-consumet conventions (Kwik, MegaUp, MegaPlay)
105
+ */
106
+ export function Gofile(ctx: ExtractorContext): IVideoExtractor {
107
+ const serverName = 'Gofile';
108
+ const sources: IVideo[] = [];
109
+ const { axios: client, USER_AGENT, PolyURL } = ctx;
110
+ const userAgent = USER_AGENT || DEFAULT_USER_AGENT;
111
+
112
+ const extract = async (videoUrl: PolyURL): Promise<ISource> => {
113
+ try {
114
+ const urlHref = typeof videoUrl === 'string' ? videoUrl : videoUrl.href;
115
+ const urlObj = typeof videoUrl === 'object' && videoUrl.origin ? videoUrl : new PolyURL(urlHref);
116
+ const id = urlObj.searchParams.get('c') || urlObj.pathname.split('/').filter(Boolean).pop() || urlHref;
117
+
118
+ const token = await getOrFetchToken(client, userAgent);
119
+ const generateWT = await getOrFetchGenerateWT(client, userAgent);
120
+ const websiteToken = generateWT(token);
121
+
122
+ const response = await client.get(`${GOFILE_API}/contents/${id}`, {
123
+ params: {
124
+ contentFilter: '',
125
+ page: 1,
126
+ pageSize: 1000,
127
+ sortField: 'name',
128
+ sortDirection: 1,
129
+ },
130
+ headers: {
131
+ 'Accept': '*/*',
132
+ 'Accept-Language': `${GOFILE_LANGUAGE},en;q=0.9`,
133
+ 'Authorization': `Bearer ${token}`,
134
+ 'Origin': 'https://gofile.io',
135
+ 'Referer': 'https://gofile.io/',
136
+ 'User-Agent': userAgent,
137
+ 'X-BL': GOFILE_LANGUAGE,
138
+ 'X-Website-Token': websiteToken,
139
+ },
140
+ });
141
+
142
+ if (response.data?.status !== 'ok') {
143
+ if (response.data?.status === 'error-auth' || response.status === 401) {
144
+ cachedAccountToken = null;
145
+ }
146
+ throw new Error(`[Gofile] API returned ${response.data?.status ?? 'invalid data'}`);
147
+ }
148
+
149
+ const file = findFirstFile(response.data.data);
150
+ if (!file?.link) {
151
+ throw new Error('[Gofile] No downloadable file found in Gofile response');
152
+ }
153
+
154
+ const defaultSource: IVideo = {
155
+ url: file.link,
156
+ isM3U8: file.link.includes('.m3u8'),
157
+ isDASH: file.link.includes('.mpd'),
158
+ quality: 'auto',
159
+ };
160
+
161
+ return {
162
+ sources: [defaultSource],
163
+ headers: {
164
+ 'User-Agent': userAgent,
165
+ 'Referer': 'https://gofile.io/',
166
+ 'Cookie': `accountToken=${token}`,
167
+ },
168
+ download: file.link,
169
+ };
170
+ } catch (error) {
171
+ throw new Error(`[Gofile] Failed to extract: ${(error as Error).message}`);
172
+ }
173
+ };
174
+
175
+ return {
176
+ serverName,
177
+ sources,
178
+ extract,
179
+ };
180
+ }
181
+
182
+ export default Gofile;
@@ -0,0 +1,357 @@
1
+ import { type ExtractorContext, type ISource, type IVideo, type IVideoExtractor } from '../models';
2
+ import type { PolyURL } from '../utils/url-polyfill';
3
+ import { Gofile } from './gofile';
4
+
5
+ const DEFAULT_USER_AGENT =
6
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
7
+
8
+ function safeAtob(value: string): string {
9
+ if (!value) return '';
10
+ if (typeof atob === 'function') {
11
+ try {
12
+ return atob(value);
13
+ } catch {}
14
+ }
15
+ if (typeof Buffer !== 'undefined') {
16
+ try {
17
+ return Buffer.from(value, 'base64').toString('binary');
18
+ } catch {}
19
+ }
20
+ return '';
21
+ }
22
+
23
+ const hubcloudDecode = function (value: string) {
24
+ if (!value) return '';
25
+ return safeAtob(value.toString());
26
+ };
27
+
28
+ const extractUrlFromScript = (html: string): string => {
29
+ const doubleAtobMatch = html.match(/(?:var|let|const)\s+\w+\s*=\s*atob\(atob\(['"]([^'"]+)['"]\)\)/);
30
+ if (doubleAtobMatch?.[1]) {
31
+ return safeAtob(safeAtob(doubleAtobMatch[1]));
32
+ }
33
+ const plainMatch = html.match(/var\s+url\s*=\s*['"]([^'"]+)['"]/);
34
+ return hubcloudDecode(plainMatch?.[1]?.split('r=')?.[1] ?? '') || plainMatch?.[1] || '';
35
+ };
36
+
37
+ const getPixelDrainUrl = (html: string) => {
38
+ const match = html.match(/var\s+pxl\s*=\s*['"]([^'"]+)['"];?/i);
39
+ return match?.[1] || '';
40
+ };
41
+
42
+ const getRedirectedPixelDrainUrl = (...htmlSources: Array<string | undefined>) => {
43
+ for (const html of htmlSources) {
44
+ if (!html) continue;
45
+ const redirectedUrl = getPixelDrainUrl(html);
46
+ if (redirectedUrl) {
47
+ return redirectedUrl;
48
+ }
49
+ }
50
+ return '';
51
+ };
52
+
53
+ /**
54
+ * HubCloud extractor function / factory relying on ExtractorContext
55
+ * Follows react-native-consumet conventions (Kwik, MegaUp, MegaPlay)
56
+ */
57
+ export function HubCloud(ctx: ExtractorContext): IVideoExtractor {
58
+ const serverName = 'HubCloud';
59
+ const sources: IVideo[] = [];
60
+ const { axios: client, load, USER_AGENT, PolyURL } = ctx;
61
+ const userAgent = USER_AGENT || DEFAULT_USER_AGENT;
62
+
63
+ const extract = async (videoUrl: PolyURL, referer?: string): Promise<ISource> => {
64
+ try {
65
+ const urlHref = typeof videoUrl === 'string' ? videoUrl : videoUrl.href;
66
+ const urlObj = typeof videoUrl === 'object' && videoUrl.origin ? videoUrl : new PolyURL(urlHref);
67
+ const baseUrl = urlObj.origin;
68
+
69
+ const pageHeaders: Record<string, string> = {
70
+ 'User-Agent': userAgent,
71
+ 'Referer': referer || baseUrl,
72
+ 'Cookie':
73
+ 'ext_name=ojplmecpdpgccookcobabopnaifgidhf; xla=s4t; cf_clearance=woQrFGXtLfmEMBEiGUsVHrUBMT8s3cmguIzmMjmvpkg-1770053679-1.2.1.1-xBrQdciOJsweUF6F2T_OtH6jmyanN_TduQ0yslc_XqjU6RcHSxI7.YOKv6ry7oYo64868HYoULnVyww536H2eVI3R2e4wKzsky6abjPdfQPxqpUaXjxfJ02o6jl3_Vkwr4uiaU7Wy596Vdst3y78HXvVmKdIohhtPvp.vZ9_L7wvWdce0GRixjh_6JiqWmWMws46hwEt3hboaS1e1e4EoWCvj5b0M_jVwvSxBOAW5emFzvT3QrnRh4nyYmKDERnY',
74
+ };
75
+
76
+ const vLinkRes = await client.get(urlHref, { headers: pageHeaders });
77
+ const vLinkText = vLinkRes.data;
78
+ const $vLink = load(vLinkText);
79
+
80
+ // Extract file quality and size from page text and headers
81
+ const extractQualityFromText = (text: string): string => {
82
+ const m = text.match(/\b(2160p|4k|1080p|720p|480p|360p)\b/i);
83
+ if (m) {
84
+ return m[1]!.toLowerCase() === '4k' ? '2160p' : m[1]!.toLowerCase();
85
+ }
86
+ return '';
87
+ };
88
+
89
+ const parseSizeInBytes = (text: string): number | undefined => {
90
+ const match = text.match(/([\d.]+)\s*(GB|MB|KB|B)/i);
91
+ if (!match) return undefined;
92
+ const val = parseFloat(match[1]!);
93
+ const unit = match[2]!.toUpperCase();
94
+ if (unit === 'GB') return Math.round(val * 1024 * 1024 * 1024);
95
+ if (unit === 'MB') return Math.round(val * 1024 * 1024);
96
+ if (unit === 'KB') return Math.round(val * 1024);
97
+ return Math.round(val);
98
+ };
99
+
100
+ let pageQuality =
101
+ extractQualityFromText($vLink('title').text()) ||
102
+ extractQualityFromText($vLink('.card-header').text()) ||
103
+ extractQualityFromText(urlHref) ||
104
+ 'auto';
105
+
106
+ let fileSize = parseSizeInBytes($vLink('#size, .list-group-item:contains("Size")').text());
107
+
108
+ const extractedSources: IVideo[] = [];
109
+
110
+ const addGofileSources = (res: ISource | IVideo[]) => {
111
+ const list = Array.isArray(res) ? res : res.sources;
112
+ if (Array.isArray(list)) {
113
+ for (const s of list) {
114
+ if (!extractedSources.some((item) => item.url === s.url)) {
115
+ extractedSources.push({
116
+ ...s,
117
+ server: 'Gofile',
118
+ quality: pageQuality !== 'auto' ? pageQuality : s.quality || 'auto',
119
+ size: s.size || fileSize,
120
+ });
121
+ }
122
+ }
123
+ }
124
+ };
125
+
126
+ // Check if initial page contains any direct Gofile download links
127
+ const vLinkGofileBtns = $vLink("a[href*='gofile.io']");
128
+ for (const el of vLinkGofileBtns.toArray()) {
129
+ const gfHref = $vLink(el).attr('href');
130
+ if (gfHref) {
131
+ try {
132
+ const gofileRes = await Gofile(ctx).extract(new PolyURL(gfHref));
133
+ addGofileSources(gofileRes);
134
+ } catch {}
135
+ }
136
+ }
137
+
138
+ let vcloudLink =
139
+ extractUrlFromScript(vLinkText) || $vLink('.fa-file-download.fa-lg').parent().attr('href') || urlHref;
140
+
141
+ if (vcloudLink?.startsWith('/')) {
142
+ vcloudLink = `${baseUrl}${vcloudLink}`;
143
+ }
144
+
145
+ // If vcloudLink is directly a Gofile URL
146
+ if (vcloudLink?.includes('gofile.io')) {
147
+ try {
148
+ const gofileRes = await Gofile(ctx).extract(new PolyURL(vcloudLink));
149
+ addGofileSources(gofileRes);
150
+ } catch {}
151
+ }
152
+
153
+ let vcloudText = '';
154
+ if (vcloudLink && !vcloudLink.includes('gofile.io') && vcloudLink !== urlHref) {
155
+ const vcloudRes = await client.get(vcloudLink, { headers: pageHeaders });
156
+ vcloudText = vcloudRes.data;
157
+ }
158
+
159
+ const $ = load(vcloudText || vLinkText);
160
+
161
+ // Re-check quality and size from final page if not found earlier
162
+ if (pageQuality === 'auto') {
163
+ pageQuality =
164
+ extractQualityFromText($('title').text()) ||
165
+ extractQualityFromText($('.card-header').text()) ||
166
+ extractQualityFromText(vcloudLink) ||
167
+ 'auto';
168
+ }
169
+ if (!fileSize) {
170
+ fileSize = parseSizeInBytes($('#size, .list-group-item:contains("Size")').text());
171
+ }
172
+
173
+ const linkClass = $('.btn-success.btn-lg.h6, .btn-danger, .btn-secondary');
174
+
175
+ for (const element of linkClass.toArray()) {
176
+ const itm = $(element);
177
+ let btnUrl = itm.attr('href') || '';
178
+
179
+ switch (true) {
180
+ case btnUrl.includes('pixeld'):
181
+ if (!btnUrl.includes('api')) {
182
+ const redirectedPixelDrainUrl = getRedirectedPixelDrainUrl(vLinkText, vcloudText);
183
+ if (redirectedPixelDrainUrl) {
184
+ btnUrl = redirectedPixelDrainUrl;
185
+ }
186
+
187
+ const token = btnUrl.split('/').pop()?.split('?')[0];
188
+ const pxlBaseUrl = btnUrl.split('/').slice(0, -2).join('/');
189
+ btnUrl = `${pxlBaseUrl}/api/file/${token}?download`;
190
+ }
191
+ extractedSources.push({
192
+ url: btnUrl,
193
+ server: 'Pixeldrain',
194
+ quality: pageQuality,
195
+ isM3U8: btnUrl.includes('.m3u8'),
196
+ size: fileSize,
197
+ });
198
+ break;
199
+
200
+ case btnUrl.includes('.dev') && !btnUrl.includes('/?id='):
201
+ extractedSources.push({
202
+ url: btnUrl,
203
+ server: 'CF Worker',
204
+ quality: pageQuality,
205
+ isM3U8: btnUrl.includes('.m3u8'),
206
+ size: fileSize,
207
+ });
208
+ break;
209
+
210
+ case btnUrl.includes('hubcloud') || btnUrl.includes('/?id='):
211
+ try {
212
+ let newUrl = btnUrl;
213
+ try {
214
+ if (typeof fetch !== 'undefined') {
215
+ const fRes = await fetch(btnUrl, {
216
+ headers: pageHeaders,
217
+ redirect: 'follow',
218
+ });
219
+ if (fRes.url && fRes.url.includes('googleusercontent')) {
220
+ newUrl = fRes.url.split('?link=')[1] || fRes.url;
221
+ } else if (fRes.url && fRes.url !== btnUrl) {
222
+ newUrl = fRes.url;
223
+ }
224
+ }
225
+ } catch {}
226
+
227
+ if (!newUrl.includes('googleusercontent')) {
228
+ try {
229
+ const res1 = await client.get(newUrl, {
230
+ headers: pageHeaders,
231
+ maxRedirects: 0,
232
+ validateStatus: (s: number) => s >= 200 && s < 400,
233
+ });
234
+ if (res1.headers?.location) {
235
+ newUrl = res1.headers.location;
236
+ }
237
+ if (newUrl.includes('googleusercontent')) {
238
+ newUrl = newUrl.split('?link=')[1] || newUrl;
239
+ } else if (newUrl.includes('http')) {
240
+ const res2 = await client.get(newUrl, {
241
+ headers: pageHeaders,
242
+ maxRedirects: 0,
243
+ validateStatus: (s: number) => s >= 200 && s < 400,
244
+ });
245
+ if (res2.headers?.location) {
246
+ const loc2 = res2.headers.location;
247
+ newUrl = loc2.includes('?link=') ? loc2.split('?link=')[1] : loc2;
248
+ }
249
+ }
250
+ } catch {}
251
+ }
252
+
253
+ if (newUrl.includes('?link=')) {
254
+ newUrl = newUrl.split('?link=')[1] || newUrl;
255
+ }
256
+
257
+ extractedSources.push({
258
+ url: newUrl,
259
+ server: 'GDrive (download only)',
260
+ quality: pageQuality,
261
+ isM3U8: newUrl.includes('.m3u8'),
262
+ size: fileSize,
263
+ });
264
+ } catch {}
265
+ break;
266
+
267
+ case btnUrl.includes('gofile.io'):
268
+ try {
269
+ const gofileRes = await Gofile(ctx).extract(new PolyURL(btnUrl));
270
+ addGofileSources(gofileRes);
271
+ } catch {}
272
+ break;
273
+
274
+ case btnUrl.includes('cloudflarestorage'):
275
+ extractedSources.push({
276
+ url: btnUrl,
277
+ server: 'CF Storage',
278
+ quality: pageQuality,
279
+ isM3U8: btnUrl.includes('.m3u8'),
280
+ size: fileSize,
281
+ });
282
+ break;
283
+
284
+ case btnUrl.includes('fastdl') || btnUrl.includes('fsl.'):
285
+ extractedSources.push({
286
+ url: btnUrl,
287
+ server: 'FastDl',
288
+ quality: pageQuality,
289
+ isM3U8: btnUrl.includes('.m3u8'),
290
+ size: fileSize,
291
+ });
292
+ break;
293
+
294
+ case btnUrl.includes('hubcdn') && !btnUrl.includes('/?id='):
295
+ extractedSources.push({
296
+ url: btnUrl,
297
+ server: 'HubCdn',
298
+ quality: pageQuality,
299
+ isM3U8: btnUrl.includes('.m3u8'),
300
+ size: fileSize,
301
+ });
302
+ break;
303
+
304
+ default:
305
+ if (
306
+ btnUrl.includes('.m3u8') ||
307
+ btnUrl.includes('.mp4') ||
308
+ btnUrl.includes('.mkv') ||
309
+ btnUrl.includes('?token=')
310
+ ) {
311
+ extractedSources.push({
312
+ url: btnUrl,
313
+ server: 'CF Worker',
314
+ quality: pageQuality,
315
+ isM3U8: btnUrl.includes('.m3u8'),
316
+ size: fileSize,
317
+ });
318
+ }
319
+ break;
320
+ }
321
+ }
322
+
323
+ // Sort extracted sources by priority
324
+ const getPriority = (serverName: string = '') => {
325
+ const s = serverName.toLowerCase();
326
+ if (s.includes('cf storage') || s.includes('storage')) return 1;
327
+ if (s.includes('cf worker') || s.includes('worker') || s.includes('fast cloud')) return 2;
328
+ if (s.includes('gofile')) return 3;
329
+ if (s.includes('pixeldrain')) return 4;
330
+ if (s.includes('fastdl') || s.includes('fsl')) return 5;
331
+ if (s.includes('hubcdn')) return 6;
332
+ if (s.includes('gdrive') || s.includes('google')) return 7;
333
+ return 10;
334
+ };
335
+
336
+ extractedSources.sort((a, b) => getPriority(a.server || a.quality) - getPriority(b.server || b.quality));
337
+
338
+ return {
339
+ sources: extractedSources,
340
+ headers: {
341
+ 'User-Agent': userAgent,
342
+ 'Referer': baseUrl,
343
+ },
344
+ };
345
+ } catch (error) {
346
+ throw new Error(`[HubCloud] Failed to extract: ${(error as Error).message}`);
347
+ }
348
+ };
349
+
350
+ return {
351
+ serverName,
352
+ sources,
353
+ extract,
354
+ };
355
+ }
356
+
357
+ export default HubCloud;