diff --git a/docs/multimedia.md b/docs/multimedia.md index 7b28d8eab..24001bf59 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -886,6 +886,10 @@ pageClass: routes +### 指定剧集 + + + ## 腾讯视频 ### 播放列表 diff --git a/lib/router.js b/lib/router.js index 46e541c11..4d86e6fbb 100644 --- a/lib/router.js +++ b/lib/router.js @@ -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')); // 天眼查 diff --git a/lib/routes/shinybbs/p.js b/lib/routes/shinybbs/p.js new file mode 100644 index 000000000..853af59f2 --- /dev/null +++ b/lib/routes/shinybbs/p.js @@ -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(), + }; +};