feat: add 深影译站指定剧集 (#6854)
This commit is contained in:
@@ -886,6 +886,10 @@ pageClass: routes
|
||||
|
||||
<Route author="nczitzk" example="/shinybbs/latest" path="/shinybbs/latest" />
|
||||
|
||||
### 指定剧集
|
||||
|
||||
<Route author="nczitzk" example="/shinybbs/p/1790" path="/shinybbs/p/:id" :paramsDesc="['剧集 id,可在剧集页 URL 中找到']" />
|
||||
|
||||
## 腾讯视频
|
||||
|
||||
### 播放列表
|
||||
|
||||
@@ -3911,6 +3911,7 @@ router.get('/gov/mohrss/sbjm/:category?', require('./routes/gov/mohrss/sbjm'));
|
||||
|
||||
// 深影译站
|
||||
router.get('/shinybbs/:id?', require('./routes/shinybbs/index'));
|
||||
router.get('/shinybbs/p/:id', require('./routes/shinybbs/p'));
|
||||
router.get('/shinybbs/latest', require('./routes/shinybbs/latest'));
|
||||
|
||||
// 天眼查
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const id = ctx.params.id;
|
||||
|
||||
const rootUrl = 'https://sub.shinybbs.vip';
|
||||
const currentUrl = `${rootUrl}/?p=${id}`;
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: currentUrl,
|
||||
});
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
$('.elementor-section').last().remove();
|
||||
$('.elementor-section').last().remove();
|
||||
|
||||
$('.elementor-tabs-wrapper').remove();
|
||||
|
||||
const items = $('.elementor-tab-content a')
|
||||
.map((_, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.text(),
|
||||
link: item.attr('href'),
|
||||
enclosure_url: item.attr('href'),
|
||||
enclosure_type: 'application/x-bittorrent',
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${$('.post-title').text()} - 深影译站`,
|
||||
link: currentUrl,
|
||||
item: items.reverse(),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user