mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 20:27:52 +08:00
* feat: domp4 最近更新+详情订阅 * fix: docs && radar * docs: add radar support * fix: detail remove puppeteer use * fix: domp4 add meta info * fix: feed link Co-authored-by: jasehuang <jasehuang@tencent.com>
32 lines
810 B
JavaScript
32 lines
810 B
JavaScript
const got = require('@/utils/got');
|
|
const cheerio = require('cheerio');
|
|
|
|
const baseUrl = 'https://www.domp4.cc';
|
|
const latestUrl = 'https://www.domp4.cc/custom/update.html';
|
|
|
|
function getItemList($, type) {
|
|
const list = $(`#${type} .list-group-item`)
|
|
.toArray()
|
|
.map((item) => {
|
|
item = $(item);
|
|
return {
|
|
title: item.find('a').text(),
|
|
link: `${baseUrl}${item.find('a').attr('href')}`,
|
|
};
|
|
});
|
|
return list;
|
|
}
|
|
|
|
module.exports = async (ctx) => {
|
|
const { type = 'vod' } = ctx.params;
|
|
const res = await got.get(latestUrl);
|
|
const $ = cheerio.load(res.data);
|
|
const list = getItemList($, type);
|
|
|
|
ctx.state.data = {
|
|
link: latestUrl,
|
|
title: 'domp4电影',
|
|
item: list,
|
|
};
|
|
};
|