CoderTonyChan
2019-02-13 14:30:21 +08:00
committed by DIYgod
parent ba3ef16542
commit f14a24558e
4 changed files with 74 additions and 0 deletions

View File

@@ -1163,6 +1163,16 @@ GitHub 官方也提供了一些 RSS:
</route>
### Vol.moe
<route name="vol" author="CoderTonyChan" example="/vol/finsh" path="/vol/:mode?" :paramsDesc="['模式']">
| 连载 | 完结 |
| ------ | ----- |
| serial | finsh |
</route>
### ebb.io
<route name="ebb" author="Tsuki" example="/ebb" path="/ebb"/>

View File

@@ -249,6 +249,16 @@ For private channels, pass the channel `id` (such as `-1001001234567`) intstead
<routeEn name="Sticker Pack" author="DIYgod" example="/telegram/stickerpack/DIYgod" path="/telegram/stickerpack/:name" :paramsDesc="['Sticker Pack name, available in the sharing URL']"/>
## ACG
### Vol.moe
<route name="vol" author="CoderTonyChan" example="/vol/finsh" path="/vol/:mode?" :paramsDesc="['mode type']">
| Comics are serialized | Comics is finshed |
| --------------------- | ----------------- |
| serial | finsh |
## Travel
### All the Flight Deals

View File

@@ -868,6 +868,8 @@ router.get('/tencentvideo/playlist/:id', require('./routes/tencent/video/playlis
router.get('/manhuagui/comic/:id', require('./routes/manhuagui/comic'));
// 動漫狂
router.get('/cartoonmad/comic/:id', require('./routes/cartoonmad/comic'));
// Vol
router.get('/vol/:mode?', require('./routes/vol/lastupdate'));
// Tits Guru
router.get('/tits-guru/home', require('./routes/titsguru/home'));

View File

@@ -0,0 +1,52 @@
const axios = require('../../utils/axios');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
let mode = ctx.params.mode;
let title = ``;
if (mode === 'serial') {
mode = '%E9%80%A3%E8%BC%89';
title = `Vol.moe - serial`;
} else if (mode === 'finish') {
mode = '%E5%AE%8C%E7%B5%90';
title = `Vol.moe - finish`;
} else {
mode = 'all';
title = `Vol.moe`;
}
const link = `http://vol.moe/list/all,all,${mode},lastupdate,all,all,none/`;
const listData = await axios.get(link);
const $list = cheerio.load(listData.data);
const items = $list('.listbg td')
.map((_, el) => {
const $el = $list(el);
const title = $el
.find('a')
.last()
.text();
const imgEL = $el.find('a').first();
const link = imgEL.attr('href');
const imgSrc = imgEL.find('.img_book').attr('src');
const match = $el.text().match(/\[[\s\S]*?\]/g);
const detail = $el.find('.pagefoot').text();
const date = $el.find('.filesize').text();
return {
title: `${title} ${detail} ${match}`,
description: `
<img referrerpolicy="no-referrer" src="${imgSrc}" />
<h1>${title}</h1>
<h2>${match}</h2>
<h2>${detail}</h2>
<h2>${date}</h2>
`.trim(),
link: link,
pubDate: new Date(date).toUTCString(),
};
})
.get();
ctx.state.data = {
title,
link,
item: items,
};
};