@@ -3,16 +3,26 @@ const cheerio = require('cheerio');
|
||||
const axios = require('../../utils/axios');
|
||||
|
||||
const getChapters = ($) =>
|
||||
$('.chapter-list > ul li')
|
||||
.map((_, ele) => {
|
||||
$('.chapter-list > ul')
|
||||
.toArray()
|
||||
.reverse()
|
||||
.reduce(
|
||||
(acc, curr) =>
|
||||
acc.concat(
|
||||
$(curr)
|
||||
.children('li')
|
||||
.toArray()
|
||||
),
|
||||
[]
|
||||
)
|
||||
.map((ele) => {
|
||||
const a = $(ele).children('a');
|
||||
return {
|
||||
link: resolve('https://www.manhuagui.com/', a.attr('href')),
|
||||
title: a.attr('title'),
|
||||
num: a.find('i').text(),
|
||||
};
|
||||
})
|
||||
.toArray();
|
||||
});
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const { id } = ctx.params;
|
||||
|
||||
Reference in New Issue
Block a user