DIYgod/RSSHub · error · InvalidParameterError
该用户已设置收藏内容不可见
Error message
该用户已设置收藏内容不可见
What it means
InvalidParameterError thrown in renderCollect when collect is falsy. collect is '' (empty string) by default — set in util.ts when the proxy path is used (which cannot fetch collect) or when the Playwright click/waitForResponse for the collect API fell into its own catch and left collect as ''. So the route could not obtain the collections feed at all.
Source
Thrown at lib/routes/xiaohongshu/user.ts:115
const image = basicInfo.imageb || basicInfo.images;
const renderNote = (notes) =>
notes.flatMap((n) =>
n.map(({ noteCard }) => {
const coverUrl = noteCard.cover.infoList.pop().url;
return {
title: noteCard.displayTitle,
link: coverUrl,
guid: noteCard.displayTitle,
description: `<img src="${coverUrl}" width="${noteCard.cover.width}" height="${noteCard.cover.height}"><br>${noteCard.displayTitle}`,
author: noteCard.user.nickname,
upvotes: noteCard.interactInfo.likedCount,
};
})
);
const renderCollect = (collect) => {
if (!collect) {
throw new InvalidParameterError('该用户已设置收藏内容不可见');
}
if (collect.code !== 0) {
throw new Error(JSON.stringify(collect));
}
if (!collect.data.notes.length) {
throw new InvalidParameterError('该用户已设置收藏内容不可见');
}
return collect.data.notes.map((item) => ({
title: item.display_title,
link: `${url}/${item.note_id}`,
description: `<img src ="${item.cover.info_list.pop().url}"><br>${item.display_title}`,
author: item.user.nickname,
upvotes: item.interact_info.likedCount,
}));
};
return {
title,View on GitHub (pinned to bed535e087)
Solutions
- Do not use the proxy path for the collect category — ensure Playwright is available so util.ts can click the collect tab.
- Retry; if the collect XHR timed out it may succeed on the next run.
- Confirm the target user actually has a public collect tab (see error 638 for the private case).
Defensive patterns
Strategy: validation
Validate before calling
// Detect the unsupported-proxy-for-collect case before calling renderCollect
if (category === 'collect' && config.xiaohongshu.proxy && !config.xiaohongshu.cookie) {
throw new InvalidParameterError('collect category requires Playwright (no proxy) or a logged-in cookie');
} Type guard
function isCollectUnavailableError(e: unknown): boolean {
return e instanceof Error && e.name === 'InvalidParameterError' && /收藏内容不可见/.test(e.message);
} Try / catch
try {
return renderCollect(collect);
} catch (e) {
if (isCollectUnavailableError(e)) {
// Distinguish 'no data fetched' (636) from 'private' (638) for the user
return ctx.json({ error: 'Collect data unavailable — retry or use the notes category.' }, 503);
}
throw e;
} Prevention
- Do not enable the proxy path if you need collect feeds — it cannot fetch them.
- Ensure Playwright is healthy so the collect XHR has a chance to succeed.
- Retry once on the empty-collect case before declaring failure.
When it happens
Trigger: category === 'collect' and the collect payload is empty: either XIAOHONGSHU proxy is configured (collect unsupported without Playwright) or the Playwright collect-fetch try/catch at util.ts:95-107 failed silently.
Common situations: Operator set config.xiaohongshu.proxy (proxy path never yields collect); the collect XHR timed out under Playwright; user is not logged in so the collect tab is unreachable.
Related errors
- type not supported
- type not supported
- ${JSON.stringify(collect)}
- 小红书风控校验,请稍后再试
- 小红书未返回用户数据,请稍后再试: ${JSON.stringify(userPageData.result)}
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/16f6b0b72f1a22e0.
Report an issue: GitHub.