react-native-consumet 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/README.md +19 -0
  2. package/android/generated/java/com/consumet/NativeConsumetSpec.java +8 -0
  3. package/android/generated/jni/RNConsumetSpec-generated.cpp +12 -0
  4. package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI-generated.cpp +18 -0
  5. package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI.h +18 -0
  6. package/android/src/main/java/com/consumet/ConsumetModule.kt +12 -1
  7. package/android/src/main/java/com/consumet/DdosGuardModule.kt +1 -132
  8. package/android/src/main/java/com/consumet/HttpRequestModule.kt +417 -0
  9. package/ios/generated/RNConsumetSpec/RNConsumetSpec-generated.mm +14 -0
  10. package/ios/generated/RNConsumetSpec/RNConsumetSpec.h +10 -0
  11. package/ios/generated/RNConsumetSpecJSI-generated.cpp +18 -0
  12. package/ios/generated/RNConsumetSpecJSI.h +18 -0
  13. package/lib/commonjs/NativeConsumet.ts +22 -0
  14. package/lib/commonjs/extension-registry.json +75 -2
  15. package/lib/commonjs/extractors/index.js +6 -6
  16. package/lib/commonjs/extractors/index.js.map +1 -1
  17. package/lib/commonjs/extractors/megacloud.js +11 -5
  18. package/lib/commonjs/extractors/megacloud.js.map +1 -1
  19. package/lib/commonjs/extractors/megaup.js +97 -85
  20. package/lib/commonjs/extractors/megaup.js.map +1 -1
  21. package/lib/commonjs/extractors/{StreamP2P.js → streamp2p.js} +1 -1
  22. package/lib/commonjs/extractors/{StreamP2P.js.map → streamp2p.js.map} +1 -1
  23. package/lib/commonjs/extractors/streamwish.js +31 -25
  24. package/lib/commonjs/extractors/streamwish.js.map +1 -1
  25. package/lib/commonjs/extractors/vidhide.js +35 -20
  26. package/lib/commonjs/extractors/vidhide.js.map +1 -1
  27. package/lib/commonjs/index.js +1 -0
  28. package/lib/commonjs/index.js.map +1 -1
  29. package/lib/commonjs/providers/anime/animekai/animekai.js +112 -0
  30. package/lib/commonjs/providers/anime/animekai/animekai.js.map +1 -0
  31. package/lib/commonjs/providers/anime/animekai/create-animekai.js +499 -0
  32. package/lib/commonjs/providers/anime/animekai/create-animekai.js.map +1 -0
  33. package/lib/commonjs/providers/anime/animepahe/animepahe.js +6 -13
  34. package/lib/commonjs/providers/anime/animepahe/animepahe.js.map +1 -1
  35. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +1 -10
  36. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
  37. package/lib/commonjs/providers/anime/index.js +4 -2
  38. package/lib/commonjs/providers/anime/index.js.map +1 -1
  39. package/lib/commonjs/providers/anime/zoro/create-zoro.js +1 -10
  40. package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +1 -1
  41. package/lib/commonjs/providers/anime/zoro/zoro.js +6 -13
  42. package/lib/commonjs/providers/anime/zoro/zoro.js.map +1 -1
  43. package/lib/commonjs/providers/meta/anilist.js +1 -1
  44. package/lib/commonjs/providers/movies/dramacool.js +395 -331
  45. package/lib/commonjs/providers/movies/dramacool.js.map +1 -1
  46. package/lib/commonjs/providers/movies/himovies/create-himovies.js +1 -12
  47. package/lib/commonjs/providers/movies/himovies/create-himovies.js.map +1 -1
  48. package/lib/commonjs/providers/movies/himovies/himovies.js +6 -16
  49. package/lib/commonjs/providers/movies/himovies/himovies.js.map +1 -1
  50. package/lib/commonjs/providers/movies/index.js +10 -4
  51. package/lib/commonjs/providers/movies/index.js.map +1 -1
  52. package/lib/{module/providers/movies/multimovies.js → commonjs/providers/movies/multimovies/create-multimovies.js} +183 -149
  53. package/lib/commonjs/providers/movies/multimovies/create-multimovies.js.map +1 -0
  54. package/lib/commonjs/providers/movies/multimovies/multimovies.js +46 -0
  55. package/lib/commonjs/providers/movies/multimovies/multimovies.js.map +1 -0
  56. package/lib/commonjs/providers/movies/multistream/index.js +16 -16
  57. package/lib/commonjs/providers/movies/multistream/utils.js +252 -26
  58. package/lib/commonjs/providers/movies/multistream/utils.js.map +1 -1
  59. package/lib/commonjs/providers/movies/netflixmirror.js +14 -14
  60. package/lib/commonjs/providers/movies/yflix/create-yflix.js +418 -0
  61. package/lib/commonjs/providers/movies/yflix/create-yflix.js.map +1 -0
  62. package/lib/commonjs/providers/movies/yflix/yflix.js +59 -0
  63. package/lib/commonjs/providers/movies/yflix/yflix.js.map +1 -0
  64. package/lib/commonjs/providers/movies/yflix.js +561 -0
  65. package/lib/commonjs/providers/movies/yflix.js.map +1 -0
  66. package/lib/commonjs/utils/create-extractor-context.js +2 -0
  67. package/lib/commonjs/utils/create-extractor-context.js.map +1 -1
  68. package/lib/commonjs/utils/create-provider-context.js +2 -0
  69. package/lib/commonjs/utils/create-provider-context.js.map +1 -1
  70. package/lib/commonjs/utils/extension-utils.js +5 -3
  71. package/lib/commonjs/utils/extension-utils.js.map +1 -1
  72. package/lib/commonjs/utils/provider-maps.js +7 -1
  73. package/lib/commonjs/utils/provider-maps.js.map +1 -1
  74. package/lib/module/NativeConsumet.ts +22 -0
  75. package/lib/module/extension-registry.json +75 -2
  76. package/lib/module/extractors/index.js +3 -3
  77. package/lib/module/extractors/index.js.map +1 -1
  78. package/lib/module/extractors/megacloud.js +11 -5
  79. package/lib/module/extractors/megacloud.js.map +1 -1
  80. package/lib/module/extractors/megaup.js +95 -83
  81. package/lib/module/extractors/megaup.js.map +1 -1
  82. package/lib/module/extractors/{StreamP2P.js → streamp2p.js} +1 -1
  83. package/lib/module/extractors/{StreamP2P.js.map → streamp2p.js.map} +1 -1
  84. package/lib/module/extractors/streamwish.js +28 -21
  85. package/lib/module/extractors/streamwish.js.map +1 -1
  86. package/lib/module/extractors/vidhide.js +33 -17
  87. package/lib/module/extractors/vidhide.js.map +1 -1
  88. package/lib/module/index.js +3 -2
  89. package/lib/module/index.js.map +1 -1
  90. package/lib/module/providers/anime/animekai/animekai.js +106 -0
  91. package/lib/module/providers/anime/animekai/animekai.js.map +1 -0
  92. package/lib/module/providers/anime/animekai/create-animekai.js +495 -0
  93. package/lib/module/providers/anime/animekai/create-animekai.js.map +1 -0
  94. package/lib/module/providers/anime/animepahe/animepahe.js +6 -13
  95. package/lib/module/providers/anime/animepahe/animepahe.js.map +1 -1
  96. package/lib/module/providers/anime/animepahe/create-animepahe.js +1 -10
  97. package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
  98. package/lib/module/providers/anime/index.js +4 -2
  99. package/lib/module/providers/anime/index.js.map +1 -1
  100. package/lib/module/providers/anime/zoro/create-zoro.js +1 -10
  101. package/lib/module/providers/anime/zoro/create-zoro.js.map +1 -1
  102. package/lib/module/providers/anime/zoro/zoro.js +6 -13
  103. package/lib/module/providers/anime/zoro/zoro.js.map +1 -1
  104. package/lib/module/providers/meta/anilist.js +1 -1
  105. package/lib/module/providers/meta/anilist.js.map +1 -1
  106. package/lib/module/providers/movies/dramacool.js +395 -327
  107. package/lib/module/providers/movies/dramacool.js.map +1 -1
  108. package/lib/module/providers/movies/himovies/create-himovies.js +1 -11
  109. package/lib/module/providers/movies/himovies/create-himovies.js.map +1 -1
  110. package/lib/module/providers/movies/himovies/himovies.js +6 -16
  111. package/lib/module/providers/movies/himovies/himovies.js.map +1 -1
  112. package/lib/module/providers/movies/index.js +10 -4
  113. package/lib/module/providers/movies/index.js.map +1 -1
  114. package/lib/{commonjs/providers/movies/multimovies.js → module/providers/movies/multimovies/create-multimovies.js} +187 -161
  115. package/lib/module/providers/movies/multimovies/create-multimovies.js.map +1 -0
  116. package/lib/module/providers/movies/multimovies/multimovies.js +43 -0
  117. package/lib/module/providers/movies/multimovies/multimovies.js.map +1 -0
  118. package/lib/module/providers/movies/multistream/index.js +16 -16
  119. package/lib/module/providers/movies/multistream/utils.js +249 -26
  120. package/lib/module/providers/movies/multistream/utils.js.map +1 -1
  121. package/lib/module/providers/movies/netflixmirror.js +14 -14
  122. package/lib/module/providers/movies/yflix/create-yflix.js +414 -0
  123. package/lib/module/providers/movies/yflix/create-yflix.js.map +1 -0
  124. package/lib/module/providers/movies/yflix/yflix.js +55 -0
  125. package/lib/module/providers/movies/yflix/yflix.js.map +1 -0
  126. package/lib/module/providers/movies/yflix.js +561 -0
  127. package/lib/module/providers/movies/yflix.js.map +1 -0
  128. package/lib/module/utils/create-extractor-context.js +3 -1
  129. package/lib/module/utils/create-extractor-context.js.map +1 -1
  130. package/lib/module/utils/create-provider-context.js +3 -1
  131. package/lib/module/utils/create-provider-context.js.map +1 -1
  132. package/lib/module/utils/extension-utils.js +6 -4
  133. package/lib/module/utils/extension-utils.js.map +1 -1
  134. package/lib/module/utils/provider-maps.js +7 -1
  135. package/lib/module/utils/provider-maps.js.map +1 -1
  136. package/lib/typescript/commonjs/src/NativeConsumet.d.ts +36 -0
  137. package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
  138. package/lib/typescript/commonjs/src/extractors/index.d.ts +3 -3
  139. package/lib/typescript/commonjs/src/extractors/index.d.ts.map +1 -1
  140. package/lib/typescript/commonjs/src/extractors/megacloud.d.ts.map +1 -1
  141. package/lib/typescript/commonjs/src/extractors/megaup.d.ts +5 -15
  142. package/lib/typescript/commonjs/src/extractors/megaup.d.ts.map +1 -1
  143. package/lib/typescript/commonjs/src/extractors/{StreamP2P.d.ts → streamp2p.d.ts} +1 -1
  144. package/lib/typescript/commonjs/src/extractors/{StreamP2P.d.ts.map → streamp2p.d.ts.map} +1 -1
  145. package/lib/typescript/commonjs/src/extractors/streamwish.d.ts +7 -11
  146. package/lib/typescript/commonjs/src/extractors/streamwish.d.ts.map +1 -1
  147. package/lib/typescript/commonjs/src/extractors/vidhide.d.ts +7 -7
  148. package/lib/typescript/commonjs/src/extractors/vidhide.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/src/index.d.ts +3 -2
  150. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  151. package/lib/typescript/commonjs/src/models/extractor-context.d.ts +3 -1
  152. package/lib/typescript/commonjs/src/models/extractor-context.d.ts.map +1 -1
  153. package/lib/typescript/commonjs/src/models/provider-context.d.ts +9 -7
  154. package/lib/typescript/commonjs/src/models/provider-context.d.ts.map +1 -1
  155. package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts +85 -0
  156. package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts.map +1 -0
  157. package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts +32 -0
  158. package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts.map +1 -0
  159. package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts +6 -4
  160. package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts.map +1 -1
  161. package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts +8 -4
  162. package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
  163. package/lib/typescript/commonjs/src/providers/anime/index.d.ts +3 -1
  164. package/lib/typescript/commonjs/src/providers/anime/index.d.ts.map +1 -1
  165. package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts +8 -4
  166. package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
  167. package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts +6 -4
  168. package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts.map +1 -1
  169. package/lib/typescript/commonjs/src/providers/movies/dramacool.d.ts +0 -21
  170. package/lib/typescript/commonjs/src/providers/movies/dramacool.d.ts.map +1 -1
  171. package/lib/typescript/commonjs/src/providers/movies/himovies/create-himovies.d.ts +8 -5
  172. package/lib/typescript/commonjs/src/providers/movies/himovies/create-himovies.d.ts.map +1 -1
  173. package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts +6 -5
  174. package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts.map +1 -1
  175. package/lib/typescript/commonjs/src/providers/movies/index.d.ts +7 -3
  176. package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
  177. package/lib/typescript/commonjs/src/providers/movies/multimovies/create-multimovies.d.ts +20 -0
  178. package/lib/typescript/commonjs/src/providers/movies/multimovies/create-multimovies.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/src/providers/movies/multimovies/multimovies.d.ts +21 -0
  180. package/lib/typescript/commonjs/src/providers/movies/multimovies/multimovies.d.ts.map +1 -0
  181. package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts +9 -0
  182. package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts.map +1 -1
  183. package/lib/typescript/commonjs/src/providers/movies/yflix/create-yflix.d.ts +25 -0
  184. package/lib/typescript/commonjs/src/providers/movies/yflix/create-yflix.d.ts.map +1 -0
  185. package/lib/typescript/commonjs/src/providers/movies/yflix/yflix.d.ts +44 -0
  186. package/lib/typescript/commonjs/src/providers/movies/yflix/yflix.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/src/providers/movies/yflix.d.ts +1 -0
  188. package/lib/typescript/commonjs/src/providers/movies/yflix.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/src/utils/create-extractor-context.d.ts.map +1 -1
  190. package/lib/typescript/commonjs/src/utils/create-provider-context.d.ts.map +1 -1
  191. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts +5 -5
  192. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -1
  193. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts +2 -0
  194. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts.map +1 -1
  195. package/lib/typescript/module/src/NativeConsumet.d.ts +36 -0
  196. package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
  197. package/lib/typescript/module/src/extractors/index.d.ts +3 -3
  198. package/lib/typescript/module/src/extractors/index.d.ts.map +1 -1
  199. package/lib/typescript/module/src/extractors/megacloud.d.ts.map +1 -1
  200. package/lib/typescript/module/src/extractors/megaup.d.ts +5 -15
  201. package/lib/typescript/module/src/extractors/megaup.d.ts.map +1 -1
  202. package/lib/typescript/module/src/extractors/{StreamP2P.d.ts → streamp2p.d.ts} +1 -1
  203. package/lib/typescript/module/src/extractors/{StreamP2P.d.ts.map → streamp2p.d.ts.map} +1 -1
  204. package/lib/typescript/module/src/extractors/streamwish.d.ts +7 -11
  205. package/lib/typescript/module/src/extractors/streamwish.d.ts.map +1 -1
  206. package/lib/typescript/module/src/extractors/vidhide.d.ts +7 -7
  207. package/lib/typescript/module/src/extractors/vidhide.d.ts.map +1 -1
  208. package/lib/typescript/module/src/index.d.ts +3 -2
  209. package/lib/typescript/module/src/index.d.ts.map +1 -1
  210. package/lib/typescript/module/src/models/extractor-context.d.ts +3 -1
  211. package/lib/typescript/module/src/models/extractor-context.d.ts.map +1 -1
  212. package/lib/typescript/module/src/models/provider-context.d.ts +9 -7
  213. package/lib/typescript/module/src/models/provider-context.d.ts.map +1 -1
  214. package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts +85 -0
  215. package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts.map +1 -0
  216. package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts +32 -0
  217. package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts.map +1 -0
  218. package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts +6 -4
  219. package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts.map +1 -1
  220. package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts +8 -4
  221. package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
  222. package/lib/typescript/module/src/providers/anime/index.d.ts +3 -1
  223. package/lib/typescript/module/src/providers/anime/index.d.ts.map +1 -1
  224. package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts +8 -4
  225. package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
  226. package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts +6 -4
  227. package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts.map +1 -1
  228. package/lib/typescript/module/src/providers/movies/dramacool.d.ts +0 -21
  229. package/lib/typescript/module/src/providers/movies/dramacool.d.ts.map +1 -1
  230. package/lib/typescript/module/src/providers/movies/himovies/create-himovies.d.ts +8 -5
  231. package/lib/typescript/module/src/providers/movies/himovies/create-himovies.d.ts.map +1 -1
  232. package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts +6 -5
  233. package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts.map +1 -1
  234. package/lib/typescript/module/src/providers/movies/index.d.ts +7 -3
  235. package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
  236. package/lib/typescript/module/src/providers/movies/multimovies/create-multimovies.d.ts +20 -0
  237. package/lib/typescript/module/src/providers/movies/multimovies/create-multimovies.d.ts.map +1 -0
  238. package/lib/typescript/module/src/providers/movies/multimovies/multimovies.d.ts +21 -0
  239. package/lib/typescript/module/src/providers/movies/multimovies/multimovies.d.ts.map +1 -0
  240. package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts +9 -0
  241. package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts.map +1 -1
  242. package/lib/typescript/module/src/providers/movies/yflix/create-yflix.d.ts +25 -0
  243. package/lib/typescript/module/src/providers/movies/yflix/create-yflix.d.ts.map +1 -0
  244. package/lib/typescript/module/src/providers/movies/yflix/yflix.d.ts +44 -0
  245. package/lib/typescript/module/src/providers/movies/yflix/yflix.d.ts.map +1 -0
  246. package/lib/typescript/module/src/providers/movies/yflix.d.ts +1 -0
  247. package/lib/typescript/module/src/providers/movies/yflix.d.ts.map +1 -0
  248. package/lib/typescript/module/src/utils/create-extractor-context.d.ts.map +1 -1
  249. package/lib/typescript/module/src/utils/create-provider-context.d.ts.map +1 -1
  250. package/lib/typescript/module/src/utils/extension-utils.d.ts +5 -5
  251. package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -1
  252. package/lib/typescript/module/src/utils/provider-maps.d.ts +2 -0
  253. package/lib/typescript/module/src/utils/provider-maps.d.ts.map +1 -1
  254. package/package.json +18 -9
  255. package/src/NativeConsumet.ts +22 -0
  256. package/src/extension-registry.json +75 -2
  257. package/src/extractors/index.ts +3 -3
  258. package/src/extractors/megacloud.ts +11 -5
  259. package/src/extractors/megaup.ts +110 -89
  260. package/src/extractors/streamwish.ts +36 -27
  261. package/src/extractors/vidhide.ts +42 -23
  262. package/src/index.tsx +3 -2
  263. package/src/models/extractor-context.ts +4 -0
  264. package/src/models/provider-context.ts +10 -12
  265. package/src/providers/anime/animekai/animekai.ts +121 -0
  266. package/src/providers/anime/animekai/create-animekai.ts +570 -0
  267. package/src/providers/anime/animepahe/animepahe.ts +14 -14
  268. package/src/providers/anime/animepahe/create-animepahe.ts +1 -11
  269. package/src/providers/anime/index.ts +3 -1
  270. package/src/providers/anime/zoro/create-zoro.ts +1 -11
  271. package/src/providers/anime/zoro/zoro.ts +14 -14
  272. package/src/providers/meta/anilist.ts +1 -1
  273. package/src/providers/movies/dramacool.ts +395 -394
  274. package/src/providers/movies/himovies/create-himovies.ts +1 -12
  275. package/src/providers/movies/himovies/himovies.ts +14 -17
  276. package/src/providers/movies/index.ts +9 -3
  277. package/src/providers/movies/{multimovies.ts → multimovies/create-multimovies.ts} +181 -156
  278. package/src/providers/movies/multimovies/multimovies.ts +57 -0
  279. package/src/providers/movies/multistream/index.ts +232 -232
  280. package/src/providers/movies/multistream/utils.ts +213 -16
  281. package/src/providers/movies/netflixmirror.ts +288 -288
  282. package/src/providers/movies/yflix/create-yflix.ts +496 -0
  283. package/src/providers/movies/yflix/yflix.ts +82 -0
  284. package/src/providers/movies/yflix.ts +559 -0
  285. package/src/utils/create-extractor-context.ts +4 -0
  286. package/src/utils/create-provider-context.ts +4 -0
  287. package/src/utils/extension-utils.ts +7 -3
  288. package/src/utils/provider-maps.ts +7 -1
  289. package/lib/commonjs/providers/anime/animekai.js +0 -587
  290. package/lib/commonjs/providers/anime/animekai.js.map +0 -1
  291. package/lib/commonjs/providers/movies/multimovies.js.map +0 -1
  292. package/lib/module/providers/anime/animekai.js +0 -583
  293. package/lib/module/providers/anime/animekai.js.map +0 -1
  294. package/lib/module/providers/movies/multimovies.js.map +0 -1
  295. package/lib/typescript/commonjs/src/providers/anime/animekai.d.ts +0 -89
  296. package/lib/typescript/commonjs/src/providers/anime/animekai.d.ts.map +0 -1
  297. package/lib/typescript/commonjs/src/providers/movies/multimovies.d.ts +0 -40
  298. package/lib/typescript/commonjs/src/providers/movies/multimovies.d.ts.map +0 -1
  299. package/lib/typescript/module/src/providers/anime/animekai.d.ts +0 -89
  300. package/lib/typescript/module/src/providers/anime/animekai.d.ts.map +0 -1
  301. package/lib/typescript/module/src/providers/movies/multimovies.d.ts +0 -40
  302. package/lib/typescript/module/src/providers/movies/multimovies.d.ts.map +0 -1
  303. package/src/providers/anime/animekai.ts +0 -627
  304. /package/src/extractors/{StreamP2P.ts → streamp2p.ts} +0 -0
@@ -1,394 +1,395 @@
1
- import axios from 'axios';
2
- import { load } from 'cheerio';
3
-
4
- import { AsianLoad, MixDrop, StreamSB, StreamTape, StreamWish, VidHide } from '../../extractors';
5
- import {
6
- type IEpisodeServer,
7
- type IMovieInfo,
8
- type IMovieResult,
9
- type ISearch,
10
- type ISource,
11
- MediaStatus,
12
- MovieParser,
13
- StreamingServers,
14
- TvType,
15
- } from '../../models';
16
-
17
- class DramaCool extends MovieParser {
18
- override readonly name = 'DramaCool';
19
- protected override baseUrl = 'https://dramacool.bg';
20
- protected override logo =
21
- 'https://play-lh.googleusercontent.com/IaCb2JXII0OV611MQ-wSA8v_SAs9XF6E3TMDiuxGGXo4wp9bI60GtDASIqdERSTO5XU';
22
- protected override classPath = 'MOVIES.DramaCool';
23
- override supportedTypes = new Set([TvType.MOVIE, TvType.TVSERIES]);
24
-
25
- override search = async (query: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
26
- try {
27
- const searchResult: ISearch<IMovieResult> = {
28
- currentPage: page,
29
- totalPages: page,
30
- hasNextPage: false,
31
- results: [],
32
- };
33
-
34
- const { data } = await axios.get(
35
- `${this.baseUrl}/search?type=drama&keyword=${query.replace(/[\W_]+/g, '+')}&page=${page}`
36
- );
37
-
38
- const $ = load(data);
39
-
40
- const navSelector = 'ul.pagination';
41
-
42
- searchResult.hasNextPage =
43
- $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('selected') : false;
44
-
45
- const lastPage = $(navSelector).children().last().find('a').attr('href');
46
- if (lastPage !== undefined && lastPage !== '' && lastPage.includes('page=')) {
47
- const maxPage = new URLSearchParams(lastPage).get('page');
48
- if (maxPage !== null && !isNaN(parseInt(maxPage))) searchResult.totalPages = parseInt(maxPage);
49
- else if (searchResult.hasNextPage) searchResult.totalPages = page + 1;
50
- } else if (searchResult.hasNextPage) searchResult.totalPages = page + 1;
51
-
52
- $('div.block > div.tab-content > ul.list-episode-item > li').each((i, el) => {
53
- searchResult.results.push({
54
- id: $(el).find('a').attr('href')?.split(`${this.baseUrl}/`)[1]!,
55
- title: $(el).find('a > h3').text(),
56
- url: `${$(el).find('a').attr('href')}`,
57
- image: $(el).find('a > img').attr('data-original'),
58
- });
59
- });
60
- return searchResult;
61
- } catch (err) {
62
- throw new Error((err as Error).message);
63
- }
64
- };
65
-
66
- override fetchMediaInfo = async (mediaId: string): Promise<IMovieInfo> => {
67
- try {
68
- const realMediaId = mediaId;
69
- if (!mediaId.startsWith(this.baseUrl)) mediaId = `${this.baseUrl}/${mediaId}`;
70
-
71
- const mediaInfo: IMovieInfo = {
72
- id: '',
73
- title: '',
74
- };
75
-
76
- const { data } = await axios.get(mediaId);
77
- const $ = load(data);
78
-
79
- mediaInfo.id = realMediaId;
80
-
81
- const duration = $('div.details div.info p:contains("Duration:")').first().text().trim();
82
- if (duration !== '') mediaInfo.duration = duration.replace('Duration:', '').trim();
83
- const status = $('div.details div.info p:contains("Status:")').find('a').first().text().trim();
84
- switch (status) {
85
- case 'Ongoing':
86
- mediaInfo.status = MediaStatus.ONGOING;
87
- break;
88
- case 'Completed':
89
- mediaInfo.status = MediaStatus.COMPLETED;
90
- break;
91
- default:
92
- mediaInfo.status = MediaStatus.UNKNOWN;
93
- break;
94
- }
95
- mediaInfo.genres = [];
96
- const genres = $('div.details div.info p:contains("Genre:")');
97
- genres.each((_index, element) => {
98
- $(element)
99
- .find('a')
100
- .each((_, anchorElement) => {
101
- mediaInfo.genres?.push($(anchorElement).text());
102
- });
103
- });
104
-
105
- mediaInfo.title = $('.info > h1:nth-child(1)').text();
106
- mediaInfo.otherNames = $('.other_name > a')
107
- .map((i, el) => $(el).text().trim())
108
- .get();
109
- mediaInfo.image = $('div.details > div.img > img').attr('src');
110
- mediaInfo.description = $('div.details div.info p:not(:has(*))')
111
- .map((i, el) => $(el).text().trim())
112
- .get()
113
- .join('\n\n')
114
- .trim();
115
- mediaInfo.releaseDate = this.removeContainsFromString(
116
- $('div.details div.info p:contains("Released:")').text(),
117
- 'Released'
118
- );
119
- mediaInfo.contentRating = this.removeContainsFromString(
120
- $('div.details div.info p:contains("Content Rating:")').text(),
121
- 'Content Rating'
122
- );
123
- mediaInfo.airsOn = this.removeContainsFromString(
124
- $('div.details div.info p:contains("Airs On:")').text(),
125
- 'Airs On'
126
- );
127
- mediaInfo.director = this.removeContainsFromString(
128
- $('div.details div.info p:contains("Director:")').text(),
129
- 'Director'
130
- );
131
- mediaInfo.originalNetwork = this.cleanUpText(
132
- this.removeContainsFromString(
133
- $('div.details div.info p:contains("Original Network:")').text().trim(),
134
- 'Original Network'
135
- )
136
- );
137
-
138
- const trailerIframe = $('div.trailer').find('iframe').attr('src');
139
- mediaInfo.trailer = {
140
- id: trailerIframe?.split('embed/')[1]?.split('?')[0]!,
141
- url: trailerIframe,
142
- };
143
- mediaInfo.characters = [];
144
- $('div.slider-star > div.item').each((i, el) => {
145
- const url = `${this.baseUrl}${$(el).find('a.img').attr('href')}`;
146
- const image = $(el).find('img').attr('src');
147
- const name = $(el).find('h3.title').text().trim();
148
-
149
- (mediaInfo.characters as any[]).push({
150
- url,
151
- image,
152
- name,
153
- });
154
- });
155
-
156
- mediaInfo.episodes = [];
157
- $('div.content-left > div.block-tab > div > div > ul > li').each((i, el) => {
158
- mediaInfo.episodes?.push({
159
- id: $(el).find('a').attr('href')?.split(`${this.baseUrl}/`)[1]!,
160
- title: $(el).find('h3').text().replace(mediaInfo.title.toString(), '').trim(),
161
- episode: parseFloat($(el).find('a').attr('href')?.split('-episode-')[1]!),
162
- subType: $(el).find('span.type').text(),
163
- releaseDate: $(el).find('span.time').text(),
164
- url: `${$(el).find('a').attr('href')}`,
165
- });
166
- });
167
- mediaInfo.episodes.reverse();
168
-
169
- return mediaInfo;
170
- } catch (err) {
171
- throw new Error((err as Error).message);
172
- }
173
- };
174
-
175
- override async fetchEpisodeServers(episodeId: string, ...args: any): Promise<IEpisodeServer[]> {
176
- try {
177
- const episodeServers: IEpisodeServer[] = [];
178
-
179
- episodeId = `${this.baseUrl}/${episodeId}`;
180
-
181
- const { data } = await axios.get(episodeId);
182
- const $ = load(data);
183
-
184
- // keeping the old code future reference
185
- // $('div.anime_muti_link > ul > li').map(async (i, ele) => {
186
- // const url = $(ele).attr('data-video')!;
187
- // let name = $(ele).attr('class')!.replace('selected', '').trim();
188
- // if (name.includes('standard')) {
189
- // name = StreamingServers.AsianLoad;
190
- // }
191
- // episodeServers.push({
192
- // name: name,
193
- // url: url.startsWith('//') ? url?.replace('//', 'https://') : url,
194
- // });
195
- // });
196
-
197
- const standardServer = $('div.anime_muti_link > ul > li.standard').attr('data-video')!;
198
- const url = standardServer.startsWith('//') ? standardServer?.replace('//', 'https://') : standardServer;
199
- const { data: servers } = await axios.get(url);
200
- const $$ = load(servers);
201
- $$('div#list-server-more > ul > li').each((i, el) => {
202
- let name = $$(el).attr('data-provider')!;
203
- const server = $$(el).attr('data-video')!;
204
- if (name.includes('serverwithtoken')) {
205
- name = StreamingServers.AsianLoad;
206
- }
207
- if (server) {
208
- episodeServers.push({
209
- name: name,
210
- url: server.startsWith('//') ? server?.replace('//', 'https://') : server,
211
- });
212
- }
213
- });
214
- return episodeServers;
215
- } catch (err) {
216
- throw new Error((err as Error).message);
217
- }
218
- }
219
-
220
- override fetchEpisodeSources = async (
221
- episodeId: string,
222
- server: StreamingServers = StreamingServers.AsianLoad
223
- ): Promise<ISource> => {
224
- if (episodeId.startsWith('http')) {
225
- const serverUrl = new URL(episodeId);
226
- switch (server) {
227
- case StreamingServers.AsianLoad:
228
- return {
229
- headers: { Referer: serverUrl.origin },
230
- ...(await new AsianLoad().extract(serverUrl)),
231
- download: this.downloadLink(episodeId),
232
- };
233
- case StreamingServers.MixDrop:
234
- return {
235
- headers: { Referer: serverUrl.origin },
236
- sources: await new MixDrop().extract(serverUrl),
237
- };
238
- case StreamingServers.StreamTape:
239
- return {
240
- headers: { Referer: serverUrl.origin },
241
- sources: await new StreamTape().extract(serverUrl),
242
- };
243
- case StreamingServers.StreamSB:
244
- return {
245
- headers: { Referer: serverUrl.origin },
246
- sources: await new StreamSB().extract(serverUrl),
247
- };
248
- case StreamingServers.StreamWish:
249
- return {
250
- headers: { Referer: serverUrl.origin },
251
- ...(await new StreamWish().extract(serverUrl)),
252
- };
253
- case StreamingServers.VidHide:
254
- return {
255
- headers: { Referer: serverUrl.href },
256
- sources: await new VidHide().extract(serverUrl),
257
- };
258
- default:
259
- throw new Error('Server not supported');
260
- }
261
- }
262
- try {
263
- // episodeId = `${this.baseUrl}/${episodeId}`;
264
-
265
- const servers = await this.fetchEpisodeServers(episodeId);
266
- const i = servers.findIndex((s) => s.name.toLowerCase() === server.toLowerCase());
267
- if (i === -1) {
268
- throw new Error(`Server ${server} not found`);
269
- }
270
- const serverUrl: URL = new URL(servers.filter((s) => s.name.toLowerCase() === server.toLowerCase())[0]!.url);
271
-
272
- return await this.fetchEpisodeSources(serverUrl.href, server);
273
- } catch (err) {
274
- throw new Error((err as Error).message);
275
- }
276
- };
277
-
278
- fetchPopular = async (page: number = 1): Promise<ISearch<IMovieResult>> => {
279
- return this.fetchData(`${this.baseUrl}/all-most-popular-drama?page=${page}`, page);
280
- };
281
-
282
- fetchRecentTvShows = async (page: number = 1): Promise<ISearch<IMovieResult>> => {
283
- return this.fetchData(`${this.baseUrl}/all-recently-added/drama?page=${page}`, page, true);
284
- };
285
-
286
- fetchRecentMovies = async (page: number = 1): Promise<ISearch<IMovieResult>> => {
287
- return this.fetchData(`${this.baseUrl}/all-recently-added/movie?page=${page}`, page, false, true);
288
- };
289
-
290
- fetchSpotlight = async (): Promise<ISearch<IMovieResult>> => {
291
- try {
292
- const results: ISearch<IMovieResult> = { results: [] };
293
- const { data } = await axios.get(`${this.baseUrl}`);
294
-
295
- const $ = load(data);
296
-
297
- $('div.ls-slide').each((i, el) => {
298
- results.results.push({
299
- id: $(el).find('a').attr('href')?.slice(1)!,
300
- title: $(el).find('img').attr('title')!,
301
- url: `${this.baseUrl}${$(el).find('a').attr('href')}`,
302
- cover: $(el).find('img').attr('src'),
303
- });
304
- });
305
-
306
- return results;
307
- } catch (err) {
308
- console.error(err);
309
- throw new Error((err as Error).message);
310
- }
311
- };
312
-
313
- private async fetchData(
314
- url: string,
315
- page: number,
316
- isTvShow: boolean = false,
317
- isMovies: boolean = false
318
- ): Promise<ISearch<IMovieResult>> {
319
- try {
320
- const { data } = await axios.get(url);
321
- const $ = load(data);
322
- const results: ISearch<IMovieResult> = {
323
- currentPage: page,
324
- totalPages: page,
325
- hasNextPage: false,
326
- results: [],
327
- };
328
-
329
- $('ul.switch-block.list-episode-item')
330
- .find('li')
331
- .each((i, el) => {
332
- const result: IMovieResult = {
333
- id: $(el).find('a').attr('href')?.split(`${this.baseUrl}/`)[1]!,
334
- title: $(el).find('h3.title').text().trim(),
335
- url: `${$(el).find('a').attr('href')}`,
336
- image: $(el).find('img').attr('data-original'),
337
- };
338
-
339
- // keeping the old code for future reference
340
- // if (isTvShow || isMovies) {
341
- // result.id = result.image
342
- // ? result.image.replace(/^https:\/\/[^\/]+\/[^\/]+\/(.+?)-\d+\.\w+$/, 'drama-detail/$1')!
343
- // : '';
344
- // }
345
-
346
- if (isTvShow) {
347
- result.episodeNumber = parseFloat($(el).find('span.ep').text().trim().split(' ')[1]!);
348
- }
349
-
350
- results.results.push(result);
351
- });
352
-
353
- const navSelector = 'ul.pagination';
354
- results.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('selected') : false;
355
-
356
- const lastPage = $(navSelector).children().last().find('a').attr('href');
357
- if (lastPage !== undefined && lastPage !== '' && lastPage.includes('page=')) {
358
- const maxPage = new URLSearchParams(lastPage).get('page');
359
- if (maxPage !== null && !isNaN(parseInt(maxPage))) results.totalPages = parseInt(maxPage);
360
- else if (results.hasNextPage) results.totalPages = page + 1;
361
- } else if (results.hasNextPage) results.totalPages = page + 1;
362
-
363
- return results;
364
- } catch (err) {
365
- throw new Error((err as Error).message);
366
- }
367
- }
368
-
369
- private downloadLink = (url: string) => {
370
- return url.replace(/^(https:\/\/[^\/]+)\/[^?]+(\?.+)$/, '$1/download$2');
371
- };
372
-
373
- private removeContainsFromString = (str: string, contains: string) => {
374
- contains = contains.toLowerCase();
375
- return str.toLowerCase().replace(/\n/g, '').replace(`${contains}:`, '').trim();
376
- };
377
- private cleanUpText = (str: string) => {
378
- return str
379
- .split(';')
380
- .map((part) => part.trim())
381
- .filter((part) => part.length > 0)
382
- .join('; ');
383
- };
384
- }
385
- // (async () => {
386
- // const dramaCool = new DramaCool();
387
- // // const l=await dramaCool.search('squid game');
388
- // const m = await dramaCool.fetchEpisodeServers('video-watch/squid-games-2021-episode-9-as-jao');
389
- // const l = await dramaCool.fetchEpisodeSources('video-watch/squid-games-2021-episode-9-as-jao');
390
- // // const l = await dramaCool.fetchMediaInfo('drama-detail/squid-games-2021-hd');
391
- // console.log(m,l);
392
- // })();
393
-
394
- export default DramaCool;
1
+ // import axios from 'axios';
2
+ // import { load } from 'cheerio';
3
+
4
+ // import { AsianLoad, MixDrop, StreamSB, StreamTape, StreamWish, VidHide } from '../../extractors';
5
+ // import {
6
+ // type IEpisodeServer,
7
+ // type IMovieInfo,
8
+ // type IMovieResult,
9
+ // type ISearch,
10
+ // type ISource,
11
+ // MediaStatus,
12
+ // MovieParser,
13
+ // StreamingServers,
14
+ // TvType,
15
+ // } from '../../models';
16
+ // import { PolyURL } from '../../utils';
17
+
18
+ // class DramaCool extends MovieParser {
19
+ // override readonly name = 'DramaCool';
20
+ // protected override baseUrl = 'https://dramacool.bg';
21
+ // protected override logo =
22
+ // 'https://play-lh.googleusercontent.com/IaCb2JXII0OV611MQ-wSA8v_SAs9XF6E3TMDiuxGGXo4wp9bI60GtDASIqdERSTO5XU';
23
+ // protected override classPath = 'MOVIES.DramaCool';
24
+ // override supportedTypes = new Set([TvType.MOVIE, TvType.TVSERIES]);
25
+
26
+ // override search = async (query: string, page: number = 1): Promise<ISearch<IMovieResult>> => {
27
+ // try {
28
+ // const searchResult: ISearch<IMovieResult> = {
29
+ // currentPage: page,
30
+ // totalPages: page,
31
+ // hasNextPage: false,
32
+ // results: [],
33
+ // };
34
+
35
+ // const { data } = await axios.get(
36
+ // `${this.baseUrl}/search?type=drama&keyword=${query.replace(/[\W_]+/g, '+')}&page=${page}`
37
+ // );
38
+
39
+ // const $ = load(data);
40
+
41
+ // const navSelector = 'ul.pagination';
42
+
43
+ // searchResult.hasNextPage =
44
+ // $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('selected') : false;
45
+
46
+ // const lastPage = $(navSelector).children().last().find('a').attr('href');
47
+ // if (lastPage !== undefined && lastPage !== '' && lastPage.includes('page=')) {
48
+ // const maxPage = new URLSearchParams(lastPage).get('page');
49
+ // if (maxPage !== null && !isNaN(parseInt(maxPage))) searchResult.totalPages = parseInt(maxPage);
50
+ // else if (searchResult.hasNextPage) searchResult.totalPages = page + 1;
51
+ // } else if (searchResult.hasNextPage) searchResult.totalPages = page + 1;
52
+
53
+ // $('div.block > div.tab-content > ul.list-episode-item > li').each((i, el) => {
54
+ // searchResult.results.push({
55
+ // id: $(el).find('a').attr('href')?.split(`${this.baseUrl}/`)[1]!,
56
+ // title: $(el).find('a > h3').text(),
57
+ // url: `${$(el).find('a').attr('href')}`,
58
+ // image: $(el).find('a > img').attr('data-original'),
59
+ // });
60
+ // });
61
+ // return searchResult;
62
+ // } catch (err) {
63
+ // throw new Error((err as Error).message);
64
+ // }
65
+ // };
66
+
67
+ // override fetchMediaInfo = async (mediaId: string): Promise<IMovieInfo> => {
68
+ // try {
69
+ // const realMediaId = mediaId;
70
+ // if (!mediaId.startsWith(this.baseUrl)) mediaId = `${this.baseUrl}/${mediaId}`;
71
+
72
+ // const mediaInfo: IMovieInfo = {
73
+ // id: '',
74
+ // title: '',
75
+ // };
76
+
77
+ // const { data } = await axios.get(mediaId);
78
+ // const $ = load(data);
79
+
80
+ // mediaInfo.id = realMediaId;
81
+
82
+ // const duration = $('div.details div.info p:contains("Duration:")').first().text().trim();
83
+ // if (duration !== '') mediaInfo.duration = duration.replace('Duration:', '').trim();
84
+ // const status = $('div.details div.info p:contains("Status:")').find('a').first().text().trim();
85
+ // switch (status) {
86
+ // case 'Ongoing':
87
+ // mediaInfo.status = MediaStatus.ONGOING;
88
+ // break;
89
+ // case 'Completed':
90
+ // mediaInfo.status = MediaStatus.COMPLETED;
91
+ // break;
92
+ // default:
93
+ // mediaInfo.status = MediaStatus.UNKNOWN;
94
+ // break;
95
+ // }
96
+ // mediaInfo.genres = [];
97
+ // const genres = $('div.details div.info p:contains("Genre:")');
98
+ // genres.each((_index, element) => {
99
+ // $(element)
100
+ // .find('a')
101
+ // .each((_, anchorElement) => {
102
+ // mediaInfo.genres?.push($(anchorElement).text());
103
+ // });
104
+ // });
105
+
106
+ // mediaInfo.title = $('.info > h1:nth-child(1)').text();
107
+ // mediaInfo.otherNames = $('.other_name > a')
108
+ // .map((i, el) => $(el).text().trim())
109
+ // .get();
110
+ // mediaInfo.image = $('div.details > div.img > img').attr('src');
111
+ // mediaInfo.description = $('div.details div.info p:not(:has(*))')
112
+ // .map((i, el) => $(el).text().trim())
113
+ // .get()
114
+ // .join('\n\n')
115
+ // .trim();
116
+ // mediaInfo.releaseDate = this.removeContainsFromString(
117
+ // $('div.details div.info p:contains("Released:")').text(),
118
+ // 'Released'
119
+ // );
120
+ // mediaInfo.contentRating = this.removeContainsFromString(
121
+ // $('div.details div.info p:contains("Content Rating:")').text(),
122
+ // 'Content Rating'
123
+ // );
124
+ // mediaInfo.airsOn = this.removeContainsFromString(
125
+ // $('div.details div.info p:contains("Airs On:")').text(),
126
+ // 'Airs On'
127
+ // );
128
+ // mediaInfo.director = this.removeContainsFromString(
129
+ // $('div.details div.info p:contains("Director:")').text(),
130
+ // 'Director'
131
+ // );
132
+ // mediaInfo.originalNetwork = this.cleanUpText(
133
+ // this.removeContainsFromString(
134
+ // $('div.details div.info p:contains("Original Network:")').text().trim(),
135
+ // 'Original Network'
136
+ // )
137
+ // );
138
+
139
+ // const trailerIframe = $('div.trailer').find('iframe').attr('src');
140
+ // mediaInfo.trailer = {
141
+ // id: trailerIframe?.split('embed/')[1]?.split('?')[0]!,
142
+ // url: trailerIframe,
143
+ // };
144
+ // mediaInfo.characters = [];
145
+ // $('div.slider-star > div.item').each((i, el) => {
146
+ // const url = `${this.baseUrl}${$(el).find('a.img').attr('href')}`;
147
+ // const image = $(el).find('img').attr('src');
148
+ // const name = $(el).find('h3.title').text().trim();
149
+
150
+ // (mediaInfo.characters as any[]).push({
151
+ // url,
152
+ // image,
153
+ // name,
154
+ // });
155
+ // });
156
+
157
+ // mediaInfo.episodes = [];
158
+ // $('div.content-left > div.block-tab > div > div > ul > li').each((i, el) => {
159
+ // mediaInfo.episodes?.push({
160
+ // id: $(el).find('a').attr('href')?.split(`${this.baseUrl}/`)[1]!,
161
+ // title: $(el).find('h3').text().replace(mediaInfo.title.toString(), '').trim(),
162
+ // episode: parseFloat($(el).find('a').attr('href')?.split('-episode-')[1]!),
163
+ // subType: $(el).find('span.type').text(),
164
+ // releaseDate: $(el).find('span.time').text(),
165
+ // url: `${$(el).find('a').attr('href')}`,
166
+ // });
167
+ // });
168
+ // mediaInfo.episodes.reverse();
169
+
170
+ // return mediaInfo;
171
+ // } catch (err) {
172
+ // throw new Error((err as Error).message);
173
+ // }
174
+ // };
175
+
176
+ // override async fetchEpisodeServers(episodeId: string, ...args: any): Promise<IEpisodeServer[]> {
177
+ // try {
178
+ // const episodeServers: IEpisodeServer[] = [];
179
+
180
+ // episodeId = `${this.baseUrl}/${episodeId}`;
181
+
182
+ // const { data } = await axios.get(episodeId);
183
+ // const $ = load(data);
184
+
185
+ // // keeping the old code future reference
186
+ // // $('div.anime_muti_link > ul > li').map(async (i, ele) => {
187
+ // // const url = $(ele).attr('data-video')!;
188
+ // // let name = $(ele).attr('class')!.replace('selected', '').trim();
189
+ // // if (name.includes('standard')) {
190
+ // // name = StreamingServers.AsianLoad;
191
+ // // }
192
+ // // episodeServers.push({
193
+ // // name: name,
194
+ // // url: url.startsWith('//') ? url?.replace('//', 'https://') : url,
195
+ // // });
196
+ // // });
197
+
198
+ // const standardServer = $('div.anime_muti_link > ul > li.standard').attr('data-video')!;
199
+ // const url = standardServer.startsWith('//') ? standardServer?.replace('//', 'https://') : standardServer;
200
+ // const { data: servers } = await axios.get(url);
201
+ // const $$ = load(servers);
202
+ // $$('div#list-server-more > ul > li').each((i, el) => {
203
+ // let name = $$(el).attr('data-provider')!;
204
+ // const server = $$(el).attr('data-video')!;
205
+ // if (name.includes('serverwithtoken')) {
206
+ // name = StreamingServers.AsianLoad;
207
+ // }
208
+ // if (server) {
209
+ // episodeServers.push({
210
+ // name: name,
211
+ // url: server.startsWith('//') ? server?.replace('//', 'https://') : server,
212
+ // });
213
+ // }
214
+ // });
215
+ // return episodeServers;
216
+ // } catch (err) {
217
+ // throw new Error((err as Error).message);
218
+ // }
219
+ // }
220
+
221
+ // override fetchEpisodeSources = async (
222
+ // episodeId: string,
223
+ // server: StreamingServers = StreamingServers.AsianLoad
224
+ // ): Promise<ISource> => {
225
+ // if (episodeId.startsWith('http')) {
226
+ // const serverUrl = new PolyURL(episodeId);
227
+ // switch (server) {
228
+ // case StreamingServers.AsianLoad:
229
+ // return {
230
+ // headers: { Referer: serverUrl.origin },
231
+ // ...(await new AsianLoad().extract(serverUrl)),
232
+ // download: this.downloadLink(episodeId),
233
+ // };
234
+ // case StreamingServers.MixDrop:
235
+ // return {
236
+ // headers: { Referer: serverUrl.origin },
237
+ // sources: await new MixDrop().extract(serverUrl),
238
+ // };
239
+ // case StreamingServers.StreamTape:
240
+ // return {
241
+ // headers: { Referer: serverUrl.origin },
242
+ // sources: await new StreamTape().extract(serverUrl),
243
+ // };
244
+ // case StreamingServers.StreamSB:
245
+ // return {
246
+ // headers: { Referer: serverUrl.origin },
247
+ // sources: await new StreamSB().extract(serverUrl),
248
+ // };
249
+ // case StreamingServers.StreamWish:
250
+ // return {
251
+ // headers: { Referer: serverUrl.origin },
252
+ // ...(await new StreamWish().extract(serverUrl)),
253
+ // };
254
+ // case StreamingServers.VidHide:
255
+ // return {
256
+ // headers: { Referer: serverUrl.href },
257
+ // sources: await new VidHide().extract(serverUrl),
258
+ // };
259
+ // default:
260
+ // throw new Error('Server not supported');
261
+ // }
262
+ // }
263
+ // try {
264
+ // // episodeId = `${this.baseUrl}/${episodeId}`;
265
+
266
+ // const servers = await this.fetchEpisodeServers(episodeId);
267
+ // const i = servers.findIndex((s) => s.name.toLowerCase() === server.toLowerCase());
268
+ // if (i === -1) {
269
+ // throw new Error(`Server ${server} not found`);
270
+ // }
271
+ // const serverUrl: URL = new URL(servers.filter((s) => s.name.toLowerCase() === server.toLowerCase())[0]!.url);
272
+
273
+ // return await this.fetchEpisodeSources(serverUrl.href, server);
274
+ // } catch (err) {
275
+ // throw new Error((err as Error).message);
276
+ // }
277
+ // };
278
+
279
+ // fetchPopular = async (page: number = 1): Promise<ISearch<IMovieResult>> => {
280
+ // return this.fetchData(`${this.baseUrl}/all-most-popular-drama?page=${page}`, page);
281
+ // };
282
+
283
+ // fetchRecentTvShows = async (page: number = 1): Promise<ISearch<IMovieResult>> => {
284
+ // return this.fetchData(`${this.baseUrl}/all-recently-added/drama?page=${page}`, page, true);
285
+ // };
286
+
287
+ // fetchRecentMovies = async (page: number = 1): Promise<ISearch<IMovieResult>> => {
288
+ // return this.fetchData(`${this.baseUrl}/all-recently-added/movie?page=${page}`, page, false, true);
289
+ // };
290
+
291
+ // fetchSpotlight = async (): Promise<ISearch<IMovieResult>> => {
292
+ // try {
293
+ // const results: ISearch<IMovieResult> = { results: [] };
294
+ // const { data } = await axios.get(`${this.baseUrl}`);
295
+
296
+ // const $ = load(data);
297
+
298
+ // $('div.ls-slide').each((i, el) => {
299
+ // results.results.push({
300
+ // id: $(el).find('a').attr('href')?.slice(1)!,
301
+ // title: $(el).find('img').attr('title')!,
302
+ // url: `${this.baseUrl}${$(el).find('a').attr('href')}`,
303
+ // cover: $(el).find('img').attr('src'),
304
+ // });
305
+ // });
306
+
307
+ // return results;
308
+ // } catch (err) {
309
+ // console.error(err);
310
+ // throw new Error((err as Error).message);
311
+ // }
312
+ // };
313
+
314
+ // private async fetchData(
315
+ // url: string,
316
+ // page: number,
317
+ // isTvShow: boolean = false,
318
+ // isMovies: boolean = false
319
+ // ): Promise<ISearch<IMovieResult>> {
320
+ // try {
321
+ // const { data } = await axios.get(url);
322
+ // const $ = load(data);
323
+ // const results: ISearch<IMovieResult> = {
324
+ // currentPage: page,
325
+ // totalPages: page,
326
+ // hasNextPage: false,
327
+ // results: [],
328
+ // };
329
+
330
+ // $('ul.switch-block.list-episode-item')
331
+ // .find('li')
332
+ // .each((i, el) => {
333
+ // const result: IMovieResult = {
334
+ // id: $(el).find('a').attr('href')?.split(`${this.baseUrl}/`)[1]!,
335
+ // title: $(el).find('h3.title').text().trim(),
336
+ // url: `${$(el).find('a').attr('href')}`,
337
+ // image: $(el).find('img').attr('data-original'),
338
+ // };
339
+
340
+ // // keeping the old code for future reference
341
+ // // if (isTvShow || isMovies) {
342
+ // // result.id = result.image
343
+ // // ? result.image.replace(/^https:\/\/[^\/]+\/[^\/]+\/(.+?)-\d+\.\w+$/, 'drama-detail/$1')!
344
+ // // : '';
345
+ // // }
346
+
347
+ // if (isTvShow) {
348
+ // result.episodeNumber = parseFloat($(el).find('span.ep').text().trim().split(' ')[1]!);
349
+ // }
350
+
351
+ // results.results.push(result);
352
+ // });
353
+
354
+ // const navSelector = 'ul.pagination';
355
+ // results.hasNextPage = $(navSelector).length > 0 ? !$(navSelector).children().last().hasClass('selected') : false;
356
+
357
+ // const lastPage = $(navSelector).children().last().find('a').attr('href');
358
+ // if (lastPage !== undefined && lastPage !== '' && lastPage.includes('page=')) {
359
+ // const maxPage = new URLSearchParams(lastPage).get('page');
360
+ // if (maxPage !== null && !isNaN(parseInt(maxPage))) results.totalPages = parseInt(maxPage);
361
+ // else if (results.hasNextPage) results.totalPages = page + 1;
362
+ // } else if (results.hasNextPage) results.totalPages = page + 1;
363
+
364
+ // return results;
365
+ // } catch (err) {
366
+ // throw new Error((err as Error).message);
367
+ // }
368
+ // }
369
+
370
+ // private downloadLink = (url: string) => {
371
+ // return url.replace(/^(https:\/\/[^\/]+)\/[^?]+(\?.+)$/, '$1/download$2');
372
+ // };
373
+
374
+ // private removeContainsFromString = (str: string, contains: string) => {
375
+ // contains = contains.toLowerCase();
376
+ // return str.toLowerCase().replace(/\n/g, '').replace(`${contains}:`, '').trim();
377
+ // };
378
+ // private cleanUpText = (str: string) => {
379
+ // return str
380
+ // .split(';')
381
+ // .map((part) => part.trim())
382
+ // .filter((part) => part.length > 0)
383
+ // .join('; ');
384
+ // };
385
+ // }
386
+ // // (async () => {
387
+ // // const dramaCool = new DramaCool();
388
+ // // // const l=await dramaCool.search('squid game');
389
+ // // const m = await dramaCool.fetchEpisodeServers('video-watch/squid-games-2021-episode-9-as-jao');
390
+ // // const l = await dramaCool.fetchEpisodeSources('video-watch/squid-games-2021-episode-9-as-jao');
391
+ // // // const l = await dramaCool.fetchMediaInfo('drama-detail/squid-games-2021-hd');
392
+ // // console.log(m,l);
393
+ // // })();
394
+
395
+ // export default DramaCool;