react-native-consumet 1.3.1 → 1.5.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 (439) 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 +98 -3
  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/flixcloud.js +179 -0
  21. package/lib/commonjs/extractors/flixcloud.js.map +1 -0
  22. package/lib/commonjs/extractors/gdflix.js +167 -0
  23. package/lib/commonjs/extractors/gdflix.js.map +1 -0
  24. package/lib/commonjs/extractors/gofile.js +152 -0
  25. package/lib/commonjs/extractors/gofile.js.map +1 -0
  26. package/lib/commonjs/extractors/gogocdn.js.map +1 -1
  27. package/lib/commonjs/extractors/hubcloud.js +320 -0
  28. package/lib/commonjs/extractors/hubcloud.js.map +1 -0
  29. package/lib/commonjs/extractors/index.js +35 -0
  30. package/lib/commonjs/extractors/index.js.map +1 -1
  31. package/lib/commonjs/extractors/kisskh/kkey.js.map +1 -1
  32. package/lib/commonjs/extractors/kisskh/staticdata.js.map +1 -1
  33. package/lib/commonjs/extractors/kwik.js +59 -74
  34. package/lib/commonjs/extractors/kwik.js.map +1 -1
  35. package/lib/commonjs/extractors/megacloud.js.map +1 -1
  36. package/lib/commonjs/extractors/megaplay.js +241 -0
  37. package/lib/commonjs/extractors/megaplay.js.map +1 -0
  38. package/lib/commonjs/extractors/megaup.js.map +1 -1
  39. package/lib/commonjs/extractors/mixdrop.js.map +1 -1
  40. package/lib/commonjs/extractors/mp4player.js.map +1 -1
  41. package/lib/commonjs/extractors/mp4upload.js.map +1 -1
  42. package/lib/commonjs/extractors/rapidcloud.js.map +1 -1
  43. package/lib/commonjs/extractors/streamhub.js.map +1 -1
  44. package/lib/commonjs/extractors/streamlare.js.map +1 -1
  45. package/lib/commonjs/extractors/streamsb.js.map +1 -1
  46. package/lib/commonjs/extractors/streamtape.js.map +1 -1
  47. package/lib/commonjs/extractors/streamwish.js.map +1 -1
  48. package/lib/commonjs/extractors/vidhide.js +9 -2
  49. package/lib/commonjs/extractors/vidhide.js.map +1 -1
  50. package/lib/commonjs/extractors/vidmoly.js.map +1 -1
  51. package/lib/commonjs/extractors/vizcloud.js.map +1 -1
  52. package/lib/commonjs/extractors/voe.js.map +1 -1
  53. package/lib/commonjs/index.js +24 -0
  54. package/lib/commonjs/index.js.map +1 -1
  55. package/lib/commonjs/models/anime-parser.js.map +1 -1
  56. package/lib/commonjs/models/base-parser.js.map +1 -1
  57. package/lib/commonjs/models/base-provider.js.map +1 -1
  58. package/lib/commonjs/models/base-types.js.map +1 -1
  59. package/lib/commonjs/models/extension-manifest.js.map +1 -1
  60. package/lib/commonjs/models/extractor-context.js.map +1 -1
  61. package/lib/commonjs/models/index.js.map +1 -1
  62. package/lib/commonjs/models/lightnovel-parser.js.map +1 -1
  63. package/lib/commonjs/models/manga-parser.js.map +1 -1
  64. package/lib/commonjs/models/movie-parser.js.map +1 -1
  65. package/lib/commonjs/models/provider-context.js.map +1 -1
  66. package/lib/commonjs/models/types.js +5 -0
  67. package/lib/commonjs/models/types.js.map +1 -1
  68. package/lib/commonjs/models/video-extractor.js.map +1 -1
  69. package/lib/commonjs/providers/anime/anify.js.map +1 -1
  70. package/lib/commonjs/providers/anime/anikoto/anikoto.js +62 -63
  71. package/lib/commonjs/providers/anime/anikoto/anikoto.js.map +1 -1
  72. package/lib/commonjs/providers/anime/anikoto/create-anikoto.js +359 -406
  73. package/lib/commonjs/providers/anime/anikoto/create-anikoto.js.map +1 -1
  74. package/lib/commonjs/providers/anime/animedrive.js.map +1 -1
  75. package/lib/commonjs/providers/anime/animekai/animekai.js.map +1 -1
  76. package/lib/commonjs/providers/anime/animekai/create-animekai.js.map +1 -1
  77. package/lib/commonjs/providers/anime/animepahe/animepahe.js.map +1 -1
  78. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +107 -137
  79. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
  80. package/lib/commonjs/providers/anime/animesuge/animesuge.js.map +1 -1
  81. package/lib/commonjs/providers/anime/animesuge/create-animesuge.js.map +1 -1
  82. package/lib/commonjs/providers/anime/animeunity.js.map +1 -1
  83. package/lib/commonjs/providers/anime/anineko/anineko.js +31 -0
  84. package/lib/commonjs/providers/anime/anineko/anineko.js.map +1 -0
  85. package/lib/commonjs/providers/anime/anineko/create-anineko.js +447 -0
  86. package/lib/commonjs/providers/anime/anineko/create-anineko.js.map +1 -0
  87. package/lib/commonjs/providers/anime/index.js +9 -1
  88. package/lib/commonjs/providers/anime/index.js.map +1 -1
  89. package/lib/commonjs/providers/anime/kickassanime.js.map +1 -1
  90. package/lib/commonjs/providers/anime/marin.js.map +1 -1
  91. package/lib/commonjs/providers/anime/reanime/create-reanime.js +255 -0
  92. package/lib/commonjs/providers/anime/reanime/create-reanime.js.map +1 -0
  93. package/lib/commonjs/providers/anime/reanime/reanime.js +31 -0
  94. package/lib/commonjs/providers/anime/reanime/reanime.js.map +1 -0
  95. package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +1 -1
  96. package/lib/commonjs/providers/anime/zoro/zoro.js.map +1 -1
  97. package/lib/commonjs/providers/index.js.map +1 -1
  98. package/lib/commonjs/providers/light-novels/index.js.map +1 -1
  99. package/lib/commonjs/providers/light-novels/novelupdates.js.map +1 -1
  100. package/lib/commonjs/providers/light-novels/readlightnovels.js.map +1 -1
  101. package/lib/commonjs/providers/manga/asurascans.js.map +1 -1
  102. package/lib/commonjs/providers/manga/brmangas.js.map +1 -1
  103. package/lib/commonjs/providers/manga/comick.js.map +1 -1
  104. package/lib/commonjs/providers/manga/flamescans.js.map +1 -1
  105. package/lib/commonjs/providers/manga/index.js.map +1 -1
  106. package/lib/commonjs/providers/manga/mangadex.js.map +1 -1
  107. package/lib/commonjs/providers/manga/mangahere.js.map +1 -1
  108. package/lib/commonjs/providers/manga/mangahost.js.map +1 -1
  109. package/lib/commonjs/providers/manga/mangakakalot.js.map +1 -1
  110. package/lib/commonjs/providers/manga/mangapark.js.map +1 -1
  111. package/lib/commonjs/providers/manga/mangapill.js.map +1 -1
  112. package/lib/commonjs/providers/manga/mangareader.js.map +1 -1
  113. package/lib/commonjs/providers/manga/mangasee123.js.map +1 -1
  114. package/lib/commonjs/providers/manga/readmanga.js.map +1 -1
  115. package/lib/commonjs/providers/manga/vyvymanga.js.map +1 -1
  116. package/lib/commonjs/providers/meta/anilist.js.map +1 -1
  117. package/lib/commonjs/providers/meta/index.js.map +1 -1
  118. package/lib/commonjs/providers/meta/mal.js.map +1 -1
  119. package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
  120. package/lib/commonjs/providers/movies/dramacool.js.map +1 -1
  121. package/lib/commonjs/providers/movies/himovies/create-himovies.js.map +1 -1
  122. package/lib/commonjs/providers/movies/himovies/himovies.js.map +1 -1
  123. package/lib/commonjs/providers/movies/index.js +18 -1
  124. package/lib/commonjs/providers/movies/index.js.map +1 -1
  125. package/lib/commonjs/providers/movies/multimovies/create-multimovies.js.map +1 -1
  126. package/lib/commonjs/providers/movies/multimovies/multimovies.js.map +1 -1
  127. package/lib/commonjs/providers/movies/multistream/index.js.map +1 -1
  128. package/lib/commonjs/providers/movies/multistream/utils.js.map +1 -1
  129. package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
  130. package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js.map +1 -1
  131. package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js +812 -0
  132. package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js.map +1 -0
  133. package/lib/commonjs/providers/movies/vegamovies/vegamovies.js +56 -0
  134. package/lib/commonjs/providers/movies/vegamovies/vegamovies.js.map +1 -0
  135. package/lib/commonjs/providers/movies/yflix/create-yflix.js.map +1 -1
  136. package/lib/commonjs/providers/movies/yflix/yflix.js.map +1 -1
  137. package/lib/commonjs/providers/movies/yflix.js.map +1 -1
  138. package/lib/commonjs/utils/ExtractorManager.js +17 -2
  139. package/lib/commonjs/utils/ExtractorManager.js.map +1 -1
  140. package/lib/commonjs/utils/ProviderManager.js +8 -1
  141. package/lib/commonjs/utils/ProviderManager.js.map +1 -1
  142. package/lib/commonjs/utils/constants.js.map +1 -1
  143. package/lib/commonjs/utils/create-extractor-context.js +3 -0
  144. package/lib/commonjs/utils/create-extractor-context.js.map +1 -1
  145. package/lib/commonjs/utils/create-provider-context.js +2 -0
  146. package/lib/commonjs/utils/create-provider-context.js.map +1 -1
  147. package/lib/commonjs/utils/extension-utils.js +15 -2
  148. package/lib/commonjs/utils/extension-utils.js.map +1 -1
  149. package/lib/commonjs/utils/index.js.map +1 -1
  150. package/lib/commonjs/utils/provider-maps.js +3 -0
  151. package/lib/commonjs/utils/provider-maps.js.map +1 -1
  152. package/lib/commonjs/utils/queries.js.map +1 -1
  153. package/lib/commonjs/utils/url-polyfill.js.map +1 -1
  154. package/lib/commonjs/utils/utils.js.map +1 -1
  155. package/lib/module/extension-registry.json +98 -3
  156. package/lib/module/extractors/{streamp2p.js → StreamP2P.js} +1 -1
  157. package/lib/module/extractors/StreamP2P.js.map +1 -0
  158. package/lib/module/extractors/asianload.js.map +1 -1
  159. package/lib/module/extractors/filemoon.js.map +1 -1
  160. package/lib/module/extractors/flixcloud.js +174 -0
  161. package/lib/module/extractors/flixcloud.js.map +1 -0
  162. package/lib/module/extractors/gdflix.js +162 -0
  163. package/lib/module/extractors/gdflix.js.map +1 -0
  164. package/lib/module/extractors/gofile.js +147 -0
  165. package/lib/module/extractors/gofile.js.map +1 -0
  166. package/lib/module/extractors/gogocdn.js.map +1 -1
  167. package/lib/module/extractors/hubcloud.js +315 -0
  168. package/lib/module/extractors/hubcloud.js.map +1 -0
  169. package/lib/module/extractors/index.js +6 -1
  170. package/lib/module/extractors/index.js.map +1 -1
  171. package/lib/module/extractors/kisskh/kkey.js.map +1 -1
  172. package/lib/module/extractors/kisskh/staticdata.js.map +1 -1
  173. package/lib/module/extractors/kwik.js +58 -74
  174. package/lib/module/extractors/kwik.js.map +1 -1
  175. package/lib/module/extractors/megacloud.js.map +1 -1
  176. package/lib/module/extractors/megaplay.js +236 -0
  177. package/lib/module/extractors/megaplay.js.map +1 -0
  178. package/lib/module/extractors/megaup.js.map +1 -1
  179. package/lib/module/extractors/mixdrop.js.map +1 -1
  180. package/lib/module/extractors/mp4player.js.map +1 -1
  181. package/lib/module/extractors/mp4upload.js.map +1 -1
  182. package/lib/module/extractors/rapidcloud.js.map +1 -1
  183. package/lib/module/extractors/streamhub.js.map +1 -1
  184. package/lib/module/extractors/streamlare.js.map +1 -1
  185. package/lib/module/extractors/streamsb.js.map +1 -1
  186. package/lib/module/extractors/streamtape.js.map +1 -1
  187. package/lib/module/extractors/streamwish.js.map +1 -1
  188. package/lib/module/extractors/vidhide.js +8 -2
  189. package/lib/module/extractors/vidhide.js.map +1 -1
  190. package/lib/module/extractors/vidmoly.js.map +1 -1
  191. package/lib/module/extractors/vizcloud.js.map +1 -1
  192. package/lib/module/extractors/voe.js.map +1 -1
  193. package/lib/module/index.js +2 -2
  194. package/lib/module/index.js.map +1 -1
  195. package/lib/module/models/anime-parser.js.map +1 -1
  196. package/lib/module/models/base-parser.js.map +1 -1
  197. package/lib/module/models/base-provider.js.map +1 -1
  198. package/lib/module/models/base-types.js.map +1 -1
  199. package/lib/module/models/extension-manifest.js.map +1 -1
  200. package/lib/module/models/extractor-context.js.map +1 -1
  201. package/lib/module/models/index.js.map +1 -1
  202. package/lib/module/models/lightnovel-parser.js.map +1 -1
  203. package/lib/module/models/manga-parser.js.map +1 -1
  204. package/lib/module/models/movie-parser.js.map +1 -1
  205. package/lib/module/models/provider-context.js.map +1 -1
  206. package/lib/module/models/types.js +5 -0
  207. package/lib/module/models/types.js.map +1 -1
  208. package/lib/module/models/video-extractor.js.map +1 -1
  209. package/lib/module/providers/anime/anify.js.map +1 -1
  210. package/lib/module/providers/anime/anikoto/anikoto.js +61 -64
  211. package/lib/module/providers/anime/anikoto/anikoto.js.map +1 -1
  212. package/lib/module/providers/anime/anikoto/create-anikoto.js +359 -407
  213. package/lib/module/providers/anime/anikoto/create-anikoto.js.map +1 -1
  214. package/lib/module/providers/anime/animedrive.js.map +1 -1
  215. package/lib/module/providers/anime/animekai/animekai.js.map +1 -1
  216. package/lib/module/providers/anime/animekai/create-animekai.js.map +1 -1
  217. package/lib/module/providers/anime/animepahe/animepahe.js.map +1 -1
  218. package/lib/module/providers/anime/animepahe/create-animepahe.js +107 -138
  219. package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
  220. package/lib/module/providers/anime/animesuge/animesuge.js.map +1 -1
  221. package/lib/module/providers/anime/animesuge/create-animesuge.js.map +1 -1
  222. package/lib/module/providers/anime/animeunity.js.map +1 -1
  223. package/lib/module/providers/anime/anineko/anineko.js +25 -0
  224. package/lib/module/providers/anime/anineko/anineko.js.map +1 -0
  225. package/lib/module/providers/anime/anineko/create-anineko.js +443 -0
  226. package/lib/module/providers/anime/anineko/create-anineko.js.map +1 -0
  227. package/lib/module/providers/anime/index.js +9 -1
  228. package/lib/module/providers/anime/index.js.map +1 -1
  229. package/lib/module/providers/anime/kickassanime.js.map +1 -1
  230. package/lib/module/providers/anime/marin.js.map +1 -1
  231. package/lib/module/providers/anime/reanime/create-reanime.js +251 -0
  232. package/lib/module/providers/anime/reanime/create-reanime.js.map +1 -0
  233. package/lib/module/providers/anime/reanime/reanime.js +25 -0
  234. package/lib/module/providers/anime/reanime/reanime.js.map +1 -0
  235. package/lib/module/providers/anime/zoro/create-zoro.js.map +1 -1
  236. package/lib/module/providers/anime/zoro/zoro.js.map +1 -1
  237. package/lib/module/providers/index.js.map +1 -1
  238. package/lib/module/providers/light-novels/index.js.map +1 -1
  239. package/lib/module/providers/light-novels/novelupdates.js.map +1 -1
  240. package/lib/module/providers/light-novels/readlightnovels.js.map +1 -1
  241. package/lib/module/providers/manga/asurascans.js.map +1 -1
  242. package/lib/module/providers/manga/brmangas.js.map +1 -1
  243. package/lib/module/providers/manga/comick.js.map +1 -1
  244. package/lib/module/providers/manga/flamescans.js.map +1 -1
  245. package/lib/module/providers/manga/index.js.map +1 -1
  246. package/lib/module/providers/manga/mangadex.js.map +1 -1
  247. package/lib/module/providers/manga/mangahere.js.map +1 -1
  248. package/lib/module/providers/manga/mangahost.js.map +1 -1
  249. package/lib/module/providers/manga/mangakakalot.js.map +1 -1
  250. package/lib/module/providers/manga/mangapark.js.map +1 -1
  251. package/lib/module/providers/manga/mangapill.js.map +1 -1
  252. package/lib/module/providers/manga/mangareader.js.map +1 -1
  253. package/lib/module/providers/manga/mangasee123.js.map +1 -1
  254. package/lib/module/providers/manga/readmanga.js.map +1 -1
  255. package/lib/module/providers/manga/vyvymanga.js.map +1 -1
  256. package/lib/module/providers/meta/anilist.js.map +1 -1
  257. package/lib/module/providers/meta/index.js.map +1 -1
  258. package/lib/module/providers/meta/mal.js.map +1 -1
  259. package/lib/module/providers/meta/tmdb.js.map +1 -1
  260. package/lib/module/providers/movies/dramacool.js.map +1 -1
  261. package/lib/module/providers/movies/himovies/create-himovies.js.map +1 -1
  262. package/lib/module/providers/movies/himovies/himovies.js.map +1 -1
  263. package/lib/module/providers/movies/index.js +6 -1
  264. package/lib/module/providers/movies/index.js.map +1 -1
  265. package/lib/module/providers/movies/multimovies/create-multimovies.js.map +1 -1
  266. package/lib/module/providers/movies/multimovies/multimovies.js.map +1 -1
  267. package/lib/module/providers/movies/multistream/index.js.map +1 -1
  268. package/lib/module/providers/movies/multistream/utils.js.map +1 -1
  269. package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
  270. package/lib/module/providers/movies/netflixmirror/netflixmirror.js.map +1 -1
  271. package/lib/module/providers/movies/vegamovies/create-vegamovies.js +808 -0
  272. package/lib/module/providers/movies/vegamovies/create-vegamovies.js.map +1 -0
  273. package/lib/module/providers/movies/vegamovies/vegamovies.js +47 -0
  274. package/lib/module/providers/movies/vegamovies/vegamovies.js.map +1 -0
  275. package/lib/module/providers/movies/yflix/create-yflix.js.map +1 -1
  276. package/lib/module/providers/movies/yflix/yflix.js.map +1 -1
  277. package/lib/module/providers/movies/yflix.js.map +1 -1
  278. package/lib/module/utils/ExtractorManager.js +17 -2
  279. package/lib/module/utils/ExtractorManager.js.map +1 -1
  280. package/lib/module/utils/ProviderManager.js +8 -1
  281. package/lib/module/utils/ProviderManager.js.map +1 -1
  282. package/lib/module/utils/constants.js.map +1 -1
  283. package/lib/module/utils/create-extractor-context.js +2 -0
  284. package/lib/module/utils/create-extractor-context.js.map +1 -1
  285. package/lib/module/utils/create-provider-context.js +2 -0
  286. package/lib/module/utils/create-provider-context.js.map +1 -1
  287. package/lib/module/utils/extension-utils.js +16 -3
  288. package/lib/module/utils/extension-utils.js.map +1 -1
  289. package/lib/module/utils/index.js.map +1 -1
  290. package/lib/module/utils/provider-maps.js +3 -0
  291. package/lib/module/utils/provider-maps.js.map +1 -1
  292. package/lib/module/utils/queries.js.map +1 -1
  293. package/lib/module/utils/url-polyfill.js.map +1 -1
  294. package/lib/module/utils/utils.js.map +1 -1
  295. package/lib/typescript/commonjs/src/extractors/{streamp2p.d.ts → StreamP2P.d.ts} +1 -1
  296. package/lib/typescript/commonjs/src/extractors/{streamp2p.d.ts.map → StreamP2P.d.ts.map} +1 -1
  297. package/lib/typescript/commonjs/src/extractors/flixcloud.d.ts +18 -0
  298. package/lib/typescript/commonjs/src/extractors/flixcloud.d.ts.map +1 -0
  299. package/lib/typescript/commonjs/src/extractors/gdflix.d.ts +8 -0
  300. package/lib/typescript/commonjs/src/extractors/gdflix.d.ts.map +1 -0
  301. package/lib/typescript/commonjs/src/extractors/gofile.d.ts +8 -0
  302. package/lib/typescript/commonjs/src/extractors/gofile.d.ts.map +1 -0
  303. package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts +8 -0
  304. package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts.map +1 -0
  305. package/lib/typescript/commonjs/src/extractors/index.d.ts +6 -1
  306. package/lib/typescript/commonjs/src/extractors/index.d.ts.map +1 -1
  307. package/lib/typescript/commonjs/src/extractors/kwik.d.ts +1 -0
  308. package/lib/typescript/commonjs/src/extractors/kwik.d.ts.map +1 -1
  309. package/lib/typescript/commonjs/src/extractors/megaplay.d.ts +9 -0
  310. package/lib/typescript/commonjs/src/extractors/megaplay.d.ts.map +1 -0
  311. package/lib/typescript/commonjs/src/extractors/vidhide.d.ts +1 -0
  312. package/lib/typescript/commonjs/src/extractors/vidhide.d.ts.map +1 -1
  313. package/lib/typescript/commonjs/src/index.d.ts +2 -2
  314. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  315. package/lib/typescript/commonjs/src/models/extractor-context.d.ts +3 -0
  316. package/lib/typescript/commonjs/src/models/extractor-context.d.ts.map +1 -1
  317. package/lib/typescript/commonjs/src/models/provider-context.d.ts +18 -0
  318. package/lib/typescript/commonjs/src/models/provider-context.d.ts.map +1 -1
  319. package/lib/typescript/commonjs/src/models/types.d.ts +10 -1
  320. package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
  321. package/lib/typescript/commonjs/src/providers/anime/anikoto/anikoto.d.ts +59 -49
  322. package/lib/typescript/commonjs/src/providers/anime/anikoto/anikoto.d.ts.map +1 -1
  323. package/lib/typescript/commonjs/src/providers/anime/anikoto/create-anikoto.d.ts +6 -8
  324. package/lib/typescript/commonjs/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -1
  325. package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
  326. package/lib/typescript/commonjs/src/providers/anime/anineko/anineko.d.ts +23 -0
  327. package/lib/typescript/commonjs/src/providers/anime/anineko/anineko.d.ts.map +1 -0
  328. package/lib/typescript/commonjs/src/providers/anime/anineko/create-anineko.d.ts +52 -0
  329. package/lib/typescript/commonjs/src/providers/anime/anineko/create-anineko.d.ts.map +1 -0
  330. package/lib/typescript/commonjs/src/providers/anime/index.d.ts +8 -0
  331. package/lib/typescript/commonjs/src/providers/anime/index.d.ts.map +1 -1
  332. package/lib/typescript/commonjs/src/providers/anime/reanime/create-reanime.d.ts +18 -0
  333. package/lib/typescript/commonjs/src/providers/anime/reanime/create-reanime.d.ts.map +1 -0
  334. package/lib/typescript/commonjs/src/providers/anime/reanime/reanime.d.ts +19 -0
  335. package/lib/typescript/commonjs/src/providers/anime/reanime/reanime.d.ts.map +1 -0
  336. package/lib/typescript/commonjs/src/providers/movies/index.d.ts +5 -0
  337. package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
  338. package/lib/typescript/commonjs/src/providers/movies/vegamovies/create-vegamovies.d.ts +22 -0
  339. package/lib/typescript/commonjs/src/providers/movies/vegamovies/create-vegamovies.d.ts.map +1 -0
  340. package/lib/typescript/commonjs/src/providers/movies/vegamovies/vegamovies.d.ts +25 -0
  341. package/lib/typescript/commonjs/src/providers/movies/vegamovies/vegamovies.d.ts.map +1 -0
  342. package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts.map +1 -1
  343. package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/src/utils/create-extractor-context.d.ts.map +1 -1
  345. package/lib/typescript/commonjs/src/utils/create-provider-context.d.ts.map +1 -1
  346. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts +11 -0
  347. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -1
  348. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts +1 -0
  349. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts.map +1 -1
  350. package/lib/typescript/module/src/extractors/{streamp2p.d.ts → StreamP2P.d.ts} +1 -1
  351. package/lib/typescript/module/src/extractors/{streamp2p.d.ts.map → StreamP2P.d.ts.map} +1 -1
  352. package/lib/typescript/module/src/extractors/flixcloud.d.ts +18 -0
  353. package/lib/typescript/module/src/extractors/flixcloud.d.ts.map +1 -0
  354. package/lib/typescript/module/src/extractors/gdflix.d.ts +8 -0
  355. package/lib/typescript/module/src/extractors/gdflix.d.ts.map +1 -0
  356. package/lib/typescript/module/src/extractors/gofile.d.ts +8 -0
  357. package/lib/typescript/module/src/extractors/gofile.d.ts.map +1 -0
  358. package/lib/typescript/module/src/extractors/hubcloud.d.ts +8 -0
  359. package/lib/typescript/module/src/extractors/hubcloud.d.ts.map +1 -0
  360. package/lib/typescript/module/src/extractors/index.d.ts +6 -1
  361. package/lib/typescript/module/src/extractors/index.d.ts.map +1 -1
  362. package/lib/typescript/module/src/extractors/kwik.d.ts +1 -0
  363. package/lib/typescript/module/src/extractors/kwik.d.ts.map +1 -1
  364. package/lib/typescript/module/src/extractors/megaplay.d.ts +9 -0
  365. package/lib/typescript/module/src/extractors/megaplay.d.ts.map +1 -0
  366. package/lib/typescript/module/src/extractors/vidhide.d.ts +1 -0
  367. package/lib/typescript/module/src/extractors/vidhide.d.ts.map +1 -1
  368. package/lib/typescript/module/src/index.d.ts +2 -2
  369. package/lib/typescript/module/src/index.d.ts.map +1 -1
  370. package/lib/typescript/module/src/models/extractor-context.d.ts +3 -0
  371. package/lib/typescript/module/src/models/extractor-context.d.ts.map +1 -1
  372. package/lib/typescript/module/src/models/provider-context.d.ts +18 -0
  373. package/lib/typescript/module/src/models/provider-context.d.ts.map +1 -1
  374. package/lib/typescript/module/src/models/types.d.ts +10 -1
  375. package/lib/typescript/module/src/models/types.d.ts.map +1 -1
  376. package/lib/typescript/module/src/providers/anime/anikoto/anikoto.d.ts +59 -49
  377. package/lib/typescript/module/src/providers/anime/anikoto/anikoto.d.ts.map +1 -1
  378. package/lib/typescript/module/src/providers/anime/anikoto/create-anikoto.d.ts +6 -8
  379. package/lib/typescript/module/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -1
  380. package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
  381. package/lib/typescript/module/src/providers/anime/anineko/anineko.d.ts +23 -0
  382. package/lib/typescript/module/src/providers/anime/anineko/anineko.d.ts.map +1 -0
  383. package/lib/typescript/module/src/providers/anime/anineko/create-anineko.d.ts +52 -0
  384. package/lib/typescript/module/src/providers/anime/anineko/create-anineko.d.ts.map +1 -0
  385. package/lib/typescript/module/src/providers/anime/index.d.ts +8 -0
  386. package/lib/typescript/module/src/providers/anime/index.d.ts.map +1 -1
  387. package/lib/typescript/module/src/providers/anime/reanime/create-reanime.d.ts +18 -0
  388. package/lib/typescript/module/src/providers/anime/reanime/create-reanime.d.ts.map +1 -0
  389. package/lib/typescript/module/src/providers/anime/reanime/reanime.d.ts +19 -0
  390. package/lib/typescript/module/src/providers/anime/reanime/reanime.d.ts.map +1 -0
  391. package/lib/typescript/module/src/providers/movies/index.d.ts +5 -0
  392. package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
  393. package/lib/typescript/module/src/providers/movies/vegamovies/create-vegamovies.d.ts +22 -0
  394. package/lib/typescript/module/src/providers/movies/vegamovies/create-vegamovies.d.ts.map +1 -0
  395. package/lib/typescript/module/src/providers/movies/vegamovies/vegamovies.d.ts +25 -0
  396. package/lib/typescript/module/src/providers/movies/vegamovies/vegamovies.d.ts.map +1 -0
  397. package/lib/typescript/module/src/utils/ExtractorManager.d.ts.map +1 -1
  398. package/lib/typescript/module/src/utils/ProviderManager.d.ts.map +1 -1
  399. package/lib/typescript/module/src/utils/create-extractor-context.d.ts.map +1 -1
  400. package/lib/typescript/module/src/utils/create-provider-context.d.ts.map +1 -1
  401. package/lib/typescript/module/src/utils/extension-utils.d.ts +11 -0
  402. package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -1
  403. package/lib/typescript/module/src/utils/provider-maps.d.ts +1 -0
  404. package/lib/typescript/module/src/utils/provider-maps.d.ts.map +1 -1
  405. package/package.json +217 -217
  406. package/react-native.config.js +12 -12
  407. package/src/extension-registry.json +98 -3
  408. package/src/extractors/flixcloud.ts +139 -0
  409. package/src/extractors/gdflix.ts +167 -0
  410. package/src/extractors/gofile.ts +182 -0
  411. package/src/extractors/hubcloud.ts +357 -0
  412. package/src/extractors/index.ts +10 -0
  413. package/src/extractors/kwik.ts +74 -93
  414. package/src/extractors/megaplay.ts +254 -0
  415. package/src/extractors/vidhide.ts +12 -4
  416. package/src/index.tsx +8 -0
  417. package/src/models/extractor-context.ts +3 -0
  418. package/src/models/provider-context.ts +18 -0
  419. package/src/models/types.ts +9 -0
  420. package/src/providers/anime/anikoto/anikoto.ts +84 -67
  421. package/src/providers/anime/anikoto/create-anikoto.ts +413 -419
  422. package/src/providers/anime/animepahe/create-animepahe.ts +118 -158
  423. package/src/providers/anime/anineko/anineko.ts +44 -0
  424. package/src/providers/anime/anineko/create-anineko.ts +489 -0
  425. package/src/providers/anime/index.ts +8 -0
  426. package/src/providers/anime/reanime/create-reanime.ts +283 -0
  427. package/src/providers/anime/reanime/reanime.ts +41 -0
  428. package/src/providers/movies/index.ts +6 -0
  429. package/src/providers/movies/vegamovies/create-vegamovies.ts +921 -0
  430. package/src/providers/movies/vegamovies/vegamovies.ts +63 -0
  431. package/src/utils/ExtractorManager.ts +14 -1
  432. package/src/utils/ProviderManager.ts +7 -0
  433. package/src/utils/create-extractor-context.ts +2 -0
  434. package/src/utils/create-provider-context.ts +2 -0
  435. package/src/utils/extension-utils.ts +18 -0
  436. package/src/utils/provider-maps.ts +3 -0
  437. package/lib/commonjs/extractors/streamp2p.js.map +0 -1
  438. package/lib/module/extractors/streamp2p.js.map +0 -1
  439. /package/src/extractors/{streamp2p.ts → StreamP2P.ts} +0 -0
@@ -14,18 +14,15 @@ function createAniKoto(ctx, customBaseURL) {
14
14
  PolyURL
15
15
  } = ctx;
16
16
  const {
17
- StreamSB,
18
- MegaCloud,
19
- StreamTape
17
+ MegaPlay
20
18
  } = extractors;
21
19
  const {
22
20
  StreamingServers: StreamingServersEnum,
23
21
  SubOrDub: SubOrDubEnum,
24
- MediaStatus: MediaStatusEnum,
25
- WatchListType: WatchListTypeEnum
22
+ MediaStatus: MediaStatusEnum
26
23
  } = enums;
27
24
 
28
- // Provider configuration - use the standardized base URL creation
25
+ // Provider configuration
29
26
  const baseUrl = createCustomBaseUrl('https://anikototv.to', customBaseURL);
30
27
  const config = {
31
28
  name: 'AniKoto',
@@ -37,513 +34,474 @@ function createAniKoto(ctx, customBaseURL) {
37
34
  isWorking: true,
38
35
  isDubAvailableSeparately: true
39
36
  };
40
-
41
- // Helper functions
37
+ const defaultHeaders = {
38
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
39
+ };
40
+ const ajaxHeaders = referer => ({
41
+ ...defaultHeaders,
42
+ 'X-Requested-With': 'XMLHttpRequest',
43
+ 'Referer': referer || config.baseUrl
44
+ });
42
45
  const normalizePageNumber = page => {
43
46
  return page <= 0 ? 1 : page;
44
47
  };
45
48
 
49
+ // Helper to scrape card lists across search, types, genres, statuses
50
+ const scrapeCardPage = async (url, page = 1) => {
51
+ try {
52
+ const {
53
+ data
54
+ } = await axios.get(url, {
55
+ headers: defaultHeaders
56
+ });
57
+ const $ = load(data);
58
+ const results = [];
59
+ $('.item').each((_, el) => {
60
+ const item = $(el);
61
+ const nameEl = item.find('.name.d-title, .name').first();
62
+ const title = nameEl.text().trim();
63
+ const japaneseTitle = nameEl.attr('data-jp') || undefined;
64
+ const href = item.find('a.name, .poster a').first().attr('href') || '';
65
+ const match = href.match(/\/watch\/([^/?#]+)/);
66
+ const id = match ? match[1] : href.replace(/^.*\/watch\//, '').replace(/\/.*$/, '');
67
+ const image = item.find('.poster img, img').attr('src') || '';
68
+ const subText = item.find('.ep-status.sub').first().text().trim();
69
+ const sub = parseInt(subText, 10) || 0;
70
+ const dubText = item.find('.ep-status.dub').first().text().trim();
71
+ const dub = parseInt(dubText, 10) || 0;
72
+ const type = item.find('.meta .right').first().text().trim() || 'TV';
73
+ const ratingStr = item.find('.m-item.rated span').first().text().trim();
74
+ const rating = ratingStr ? parseFloat(ratingStr) : undefined;
75
+ if (id && title) {
76
+ results.push({
77
+ id,
78
+ title,
79
+ japaneseTitle,
80
+ image,
81
+ url: href.startsWith('http') ? href : `${config.baseUrl}${href.startsWith('/') ? '' : '/'}${href}`,
82
+ type,
83
+ sub,
84
+ dub,
85
+ rating
86
+ });
87
+ }
88
+ });
89
+ const hasNextPage = $('.pagination .page-item .page-link[rel="next"]').length > 0 || $('.pagination .page-item.active').next('.page-item').find('.page-link').length > 0;
90
+ const lastPageHref = $('.pagination .page-item a[title="Last"]').attr('href') || '';
91
+ const lastPageMatch = lastPageHref.match(/page=(\d+)/);
92
+ const totalPages = lastPageMatch ? parseInt(lastPageMatch[1], 10) : undefined;
93
+ return {
94
+ currentPage: page,
95
+ hasNextPage,
96
+ totalPages,
97
+ results
98
+ };
99
+ } catch (err) {
100
+ throw new Error(`[AniKoto] Failed to scrape card page: ${err.message}`);
101
+ }
102
+ };
103
+
46
104
  // Main provider functions
47
105
  const search = async (query, page = 1) => {
48
106
  const normalizedPage = normalizePageNumber(page);
49
- return scrapeCardPage(`${config.baseUrl}/filter?keyword=${decodeURIComponent(query)}&page=${normalizedPage}`);
107
+ return scrapeCardPage(`${config.baseUrl}/search?keyword=${encodeURIComponent(query)}&page=${normalizedPage}`, normalizedPage);
50
108
  };
51
- const fetchAdvancedSearch = async (page = 1, type, status, rated, score, season, language, startDate, endDate, sort, genres) => {
109
+ const fetchAdvancedSearch = async (page = 1, type, status, rated, score, season, language, _startDate, _endDate, sort, genres) => {
52
110
  const normalizedPage = normalizePageNumber(page);
53
- const mappings = {
54
- type: {
55
- movie: 1,
56
- tv: 2,
57
- ova: 3,
58
- ona: 4,
59
- special: 5,
60
- music: 6
61
- },
62
- status: {
63
- finished_airing: 1,
64
- currently_airing: 2,
65
- not_yet_aired: 3
66
- },
67
- rated: {
68
- g: 1,
69
- pg: 2,
70
- pg_13: 3,
71
- r: 4,
72
- r_plus: 5,
73
- rx: 6
74
- },
75
- season: {
76
- spring: 1,
77
- summer: 2,
78
- fall: 3,
79
- winter: 4
80
- },
81
- language: {
82
- sub: 1,
83
- dub: 2,
84
- sub_dub: 3
85
- },
86
- genre: {
87
- action: 1,
88
- adventure: 2,
89
- cars: 3,
90
- comedy: 4,
91
- dementia: 5,
92
- demons: 6,
93
- mystery: 7,
94
- drama: 8,
95
- ecchi: 9,
96
- fantasy: 10,
97
- game: 11,
98
- historical: 12,
99
- horror: 13,
100
- kids: 14,
101
- magic: 15,
102
- martial_arts: 16,
103
- mecha: 17,
104
- music: 18,
105
- parody: 19,
106
- samurai: 20,
107
- romance: 21,
108
- school: 22,
109
- sci_fi: 23,
110
- shoujo: 24,
111
- shoujo_ai: 25,
112
- shounen: 26,
113
- shounen_ai: 27,
114
- space: 28,
115
- sports: 29,
116
- super_power: 30,
117
- vampire: 31,
118
- harem: 32,
119
- slice_of_life: 33,
120
- supernatural: 34,
121
- military: 35,
122
- police: 36,
123
- psychological: 37,
124
- thriller: 38,
125
- seinen: 39,
126
- josei: 40,
127
- isekai: 41
128
- }
129
- };
130
111
  const params = new URLSearchParams();
131
- params.append('page', normalizedPage.toString());
132
- if (type && mappings.type[type]) {
133
- params.append('type', mappings.type[type].toString());
134
- }
135
- if (status && mappings.status[status]) {
136
- params.append('status', mappings.status[status].toString());
137
- }
138
- if (rated && mappings.rated[rated]) {
139
- params.append('rated', mappings.rated[rated].toString());
140
- }
141
- if (score) params.append('score', score.toString());
142
- if (season && mappings.season[season]) {
143
- params.append('season', mappings.season[season].toString());
144
- }
145
- if (language && mappings.language[language]) {
146
- params.append('language', mappings.language[language].toString());
147
- }
148
- if (sort) params.append('sort', sort);
149
- if (startDate) {
150
- params.append('start_date', `${startDate.year}-${startDate.month.toString().padStart(2, '0')}-${startDate.day.toString().padStart(2, '0')}`);
151
- }
152
- if (endDate) {
153
- params.append('end_date', `${endDate.year}-${endDate.month.toString().padStart(2, '0')}-${endDate.day.toString().padStart(2, '0')}`);
154
- }
112
+ params.set('page', String(normalizedPage));
113
+ if (type) params.set('type', type);
114
+ if (status) params.set('status', status);
115
+ if (rated) params.set('rated', rated);
116
+ if (score) params.set('score', String(score));
117
+ if (season) params.set('season', season);
118
+ if (language) params.set('language', language);
119
+ if (sort) params.set('sort', sort);
155
120
  if (genres && genres.length > 0) {
156
- const genreIds = genres.map(g => mappings.genre[g]).filter(Boolean);
157
- if (genreIds.length > 0) {
158
- params.append('genres', genreIds.join(','));
121
+ for (const g of genres) {
122
+ params.append('genres[]', g);
159
123
  }
160
124
  }
161
- return scrapeCardPage(`${config.baseUrl}/filter?${params.toString()}`);
125
+ return scrapeCardPage(`${config.baseUrl}/filter?${params.toString()}`, normalizedPage);
162
126
  };
163
127
  const fetchTopAiring = async (page = 1) => {
164
128
  const normalizedPage = normalizePageNumber(page);
165
- return scrapeCardPage(`${config.baseUrl}/top-airing?page=${normalizedPage}`);
129
+ return scrapeCardPage(`${config.baseUrl}/status/currently-airing?page=${normalizedPage}`, normalizedPage);
166
130
  };
167
131
  const fetchMostPopular = async (page = 1) => {
168
132
  const normalizedPage = normalizePageNumber(page);
169
- return scrapeCardPage(`${config.baseUrl}/most-popular?page=${normalizedPage}`);
133
+ return scrapeCardPage(`${config.baseUrl}/most-viewed?page=${normalizedPage}`, normalizedPage);
170
134
  };
171
135
  const fetchMostFavorite = async (page = 1) => {
172
136
  const normalizedPage = normalizePageNumber(page);
173
- return scrapeCardPage(`${config.baseUrl}/most-favorite?page=${normalizedPage}`);
137
+ return scrapeCardPage(`${config.baseUrl}/filter?sort=most_favorite&page=${normalizedPage}`, normalizedPage);
174
138
  };
175
139
  const fetchLatestCompleted = async (page = 1) => {
176
140
  const normalizedPage = normalizePageNumber(page);
177
- return scrapeCardPage(`${config.baseUrl}/completed?page=${normalizedPage}`);
141
+ return scrapeCardPage(`${config.baseUrl}/status/finished-airing?page=${normalizedPage}`, normalizedPage);
178
142
  };
179
143
  const fetchRecentlyUpdated = async (page = 1) => {
180
144
  const normalizedPage = normalizePageNumber(page);
181
- return scrapeCardPage(`${config.baseUrl}/recently-updated?page=${normalizedPage}`);
145
+ return scrapeCardPage(`${config.baseUrl}/latest-updated?page=${normalizedPage}`, normalizedPage);
182
146
  };
183
147
  const fetchRecentlyAdded = async (page = 1) => {
184
148
  const normalizedPage = normalizePageNumber(page);
185
- return scrapeCardPage(`${config.baseUrl}/recently-added?page=${normalizedPage}`);
149
+ return scrapeCardPage(`${config.baseUrl}/new-release?page=${normalizedPage}`, normalizedPage);
186
150
  };
187
151
  const fetchTopUpcoming = async (page = 1) => {
188
152
  const normalizedPage = normalizePageNumber(page);
189
- return scrapeCardPage(`${config.baseUrl}/top-upcoming?page=${normalizedPage}`);
153
+ return scrapeCardPage(`${config.baseUrl}/status/not-yet-aired?page=${normalizedPage}`, normalizedPage);
190
154
  };
191
- const fetchStudio = async (studio, page = 1) => {
155
+ const fetchStudio = async (studioId, page = 1) => {
192
156
  const normalizedPage = normalizePageNumber(page);
193
- return scrapeCardPage(`${config.baseUrl}/producer/${studio}?page=${normalizedPage}`);
157
+ return scrapeCardPage(`${config.baseUrl}/studio/${studioId}?page=${normalizedPage}`, normalizedPage);
194
158
  };
195
159
  const fetchSubbedAnime = async (page = 1) => {
196
160
  const normalizedPage = normalizePageNumber(page);
197
- return scrapeCardPage(`${config.baseUrl}/subbed-anime?page=${normalizedPage}`);
161
+ return scrapeCardPage(`${config.baseUrl}/filter?language=1&page=${normalizedPage}`, normalizedPage);
198
162
  };
199
163
  const fetchDubbedAnime = async (page = 1) => {
200
164
  const normalizedPage = normalizePageNumber(page);
201
- return scrapeCardPage(`${config.baseUrl}/dubbed-anime?page=${normalizedPage}`);
165
+ return scrapeCardPage(`${config.baseUrl}/filter?language=2&page=${normalizedPage}`, normalizedPage);
202
166
  };
203
167
  const fetchMovie = async (page = 1) => {
204
168
  const normalizedPage = normalizePageNumber(page);
205
- return scrapeCardPage(`${config.baseUrl}/movie?page=${normalizedPage}`);
169
+ return scrapeCardPage(`${config.baseUrl}/type/movie?page=${normalizedPage}`, normalizedPage);
206
170
  };
207
171
  const fetchTV = async (page = 1) => {
208
172
  const normalizedPage = normalizePageNumber(page);
209
- return scrapeCardPage(`${config.baseUrl}/tv?page=${normalizedPage}`);
173
+ return scrapeCardPage(`${config.baseUrl}/type/tv?page=${normalizedPage}`, normalizedPage);
210
174
  };
211
175
  const fetchOVA = async (page = 1) => {
212
176
  const normalizedPage = normalizePageNumber(page);
213
- return scrapeCardPage(`${config.baseUrl}/ova?page=${normalizedPage}`);
177
+ return scrapeCardPage(`${config.baseUrl}/type/ova?page=${normalizedPage}`, normalizedPage);
214
178
  };
215
179
  const fetchONA = async (page = 1) => {
216
180
  const normalizedPage = normalizePageNumber(page);
217
- return scrapeCardPage(`${config.baseUrl}/ona?page=${normalizedPage}`);
181
+ return scrapeCardPage(`${config.baseUrl}/type/ona?page=${normalizedPage}`, normalizedPage);
218
182
  };
219
183
  const fetchSpecial = async (page = 1) => {
220
184
  const normalizedPage = normalizePageNumber(page);
221
- return scrapeCardPage(`${config.baseUrl}/special?page=${normalizedPage}`);
185
+ return scrapeCardPage(`${config.baseUrl}/type/special?page=${normalizedPage}`, normalizedPage);
222
186
  };
223
- const fetchGenres = async (page = 1) => {
224
- const normalizedPage = normalizePageNumber(page);
225
- return scrapeCardPage(`${config.baseUrl}/genre?page=${normalizedPage}`);
187
+ const fetchGenres = async () => {
188
+ try {
189
+ const {
190
+ data
191
+ } = await axios.get(`${config.baseUrl}/home`, {
192
+ headers: defaultHeaders
193
+ });
194
+ const $ = load(data);
195
+ const genres = [];
196
+ $('a[href*="/genre/"]').each((_, el) => {
197
+ const g = $(el).text().trim();
198
+ if (g && !genres.includes(g)) {
199
+ genres.push(g);
200
+ }
201
+ });
202
+ return genres.length > 0 ? genres : ['Action', 'Adventure', 'Comedy', 'Drama', 'Fantasy', 'Horror', 'Mystery', 'Romance', 'Sci-Fi', 'Slice of Life', 'Supernatural'];
203
+ } catch {
204
+ return ['Action', 'Adventure', 'Comedy', 'Drama', 'Fantasy', 'Horror', 'Mystery', 'Romance', 'Sci-Fi', 'Slice of Life', 'Supernatural'];
205
+ }
226
206
  };
227
207
  const genreSearch = async (genre, page = 1) => {
228
208
  const normalizedPage = normalizePageNumber(page);
229
- return scrapeCardPage(`${config.baseUrl}/genre/${genre}?page=${normalizedPage}`);
209
+ const cleanGenre = genre.toLowerCase().replace(/\s+/g, '-');
210
+ return scrapeCardPage(`${config.baseUrl}/genre/${cleanGenre}?page=${normalizedPage}`, normalizedPage);
230
211
  };
231
212
  const fetchSchedule = async date => {
232
213
  try {
233
- const response = await fetch(`${config.baseUrl}/ajax/schedule/list?tzOffset=-330&date=${date}`);
234
- const data = await response.json();
235
- const $ = load(data.html);
236
- return await scrapeCard($);
237
- } catch (error) {
238
- throw new Error(`Failed to fetch schedule: ${error}`);
214
+ const res = await axios.get(`${config.baseUrl}/ajax/schedule/date?date=${date}&tzOffset=-330`, {
215
+ headers: ajaxHeaders()
216
+ });
217
+ const html = res.data?.result || res.data;
218
+ const $ = load(html);
219
+ const results = [];
220
+ $('a.item').each((_, el) => {
221
+ const item = $(el);
222
+ const href = item.attr('href') || '';
223
+ const match = href.match(/\/watch\/([^/?#]+)/);
224
+ const id = match ? match[1] : href;
225
+ const title = item.find('.title.d-title, .title').text().trim();
226
+ const time = item.find('.time').text().trim();
227
+ const episodeText = item.find('.ep span').text().trim();
228
+ if (id && title) {
229
+ results.push({
230
+ id,
231
+ title,
232
+ url: href,
233
+ time,
234
+ episodeText
235
+ });
236
+ }
237
+ });
238
+ return results;
239
+ } catch (err) {
240
+ throw new Error(`[AniKoto] Failed to fetch schedule: ${err.message}`);
239
241
  }
240
242
  };
241
243
  const fetchSpotlight = async () => {
242
244
  try {
243
- const response = await fetch(config.baseUrl);
244
- const data = await response.text();
245
+ const {
246
+ data
247
+ } = await axios.get(`${config.baseUrl}/home`, {
248
+ headers: defaultHeaders
249
+ });
245
250
  const $ = load(data);
246
251
  const results = [];
247
- $('.deslide-item').each((_, element) => {
248
- const id = $(element).find('a').attr('href')?.split('/')[1] || '';
249
- const title = $(element).find('.desi-head-title').text().trim();
250
- const poster = $(element).find('.desi-buttons-wrap .btn-secondary').attr('href')?.match(/url=([^&]+)/)?.[1] || '';
251
- const description = $(element).find('.desi-description').text().trim();
252
- if (id) {
252
+ $('.swiper-slide.item').each((_, el) => {
253
+ const slide = $(el);
254
+ const title = slide.find('.title.d-title, .title').text().trim();
255
+ const japaneseTitle = slide.find('.title.d-title').attr('data-jp') || undefined;
256
+ const href = slide.find('a[href*="/watch/"]').first().attr('href') || '';
257
+ const match = href.match(/\/watch\/([^/?#]+)/);
258
+ const id = match ? match[1] : '';
259
+ const description = slide.find('.synopsis').text().trim() || undefined;
260
+ const image = slide.find('img').attr('src') || '';
261
+ if (id && title) {
253
262
  results.push({
254
263
  id,
255
264
  title,
256
- url: `${config.baseUrl}/${id}`,
257
- image: decodeURIComponent(poster),
258
- description
265
+ japaneseTitle,
266
+ description,
267
+ image,
268
+ url: href.startsWith('http') ? href : `${config.baseUrl}${href}`
259
269
  });
260
270
  }
261
271
  });
262
272
  return results;
263
- } catch (error) {
264
- throw new Error(`Failed to fetch spotlight: ${error}`);
273
+ } catch (err) {
274
+ throw new Error(`[AniKoto] Failed to fetch spotlight: ${err.message}`);
265
275
  }
266
276
  };
267
277
  const fetchSearchSuggestions = async query => {
268
278
  try {
269
- const response = await fetch(`${config.baseUrl}/ajax/search/suggest?keyword=${encodeURIComponent(query)}`);
270
- const data = await response.json();
271
- const $ = load(data.html);
272
- return await scrapeCard($);
273
- } catch (error) {
274
- throw new Error(`Failed to fetch search suggestions: ${error}`);
275
- }
276
- };
277
- const fetchContinueWatching = async () => {
278
- try {
279
- const response = await fetch(`${config.baseUrl}/ajax/home/widget/continue-watching`);
280
- const data = await response.json();
281
- const $ = load(data.html);
282
- return await scrapeCard($);
283
- } catch (error) {
284
- throw new Error(`Failed to fetch continue watching: ${error}`);
285
- }
286
- };
287
- const fetchWatchList = async watchListType => {
288
- try {
289
- const response = await fetch(`${config.baseUrl}/ajax/user/watchlist/${watchListType}`);
290
- const data = await response.json();
291
- const $ = load(data.html);
292
- return await scrapeCard($);
293
- } catch (error) {
294
- throw new Error(`Failed to fetch watch list: ${error}`);
279
+ const res = await axios.get(`${config.baseUrl}/ajax/anime/search?keyword=${encodeURIComponent(query)}`, {
280
+ headers: ajaxHeaders()
281
+ });
282
+ const html = res.data?.result?.html || res.data?.result || res.data;
283
+ const $ = load(html);
284
+ const suggestions = [];
285
+ $('a.item').each((_, el) => {
286
+ const item = $(el);
287
+ const href = item.attr('href') || '';
288
+ const match = href.match(/\/watch\/([^/?#]+)/);
289
+ const id = match ? match[1] : '';
290
+ const title = item.find('.name.d-title, .name').text().trim();
291
+ const japaneseTitle = item.find('.name.d-title').attr('data-jp') || undefined;
292
+ const image = item.find('.poster img, img').attr('src') || '';
293
+ if (id && title) {
294
+ suggestions.push({
295
+ id,
296
+ title,
297
+ japaneseTitle,
298
+ image,
299
+ url: href
300
+ });
301
+ }
302
+ });
303
+ return suggestions;
304
+ } catch {
305
+ return [];
295
306
  }
296
307
  };
297
308
  const fetchAnimeInfo = async id => {
298
309
  try {
299
- const animeUrl = `${config.baseUrl}/watch/${id}`;
300
- const response = await fetch(animeUrl);
301
- const data = await response.text();
302
- const $ = load(data);
303
- const info = {
304
- id: id,
305
- title: $('.binfo .info h1.title').text().trim(),
306
- url: animeUrl,
307
- genres: [],
308
- totalEpisodes: 0
309
- };
310
- info.japaneseTitle = $('.binfo .info h1.title').attr('data-jp');
311
- info.image = $('.binfo .poster img').attr('src');
312
- info.description = $('.binfo .info .synopsis .content').text().trim();
310
+ const animeSlug = id.replace(/^\/watch\//, '').replace(/\/.*$/, '');
311
+ const watchUrl = `${config.baseUrl}/watch/${animeSlug}`;
312
+ const {
313
+ data: pageHtml
314
+ } = await axios.get(watchUrl, {
315
+ headers: defaultHeaders
316
+ });
317
+ const $ = load(pageHtml);
318
+ const title = $('#w-info .title.d-title, h1.title').first().text().trim();
319
+ const japaneseTitle = $('#w-info .title.d-title').attr('data-jp') || $('#w-info .names').text().split(';')[1]?.trim() || title;
320
+ const image = $('#w-info .poster img').attr('src') || $('meta[property="og:image"]').attr('content') || '';
321
+ const description = $('#w-info .synopsis .content, .synopsis').text().replace(/\[more\]/g, '').trim();
313
322
 
314
- // Extract other info from the info list
315
- $('.binfo .bmeta .meta > div').each((_, item) => {
316
- const text = $(item).text().trim().toLowerCase();
317
- let value = $(item).find('span').text().trim();
318
- // Fallback for simple "Label: Value"
319
- if (!value) {
320
- value = $(item).text().split(':')[1]?.trim() || '';
321
- }
322
- if (text.startsWith('studios:')) {
323
- info.studios = $(item).find('a').map((_, el) => $(el).text().trim()).get();
324
- } else if (text.startsWith('duration:')) {
325
- info.duration = value;
326
- } else if (text.startsWith('status:')) {
327
- switch (value) {
328
- case 'Finished Airing':
329
- info.status = MediaStatusEnum.COMPLETED;
330
- break;
331
- case 'Currently Airing':
332
- info.status = MediaStatusEnum.ONGOING;
333
- break;
334
- case 'Not yet aired':
335
- info.status = MediaStatusEnum.NOT_YET_AIRED;
336
- break;
337
- default:
338
- info.status = MediaStatusEnum.UNKNOWN;
339
- break;
340
- }
341
- } else if (text.startsWith('type:')) {
342
- info.type = value;
343
- } else if (text.startsWith('mal:')) {
344
- info.rating = parseFloat(value);
345
- } else if (text.startsWith('premiered:')) {
346
- info.releaseDate = value;
347
- } else if (text.startsWith('genres:')) {
348
- info.genres = $(item).find('a').map((_, el) => $(el).text().trim()).get();
323
+ // Extract anime ID (data-id e.g. 7174)
324
+ const dataId = $('#watch-main').attr('data-id') || $('.layout-page-watchtv').attr('data-id') || $('#w-rating').attr('data-id') || $('[data-id]').first().attr('data-id');
325
+
326
+ // Extract metadata
327
+ let type = 'TV';
328
+ let premiered;
329
+ let aired;
330
+ let status = MediaStatusEnum.UNKNOWN;
331
+ const genres = [];
332
+ const studios = [];
333
+ const producers = [];
334
+ let duration;
335
+ let rating;
336
+ $('#w-info .bmeta .meta div').each((_, el) => {
337
+ const text = $(el).text();
338
+ if (text.includes('Type:')) {
339
+ type = $(el).find('span').text().trim();
340
+ } else if (text.includes('Premiered:')) {
341
+ premiered = $(el).find('span').text().trim();
342
+ } else if (text.includes('Aired:')) {
343
+ aired = $(el).find('span').text().trim();
344
+ } else if (text.includes('Status:')) {
345
+ const s = $(el).find('span').text().trim().toLowerCase();
346
+ if (s.includes('finished')) status = MediaStatusEnum.COMPLETED;else if (s.includes('airing') || s.includes('ongoing')) status = MediaStatusEnum.ONGOING;else if (s.includes('not yet')) status = MediaStatusEnum.NOT_YET_AIRED;
347
+ } else if (text.includes('Genres:')) {
348
+ $(el).find('a').each((_, a) => {
349
+ const g = $(a).text().trim();
350
+ if (g && !genres.includes(g)) genres.push(g);
351
+ });
352
+ } else if (text.includes('Studios:')) {
353
+ $(el).find('a').each((_, a) => {
354
+ const st = $(a).text().trim();
355
+ if (st && !studios.includes(st)) studios.push(st);
356
+ });
357
+ } else if (text.includes('Producers:')) {
358
+ $(el).find('a').each((_, a) => {
359
+ const pr = $(a).text().trim();
360
+ if (pr && pr !== 'unknown' && !producers.includes(pr)) producers.push(pr);
361
+ });
362
+ } else if (text.includes('Duration:')) {
363
+ duration = $(el).find('span').text().trim();
364
+ } else if (text.includes('MAL:')) {
365
+ const r = $(el).find('span').text().trim();
366
+ rating = r ? parseFloat(r) : undefined;
349
367
  }
350
368
  });
351
369
 
352
- // Check for sub/dub availability
353
- const hasSub = $('.binfo .meta.icons .sub').length > 0;
354
- const hasDub = $('.binfo .meta.icons .dub').length > 0;
355
- if (hasSub) {
356
- info.subOrDub = SubOrDubEnum.SUB;
357
- info.hasSub = hasSub;
358
- }
359
- if (hasDub) {
360
- info.subOrDub = SubOrDubEnum.DUB;
361
- info.hasDub = hasDub;
370
+ // Fetch episodes from /ajax/episode/list/${dataId}
371
+ const episodes = [];
372
+ if (dataId) {
373
+ try {
374
+ const epRes = await axios.get(`${config.baseUrl}/ajax/episode/list/${dataId}`, {
375
+ headers: ajaxHeaders(watchUrl)
376
+ });
377
+ const epHtml = epRes.data?.result || epRes.data;
378
+ const $ep = load(epHtml);
379
+ $ep('li a').each((_, a) => {
380
+ const anchor = $ep(a);
381
+ const dataIds = anchor.attr('data-ids') || anchor.attr('data-id') || '';
382
+ const numAttr = anchor.attr('data-num') || anchor.attr('data-slug') || anchor.find('b').text().trim();
383
+ const num = parseInt(numAttr, 10) || 1;
384
+ const epTitle = anchor.find('.d-title').text().trim() || `Episode ${num}`;
385
+ if (dataIds) {
386
+ episodes.push({
387
+ id: `${animeSlug}$episode$${dataIds}`,
388
+ number: num,
389
+ title: epTitle,
390
+ url: `${config.baseUrl}/watch/${animeSlug}/ep-${num}`
391
+ });
392
+ }
393
+ });
394
+ } catch {
395
+ // Keep empty episodes if request fails
396
+ }
362
397
  }
363
- if (hasSub && hasDub) {
364
- info.subOrDub = SubOrDubEnum.BOTH;
398
+ return {
399
+ id: animeSlug,
400
+ title,
401
+ japaneseTitle,
402
+ image,
403
+ description,
404
+ type,
405
+ status,
406
+ genres,
407
+ studios,
408
+ producers,
409
+ duration,
410
+ rating,
411
+ aired,
412
+ season: premiered,
413
+ totalEpisodes: episodes.length > 0 ? episodes.length : undefined,
414
+ episodes
415
+ };
416
+ } catch (err) {
417
+ throw new Error(`[AniKoto] Failed to fetch anime info: ${err.message}`);
418
+ }
419
+ };
420
+ const fetchEpisodeServers = async (episodeId, subOrDub = SubOrDubEnum.SUB) => {
421
+ try {
422
+ const dataIds = episodeId.includes('$episode$') ? episodeId.split('$episode$')[1] : episodeId;
423
+ const targetSubDub = subOrDub === SubOrDubEnum.DUB ? 'dub' : 'sub';
424
+ const res = await axios.get(`${config.baseUrl}/ajax/server/list?servers=${encodeURIComponent(dataIds)}`, {
425
+ headers: ajaxHeaders()
426
+ });
427
+ const html = res.data?.result || res.data;
428
+ const $ = load(html);
429
+ const rawServers = [];
430
+ let serverList = $(`.servers .type[data-type="${targetSubDub}"] li[data-link-id]`);
431
+ if (!serverList.length) {
432
+ // Fallback to any available type
433
+ serverList = $('.servers li[data-link-id]');
365
434
  }
366
-
367
- //stop execution for 2 seconds
368
- setTimeout(() => {}, 2000);
369
- const episodeElements = $('#w-episodes');
370
- console.log(episodeElements.html());
371
- // Sub/dub count can be stored on other elements as well for ep count, update if possible if it matches the DOM
372
- const subCount = parseInt($('.binfo .meta.icons .sub').text().trim() || '0') || 0;
373
- const dubCount = parseInt($('.binfo .meta.icons .dub').text().trim() || '0') || 0;
374
- info.totalEpisodes = episodeElements.length;
375
- info.episodes = [];
376
- episodeElements.each((i, el) => {
377
- const $el = $(el);
378
- const $li = $el.parent();
379
- const href = $el.attr('href') || '';
380
- const number = parseInt($el.attr('data-num') || '0');
381
- info.episodes?.push({
382
- id: "href.split('/watch/')[1]!",
383
- number: number,
384
- title: $li.attr('title'),
385
- isFiller: $el.hasClass('filler'),
386
- isSubbed: number <= subCount,
387
- isDubbed: number <= dubCount,
388
- url: config.baseUrl + href
389
- });
435
+ serverList.each((_, el) => {
436
+ const item = $(el);
437
+ const name = item.text().trim();
438
+ const linkId = item.attr('data-link-id');
439
+ if (linkId) {
440
+ rawServers.push({
441
+ name,
442
+ linkId
443
+ });
444
+ }
390
445
  });
391
- return info;
446
+
447
+ // Resolve each server link to its embed URL via /ajax/server?get=
448
+ const servers = [];
449
+ for (const s of rawServers) {
450
+ try {
451
+ const {
452
+ data: linkData
453
+ } = await axios.get(`${config.baseUrl}/ajax/server?get=${encodeURIComponent(s.linkId)}`, {
454
+ headers: ajaxHeaders()
455
+ });
456
+ const embedUrl = linkData?.result?.url;
457
+ if (embedUrl) {
458
+ servers.push({
459
+ name: `megaplay-${s.name.toLowerCase().replace(/[^a-z0-9_-]/g, '')}`,
460
+ url: embedUrl
461
+ });
462
+ }
463
+ } catch {
464
+ // Continue to next server
465
+ }
466
+ }
467
+ return servers;
392
468
  } catch (err) {
393
- throw new Error(err.message);
469
+ throw new Error(`[AniKoto] Failed to fetch episode servers: ${err.message}`);
394
470
  }
395
471
  };
396
- const fetchEpisodeSources = async (episodeId, server = StreamingServersEnum.MegaCloud, subOrDub = SubOrDubEnum.SUB) => {
472
+ const fetchEpisodeSources = async (episodeId, server = StreamingServersEnum.MegaPlay, subOrDub = SubOrDubEnum.SUB) => {
397
473
  if (episodeId.startsWith('http')) {
398
474
  const serverUrl = new PolyURL(episodeId);
399
475
  switch (server) {
400
- case StreamingServersEnum.MegaCloud:
401
- return {
402
- headers: {
403
- Referer: serverUrl.href
404
- },
405
- ...(await MegaCloud().extract(serverUrl, config.baseUrl))
406
- };
476
+ case StreamingServersEnum.MegaPlay:
407
477
  default:
408
478
  return {
409
479
  headers: {
410
480
  Referer: serverUrl.href
411
481
  },
412
- ...(await MegaCloud().extract(serverUrl, config.baseUrl))
482
+ ...(await MegaPlay().extract(serverUrl, config.baseUrl))
413
483
  };
414
484
  }
415
485
  }
416
- if (!episodeId.includes('$episode$')) throw new Error('Invalid episode id');
417
- episodeId = `${config.baseUrl}/watch/${episodeId.replace('$episode$', '?ep=').replace(/\$auto|\$sub|\$dub/gi, '')}`;
418
- try {
419
- const servers = await fetchEpisodeServers(episodeId.split('?ep=')[1], subOrDub);
420
- const i = servers.findIndex(s => s.name.toLowerCase().includes(server));
421
- if (i === -1) {
422
- throw new Error(`Server ${server} not found`);
423
- }
424
- const serverUrl = new URL(servers[i].url);
425
- return await fetchEpisodeSources(serverUrl.href, server, SubOrDubEnum.SUB);
426
- } catch (err) {
427
- throw err;
428
- }
429
- };
430
- const fetchEpisodeServers = async (episodeId, subOrDub) => {
431
486
  try {
432
- if (episodeId.includes('$episode$')) episodeId = episodeId.split('$episode$')[1];
433
- const response = await fetch(`${config.baseUrl}/ajax/v2/episode/servers?episodeId=${episodeId}`);
434
- const data = await response.json();
435
- const $ = load(data.html);
436
- const scrapedServers = [];
437
- let selector;
438
- try {
439
- selector = `.ps_-block.ps_-block-sub.servers-${false ? 'raw' : subOrDub} > .ps__-list .server-item`;
440
- } catch {
441
- selector = `.ps_-block.ps_-block-sub.servers-${true ? 'raw' : subOrDub} > .ps__-list .server-item`;
487
+ const servers = await fetchEpisodeServers(episodeId, subOrDub);
488
+ if (!servers.length) {
489
+ throw new Error(`[AniKoto] No servers available for episode: ${episodeId}`);
442
490
  }
443
- $(selector).each((_, element) => {
444
- const name = $(element).text().trim();
445
- const sourcesId = $(element).attr('data-id') || '';
446
- const subOrDubValue = $(element).attr('data-type') === 'sub' ? SubOrDubEnum.SUB : SubOrDubEnum.DUB;
447
- scrapedServers.push({
448
- name,
449
- sourcesId,
450
- subOrDub: subOrDubValue
451
- });
452
- });
453
- const servers = await Promise.all(scrapedServers.map(async server => {
454
- const {
455
- data
456
- } = await axios.get(`https://aniwatchtv.to/ajax/v2/episode/sources?id=${server.sourcesId}`);
457
- return {
458
- name: `megacloud-${server.name.toLowerCase()}`,
459
- url: data.link
460
- };
461
- }));
462
- return servers;
463
- } catch (error) {
464
- throw new Error(`Failed to fetch episode servers: ${error}`);
465
- }
466
- };
467
- const scrapeCard = async $ => {
468
- try {
469
- const results = [];
470
- $('#list-items .item').each((i, ele) => {
471
- const card = $(ele);
472
- const atag = card.find('.name.d-title');
473
- const href = atag.attr('href') || card.find('.ani.poster a').attr('href');
474
- let type = 'Unknown';
475
- let eps = 0;
476
- const metaItem = card.find('.m-item').eq(1);
477
- if (metaItem.find('label').length > 0) {
478
- type = metaItem.find('label').text().trim();
479
- }
480
- if (metaItem.find('span').length > 0) {
481
- eps = parseInt(metaItem.find('span').text().trim(), 10) || 0;
482
- }
483
- const subText = card.find('.ep-status.sub span').text().trim();
484
- const dubText = card.find('.ep-status.dub span').text().trim();
485
- const totalText = card.find('.ep-status.total span').text().trim();
486
- results.push({
487
- id: href?.split('/watch/')[1],
488
- title: atag.text().trim(),
489
- url: href ? href.startsWith('http') ? href : `${config.baseUrl}${href}` : '',
490
- image: card.find('.ani.poster img').attr('src') || card.find('.ani.poster img').attr('data-src'),
491
- japaneseTitle: atag.attr('data-jp'),
492
- type: type,
493
- sub: parseInt(subText, 10) || 0,
494
- dub: parseInt(dubText, 10) || 0,
495
- episodes: parseInt(totalText, 10) || eps || 0
496
- });
497
- });
498
- return results;
499
- } catch (err) {
500
- //console.log(err);
501
- throw new Error(`Failed to scrape card: ${err}`);
502
- }
503
- };
504
- const scrapeCardPage = async (url, headers) => {
505
- try {
506
- const res = {
507
- currentPage: 0,
508
- hasNextPage: false,
509
- totalPages: 0,
510
- results: []
491
+ const matchedServer = servers.find(s => s.name.toLowerCase().includes(String(server).toLowerCase())) || servers[0];
492
+ const serverUrl = new PolyURL(matchedServer.url);
493
+ return {
494
+ headers: {
495
+ Referer: serverUrl.href
496
+ },
497
+ ...(await MegaPlay().extract(serverUrl, config.baseUrl))
511
498
  };
512
- const response = await fetch(url, headers);
513
- if (!response.ok) {
514
- throw new Error(`HTTP ${response.status} ${response.statusText} for ${url}`);
515
- }
516
- const data = await response.text();
517
- const $ = load(data);
518
- const pagination = $('ul.pagination');
519
- res.currentPage = parseInt(pagination.find('.page-item.active').text().trim(), 10) || 1;
520
- const nextPage = pagination.find('a[rel=next]').attr('href') || pagination.find('a[title=Next]').attr('href');
521
- if (nextPage !== undefined && nextPage !== '') {
522
- res.hasNextPage = true;
523
- }
524
- const totalPages = pagination.find('a[title=Last]').attr('href')?.split('=').pop();
525
- if (totalPages === undefined || totalPages === '') {
526
- res.totalPages = res.currentPage;
527
- } else {
528
- res.totalPages = parseInt(totalPages, 10);
529
- }
530
- res.results = await scrapeCard($);
531
- if (res.results.length === 0) {
532
- res.currentPage = 0;
533
- res.hasNextPage = false;
534
- res.totalPages = 0;
535
- }
536
- return res;
537
499
  } catch (err) {
538
- console.error('scrapeCardPage error:', err);
539
- throw new Error(`Failed to scrape page ${url}: ${err instanceof Error ? err.message : 'Unknown error'}`);
500
+ throw new Error(`[AniKoto] Failed to fetch episode sources: ${err.message}`);
540
501
  }
541
502
  };
542
-
543
- // Return the functional provider object
544
503
  return {
545
504
  ...config,
546
- // Core methods, pass only the necessary methods, dont pass helpers or unused methods
547
505
  search,
548
506
  fetchAdvancedSearch,
549
507
  fetchTopAiring,
@@ -566,15 +524,10 @@ function createAniKoto(ctx, customBaseURL) {
566
524
  fetchSchedule,
567
525
  fetchSpotlight,
568
526
  fetchSearchSuggestions,
569
- fetchContinueWatching,
570
- fetchWatchList,
571
527
  fetchAnimeInfo,
572
- fetchEpisodeSources,
573
- fetchEpisodeServers
528
+ fetchEpisodeServers,
529
+ fetchEpisodeSources
574
530
  };
575
531
  }
576
-
577
- // Type definition for the provider instance returned by createAniKoto
578
- // Default export for backward compatibility
579
532
  var _default = exports.default = createAniKoto;
580
533
  //# sourceMappingURL=create-anikoto.js.map