mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-13 00:35:57 +08:00
fix: change ftchinese cover URL & remove comments elements (#4176)
This commit is contained in:
@@ -8,7 +8,7 @@ const ProcessFeed = ($, link) => {
|
|||||||
|
|
||||||
// 处理封面图片
|
// 处理封面图片
|
||||||
content.find('div.story-image > figure').each((i, e) => {
|
content.find('div.story-image > figure').each((i, e) => {
|
||||||
const src = `https://www.ft.com/__origami/service/image/v2/images/raw/${encodeURIComponent(e.attribs['data-url'])}?source=ftchinese&width=800&fit=cover`;
|
const src = `https://thumbor.ftacademy.cn/unsafe/1340x754/${e.attribs['data-url']}`;
|
||||||
|
|
||||||
$(`<img src=${src}>`).insertAfter(content.find('div.story-lead')[0]);
|
$(`<img src=${src}>`).insertAfter(content.find('div.story-lead')[0]);
|
||||||
});
|
});
|
||||||
@@ -27,7 +27,11 @@ const ProcessFeed = ($, link) => {
|
|||||||
author = author.trim();
|
author = author.trim();
|
||||||
|
|
||||||
// 去除头部主题, 头部重复标题, 冗余元数据, 植入广告, 植入 js, 社交分享按钮, 底部版权声明, 空白 DOM
|
// 去除头部主题, 头部重复标题, 冗余元数据, 植入广告, 植入 js, 社交分享按钮, 底部版权声明, 空白 DOM
|
||||||
content.find('div.story-theme, h1.story-headline, div.story-byline, div.mpu-container-instory,script, div#story-action-placeholder, div.copyrightstatement-container, div.clearfloat, div.o-ads').each((i, e) => {
|
content
|
||||||
|
.find(
|
||||||
|
'div.story-theme, h1.story-headline, div.story-byline, div.mpu-container-instory,script, div#story-action-placeholder, div.copyrightstatement-container, div.clearfloat, div.o-ads, h2.list-title, div.allcomments, div.logincomment, div.nologincomment'
|
||||||
|
)
|
||||||
|
.each((i, e) => {
|
||||||
$(e).remove();
|
$(e).remove();
|
||||||
});
|
});
|
||||||
content = content.html();
|
content = content.html();
|
||||||
|
|||||||
Reference in New Issue
Block a user