feat(route): add support for linovelib 哩哔轻小说 (#10757)
* add support for linovelib * move readme from anime to reading
This commit is contained in:
@@ -371,6 +371,12 @@ count 的取值范围为 1-12,为防止请求次数过多,推荐设置为 5
|
||||
|
||||
</Route>
|
||||
|
||||
## 哩哔轻小说
|
||||
|
||||
### 小说更新
|
||||
|
||||
<Route author="misakicoca" path="/linovelib/novel/:id" example="/linovelib/novel/2547" :paramsDesc="['小说 id,对应书架开始阅读 URL 中找到']"/>
|
||||
|
||||
## 飘天文学
|
||||
|
||||
### 章节
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
'/novel/:id': ['misakicoca'],
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got(`https://www.linovelib.com/novel/${ctx.params.id}/catalog`);
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const meta = $('.book-meta');
|
||||
const title = meta.children().first().text();
|
||||
const author = meta.find('p > span > a').text();
|
||||
|
||||
const list = $('.chapter-list');
|
||||
const items = list
|
||||
.find('li')
|
||||
.find('a')
|
||||
.filter((idx, item) => $(item).attr('href').startsWith('/novel/'))
|
||||
.map((idx, item) => ({
|
||||
title: $(item).text(),
|
||||
author,
|
||||
description: $(item).text(),
|
||||
link: `https://www.linovelib.com${$(item).attr('href')}`,
|
||||
}))
|
||||
.get();
|
||||
items.reverse();
|
||||
|
||||
ctx.state.data = {
|
||||
title: `哩哔轻小说 - ${title}`,
|
||||
link: `https://www.linovelib.com/novel/${ctx.params.id}/catalog`,
|
||||
description: title,
|
||||
language: 'zh',
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
'linovelib.com': {
|
||||
_name: '哩哔轻小说',
|
||||
'.': [
|
||||
{
|
||||
title: '小说详情',
|
||||
docs: 'https://docs.rsshub.app/anime.html#linovelib',
|
||||
source: ['/novel/:id'],
|
||||
target: '/linovellib/novel/:id',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = (router) => {
|
||||
router.get('/novel/:id', require('./novel'));
|
||||
};
|
||||
Reference in New Issue
Block a user