react-native-consumet 2.0.0 → 3.0.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 (211) hide show
  1. package/android/src/main/java/com/consumet/HttpRequestModule.kt +88 -33
  2. package/android/src/main/java/com/consumet/WebViewTask.kt +18 -3
  3. package/ios/Consumet.mm +172 -72
  4. package/lib/commonjs/NativeConsumet.ts +11 -5
  5. package/lib/commonjs/extension-registry.json +6 -6
  6. package/lib/commonjs/extension-registry.json.sig +1 -1
  7. package/lib/commonjs/extractors/kwik.js +28 -29
  8. package/lib/commonjs/extractors/kwik.js.map +1 -1
  9. package/lib/commonjs/index.js +18 -0
  10. package/lib/commonjs/index.js.map +1 -1
  11. package/lib/commonjs/models/types.js +6 -0
  12. package/lib/commonjs/models/types.js.map +1 -1
  13. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +12 -13
  14. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
  15. package/lib/commonjs/providers/manga/asurascans.js +160 -96
  16. package/lib/commonjs/providers/manga/asurascans.js.map +1 -1
  17. package/lib/commonjs/providers/manga/flamescans.js +173 -91
  18. package/lib/commonjs/providers/manga/flamescans.js.map +1 -1
  19. package/lib/commonjs/providers/manga/index.js +1 -15
  20. package/lib/commonjs/providers/manga/index.js.map +1 -1
  21. package/lib/commonjs/providers/manga/mangadex.js +234 -227
  22. package/lib/commonjs/providers/manga/mangadex.js.map +1 -1
  23. package/lib/commonjs/providers/manga/mangahere.js +279 -135
  24. package/lib/commonjs/providers/manga/mangahere.js.map +1 -1
  25. package/lib/commonjs/providers/manga/mangakakalot.js +206 -107
  26. package/lib/commonjs/providers/manga/mangakakalot.js.map +1 -1
  27. package/lib/commonjs/providers/manga/mangapill.js +126 -38
  28. package/lib/commonjs/providers/manga/mangapill.js.map +1 -1
  29. package/lib/commonjs/providers/meta/anilist.js +41 -12
  30. package/lib/commonjs/providers/meta/anilist.js.map +1 -1
  31. package/lib/commonjs/utils/index.js +19 -0
  32. package/lib/commonjs/utils/index.js.map +1 -1
  33. package/lib/commonjs/utils/manga.js +60 -0
  34. package/lib/commonjs/utils/manga.js.map +1 -0
  35. package/lib/module/NativeConsumet.ts +11 -5
  36. package/lib/module/extension-registry.json +6 -6
  37. package/lib/module/extension-registry.json.sig +1 -1
  38. package/lib/module/extractors/kwik.js +28 -29
  39. package/lib/module/extractors/kwik.js.map +1 -1
  40. package/lib/module/index.js +2 -2
  41. package/lib/module/index.js.map +1 -1
  42. package/lib/module/models/types.js +9 -0
  43. package/lib/module/models/types.js.map +1 -1
  44. package/lib/module/providers/anime/animepahe/create-animepahe.js +12 -13
  45. package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
  46. package/lib/module/providers/manga/asurascans.js +161 -96
  47. package/lib/module/providers/manga/asurascans.js.map +1 -1
  48. package/lib/module/providers/manga/flamescans.js +174 -91
  49. package/lib/module/providers/manga/flamescans.js.map +1 -1
  50. package/lib/module/providers/manga/index.js +1 -15
  51. package/lib/module/providers/manga/index.js.map +1 -1
  52. package/lib/module/providers/manga/mangadex.js +236 -228
  53. package/lib/module/providers/manga/mangadex.js.map +1 -1
  54. package/lib/module/providers/manga/mangahere.js +276 -132
  55. package/lib/module/providers/manga/mangahere.js.map +1 -1
  56. package/lib/module/providers/manga/mangakakalot.js +207 -107
  57. package/lib/module/providers/manga/mangakakalot.js.map +1 -1
  58. package/lib/module/providers/manga/mangapill.js +128 -39
  59. package/lib/module/providers/manga/mangapill.js.map +1 -1
  60. package/lib/module/providers/meta/anilist.js +41 -12
  61. package/lib/module/providers/meta/anilist.js.map +1 -1
  62. package/lib/module/utils/index.js +1 -0
  63. package/lib/module/utils/index.js.map +1 -1
  64. package/lib/module/utils/manga.js +54 -0
  65. package/lib/module/utils/manga.js.map +1 -0
  66. package/lib/typescript/commonjs/src/NativeConsumet.d.ts +11 -5
  67. package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
  68. package/lib/typescript/commonjs/src/extractors/kwik.d.ts +1 -1
  69. package/lib/typescript/commonjs/src/extractors/kwik.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/src/index.d.ts +2 -2
  71. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/src/models/types.d.ts +38 -5
  73. package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts +14 -4
  76. package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts +18 -3
  78. package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/src/providers/manga/index.d.ts +0 -14
  80. package/lib/typescript/commonjs/src/providers/manga/index.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts +22 -5
  82. package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts +15 -3
  84. package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts +26 -4
  86. package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts +16 -2
  88. package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts.map +1 -1
  89. package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/src/utils/index.d.ts +1 -0
  91. package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/src/utils/manga.d.ts +19 -0
  93. package/lib/typescript/commonjs/src/utils/manga.d.ts.map +1 -0
  94. package/lib/typescript/module/src/NativeConsumet.d.ts +11 -5
  95. package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
  96. package/lib/typescript/module/src/extractors/kwik.d.ts +1 -1
  97. package/lib/typescript/module/src/extractors/kwik.d.ts.map +1 -1
  98. package/lib/typescript/module/src/index.d.ts +2 -2
  99. package/lib/typescript/module/src/index.d.ts.map +1 -1
  100. package/lib/typescript/module/src/models/types.d.ts +38 -5
  101. package/lib/typescript/module/src/models/types.d.ts.map +1 -1
  102. package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
  103. package/lib/typescript/module/src/providers/manga/asurascans.d.ts +14 -4
  104. package/lib/typescript/module/src/providers/manga/asurascans.d.ts.map +1 -1
  105. package/lib/typescript/module/src/providers/manga/flamescans.d.ts +18 -3
  106. package/lib/typescript/module/src/providers/manga/flamescans.d.ts.map +1 -1
  107. package/lib/typescript/module/src/providers/manga/index.d.ts +0 -14
  108. package/lib/typescript/module/src/providers/manga/index.d.ts.map +1 -1
  109. package/lib/typescript/module/src/providers/manga/mangadex.d.ts +22 -5
  110. package/lib/typescript/module/src/providers/manga/mangadex.d.ts.map +1 -1
  111. package/lib/typescript/module/src/providers/manga/mangahere.d.ts +15 -3
  112. package/lib/typescript/module/src/providers/manga/mangahere.d.ts.map +1 -1
  113. package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts +26 -4
  114. package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts.map +1 -1
  115. package/lib/typescript/module/src/providers/manga/mangapill.d.ts +16 -2
  116. package/lib/typescript/module/src/providers/manga/mangapill.d.ts.map +1 -1
  117. package/lib/typescript/module/src/providers/meta/anilist.d.ts.map +1 -1
  118. package/lib/typescript/module/src/utils/index.d.ts +1 -0
  119. package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
  120. package/lib/typescript/module/src/utils/manga.d.ts +19 -0
  121. package/lib/typescript/module/src/utils/manga.d.ts.map +1 -0
  122. package/package.json +1 -1
  123. package/src/NativeConsumet.ts +11 -5
  124. package/src/extension-registry.json +6 -6
  125. package/src/extension-registry.json.sig +1 -1
  126. package/src/extractors/kwik.ts +30 -43
  127. package/src/index.tsx +6 -0
  128. package/src/models/types.ts +38 -3
  129. package/src/providers/anime/animepahe/create-animepahe.ts +15 -14
  130. package/src/providers/manga/asurascans.ts +200 -135
  131. package/src/providers/manga/flamescans.ts +221 -118
  132. package/src/providers/manga/index.ts +0 -14
  133. package/src/providers/manga/mangadex.ts +335 -282
  134. package/src/providers/manga/mangahere.ts +309 -156
  135. package/src/providers/manga/mangakakalot.ts +249 -152
  136. package/src/providers/manga/mangapill.ts +163 -64
  137. package/src/providers/meta/anilist.ts +50 -14
  138. package/src/utils/index.ts +1 -0
  139. package/src/utils/manga.ts +58 -0
  140. package/lib/commonjs/providers/manga/brmangas.js +0 -110
  141. package/lib/commonjs/providers/manga/brmangas.js.map +0 -1
  142. package/lib/commonjs/providers/manga/comick.js +0 -154
  143. package/lib/commonjs/providers/manga/comick.js.map +0 -1
  144. package/lib/commonjs/providers/manga/mangahost.js +0 -113
  145. package/lib/commonjs/providers/manga/mangahost.js.map +0 -1
  146. package/lib/commonjs/providers/manga/mangapark.js +0 -97
  147. package/lib/commonjs/providers/manga/mangapark.js.map +0 -1
  148. package/lib/commonjs/providers/manga/mangareader.js +0 -106
  149. package/lib/commonjs/providers/manga/mangareader.js.map +0 -1
  150. package/lib/commonjs/providers/manga/mangasee123.js +0 -161
  151. package/lib/commonjs/providers/manga/mangasee123.js.map +0 -1
  152. package/lib/commonjs/providers/manga/readmanga.js +0 -269
  153. package/lib/commonjs/providers/manga/readmanga.js.map +0 -1
  154. package/lib/commonjs/providers/manga/vyvymanga.js +0 -166
  155. package/lib/commonjs/providers/manga/vyvymanga.js.map +0 -1
  156. package/lib/module/providers/manga/brmangas.js +0 -105
  157. package/lib/module/providers/manga/brmangas.js.map +0 -1
  158. package/lib/module/providers/manga/comick.js +0 -149
  159. package/lib/module/providers/manga/comick.js.map +0 -1
  160. package/lib/module/providers/manga/mangahost.js +0 -108
  161. package/lib/module/providers/manga/mangahost.js.map +0 -1
  162. package/lib/module/providers/manga/mangapark.js +0 -92
  163. package/lib/module/providers/manga/mangapark.js.map +0 -1
  164. package/lib/module/providers/manga/mangareader.js +0 -101
  165. package/lib/module/providers/manga/mangareader.js.map +0 -1
  166. package/lib/module/providers/manga/mangasee123.js +0 -156
  167. package/lib/module/providers/manga/mangasee123.js.map +0 -1
  168. package/lib/module/providers/manga/readmanga.js +0 -264
  169. package/lib/module/providers/manga/readmanga.js.map +0 -1
  170. package/lib/module/providers/manga/vyvymanga.js +0 -161
  171. package/lib/module/providers/manga/vyvymanga.js.map +0 -1
  172. package/lib/typescript/commonjs/src/providers/manga/brmangas.d.ts +0 -18
  173. package/lib/typescript/commonjs/src/providers/manga/brmangas.d.ts.map +0 -1
  174. package/lib/typescript/commonjs/src/providers/manga/comick.d.ts +0 -39
  175. package/lib/typescript/commonjs/src/providers/manga/comick.d.ts.map +0 -1
  176. package/lib/typescript/commonjs/src/providers/manga/mangahost.d.ts +0 -18
  177. package/lib/typescript/commonjs/src/providers/manga/mangahost.d.ts.map +0 -1
  178. package/lib/typescript/commonjs/src/providers/manga/mangapark.d.ts +0 -14
  179. package/lib/typescript/commonjs/src/providers/manga/mangapark.d.ts.map +0 -1
  180. package/lib/typescript/commonjs/src/providers/manga/mangareader.d.ts +0 -18
  181. package/lib/typescript/commonjs/src/providers/manga/mangareader.d.ts.map +0 -1
  182. package/lib/typescript/commonjs/src/providers/manga/mangasee123.d.ts +0 -17
  183. package/lib/typescript/commonjs/src/providers/manga/mangasee123.d.ts.map +0 -1
  184. package/lib/typescript/commonjs/src/providers/manga/readmanga.d.ts +0 -31
  185. package/lib/typescript/commonjs/src/providers/manga/readmanga.d.ts.map +0 -1
  186. package/lib/typescript/commonjs/src/providers/manga/vyvymanga.d.ts +0 -17
  187. package/lib/typescript/commonjs/src/providers/manga/vyvymanga.d.ts.map +0 -1
  188. package/lib/typescript/module/src/providers/manga/brmangas.d.ts +0 -18
  189. package/lib/typescript/module/src/providers/manga/brmangas.d.ts.map +0 -1
  190. package/lib/typescript/module/src/providers/manga/comick.d.ts +0 -39
  191. package/lib/typescript/module/src/providers/manga/comick.d.ts.map +0 -1
  192. package/lib/typescript/module/src/providers/manga/mangahost.d.ts +0 -18
  193. package/lib/typescript/module/src/providers/manga/mangahost.d.ts.map +0 -1
  194. package/lib/typescript/module/src/providers/manga/mangapark.d.ts +0 -14
  195. package/lib/typescript/module/src/providers/manga/mangapark.d.ts.map +0 -1
  196. package/lib/typescript/module/src/providers/manga/mangareader.d.ts +0 -18
  197. package/lib/typescript/module/src/providers/manga/mangareader.d.ts.map +0 -1
  198. package/lib/typescript/module/src/providers/manga/mangasee123.d.ts +0 -17
  199. package/lib/typescript/module/src/providers/manga/mangasee123.d.ts.map +0 -1
  200. package/lib/typescript/module/src/providers/manga/readmanga.d.ts +0 -31
  201. package/lib/typescript/module/src/providers/manga/readmanga.d.ts.map +0 -1
  202. package/lib/typescript/module/src/providers/manga/vyvymanga.d.ts +0 -17
  203. package/lib/typescript/module/src/providers/manga/vyvymanga.d.ts.map +0 -1
  204. package/src/providers/manga/brmangas.ts +0 -148
  205. package/src/providers/manga/comick.ts +0 -285
  206. package/src/providers/manga/mangahost.ts +0 -134
  207. package/src/providers/manga/mangapark.ts +0 -115
  208. package/src/providers/manga/mangareader.ts +0 -132
  209. package/src/providers/manga/mangasee123.ts +0 -187
  210. package/src/providers/manga/readmanga.ts +0 -380
  211. package/src/providers/manga/vyvymanga.ts +0 -237
@@ -1,237 +0,0 @@
1
- import {
2
- type IMangaChapter,
3
- type IMangaChapterPage,
4
- type IMangaInfo,
5
- type IMangaResult,
6
- type ISearch,
7
- MangaParser,
8
- MediaStatus,
9
- type ProviderContext,
10
- } from '../../models';
11
- import { createProviderContext } from '../../utils/create-provider-context';
12
- import { type CheerioAPI, load } from 'cheerio';
13
-
14
- interface VyvyMangaSearchResult {
15
- result: VyvyMangaSearchResultData[];
16
- }
17
-
18
- interface VyvyMangaSearchResultData {
19
- authors: {
20
- id: number;
21
- name: string;
22
- name_url: string;
23
- }[];
24
- completed: number; // enum, 0 is completed, 2 is ongoing i think
25
- created_at: string;
26
- description: string;
27
- id: number;
28
- lastChapter: string;
29
- latest_chapter_id: number;
30
- main_manga_id: null;
31
- name: string;
32
- name_url: string;
33
- scored: number;
34
- status: number; // probably enum aswell
35
- thumbnail: string;
36
- title: string; // is alternate titles, seperated by comma
37
- updated_at: string;
38
- viewed: number;
39
- voted: number;
40
- }
41
-
42
- export class VyvyManga extends MangaParser {
43
- override readonly name: string = 'Vyvymanga';
44
- protected override baseUrl: string = 'https://vyvymanga.net/api';
45
- protected override logo: string = 'https://vyvymanga.net/web/img/icon.png';
46
- protected override classPath = 'MANGA.VyvyManga';
47
- protected baseWebsiteUrl = 'https://vyvymanga.net';
48
-
49
- /** @param ctx provider context; requests go through its axios (default: `createProviderContext()`) */
50
- constructor(private readonly ctx: ProviderContext = createProviderContext()) {
51
- super();
52
- }
53
-
54
- override search = async (query: string, page: number = 1): Promise<ISearch<IMangaResult>> => {
55
- if (page < 1) throw new Error('page must be equal to 1 or greater');
56
-
57
- try {
58
- const formattedQuery = query.trim().toLowerCase().split(' ').join('+');
59
- const { data }: { data: string } = await this.ctx.axios.get(
60
- `${this.baseWebsiteUrl}/search?search_po=0&q=${formattedQuery}&page=${page}`
61
- );
62
-
63
- const $: CheerioAPI = load(data);
64
- const dom = $('html');
65
-
66
- const result = dom
67
- .find('.row.book-list > div > div > a')
68
- .map((index, ele) => {
69
- return {
70
- id: ($(ele).find('div.comic-image').attr('data-background-image') as string)
71
- .split('cover/')[1]!
72
- .split('/')[0]!,
73
- title: $(ele).find('div.comic-title').text().trim(),
74
- image: $(ele).find('div.comic-image').attr('data-background-image') as string,
75
- lastChapter: $(ele).find('div.comic-image > span').text().trim(),
76
- };
77
- })
78
- .get();
79
-
80
- const pagination = dom.find('ul.pagination > li');
81
-
82
- if (!pagination.length) {
83
- return {
84
- currentPage: page,
85
- hasNextPage: false,
86
- totalPages: page,
87
- results: result,
88
- };
89
- }
90
-
91
- const lastPage = parseInt(
92
- $(pagination[pagination.length - 2])
93
- .find('a')
94
- .text()
95
- .trim()
96
- );
97
-
98
- return {
99
- currentPage: page,
100
- hasNextPage: page === lastPage ? false : true,
101
- totalPages: lastPage,
102
- results: result,
103
- };
104
- } catch (err) {
105
- throw new Error((err as Error).message);
106
- }
107
- };
108
-
109
- searchApi = async (query: string): Promise<ISearch<IMangaResult>> => {
110
- try {
111
- const formattedQuery = query.toLowerCase().split(' ').join('%20');
112
- const { data }: { data: VyvyMangaSearchResult } = await this.ctx.axios.request({
113
- method: 'get',
114
- url: `${this.baseUrl}/manga/search?search=${formattedQuery}&uid=`,
115
- headers: {
116
- Accept: 'application/json, text/javascript, */*; q=0.01',
117
- Referer: `${this.baseWebsiteUrl}/`,
118
- },
119
- });
120
-
121
- const result = {
122
- currentPage: 1,
123
- hasNextPage: false,
124
- totalPages: 1,
125
- totalResults: data.result.length,
126
- results: this.formatSearchResultData(data.result),
127
- };
128
-
129
- return result;
130
- } catch (err) {
131
- throw new Error((err as Error).message);
132
- }
133
- };
134
-
135
- override fetchMangaInfo = async (mangaId: string): Promise<IMangaInfo> => {
136
- try {
137
- const { data }: { data: string } = await this.ctx.axios.request({
138
- method: 'get',
139
- url: `${this.baseUrl}/manga-detail/${mangaId}?userid=`,
140
- headers: {
141
- Accept: 'application/json, text/javascript, */*; q=0.01',
142
- Referer: `${this.baseWebsiteUrl}/`,
143
- },
144
- });
145
-
146
- const $: CheerioAPI = load(data);
147
- const dom = $('html');
148
-
149
- const title = dom.find('.img-manga').attr('title') as string;
150
- const img = dom.find('.img-manga').attr('src');
151
- const authors = $(dom.find('.col-md-7 > p:nth-child(2) > a'))
152
- .map((index, ele) => $(ele).text().trim())
153
- .get();
154
- const status = $(dom.find('div.col-md-7 > p')[1]).find('span:nth-child(3)').text().trim() as MediaStatus;
155
- const genres = $(dom.find('div.col-md-7 > p')[2])
156
- .find('a')
157
- .map((index, ele) => $(ele).text().trim())
158
- .get();
159
- const description = dom.find('.summary > .content').text().trim();
160
- const chapters = dom
161
- .find('.list-group > a')
162
- .map((index, ele) => {
163
- const releaseDate = $(ele).find('p').text().trim();
164
- const title = $(ele).text().replace(releaseDate, '').trim();
165
-
166
- const chapterObj: IMangaChapter = {
167
- id: $(ele).attr('href') as string,
168
- title: title,
169
- releaseDate: releaseDate,
170
- };
171
-
172
- return chapterObj;
173
- })
174
- .get()
175
- .reverse();
176
-
177
- const mangaInfo = {
178
- id: mangaId,
179
- title,
180
- img,
181
- authors,
182
- status,
183
- genres,
184
- description,
185
- chapters,
186
- };
187
-
188
- return mangaInfo;
189
- } catch (err) {
190
- throw new Error((err as Error).message);
191
- }
192
- };
193
-
194
- override fetchChapterPages = async (chapterId: string): Promise<IMangaChapterPage[]> => {
195
- try {
196
- const { data } = await this.ctx.axios.get(chapterId);
197
-
198
- const $: CheerioAPI = load(data);
199
- const dom = $('html');
200
-
201
- const images: IMangaChapterPage[] = dom
202
- .find('.vview.carousel-inner > div > img')
203
- .map((index, ele) => {
204
- return {
205
- img: ($(ele).attr('data-src') as string).slice(0, -5),
206
- page: index + 1,
207
- };
208
- })
209
- .get();
210
-
211
- return images;
212
- } catch (err) {
213
- throw new Error((err as Error).message);
214
- }
215
- };
216
-
217
- private formatSearchResultData = (searchResultData: VyvyMangaSearchResultData[]): IMangaResult[] => {
218
- return searchResultData.map((ele) => {
219
- return {
220
- id: `${ele.id}`,
221
- title: ele.name,
222
- altTitles: ele.title
223
- .split(',')
224
- .filter((ele) => ele.length)
225
- .map((ele) => ele.trim()),
226
- description: ele.description,
227
- image: ele.thumbnail,
228
- status: ele.completed === 1 ? MediaStatus.COMPLETED : MediaStatus.ONGOING,
229
- score: ele.scored,
230
- views: ele.viewed,
231
- votes: ele.voted,
232
- latestChapterId: ele.latest_chapter_id,
233
- lastChapter: ele.lastChapter,
234
- };
235
- });
236
- };
237
- }