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.
- package/android/src/main/java/com/consumet/HttpRequestModule.kt +88 -33
- package/android/src/main/java/com/consumet/WebViewTask.kt +18 -3
- package/ios/Consumet.mm +172 -72
- package/lib/commonjs/NativeConsumet.ts +11 -5
- package/lib/commonjs/extension-registry.json +6 -6
- package/lib/commonjs/extension-registry.json.sig +1 -1
- package/lib/commonjs/extractors/kwik.js +28 -29
- package/lib/commonjs/extractors/kwik.js.map +1 -1
- package/lib/commonjs/index.js +18 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/types.js +6 -0
- package/lib/commonjs/models/types.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +12 -13
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/commonjs/providers/manga/asurascans.js +160 -96
- package/lib/commonjs/providers/manga/asurascans.js.map +1 -1
- package/lib/commonjs/providers/manga/flamescans.js +173 -91
- package/lib/commonjs/providers/manga/flamescans.js.map +1 -1
- package/lib/commonjs/providers/manga/index.js +1 -15
- package/lib/commonjs/providers/manga/index.js.map +1 -1
- package/lib/commonjs/providers/manga/mangadex.js +234 -227
- package/lib/commonjs/providers/manga/mangadex.js.map +1 -1
- package/lib/commonjs/providers/manga/mangahere.js +279 -135
- package/lib/commonjs/providers/manga/mangahere.js.map +1 -1
- package/lib/commonjs/providers/manga/mangakakalot.js +206 -107
- package/lib/commonjs/providers/manga/mangakakalot.js.map +1 -1
- package/lib/commonjs/providers/manga/mangapill.js +126 -38
- package/lib/commonjs/providers/manga/mangapill.js.map +1 -1
- package/lib/commonjs/providers/meta/anilist.js +41 -12
- package/lib/commonjs/providers/meta/anilist.js.map +1 -1
- package/lib/commonjs/utils/index.js +19 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/manga.js +60 -0
- package/lib/commonjs/utils/manga.js.map +1 -0
- package/lib/module/NativeConsumet.ts +11 -5
- package/lib/module/extension-registry.json +6 -6
- package/lib/module/extension-registry.json.sig +1 -1
- package/lib/module/extractors/kwik.js +28 -29
- package/lib/module/extractors/kwik.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/types.js +9 -0
- package/lib/module/models/types.js.map +1 -1
- package/lib/module/providers/anime/animepahe/create-animepahe.js +12 -13
- package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/module/providers/manga/asurascans.js +161 -96
- package/lib/module/providers/manga/asurascans.js.map +1 -1
- package/lib/module/providers/manga/flamescans.js +174 -91
- package/lib/module/providers/manga/flamescans.js.map +1 -1
- package/lib/module/providers/manga/index.js +1 -15
- package/lib/module/providers/manga/index.js.map +1 -1
- package/lib/module/providers/manga/mangadex.js +236 -228
- package/lib/module/providers/manga/mangadex.js.map +1 -1
- package/lib/module/providers/manga/mangahere.js +276 -132
- package/lib/module/providers/manga/mangahere.js.map +1 -1
- package/lib/module/providers/manga/mangakakalot.js +207 -107
- package/lib/module/providers/manga/mangakakalot.js.map +1 -1
- package/lib/module/providers/manga/mangapill.js +128 -39
- package/lib/module/providers/manga/mangapill.js.map +1 -1
- package/lib/module/providers/meta/anilist.js +41 -12
- package/lib/module/providers/meta/anilist.js.map +1 -1
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/manga.js +54 -0
- package/lib/module/utils/manga.js.map +1 -0
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts +11 -5
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/kwik.d.ts +1 -1
- package/lib/typescript/commonjs/src/extractors/kwik.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/types.d.ts +38 -5
- package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts +14 -4
- package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts +18 -3
- package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/index.d.ts +0 -14
- package/lib/typescript/commonjs/src/providers/manga/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts +22 -5
- package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts +15 -3
- package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts +26 -4
- package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts +16 -2
- package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/manga.d.ts +19 -0
- package/lib/typescript/commonjs/src/utils/manga.d.ts.map +1 -0
- package/lib/typescript/module/src/NativeConsumet.d.ts +11 -5
- package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/kwik.d.ts +1 -1
- package/lib/typescript/module/src/extractors/kwik.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +2 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/types.d.ts +38 -5
- package/lib/typescript/module/src/models/types.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/asurascans.d.ts +14 -4
- package/lib/typescript/module/src/providers/manga/asurascans.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/flamescans.d.ts +18 -3
- package/lib/typescript/module/src/providers/manga/flamescans.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/index.d.ts +0 -14
- package/lib/typescript/module/src/providers/manga/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangadex.d.ts +22 -5
- package/lib/typescript/module/src/providers/manga/mangadex.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangahere.d.ts +15 -3
- package/lib/typescript/module/src/providers/manga/mangahere.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts +26 -4
- package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangapill.d.ts +16 -2
- package/lib/typescript/module/src/providers/manga/mangapill.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/index.d.ts +1 -0
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/manga.d.ts +19 -0
- package/lib/typescript/module/src/utils/manga.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/NativeConsumet.ts +11 -5
- package/src/extension-registry.json +6 -6
- package/src/extension-registry.json.sig +1 -1
- package/src/extractors/kwik.ts +30 -43
- package/src/index.tsx +6 -0
- package/src/models/types.ts +38 -3
- package/src/providers/anime/animepahe/create-animepahe.ts +15 -14
- package/src/providers/manga/asurascans.ts +200 -135
- package/src/providers/manga/flamescans.ts +221 -118
- package/src/providers/manga/index.ts +0 -14
- package/src/providers/manga/mangadex.ts +335 -282
- package/src/providers/manga/mangahere.ts +309 -156
- package/src/providers/manga/mangakakalot.ts +249 -152
- package/src/providers/manga/mangapill.ts +163 -64
- package/src/providers/meta/anilist.ts +50 -14
- package/src/utils/index.ts +1 -0
- package/src/utils/manga.ts +58 -0
- package/lib/commonjs/providers/manga/brmangas.js +0 -110
- package/lib/commonjs/providers/manga/brmangas.js.map +0 -1
- package/lib/commonjs/providers/manga/comick.js +0 -154
- package/lib/commonjs/providers/manga/comick.js.map +0 -1
- package/lib/commonjs/providers/manga/mangahost.js +0 -113
- package/lib/commonjs/providers/manga/mangahost.js.map +0 -1
- package/lib/commonjs/providers/manga/mangapark.js +0 -97
- package/lib/commonjs/providers/manga/mangapark.js.map +0 -1
- package/lib/commonjs/providers/manga/mangareader.js +0 -106
- package/lib/commonjs/providers/manga/mangareader.js.map +0 -1
- package/lib/commonjs/providers/manga/mangasee123.js +0 -161
- package/lib/commonjs/providers/manga/mangasee123.js.map +0 -1
- package/lib/commonjs/providers/manga/readmanga.js +0 -269
- package/lib/commonjs/providers/manga/readmanga.js.map +0 -1
- package/lib/commonjs/providers/manga/vyvymanga.js +0 -166
- package/lib/commonjs/providers/manga/vyvymanga.js.map +0 -1
- package/lib/module/providers/manga/brmangas.js +0 -105
- package/lib/module/providers/manga/brmangas.js.map +0 -1
- package/lib/module/providers/manga/comick.js +0 -149
- package/lib/module/providers/manga/comick.js.map +0 -1
- package/lib/module/providers/manga/mangahost.js +0 -108
- package/lib/module/providers/manga/mangahost.js.map +0 -1
- package/lib/module/providers/manga/mangapark.js +0 -92
- package/lib/module/providers/manga/mangapark.js.map +0 -1
- package/lib/module/providers/manga/mangareader.js +0 -101
- package/lib/module/providers/manga/mangareader.js.map +0 -1
- package/lib/module/providers/manga/mangasee123.js +0 -156
- package/lib/module/providers/manga/mangasee123.js.map +0 -1
- package/lib/module/providers/manga/readmanga.js +0 -264
- package/lib/module/providers/manga/readmanga.js.map +0 -1
- package/lib/module/providers/manga/vyvymanga.js +0 -161
- package/lib/module/providers/manga/vyvymanga.js.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/brmangas.d.ts +0 -18
- package/lib/typescript/commonjs/src/providers/manga/brmangas.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/comick.d.ts +0 -39
- package/lib/typescript/commonjs/src/providers/manga/comick.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/mangahost.d.ts +0 -18
- package/lib/typescript/commonjs/src/providers/manga/mangahost.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/mangapark.d.ts +0 -14
- package/lib/typescript/commonjs/src/providers/manga/mangapark.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/mangareader.d.ts +0 -18
- package/lib/typescript/commonjs/src/providers/manga/mangareader.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/mangasee123.d.ts +0 -17
- package/lib/typescript/commonjs/src/providers/manga/mangasee123.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/readmanga.d.ts +0 -31
- package/lib/typescript/commonjs/src/providers/manga/readmanga.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/vyvymanga.d.ts +0 -17
- package/lib/typescript/commonjs/src/providers/manga/vyvymanga.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/brmangas.d.ts +0 -18
- package/lib/typescript/module/src/providers/manga/brmangas.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/comick.d.ts +0 -39
- package/lib/typescript/module/src/providers/manga/comick.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/mangahost.d.ts +0 -18
- package/lib/typescript/module/src/providers/manga/mangahost.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/mangapark.d.ts +0 -14
- package/lib/typescript/module/src/providers/manga/mangapark.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/mangareader.d.ts +0 -18
- package/lib/typescript/module/src/providers/manga/mangareader.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/mangasee123.d.ts +0 -17
- package/lib/typescript/module/src/providers/manga/mangasee123.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/readmanga.d.ts +0 -31
- package/lib/typescript/module/src/providers/manga/readmanga.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/vyvymanga.d.ts +0 -17
- package/lib/typescript/module/src/providers/manga/vyvymanga.d.ts.map +0 -1
- package/src/providers/manga/brmangas.ts +0 -148
- package/src/providers/manga/comick.ts +0 -285
- package/src/providers/manga/mangahost.ts +0 -134
- package/src/providers/manga/mangapark.ts +0 -115
- package/src/providers/manga/mangareader.ts +0 -132
- package/src/providers/manga/mangasee123.ts +0 -187
- package/src/providers/manga/readmanga.ts +0 -380
- 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
|
-
}
|