feedkeeper 0.28.3 → 0.28.5
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.
- package/package.json +4 -4
- package/server/dist/api/v1/resources.js +1 -0
- package/server/dist/feeds/extractor.js +26 -0
- package/server/dist/feeds/opml.js +6 -1
- package/server/package.json +1 -1
- package/web/dist/assets/index-BW3PMJVN.js +32 -0
- package/web/dist/index.html +1 -1
- package/web/dist/sw.js +1 -1
- package/web/dist/assets/index-CTTNHCfi.js +0 -32
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feedkeeper",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.5",
|
|
4
4
|
"description": "A lightweight, self-hosted RSS reader and remote MCP server for your news, blogs, and AI workflows.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rss",
|
|
@@ -42,17 +42,17 @@
|
|
|
42
42
|
"better-sqlite3": "^13.0.3",
|
|
43
43
|
"cookie-session": "^2.1.1",
|
|
44
44
|
"cors": "^2.8.6",
|
|
45
|
-
"dotenv": "^18.0.
|
|
45
|
+
"dotenv": "^18.0.8",
|
|
46
46
|
"express": "^5.2.1",
|
|
47
47
|
"express-rate-limit": "^8.7.1",
|
|
48
48
|
"fast-xml-parser": "^5.11.2",
|
|
49
49
|
"helmet": "^8.3.0",
|
|
50
50
|
"ipaddr.js": "^2.5.0",
|
|
51
|
-
"jsdom": "^30.1.
|
|
51
|
+
"jsdom": "^30.1.3",
|
|
52
52
|
"node-cron": "^4.6.0",
|
|
53
53
|
"otpauth": "^9.5.2",
|
|
54
54
|
"rss-parser": "^3.13.0",
|
|
55
|
-
"undici": "^8.
|
|
55
|
+
"undici": "^8.12.2",
|
|
56
56
|
"web-push": "^3.6.7",
|
|
57
57
|
"zod": "^4.6.5"
|
|
58
58
|
}
|
|
@@ -644,6 +644,7 @@ resourcesRouter.get("/items/:id/image", imageLimiter, async (req, res) => {
|
|
|
644
644
|
res.status(503).json({ error: "image_busy" });
|
|
645
645
|
return;
|
|
646
646
|
}
|
|
647
|
+
console.error(`[image_proxy] Failed to fetch image for item ${req.params.id} (${src}):`, error instanceof Error ? error.message : error);
|
|
647
648
|
res.status(502).json({ error: "image_unavailable" });
|
|
648
649
|
}
|
|
649
650
|
});
|
|
@@ -34,6 +34,31 @@ function cleanConsentDom(doc) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
function resolveLazyImages(doc) {
|
|
38
|
+
const images = doc.querySelectorAll("img");
|
|
39
|
+
for (const img of images) {
|
|
40
|
+
const lazySrc = img.getAttribute("data-lazy-src") ||
|
|
41
|
+
img.getAttribute("data-src") ||
|
|
42
|
+
img.getAttribute("data-original") ||
|
|
43
|
+
img.getAttribute("data-actualsrc");
|
|
44
|
+
const src = img.getAttribute("src");
|
|
45
|
+
if (lazySrc && (!src || src.startsWith("data:") || src.length < 10)) {
|
|
46
|
+
img.setAttribute("src", lazySrc);
|
|
47
|
+
}
|
|
48
|
+
const lazySrcset = img.getAttribute("data-lazy-srcset") || img.getAttribute("data-srcset");
|
|
49
|
+
const srcset = img.getAttribute("srcset");
|
|
50
|
+
if (lazySrcset && (!srcset || srcset.startsWith("data:"))) {
|
|
51
|
+
img.setAttribute("srcset", lazySrcset);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const sources = doc.querySelectorAll("source");
|
|
55
|
+
for (const source of sources) {
|
|
56
|
+
const lazySrcset = source.getAttribute("data-lazy-srcset") || source.getAttribute("data-srcset");
|
|
57
|
+
if (lazySrcset) {
|
|
58
|
+
source.setAttribute("srcset", lazySrcset);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
37
62
|
/**
|
|
38
63
|
* Checks if a given URL or extracted HTML/text is a cookie / consent wall rather than article content.
|
|
39
64
|
*/
|
|
@@ -183,6 +208,7 @@ async function extractArticleContent(rawUrl, fetchImpl, signal) {
|
|
|
183
208
|
try {
|
|
184
209
|
const paywall = /"isAccessibleForFree"\s*:\s*(?:false|"false")/i.test(fetched.html);
|
|
185
210
|
cleanConsentDom(dom.window.document);
|
|
211
|
+
resolveLazyImages(dom.window.document);
|
|
186
212
|
parsed = new Readability(dom.window.document, { charThreshold: 60 }).parse();
|
|
187
213
|
if (isConsentContent(fetched.url, parsed?.content ?? fetched.html, parsed?.title, parsed?.textContent)) {
|
|
188
214
|
return { status: "consent_wall" };
|
|
@@ -101,6 +101,7 @@ function extractOutlines(node, items = [], currentFolder) {
|
|
|
101
101
|
}
|
|
102
102
|
return items;
|
|
103
103
|
}
|
|
104
|
+
export const MAX_OPML_FEEDS = 2000;
|
|
104
105
|
/**
|
|
105
106
|
* Parses an OPML document string and returns a list of feed URLs and their labels.
|
|
106
107
|
*/
|
|
@@ -114,7 +115,11 @@ export function parseOpml(xmlContent) {
|
|
|
114
115
|
if (!parsed || !parsed.opml || !parsed.opml.body) {
|
|
115
116
|
throw new Error("invalid_opml_format");
|
|
116
117
|
}
|
|
117
|
-
|
|
118
|
+
const feeds = extractOutlines(parsed.opml.body.outline);
|
|
119
|
+
if (feeds.length > MAX_OPML_FEEDS) {
|
|
120
|
+
throw new Error("too_many_opml_feeds");
|
|
121
|
+
}
|
|
122
|
+
return feeds;
|
|
118
123
|
}
|
|
119
124
|
const urlSchema = z.string().url();
|
|
120
125
|
/**
|