mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 20:27:52 +08:00
* fix(route) thepaper now use nextjs as backend * Id to Name for channel and list * summary ok * determine the detail by null check instead of type check * list_url for better reading * add failback of thumbnail * fix video article * add list for thepaper * add list for thepaper * del the dup line * small fix and optimize * add maintainer
20 lines
641 B
JavaScript
20 lines
641 B
JavaScript
const utils = require('./utils');
|
|
const cheerio = require('cheerio');
|
|
const got = require('@/utils/got');
|
|
|
|
module.exports = async (ctx) => {
|
|
const { id } = ctx.params;
|
|
const list_url = `https://m.thepaper.cn/list/${id}`;
|
|
const response = await got(list_url);
|
|
const data = JSON.parse(cheerio.load(response.data)('#__NEXT_DATA__').html());
|
|
const list = data.props.pageProps.data.list;
|
|
|
|
const items = await Promise.all(list.map((item) => utils.ProcessItem(item, ctx)));
|
|
|
|
ctx.state.data = {
|
|
title: `澎湃新闻栏目 - ${utils.ListIdToName(id, data)}`,
|
|
link: list_url,
|
|
item: items,
|
|
};
|
|
};
|