mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix njxzc tzgg (#11253)
Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
This commit is contained in:
+13
-9
@@ -36,15 +36,19 @@ module.exports = async (ctx) => {
|
||||
// 使用缓存
|
||||
ctx.cache.tryGet(item.link, async () => {
|
||||
const response = await got(item.link);
|
||||
const $ = cheerio.load(response.data);
|
||||
item.title = $('.arti_title').text();
|
||||
item.description = $('.wp_articlecontent')
|
||||
.html()
|
||||
.replace(/src="\//g, `src="${new URL('.', host).href}`)
|
||||
.replace(/href="\//g, `href="${new URL('.', host).href}`)
|
||||
.trim();
|
||||
item.pubDate = timezone(parseDate($('.arti_update').text().replace('发布时间:', '')), +8);
|
||||
|
||||
if (response.redirectUrls.length > 0) {
|
||||
item.link = response.redirectUrls[0];
|
||||
item.description = '该通知无法直接预览,请点击原文链接↑查看';
|
||||
} else {
|
||||
const $ = cheerio.load(response.data);
|
||||
item.title = $('.arti_title').text();
|
||||
item.description = $('.wp_articlecontent')
|
||||
.html()
|
||||
.replace(/src="\//g, `src="${new URL('.', host).href}`)
|
||||
.replace(/href="\//g, `href="${new URL('.', host).href}`)
|
||||
.trim();
|
||||
item.pubDate = timezone(parseDate($('.arti_update').text().replace('发布时间:', '')), +8);
|
||||
}
|
||||
return item;
|
||||
})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user