From 322089d7621fdf880b32aa4801f11d6012a78745 Mon Sep 17 00:00:00 2001 From: Ethan Shen Date: Wed, 2 Feb 2022 20:35:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(route):=20=E7=85=8E=E8=9B=8B=E6=89=93?= =?UTF-8?q?=E8=B5=8F=E5=B9=BF=E5=91=8A=E7=A7=BB=E9=99=A4=20(#8916)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(route): 煎蛋打赏广告移除 * fix: show lazy image Continuation of https://github.com/DIYgod/RSSHub/pull/8904 --- lib/v2/jandan/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/v2/jandan/index.js b/lib/v2/jandan/index.js index 6614e13943..e3a45abf92 100644 --- a/lib/v2/jandan/index.js +++ b/lib/v2/jandan/index.js @@ -28,7 +28,10 @@ module.exports = async (ctx) => { link: a.attr('href'), description: art(path.join(__dirname, 'templates/description.art'), { summary: item.find('.indexs').text(), - image: item.find('img').attr('src'), + image: item + .find('img') + .attr('data-original') + .replace(/!square/, ''), }), }; }); @@ -43,6 +46,8 @@ module.exports = async (ctx) => { const content = cheerio.load(detailResponse.data); + content('.wechat-hide').prev().nextAll().remove(); + item.description += content('.entry').html(); item.author = content('.postinfo strong').text(); item.pubDate = timezone(parseDate(detailResponse.data.match(/"pubDate": "(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})"/)[1]), +8);