Skip to content

Commit 7085610

Browse files
committed
mangakakalot
1 parent 595ad1e commit 7085610

File tree

6 files changed

+62
-46
lines changed

6 files changed

+62
-46
lines changed

dist/index/index.crawler.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index/index.crawler.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/util.js

Lines changed: 27 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/util.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index/index.crawler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Comic } from "../models/comic.interface";
33

44
export class Crawler {
55
static async newestComics(page: number): Promise<Comic[]> {
6-
const body = await GET(`https://manganato.com/genre-all/${page}?type=newest`);
6+
const body = await GET(`https://ww.mangakakalot.tv/manga_list/?type=newest&category=all&state=all&page=${page}`);
77
return bodyToComicListNew(body);
88
}
99

src/util.ts

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -124,32 +124,42 @@ function bodyToComicList(body: string): Comic[] {
124124
function bodyToComicListNew(body: string): Comic[] {
125125
const $: CheerioStatic = cheerio.load(body);
126126

127-
return $('div.panel-content-genres > div.content-genres-item')
127+
return $('div.container > div.main-wrapper > div.leftCol.listCol > div.truyen-list > div.list-truyen-item-wrap')
128128
.toArray()
129-
.map((divComic: CheerioElement): Comic => {
129+
.map((divComic: CheerioElement): Comic | null => {
130130
const $divComic: Cheerio = $(divComic);
131-
const $genres_item_info = $divComic.find('div.genres-item-info');
132-
const a = $genres_item_info.find('h3 > a');
133-
const $genres_item_chap = $genres_item_info.find('a.genres-item-chap');
134131

132+
const $genres_item_chap = $divComic.find('a.list-story-item-wrap-chapter');
135133
const chapter_link = $genres_item_chap.attr('href');
136134
const chapter_name = $genres_item_chap.text();
137-
return {
138-
last_chapters: chapter_link && chapter_name
139-
? [
140-
{
141-
chapter_name,
142-
chapter_link,
143-
time: $genres_item_info.find('span.genres-item-time').text(),
144-
},
145-
]
146-
: [],
147-
link: a.attr('href'),
148-
thumbnail: $divComic.find('img').attr('src'),
149-
title: a.text(),
150-
view: $genres_item_info.find('span.genres-item-view').text(),
151-
};
152-
});
135+
136+
const thumbnail = $divComic.find('a > img.img-loading').attr('data-src');
137+
138+
const a = $divComic.find('h3 > a');
139+
const link = a.attr('href');
140+
const title = a.text();
141+
142+
return link && thumbnail && title
143+
? ({
144+
last_chapters: chapter_link && chapter_name
145+
? [
146+
{
147+
chapter_name,
148+
chapter_link: BASE_URL + chapter_link,
149+
time: '',
150+
},
151+
]
152+
: [],
153+
link: BASE_URL + link,
154+
thumbnail: BASE_URL + thumbnail,
155+
title,
156+
view: $divComic.find('span.aye_icon').text(),
157+
})
158+
: null;
159+
})
160+
.filter((c: Comic | null): c is Comic => c !== null);
153161
}
154162

163+
export const BASE_URL = 'https://ww.mangakakalot.tv';
164+
155165
export { isValidURL, log, escapeHTML, encode, decode, GET, bodyToComicList, bodyToComicListNew };

0 commit comments

Comments
 (0)