mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 22:19:40 +08:00
fix: 修正微信公众号路由(传送门来源以及CareerEngine来源)中的图片链接 (#4590)
This commit is contained in:
@@ -12,10 +12,18 @@ module.exports = async (ctx) => {
|
||||
const response = await got.get(item.link);
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
const post = $('.post');
|
||||
|
||||
post.find('img').each((_, img) => {
|
||||
const dataSrc = $(img).attr('data-src');
|
||||
if (dataSrc) {
|
||||
$(img).attr('src', dataSrc);
|
||||
}
|
||||
});
|
||||
|
||||
const single = {
|
||||
title: item.title,
|
||||
description: $('.post').html(),
|
||||
description: post.html(),
|
||||
pubDate: item.pubDate,
|
||||
link: item.link,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user