fix(route): smzdm fenlei (#11630)
This commit is contained in:
parent
9a56bb8803
commit
5456d130e0
|
|
@ -24,18 +24,24 @@ module.exports = async (ctx) => {
|
|||
return {
|
||||
title: item.find('h2.item-name a').text(),
|
||||
link: item.find('h2.item-name a').attr('href'),
|
||||
pubDate: timezone(parseDate(item.find('span.time').text())),
|
||||
description: item.find('.item-info').html(),
|
||||
author: item.find('.nickname').text(),
|
||||
pubDate: timezone(parseDate(item.find('span.time').text(), ['HH:mm', 'MM-DD HH:mm', 'YYYY-MM-DD HH:mm']), 8),
|
||||
};
|
||||
});
|
||||
|
||||
const out = await Promise.all(
|
||||
list.map((item) =>
|
||||
ctx.cache.tryGet(item.link, async () => {
|
||||
const response = await got(item.link);
|
||||
const $ = cheerio.load(response.data);
|
||||
item.description = $('article').html();
|
||||
item.pubDate = timezone(parseDate($('meta[property="og:release_date"]').attr('content')), 8);
|
||||
item.author = $('meta[property="og:author"]').attr('content');
|
||||
try {
|
||||
const response = await got(item.link);
|
||||
const $ = cheerio.load(response.data);
|
||||
item.description = $('article').html();
|
||||
item.pubDate = timezone(parseDate($('meta[property="og:release_date"]').attr('content')), 8);
|
||||
item.author = $('meta[property="og:author"]').attr('content');
|
||||
} catch (err) {
|
||||
// 404
|
||||
}
|
||||
|
||||
return item;
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue