feedkeeper 0.47.4 → 0.47.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feedkeeper",
3
- "version": "0.47.4",
3
+ "version": "0.47.6",
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",
@@ -7,7 +7,8 @@ const xmlParser = new Parser({
7
7
  customFields: {
8
8
  feed: ["icon", "itunes:image"],
9
9
  item: [
10
- ["media:content", "mediaContent", { keepArray: false }],
10
+ ["link", "rawLinks", { keepArray: true }],
11
+ ["media:content", "mediaContent", { keepArray: true }],
11
12
  ["media:thumbnail", "mediaThumbnail", { keepArray: false }],
12
13
  ["media:group", "mediaGroup", { keepArray: false }],
13
14
  ["content:encoded", "contentEncoded", { keepArray: false }],
@@ -51,6 +52,7 @@ const EXTENSION_MIME = [
51
52
  [/\.aac(\?.*)?$/i, "audio/aac"],
52
53
  [/\.(?:ogg|oga)(\?.*)?$/i, "audio/ogg"],
53
54
  [/\.opus(\?.*)?$/i, "audio/opus"],
55
+ [/\.flac(\?.*)?$/i, "audio/flac"],
54
56
  [/\.wav(\?.*)?$/i, "audio/wav"],
55
57
  [/\.mp4(\?.*)?$/i, "video/mp4"],
56
58
  [/\.m4v(\?.*)?$/i, "video/x-m4v"],
@@ -60,6 +62,8 @@ const EXTENSION_MIME = [
60
62
  function resolveMediaMime(rawType, url) {
61
63
  if (typeof rawType === "string") {
62
64
  const normalized = rawType.toLowerCase().split(";")[0].trim();
65
+ if (normalized === "application/ogg")
66
+ return "audio/ogg";
63
67
  if (normalized.startsWith("audio/") || normalized.startsWith("video/"))
64
68
  return normalized;
65
69
  }
@@ -95,6 +99,7 @@ export function parseDurationSeconds(raw) {
95
99
  function extractXmlMedia(item) {
96
100
  let enclosureUrl = null;
97
101
  let enclosureType = null;
102
+ let mediaDuration = undefined;
98
103
  if (item.enclosure?.url) {
99
104
  const url = asHttpUrl(item.enclosure.url);
100
105
  const type = url ? resolveMediaMime(item.enclosure.type, url) : null;
@@ -103,16 +108,49 @@ function extractXmlMedia(item) {
103
108
  enclosureType = type;
104
109
  }
105
110
  }
106
- const mediaContent = item.mediaContent ?? item["media:content"];
107
- if (!enclosureUrl && mediaContent) {
108
- const url = asHttpUrl(mediaAttribute(mediaContent, "url"));
109
- const type = url ? resolveMediaMime(mediaAttribute(mediaContent, "type"), url) : null;
110
- if (url && type) {
111
- enclosureUrl = url;
112
- enclosureType = type;
111
+ if (!enclosureUrl && item.rawLinks) {
112
+ for (const rawLink of asMediaEntries(item.rawLinks)) {
113
+ if (!isRecord(rawLink) || !isRecord(rawLink.$))
114
+ continue;
115
+ if (String(rawLink.$.rel ?? "").toLowerCase() !== "enclosure")
116
+ continue;
117
+ const url = asHttpUrl(rawLink.$.href);
118
+ const type = url ? resolveMediaMime(rawLink.$.type, url) : null;
119
+ if (url && type) {
120
+ enclosureUrl = url;
121
+ enclosureType = type;
122
+ break;
123
+ }
124
+ }
125
+ }
126
+ const candidateMediaEntries = [];
127
+ const directMedia = item.mediaContent ?? item["media:content"];
128
+ if (directMedia)
129
+ candidateMediaEntries.push(...asMediaEntries(directMedia));
130
+ const mediaGroup = item.mediaGroup ?? item["media:group"];
131
+ if (mediaGroup) {
132
+ for (const group of asMediaEntries(mediaGroup)) {
133
+ if (!isRecord(group))
134
+ continue;
135
+ const grouped = group["media:content"] ?? group.mediaContent;
136
+ if (grouped)
137
+ candidateMediaEntries.push(...asMediaEntries(grouped));
138
+ }
139
+ }
140
+ for (const entry of candidateMediaEntries) {
141
+ if (mediaDuration === undefined)
142
+ mediaDuration = mediaAttribute(entry, "duration");
143
+ if (!enclosureUrl) {
144
+ const url = asHttpUrl(mediaAttribute(entry, "url"));
145
+ const type = url ? resolveMediaMime(mediaAttribute(entry, "type"), url) : null;
146
+ if (url && type) {
147
+ enclosureUrl = url;
148
+ enclosureType = type;
149
+ mediaDuration = mediaAttribute(entry, "duration") ?? mediaDuration;
150
+ }
113
151
  }
114
152
  }
115
- const duration = parseDurationSeconds(item.itunesDuration ?? mediaAttribute(mediaContent, "duration"));
153
+ const duration = parseDurationSeconds(item.itunesDuration ?? mediaDuration);
116
154
  const rawChaptersUrl = mediaAttribute(item.podcastChapters, "url");
117
155
  const rawChaptersType = mediaAttribute(item.podcastChapters, "type");
118
156
  const chaptersMime = typeof rawChaptersType === "string" ? rawChaptersType.toLowerCase().split(";")[0].trim() : "";
@@ -11,9 +11,12 @@ export function securityHeaderOptions(publicUrl) {
11
11
  ...helmet.contentSecurityPolicy.getDefaultDirectives(),
12
12
  "script-src": ["'self'"],
13
13
  "img-src": ["'self'", "data:", "https:", "http:"],
14
+ "media-src": ["'self'", "https:", "http:"],
15
+ "frame-src": ["'self'", "https://www.youtube-nocookie.com", "https://www.youtube.com"],
14
16
  "upgrade-insecure-requests": servedOverHttps ? [] : null,
15
17
  },
16
18
  },
19
+ referrerPolicy: { policy: "strict-origin-when-cross-origin" },
17
20
  strictTransportSecurity: servedOverHttps,
18
21
  };
19
22
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedkeeper/server",
3
- "version": "0.47.4",
3
+ "version": "0.47.6",
4
4
  "private": true,
5
5
  "type": "module"
6
6
  }