mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 20:27:52 +08:00
feat: 咚漫 (#2081)
This commit is contained in:
@@ -42,6 +42,10 @@
|
|||||||
|
|
||||||
<Route name="漫画更新" author="KellyHwong" path="/cartoonmad/comic/:id" example="/cartoonmad/comic/5827" :paramsDesc="['漫画ID']"/>
|
<Route name="漫画更新" author="KellyHwong" path="/cartoonmad/comic/:id" example="/cartoonmad/comic/5827" :paramsDesc="['漫画ID']"/>
|
||||||
|
|
||||||
|
## 咚漫
|
||||||
|
|
||||||
|
<Route name="漫画更新" author="Machsix" path="/dongmanmanhua/comic/:category/:name/:id" example="/dongmanmanhua/comic/COMEDY/xin-xinlingdeshengyin/381" :paramsDesc="['类别','名称','ID']"/>
|
||||||
|
|
||||||
## Anime1
|
## Anime1
|
||||||
|
|
||||||
<Route name="動畫" author="maple3142" example="/anime1/anime/2018年秋季/哥布林殺手" path="/anime1/anime/:time/:name" :paramsDesc="['时间', '动画名称']">
|
<Route name="動畫" author="maple3142" example="/anime1/anime/2018年秋季/哥布林殺手" path="/anime1/anime/:time/:name" :paramsDesc="['时间', '动画名称']">
|
||||||
|
|||||||
@@ -936,6 +936,8 @@ router.get('/manhuagui/comic/:id', require('./routes/manhuagui/comic'));
|
|||||||
router.get('/cartoonmad/comic/:id', require('./routes/cartoonmad/comic'));
|
router.get('/cartoonmad/comic/:id', require('./routes/cartoonmad/comic'));
|
||||||
// Vol
|
// Vol
|
||||||
router.get('/vol/:mode?', require('./routes/vol/lastupdate'));
|
router.get('/vol/:mode?', require('./routes/vol/lastupdate'));
|
||||||
|
// 咚漫
|
||||||
|
router.get('/dongmanmanhua/comic/:category/:name/:id', require('./routes/dongmanmanhua/comic'));
|
||||||
|
|
||||||
// Tits Guru
|
// Tits Guru
|
||||||
router.get('/tits-guru/home', require('./routes/titsguru/home'));
|
router.get('/tits-guru/home', require('./routes/titsguru/home'));
|
||||||
|
|||||||
45
lib/routes/dongmanmanhua/comic.js
Normal file
45
lib/routes/dongmanmanhua/comic.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
const cheerio = require('cheerio');
|
||||||
|
const axios = require('../../utils/axios');
|
||||||
|
const domain = 'https://www.dongmanmanhua.cn';
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const category = ctx.params.category;
|
||||||
|
const name = ctx.params.name;
|
||||||
|
const id = ctx.params.id;
|
||||||
|
|
||||||
|
const comicLink = `${domain}/${category}/${name}/list?title_no=${id}`;
|
||||||
|
const { data } = await axios.get(comicLink);
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
|
||||||
|
const bookName = $('.detail_header .info .subj').text();
|
||||||
|
const title = $('#_listUl span.subj')
|
||||||
|
.map(function() {
|
||||||
|
return $(this).text();
|
||||||
|
})
|
||||||
|
.get();
|
||||||
|
const date = $('#_listUl span.date')
|
||||||
|
.map(function() {
|
||||||
|
return $(this)
|
||||||
|
.text()
|
||||||
|
.replace(/\n|\r|\t/g, '');
|
||||||
|
})
|
||||||
|
.get();
|
||||||
|
const link = $('#_listUl > li > a')
|
||||||
|
.map(function() {
|
||||||
|
return 'https:' + $(this).attr('href');
|
||||||
|
})
|
||||||
|
.get();
|
||||||
|
const resultItem = title.map((t, i) => ({
|
||||||
|
title: t,
|
||||||
|
pubDate: new Date(date[i]).toUTCString(),
|
||||||
|
link: link[i],
|
||||||
|
description: '',
|
||||||
|
}));
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: `咚漫 ${bookName}`,
|
||||||
|
link: comicLink,
|
||||||
|
description: `咚漫 ${bookName}`,
|
||||||
|
item: resultItem,
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user