mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-29 18:06:31 +08:00
fix: conditional cache in wenxuemi router (#2770)
This commit is contained in:
@@ -39,14 +39,19 @@ module.exports = async (ctx) => {
|
||||
const articleHtml = await got_ins.get(link);
|
||||
const article = iconv.decode(articleHtml.data, 'GBK');
|
||||
const $1 = cheerio.load(article);
|
||||
const res = $1('div#content').html();
|
||||
const res = $1('div#content');
|
||||
|
||||
resultItem = {
|
||||
title: $item.text(),
|
||||
description: res,
|
||||
description: res.html(),
|
||||
link: link,
|
||||
};
|
||||
if (res.slice(0, 10).includes('正在手打中') === false) {
|
||||
if (
|
||||
res
|
||||
.text()
|
||||
.slice(0, 10)
|
||||
.includes('正在手打中') === false
|
||||
) {
|
||||
ctx.cache.set(link, JSON.stringify(resultItem));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user