fix(route/natgeo): title selector (#19929)

* fix: title selector

* fix(route/natgeo): remove ads

---------
This commit is contained in:
Tsung-Han Yu 2025-08-29 05:13:44 +08:00 committed by GitHub
parent d21b8ecf1c
commit a67b79952f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -16,14 +16,14 @@ async function loadContent(link) {
.replaceAll(/ /gi, ' ')
.trim();
$('.splide__arrows, .slide-control').remove();
$('.splide__arrows, .slide-control, [class^="ad-"], style').remove();
let description = ($('article').eq(0).html() ?? '') + ($('article').eq(1).html() ?? '');
if (/photo|gallery/.test(link)) {
description = $('#content-album').html() + description;
}
return {
title: $('title').text(),
title: $('h1.content-title').text().trim(),
pubDate: parseDate(dtStr),
description,
category: $('.content-tag a')