mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
@@ -12,7 +12,7 @@ module.exports = async (ctx) => {
|
||||
const $ = cheerio.load(data, { decodeEntities: false });
|
||||
|
||||
const list = $('.media_articles ul li')
|
||||
.slice(0, 3)
|
||||
.slice(0, 5)
|
||||
.map((_, item) => {
|
||||
item = $(item);
|
||||
const a = item.find('h2.media_article_title a');
|
||||
@@ -44,8 +44,16 @@ module.exports = async (ctx) => {
|
||||
);
|
||||
content = cheerio.load(itemData, { decodeEntities: false });
|
||||
} else {
|
||||
const response = await got.get(item.link);
|
||||
content = cheerio.load(response.data, { decodeEntities: false });
|
||||
const itemData = await ctx.cache.tryGet(
|
||||
item.link,
|
||||
async () =>
|
||||
(
|
||||
await got.get(item.link, {
|
||||
responseType: 'buffer',
|
||||
})
|
||||
).data
|
||||
);
|
||||
content = cheerio.load(itemData, { decodeEntities: false });
|
||||
}
|
||||
|
||||
const eDescription = content('.post_body').html();
|
||||
|
||||
Reference in New Issue
Block a user