ns-rss-spider 1.2.0 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -105,7 +105,12 @@ async function parseContent($, $element, item, strategy) {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
|
-
|
|
108
|
+
console.log(import_zx.chalk.green("正在生成 html content"));
|
|
109
|
+
const strategyContent = (_a = strategy == null ? void 0 : strategy.getContentFromHtml) == null ? void 0 : _a.call(strategy, $, $element);
|
|
110
|
+
if (!strategyContent) {
|
|
111
|
+
console.log(import_zx.chalk.yellow("未提供 getContentFromHtml,使用默认方案"));
|
|
112
|
+
}
|
|
113
|
+
const elCont = strategyContent || $element.html() || "";
|
|
109
114
|
const content = (0, import_html_entities.decode)(elCont.trim());
|
|
110
115
|
if (!content) {
|
|
111
116
|
console.error(import_zx.chalk.red("解析 html 内容出错, html 如下"));
|
|
@@ -26,13 +26,12 @@ var macrumors = {
|
|
|
26
26
|
parse: true,
|
|
27
27
|
fetcher: "http",
|
|
28
28
|
getContentElementFromArticle: ($) => {
|
|
29
|
-
const el = $("#maincontent > article");
|
|
29
|
+
const el = $("#maincontent > article .js-content > div");
|
|
30
30
|
return el;
|
|
31
31
|
},
|
|
32
32
|
getContentFromHtml: ($, $el) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return content.html() || "";
|
|
33
|
+
$el.find('[id^="AdThrive_Content_"]').remove();
|
|
34
|
+
return $el.html() || "";
|
|
36
35
|
}
|
|
37
36
|
};
|
|
38
37
|
// Annotate the CommonJS export names for ESM import in node:
|