mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 22:19:40 +08:00
feat: add路由 追新番日剧站 (#4476)
This commit is contained in:
@@ -470,6 +470,12 @@ pageClass: routes
|
||||
|
||||
<Route author="kt286" example="/radio/2/520767" path="/radio/:channelname/:name" :paramsDesc="['频道ID, 可在对应专辑页面的 URL 中找到','节目ID,可在对应专辑页面的 URL 中找到']" supportPodcast="1"/>
|
||||
|
||||
## 追新番日剧站
|
||||
|
||||
### 更新列表
|
||||
|
||||
<Route author="mengx8" example="/zhuixinfan/list" path="/zhuixinfan/list" />
|
||||
|
||||
## 字幕库
|
||||
|
||||
### 字幕列表
|
||||
|
||||
@@ -2539,4 +2539,7 @@ router.get('/girlimg/album/:tag?/:mode?', require('./routes/girlimg/album'));
|
||||
// etoland
|
||||
router.get('/etoland/:bo_table', require('./routes/etoland/board'));
|
||||
|
||||
// zhuixinfan
|
||||
router.get('/zhuixinfan/list', require('./routes/zhuixinfan/list'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
51
lib/routes/zhuixinfan/list.js
Normal file
51
lib/routes/zhuixinfan/list.js
Normal file
@@ -0,0 +1,51 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const moment = require('moment');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: `http://www.zhuixinfan.com/main.php`,
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
|
||||
const $ = cheerio.load(data);
|
||||
const list = [];
|
||||
Array.from($('.top-list-data:not(.top-list-data-all)')).forEach((table) => {
|
||||
table = $(table);
|
||||
const date = table.children('caption').first().text();
|
||||
|
||||
table
|
||||
.find('tbody')
|
||||
.children('tr')
|
||||
.not((i) => i === 0)
|
||||
.each((i, item) => {
|
||||
item = $(item);
|
||||
item.attr('date', date.substr(date.indexOf('(') + 1, 6));
|
||||
list.push(item);
|
||||
});
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: '追新番',
|
||||
link: 'http://www.zhuixinfan.com/main.php',
|
||||
language: 'zh-CN',
|
||||
description: '追新番日剧站',
|
||||
item: list.map((item) => {
|
||||
const category = item.find('td.td2 a').first().text();
|
||||
const title = item.find('td.td2 a').last().text();
|
||||
const description = `资源大小:${item.find('td').eq(2).text()}`;
|
||||
const link = item.find('td').eq(3).children('a').first().attr('href');
|
||||
const pubDate = moment(item.attr('date'), 'MM月DD号').toDate();
|
||||
|
||||
return {
|
||||
title: title,
|
||||
description: description,
|
||||
category: category,
|
||||
link: link,
|
||||
pubDate: pubDate,
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user